text
stringlengths
49
10.4k
source
dict
scikit-learn, hyperparameter-tuning make a the standard GridSearchCV but use the roc_auc as metric as per step 2 model = DecisionTreeClassifier() params = [{'criterion':["gini","entropy"],"max_depth":[1,2,3,4,5,6,7,8,9,10],"class_weight":["balanced"]}] GSCV = GridSearchCV(model,params,scoring="roc_auc") GSCV.fit(X_train,y_train) GSCV.best_params_ best_model = GSCV.best_estimator_ Once you have the best hyper parameters set you can obtain the threshold that maximizes the roc curve as follows: from sklearn.metrics import roc_curve preds = best_model.predict_proba(X_train)[:,1] fpr, tpr, thresholds = roc_curve(y_train, preds) optimal_idx = np.argmax(tpr - fpr) optimal_threshold = thresholds[optimal_idx] This threshold will give you the lowest false positive rate and the highest true positive rate
{ "domain": "datascience.stackexchange", "id": 9149, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "scikit-learn, hyperparameter-tuning", "url": null }
# Is there a bijection between $\mathbb N$ and $\mathbb N^2$? [duplicate] This question already has an answer here: Is there a bijection between $\mathbb N$ and $\mathbb N^2$? If I can show $\mathbb N^2$ is equipotent to $\mathbb N$, I can show that $\mathbb Q$ is countable. Please help. Thanks, - ## marked as duplicate by hardmath, Arthur Fischer♦, Micah, Stefan Hansen, AangMar 9 '13 at 8:38 It is easier to write an answer than to find one of its several occurrences on this site. Let $n$ be a positive integer. Then there exist uniquely determined positive integers $u$ and $v$ such that $n=2^{u-1}(2v-1)$. This is because every positive integer $n$ can be written in one and only one way as a power of $2$ (possibly $2^0$) and an odd number. Define $g$ by $g(n)=(u,v)$. Then $g$ is a bijection from $\mathbb{N}$ to $\mathbb{N}^2$. For a different bijection, search for the Cantor Pairing Function. - Indeed the first duplicate I found has essentially the same answer by you! –  hardmath Mar 9 '13 at 4:29 It might be nice to learn some searching secrets. I did remember answering the question, but finding is another matter. –  André Nicolas Mar 9 '13 at 4:35 @AndréNicolas You can search for user:me is:answer cantor pairing to boil it down to (currently) seven candidates –  Tobias Kienzler Mar 15 '13 at 14:00 Here is a non constructive proof. Of course, there is an injection of $\mathbb{N}$ into $\mathbb{N}\times\mathbb{N}$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808684361289, "lm_q1q2_score": 0.8252255843397394, "lm_q2_score": 0.8418256551882382, "openwebmath_perplexity": 276.41306106246776, "openwebmath_score": 0.899813711643219, "tags": null, "url": "http://math.stackexchange.com/questions/325236/is-there-a-bijection-between-mathbb-n-and-mathbb-n2" }
wasps Title: Can wasps see under moonlight? It appears that the best time to attack a wasp nest is in the middle of the night. Their venom might terrorize us (my five-day old sting remains swollen and is starting to have red bumps in an area the size of a tennis ball), but at least our eyesight is superior. If we attack while they are asleep, or at least resting, we have our best chance of escaping unscathed—or so the online pundits claim. The nest in question is at the edge between the wall and the roof protrusion. Because it is 8 feet off the ground rather than on the ground, it would appear to be a paper wasp nest. But because it is covered with paper and the individual cells are occluded, with the entrance at the bottom the only visible path leading inside, it may well be a yellow jacket nest. Maybe it's futile to attack the nest in September. One might as well let them be. The nest will anyway be deserted in October when the temperature starts to freeze overnight. But it's never too early to prepare for next Spring. I could choose a night when there is absolutely no light—not even moonlight—but then I myself would need to use a flashlight, providing them with the means of pursuing me. Or I could choose a full-moon, or near full-moon, night, and then I can see and they can, perhaps, not see. Can wasps see under moonlight? No.... probably not... wasp cannot see at night... their scotopic vision{dim light vision} is not well develop so before sunset they return back to thier nest... so at night.. probably you can get them all together... rather then hunting for each indivisually...for reference https://sciencing.com/how-to-identify-wasps-bees-13406632.html hope it helps..
{ "domain": "biology.stackexchange", "id": 11608, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "wasps", "url": null }
image, swift, uikit Title: A helper class for creating icons from a PNG image and colour in Swift I have made a helper struct in Swift that creates circular icons from a PNG image (a white icon on transparent background) and a background UIColor. These variables are user-definable in my app, and the created icons are used in notifications and Spotlight, for example. The PNG images are named iconA.png, iconB.png etc. and are all a standard 100-points square. The default image is a fully transparent one called iconEmpty.png. I wanted to provide a CGSize argument so that I could use this method for other purposes as well, should the need arise. It works as expected, but I am wondering how it might be improved or made more efficient, as I am not very experienced with drawing contexts. import UIKit struct IconMaker { func makeIcon(with color: UIColor, size: CGSize, icon: UIImage = UIImage(named: "iconEmpty.png")!) -> UIImage { // Make solid color background let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height) UIGraphicsBeginImageContextWithOptions(size, false, UIScreen.main.scale) color.setFill() UIRectFill(rect) let backgroundImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() // Add other image (which has transparency) UIGraphicsBeginImageContextWithOptions(size, false, UIScreen.main.scale) backgroundImage.draw(in: rect, blendMode: .normal, alpha: 1) icon.draw(in: rect, blendMode: .normal, alpha: 1) let newImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext()
{ "domain": "codereview.stackexchange", "id": 31183, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image, swift, uikit", "url": null }
quantum-mechanics, quantum-field-theory, neutrinos, electroweak Title: Derivation of neutrino oscillation phase factor As we know, the neutrino $\nu_{\alpha}$ with flavor $\alpha=e,\mu,\tau$ is a linear combination of mass eigenstates: $$ |\nu_{\alpha}\rangle=\sum_iU_{\alpha i}|\nu_i\rangle,\quad i=1,2,3 $$ where the propagation of the mass eigenstates $|\nu_i\rangle$ can be described by plane wave solutions: $$ |\nu_{i}(t)\rangle = e^{ -i ( E_{i} t - \vec{p}_{i} \cdot \vec{x}) } |\nu_{i}(0)\rangle. $$ Suppose that $t=T$ and $|\vec{x}|=L$. Then the phase factor can be given by $$ \begin{split} E_iT-p_iL &= E_i\frac{L}{\sqrt{1-m_i^2/E_i^2}}-\sqrt{E_i^2-m_i^2}L \\ &=E_iL\left(1+\frac{m_i^2}{2E_i^2}\right)-E_iL\left(1-\frac{m_i^2}{2E_i^2}\right) +\mathcal{O}\left(\frac{m_i^4}{E_i^3}\right) \\ &=\frac{m_i^2L}{E_i}+\mathcal{O}\left(\frac{m_i^4}{E_i^3}\right) \end{split} $$ However, this result is not correct. The artilce Neutrino oscillation on Wikipedia says that $$
{ "domain": "physics.stackexchange", "id": 14190, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-field-theory, neutrinos, electroweak", "url": null }
python Is there a way to make this more efficient, short of writing it in a low-level language as a python module? Maybe something that uses regex might work faster? bytes You are working with bytes which is very cumbersome. You have to prefix all literals single bytes have type int and need to be converted to to bytes again At least I cannot do this without debugging some errors. It is much more convenient to work with strings. So I suggest to decode the bytes to a string with an 8-bit codec like 'latin-1'. No more bytes([x]) or x.to_bytes(). You can use plain comprehension, plain ''.join(), etc. If required you encode the string to bytes again with the very same codec. dict.get() For conditional translations there is a nice trick - dict.get() - which allows to pass a default value for non-existing keys. translated = replacements.get(char, char) This returns replacements[char] if char is in replacements.keys(). Otherwise it returns the default char. To use this functionality you include the escape character in the translation table (however you fill it). replacements = {escape_char: escape_char + escape_char, '\n': escape_char + '\x00', '\xfd': escape_char + '\x01', '\xfe': escape_char + '\x02', '\xff': escape_char + '\x03', } The encoding function now reads def encode(data: bytes) -> bytes: str_data = data.decode(encoding='latin-1') str_enc = ''.join(replacements.get(x, x) for x in str_data) return str_enc.encode(encoding='latin-1')
{ "domain": "codereview.stackexchange", "id": 44091, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
quantum-mechanics, quantum-field-theory, quantum-electrodynamics, hamiltonian Section 5.7 of Gross (1993), Relativistic Quantum Mechanics and Field Theory The Foldy-Wouthuysen assumes that $A$ is a background field. It constructs (in the $1/m$ expansion) a $U(x)$ that acts as $\psi(x)\to U(x)\psi(x)$. It's unitary as an "operator" on the space of $\psi(x)$s, but its action on the Hilbert space is undefined, because it involves derivatives with respect to $x$. (This is quantum field theory, so the Hilbert space is the space on which the field operators $\psi(x)$ act. The field operators are parameterized by $x$, but the Hilbert space on which they act is not.) When $A$ is an operator, we would need to find a unitary operator $U$ on the Hilbert space such that the positive/negative-frequency parts of $\psi$ are decoupled by writing the Hamiltonian in terms of $U\psi(x)U^\dagger$, order by order in the $1/m$ expansion. Since products of field operators at a single point are undefined, we need use renormalization, which this typically changes coefficients in the resulting $1/m$ expansion. The coefficients need to be adjusted to make the predictions match before and after the transformation: if the result has $N$ terms, then we need to check $N$ predictions to fix their coefficients. This is the idea behind effective field theory: we write down all terms that are consistent with the theory's symmetries and field content, to a given order in the $1/m$ expansion, and then match a few predictions to fix the unknown coefficients. I cited some references here. Altogether, the $1/m$ expansion given by the Foldy-Wouthuysen when $A$ is a background field produces the same terms that we need to include in the effective-field-theory approach when $A$ is a field operator, because they both involve terms consistent with the theory's symmetries and field content to the given order in $1/m$. The coefficients are generally different quantitatively, but the structure of the $1/m$ expansion is essentially the same.
{ "domain": "physics.stackexchange", "id": 79517, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-field-theory, quantum-electrodynamics, hamiltonian", "url": null }
newtonian-mechanics, waves, interference Title: Interaction of two sound emitting particles in a medium Consider a free particle at rest suspended in an infinite medium. If the particle becomes the source of a sound wave in one direction, will the particle start to move in the opposite direction due to an opposing force from the produced wave? If the particle instead produces that wave in all directions, will the particle stay at rest because of the cancellation of the forces? If a similar particle (i.e., producing a sound wave in all directions) is placed in the vicinity of the original particle, I want to know if there will be any kind of interaction between the two particles because of interference of the two waves. Specifically, will the particles repel each other, or attract each other, or absolutely nothing will happen and they’ll continue to stay at rest? Our source particle is unique. Its driving the medium. It is the origin of the vibrations that have now spread out in the medium. It decides its state. Consider the unidirectional case. Since it acts on the medium, the medium pushes back. For sound waves, this means that as the particle moves to compress its surroundings, it increases the pressure in the medium in its neighborhood. The increased pressure then pushes back. Similarly for rarefaction. This is similar to the movement of air in a half-pipe being driven at the closed end. There is clearly pressure variation from the vibrating air at the closed end. For the omnidirectional case, I fail to see how a single point particle can generate omnidirectional sound waves. Lets say the particle isn't really a point particle but has some size. The net force due to the surrounding air on such a 'throbbing' particle is zero by isotropy, but the pressure isn't. So its sound would still have the characteristics of the unidirectional case, without any motion of the particle's center of mass, though I won't characterise it as "not moving". (remember that in the unidirectional case, the particle moves). So the net motion of the source particle is determined by the reaction of the medium and the force driving it. In this, it acts as a driven oscillator. I think the sound waves will show resonance.
{ "domain": "physics.stackexchange", "id": 79915, "lm_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, waves, interference", "url": null }
# a compact set with nonempty convex sections Let $X = [0,1]^d$ be the unit cube in the $d$-dimensional Euclidean space. For every $x \in X$ and every coordinate $i=1,2,\ldots,d$ denote by $x_{-i} := (x_j)_{j \neq i}$. Given a set $Y \subseteq X$ and a vector $x_{-i} \in [0,1]^{d-1}$ denote by $Y_{x_{-i}} := \{(x_i,x_{-i}) \in Y \colon x_i \in [0,1]\}$ the $x_{-i}$-section of $Y$. Let $Y \subseteq X$ be a compact set that satisfies the following condition: for every $x \in X$ and every coordinate $i=1,2,\ldots,d$, the $x_{-i}$-section $Y_{x_{-i}}$ is nonempty and convex. Is it true that the set $Y$ is contractible? TL;DR: Yes, it is contractible, and it is enough for that condition to hold for a single $i \in \{1,...,d\}$. To see this, we will construct a strong deformation retraction of $[0,1]^{d}$ to $Y$.
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9852713857177955, "lm_q1q2_score": 0.8055327305176471, "lm_q2_score": 0.8175744695262775, "openwebmath_perplexity": 55.52818396222798, "openwebmath_score": 0.9883175492286682, "tags": null, "url": "https://mathoverflow.net/questions/309667/a-compact-set-with-nonempty-convex-sections" }
The image $\operatorname{Im}(T)$ of $T$ is invariant by $\Gamma$ (i.e. there are no $v\in\operatorname{Im}(T)$ and $X\in\Gamma$ such that $Xv\notin\operatorname{Im}(T)$). In fact, for every $v\in V$, $$X(Tv)=T(Xv)\in\operatorname{Im}(T).$$ So, since $\Gamma\subset\mathfrak{gl}(V)$ is irreducible, we must have that $\operatorname{Im}(T)=V$ or $0$. Also, $\operatorname{Im}(T)$ can not be $V$ because $T=Z-\lambda I$ has non-null kernel and $\dim V<\infty$. Therefore, $$Z-\lambda I = T = 0.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9711290922181331, "lm_q1q2_score": 0.8006589600361919, "lm_q2_score": 0.8244619242200082, "openwebmath_perplexity": 93.34145301395299, "openwebmath_score": 0.9396117329597473, "tags": null, "url": "https://math.stackexchange.com/questions/299356/centre-of-mathfrak-sl-3-mathbbc-lie-algebra" }
javascript, jquery Title: Simple math using arrays I'm messing around with JavaScript and am trying out objects, functions & arrays. I'd like to know if someone has tips about making it better, shorter, or has a better solution for what I have thought about for now. What I've tried to do is just do simple math (+ and -) using arrays as input for numbers. It all works, but I'm just wondering if it could be even better and/or cleaner. //Write the result function ap(n) { $(".value").append(n); } // Make sure the input is a number function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function doMath(options) { var defaults = { method: 'add' }; var options = $.extend({}, defaults, options); // Add if(options.method == 'add') { var n = 0; for(var i=0; i<options.numbers.length; i++) { if(isNumber(options.numbers[i])) { n = n + options.numbers[i]; } if(i===options.numbers.length-1) { ap(n); } } } // Subtract if(options.method == 'subtract' ) { for (var i=0; i<options.numbers.length; i++) { if(i===0) { n = options.numbers[0]; } else { if(isNumber(options.numbers[i])) { n = n - options.numbers[i]; } } if(i===options.numbers.length-1) { ap(n); } } } }
{ "domain": "codereview.stackexchange", "id": 4635, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery", "url": null }
discrete-signals, audio In more technical wordings: $\mathcal{C} \in \mathbb{R}^{N \times 12}$ is your normal chromagram matrix with $N \in \mathbb{N}$ time frames. $\mathcal{B} : \mathbb{N} \rightarrow \{s| s \subset \{1,\dots,N\}\}$ is a function that gets the index of a beat as input and outputs a set of all time frame indices belonging to this beat index. You want to compute the beat-synchronous chromagram $\mathcal{C}^\text{beat} \in \mathbb{R}^{B \times 12}$ for $B \in \mathbb{N}$ beats. Usually $N \gg B$. You can do this simply like this: $\mathcal{C}^\text{beat}_{b, c} = \frac{1}{|\mathcal{B}(b)|} \sum_{n \in \mathcal{B}(b)} \mathcal{C}_{n, c}$ with beat index $b \in \{1,\dots,B\}$ and pitch class index $c \in \{1,\dots,12\}$. This is not the place for comprehensive literature, but only two references for general chromagrams and beat-synchronous ones: Meinard Müller: Fundamentals of Music Processing, Springer 2015. (Chapter 3.1) Daniel P. W. Ellis and Graham E. Poliner: Identifying Cover Songs with Chroma Features and Dynamic Programming Beat Tracking, IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Honolulu, 2007, pp. IV-1429–IV-1432.
{ "domain": "dsp.stackexchange", "id": 5261, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "discrete-signals, audio", "url": null }
an angle (i. Moment of Inertia Calculation for a. Allow a user to input the dimensions of the object. The (scalar) moment of inertia of a point mass rotating about a known. Start SectionCalc and simply load the DXF file. 3) M A is added mass and added inertia moment matrix. Use of equivalent moment of inertia (Ie) and simplified averaging (ACI-318’s simplified procedure); Use of equivalent moment of inertia (Ie) combined with numerical integration; and Use of Finite Element floor programs that allow for cracking. It is also popular as angular mass or rotational inertia of the given rigid body. Moment Of Inertia, Example Calculation. July 17, 2018 - by Arfan - Leave a Comment. The inertia constant H (in s) - is the ratio of energy stored in the rotor at nominal speed (E in Joules) over the nominal power (P in W) of the machine. Note that if b is much greater than h, that first term is insignificant, and essentially the moment of inertia approximates hb^3/12, and the section modulus approximates hb^2/6. The moment of inertia about an axis along the edge of the cylinder is 1 2 Ma 2 + Ma2 = 3 2 Ma 2, by the parallel axis theorem. #N#(naca4412-il) NACA 4412. That’s because for every 1 kill you have 1 death, or exactly average. Click COMPUTE and read the deflection value in the output panel. In physics, when you calculate an object's moment of inertia, you need to consider not only the mass of the object but also how the mass is distributed. I would like to calculate the polar moment of intertia, J, of built up steel shapes. bw b d nA s kd n. 1) sending gmail with excel vba; 2) looping through emails with excel vba in outlook; and. The moment of inertia is a characteristic property of a rigid body. EHE-08): Where: Mf = Mcrk = Nominal cracking moment of the cross section. [10] suggests that the effective moment of inertia for FRP reinforced concrete beams can be. Files > Download Beam Analysis EXCEL Spreadsheet -
{ "domain": "madzuli.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429147241161, "lm_q1q2_score": 0.809891579729708, "lm_q2_score": 0.8221891327004132, "openwebmath_perplexity": 971.1632840136223, "openwebmath_score": 0.6123436093330383, "tags": null, "url": "http://klyn.madzuli.it/moment-of-inertia-calculator-excel.html" }
### Variance • "mean" = E(X) = mu • variance of X = Var(X) = E((x-mu)^2) = sigma^2 = sum_(i=1)^n p(x_i)(x_i-mu)^2 • standard deviation = sigma = sqrt(Var(X)) • Var(aX+b) = a^2 Var(X) • Var(X) = E(X^2) - E(X)^2 = E(X^2) - mu^2 • If X and Y are independent then: Var(X+Y) = Var(X) + Var(Y) ### Covariance Measure of how much two random variables vary together. A positive value means an increase in one leads to an increase in the other. A negative value means an increase in one leads to a decrease in the other. A value of 0 does not mean they are independent of each other though. (see Y=X^2) • "Cov"(X,Y)="Covariance"=E((X-mu_X)(Y-mu_Y)) • "Cov"(X,Y)=int_c^d int_a^b (x-mu_x)(y-mu_y)f(x,y)dxdy • = (int_c^d int_a^b xy f(x,y) dxdy) - mu_x mu_y Properties: • "Cov"(aX+b, cY+d) = ac"Cov"(X,Y) • "Cov"(X_1+X_2,Y) = "Cov"(X_1,Y) + "Cov"(X_2,Y) • "Cov"(X,X) = "Var"(X) • "Cov"(X,Y) = E(XY) - mu_X mu_Y • "Var"(X+Y) = "Var"(X) + "Var"(Y) + 2"Cov"(X,Y) • If X and Y are independent then Cov(X,Y) = 0. ### Correlation Coefficient
{ "domain": "g42.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9915543745563151, "lm_q1q2_score": 0.8083473388718275, "lm_q2_score": 0.8152324871074608, "openwebmath_perplexity": 11115.680407804673, "openwebmath_score": 0.7725174427032471, "tags": null, "url": "http://g42.org/xwiki/bin/view/Main/Probability" }
Sort by: Solution for Q-3: Using binomial theorem, one can note that, $P(x)=(x-3)^4-10x+15$ We have, using Remainder-Factor Theorem and the fact that $a,b,c,d$ are roots of $P(x)$ that, $P(x)=(x-3)^4-10x+15=0~\forall~x\in\{a,b,c,d\}\implies (x-3)^4=10x-15~\forall~x\in\{a,b,c,d\}$ Using the last result, we have the sum as, $\sum_{x\in\{a,b,c,d\}} (x-3)^4=\sum_{x\in\{a,b,c,d\}} (10x-15)$ Using Vieta's formulas, we have, $\displaystyle \sum_{x\in\{a,b,c,d\}} (x) = 12\\ \implies \sum_{x\in\{a,b,c,d\}} (10x)=120$ Hence, the required sum evaluates as, $\sum_{x\in\{a,b,c,d\}} (x-3)^4=\sum_{x\in\{a,b,c,d\}} (10x-15)=\left\{\left(\sum_{x\in\{a,b,c,d\}} (10x)\right)-\left(\sum_{x\in\{a,b,c,d\}} (15)\right)\right\}=120-15\times 4=120-60=\boxed{60}$ - 5 years, 11 months ago Nicely done. Staff - 5 years, 11 months ago Your hint did most of the work. So, the credit actually goes to you. :) - 5 years, 11 months ago $Q-1$
{ "domain": "brilliant.org", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854164256365, "lm_q1q2_score": 0.850964190198269, "lm_q2_score": 0.8774767858797979, "openwebmath_perplexity": 6110.982238306314, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://brilliant.org/discussions/thread/algebra-thailand-math-posn-2nd-round/" }
human-biology, physiology, metabolism Thus, carbon dioxide (in the form of bicarbonate) is an obligate requiement for mammalian fatty acid biosynthesis, but no CO2-derived carbon is incorporated into fatty acids. Carbon dioxide is also required for oxaloacetate formation from pyruvate. This reaction may be though of a method of 'filling up' a key Krebs Cycle intermediate (a so-called anapleurotic reaction). The enzyme here is pyruvate carboxylase and the substrates for the reaction are pyruvate, bicarbonate and ATP, with oxaloacetate being a key product. This enzyme also contains biotin and (like acetyl CoA carboxylase), CO2 becomes covalently bound to biotin during the reaction cycle. Pyruvate-CoA carboxylase was discovered by Harland.G Wood and C. Werkman in bacteria (See here for a good reference on the early work on pyruvate carboxylase). Its discovery was very controversial because at the time it was thought that animal/bacterial cells could not 'fix' CO2; that is it was though that CO2 is only 'fixed' in photosynthesis. This discovery disproved that piece of dogmatism. A third enzyme that requires CO2 as substrate (in the form of bicarbonate) is propionyl-CoA carboxylase. This enzyme occurs in mitochondria and functions in odd-chain fatty acid metabolism. It also contains biotin. I have concentrated on some biochemical aspects of your question. The three enzymes mentioned, acety-CoA carboxylase, pyruvate carboxylase and propionyl-CoA carboxylase all require CO2 in the form of bicarbonate as substrate, all contain biotin, and (as far as I am aware) all play very central roles in mammalian metabolism. (They also all require ATP as substrate).
{ "domain": "biology.stackexchange", "id": 3040, "lm_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, physiology, metabolism", "url": null }
image-processing, feature-extraction, facial-recognition Title: Software to auto-mark facial points on images I'm not interested in facial recognition per se, but my question is related. Is there a software (commercial, Github etc), which can mark, with color dots, the same reference points on a face (e.g. the outer corners of an eye, the corners of the mouth etc) on a series on photos? It's the same person, the facial expression doesn't change, but the photos are at different angles, different weather conditions etc. Did you tried mediapipe facemesh, i think you will get all the points which you need for face. https://github.com/google/mediapipe/wiki/MediaPipe-Face-Mesh
{ "domain": "ai.stackexchange", "id": 3907, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, feature-extraction, facial-recognition", "url": null }
galaxy, milky-way Title: Milky Way Galaxy from Earth I've seen a lot of beautiful pictures of the Milky Way from Earth such as this: ...but I can't understand what the cloudy ribbon at the bottom the horizon is. Is it a super-large nebula? Or is it due to the Gegenschein? What happens in the ribbon? The Milky Way Galaxy is a large spiral galaxy with some characteristic features worth mentioning: 1) The bulge - This refers to the collection of tightly packed stars located in the central region of the galaxy. 2) The spiral arms or the disk - This region extends from the inner region of the galaxy (where it meets the bulge) to outskirts of the galaxy, and contains stars, dust, and lots of gas. It's also very thin. The reason why a disk forms is largely thought to be due to slight asymmetries in the accretion of material early on in the galaxy's history. Over time, and due to conservation of angular momentum, the material collapses down into a disk. Incidentally, this is where the sun lives. That ribbon is the disk of the Milky Way. It looks cloudy because of the dust and gas which scatters light from the rest of the galaxy. The reason why gas accumulates here is because as things begin to collapse into a disk, the gas collides with itself, and sort of 'sticks' together. In other words, where a bunch of stars may very happily pass through a bunch of other stars without many of them colliding or being disturbed, gas has a much harder time doing this. If you want to learn more about what happens when galaxies and clusters collide, take a look at the Bullet Cluster. The majority of the other stars you you see which are not part of that structure are much more local. The reason why the rest of the sky looks rather transparent in comparison is because you are looking out of the plane of the galaxy. There is simply much less stuff (namely gas and dust which obscures your sight in optical wavelengths) that you are looking through. Because of this, most optical telescopes look in these directions when studying the rest of the universe. For more about the classification and structures of galaxies, see the Hubble sequence.
{ "domain": "astronomy.stackexchange", "id": 11, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "galaxy, milky-way", "url": null }
observational-astronomy, jupiter, saturn, conjunction Title: If we stood on the surface of a Jovian moon, Saturn would appear as a dot. Why doesn't Saturn appear like this in a telescope? Images from the conjunction like these show Saturn just a bit smaller than Jupiter. However, if you were in the vicinity of Jupiter, Saturn would still appear as a dot to the naked eye, wouldn't it? If so, why is Saturn recognizable as a planet through a telescope in which Jupiter is also seen as a planet? As if they were actually very close to each other, at about the same distance from the Sun. I mean, if you recognize Jupiter in a telescope, shouldn't Saturn behind it look like a dot, unless you have a much, much larger zoom in which Jupiter would appear too close to match into the whole image while being too unsharp anyway? Telescopes magnify, they don't bring you closer. So if from Earth Jupiter has an apparent radius of 0.01 degrees (measured as an angle because it is the apparent size) And if Saturn has an apparent angle of 0.005 degrees, then if you magnify 100x then Jupiter will have an apparent size of 1 degree, and Saturn would have a size of 0.5 degrees. Magnification just increases the angular size in proportion But if You go to Jupiter you have travelled less than half the distance to Saturn. So saturn is still small. Travelling closer does not make everything increase in size in proportion. You can see this simply: Stand where you can see something 20 metres of so away, and where you can see into the hills (etc) in the background. Walk towards the thing. Note that the thing appears to get bigger as you approach, but the distant hills don't change size. Travelling closer does not magnify everything in proportion. Telescopes don't "bring things closer" they "magnify".
{ "domain": "astronomy.stackexchange", "id": 5132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "observational-astronomy, jupiter, saturn, conjunction", "url": null }
how can you prove that they are parallel? 2. Substitute x in the expressions. Since $a$ and $c$ share the same values, $a = c$. Then you think about the importance of the transversal, the line that cuts across t… There are four different things we can look for that we will see in action here in just a bit. ∠6. Free parallel line calculator - find the equation of a parallel line step-by-step. Alternate exterior angles are a pair of angles found in the outer side but are lying opposite each other. If $\angle 1 ^{\circ}$ and  $\angle 8 ^{\circ}$ are equal, show that  $\angle 4 ^{\circ}$ and  $\angle 5 ^{\circ}$ are equal as well. Let’s go ahead and begin with its definition. And lastly, you’ll write two-column proofs given parallel lines. Parallel lines do not intersect. 10. Consecutive exterior angles are consecutive angles sharing the same outer side along the line. Using the same figure and angle measures from Question 7, what is the sum of $\angle 1 ^{\circ}$ and $\angle 8 ^{\circ}$? 12. Both lines must be coplanar (in the same plane). If two lines are cut by a transversal so that consecutive interior angles are supplementary, then the lines are parallel. The image shown to the right shows how a transversal line cuts a pair of parallel lines. Now what ? It is transversing both of these parallel lines. We know that if we have two lines that are parallel-- so let me draw those two parallel lines, l and m. So that's line l and line m. We know that if they are parallel, then if we were to draw a transversal that intersects both of them, that the corresponding angles are equal. Consecutive interior angles are consecutive angles sharing the same inner side along the line. Two lines cut by a transversal line are parallel when the alternate exterior angles are equal. You can use the following theorems to prove that lines are parallel. The angles that are formed at the intersection between this transversal line and the two parallel lines. of: If two lines are cut by a transversal so that corresponding angles are congruent, then the lines are
{ "domain": "chaicatalog.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9553191297273498, "lm_q1q2_score": 0.8022139289465596, "lm_q2_score": 0.8397339736884712, "openwebmath_perplexity": 368.6540659309481, "openwebmath_score": 0.6817613840103149, "tags": null, "url": "http://chaicatalog.com/apply-for-hxbd/archive.php?a44c75=proving-parallel-lines-examples" }
gazebo, differential-drive, xacro <xacro:macro name="shape_visual" params="length width height color"> <visual> <pose xyz="0 0 1.0"/> <geometry> <box size="${length} ${width} ${height}"/> </geometry> <material name="${color}"/> </visual> <collision> <geometry> <box size="${length} ${width} ${height}"/> </geometry> </collision> </xacro:macro> <xacro:macro name="camera_visual" params="length width height color"> <visual> <geometry> <box size="${length} ${width} ${height}"/> </geometry> <material name="${color}"/> </visual> <collision> <geometry> <box size="${length} ${width} ${height}"/> </geometry> </collision> </xacro:macro>
{ "domain": "robotics.stackexchange", "id": 4393, "lm_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, differential-drive, xacro", "url": null }
java, parsing, xml, dom public class PlayerScores { public static void main(String[] args) throws IOException, URISyntaxException, SAXException, ParserConfigurationException, TransformerException { // Load XML and XSL Document String inputXML = "C:/Path/To/Input.xml"; String xslFile = "C:/Path/To/XSLT/Script.xsl"; String outputXML = "C:/Path/To/Output.xml"; Source xslt = new StreamSource(new File(xslFile)); DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); Document doc = docBuilder.parse (new File(inputXML)); // XSLT Transformation with pretty print TransformerFactory prettyPrint = TransformerFactory.newInstance(); Transformer transformer = prettyPrint.newTransformer(xslt); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); transformer.setOutputProperty(OutputKeys.STANDALONE, "yes"); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); // Save Transformed Result to File DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(new File(outputXML)); transformer.transform(source, result); } }
{ "domain": "codereview.stackexchange", "id": 22363, "lm_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, parsing, xml, dom", "url": null }
c++, c++11, primes, stl, factors Title: First use of std::map in factors and prime factorization program This is from an older question of mine that I decided to revisit: Simplifying and optimizing factors and prime factorization generator In that question, someone suggested I use an std::map to hold the factors generated from my inputted number. I've also decided to use it with my generated prime factorization, which also works. Based on what I've found online, auto is one way of iterating through an std::map. I've decided to use that since it appears that my compiler supports C++11. Am I using std::map appropriately here, or am I developing some bad habits? I want to develop good habits since I'm interested in using it more in the future. #include <iostream> #include <cstdint> #include <map> #include <cmath> void displayFactors(const std::map<uint64_t, uint64_t> &factors); void displayPrimeFactorization(const std::map<uint64_t, uint64_t> &primeFactorization); void findFactors(uint64_t, std::map<uint64_t, uint64_t> &factors); void findPrimeFactorization(uint64_t positiveInt, std::map<uint64_t, uint64_t> &primeFactorization); int main() { std::map<uint64_t, uint64_t> factors; std::map<uint64_t, uint64_t> primeFactorization; uint64_t positiveInt; std::cout << "\n\n> Positive Int: "; std::cin >> positiveInt; findFactors(positiveInt, factors); std::cout << "\n\n * Factors:\n\n"; displayFactors(factors);
{ "domain": "codereview.stackexchange", "id": 7576, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, primes, stl, factors", "url": null }
In general, if $(E,d)$ is a metric space, then $d':=\frac d{1+d}$ is a metric. The triangle inequality is the only nontrivial property here. If $x,y,z\in E$, then $d(x,z)\leqslant d(x,y)+d(y,z)$, so so monotonicity of the map $t\mapsto\frac t{1+t}$ on $[0,\infty)$ yields \begin{align} d'(x,z) &= \frac{d(x,z)}{1+d(x,z)}\\ &\leqslant \frac{d(x,y)+d(y,z)}{1+d(x,y)+d(y,z)}\\ &\leqslant \frac{d(x,y)}{1+d(x,y)}+\frac{d(y,z)}{1+d(y,z)}\\ &=d'(x,y)+d'(y,z). \end{align} • @user323388 See here: math.stackexchange.com/questions/987602/… $d'$ - notation. I edited the post to use $:=$ to make it more clear. – Math1000 May 29 '16 at 12:44 • @user323388: a metric $d_1$ is equivalent to $d_2$ iff for each $x \in X$, there exist positive constants $\alpha$ and$\beta$ such that, for every point $y \in X$, $\alpha d_{1} (x, y) \leq d_{2} (x, y) \leq \beta d_{1} (x, y)$. – Mohammad W. Alomari May 29 '16 at 12:54
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109476256691, "lm_q1q2_score": 0.8248973058485074, "lm_q2_score": 0.837619959279793, "openwebmath_perplexity": 270.7874181232907, "openwebmath_score": 0.9784609079360962, "tags": null, "url": "https://math.stackexchange.com/questions/1803416/does-the-function-dx-y-frac-lvert-x-y-rvert-1-lvert-x-y-rvert-defin" }
differential-geometry, vectors, coordinate-systems, units, dimensional-analysis Title: How do units 'change' when we move to the language of differential forms? Consider a 2D Euclidean vector as we're taught in first year: $p = x \>\hat{i} + y \> \hat{j} $ where x and y are in meters. If one goes looking for the units of a unit vector they will be told that since they are vectors divided by their magnitudes, they are unit less. Thus the vector, and the vectors components, have the same units. In the language of differential forms, our (co)vector would be: $p = x \> dx + y \> dy$ however our vector now has units of square length. Similarly its dual vector in the coordinate basis, would be $p = x \> \partial_x + y \> \partial_y$ which is unit less. My question is, should it be the vector or its components which have the correct units? When we say a force is a Newton, is this a demand on the vector, or upon the vector components? You are perfectly free to assign units of length to $dx$ and units of inverse length to $\partial_x$. This doesn't change any of the conclusion of dimensional analysis, as we can see from several examples. First, this assignment gives additional units of $(\text{length})^{n-m}$ to rank $(m, n)$ tensors, i.e. those with $n$ covariant indices and $m$ contravariant indices. But since we always equate tensors of the same rank in covariant equations, these units just cancel out. We're left with just the units of the tensor components, which are by definition the same as before. Tensor operations don't mess this up. For example, we can always contract a covariant and contravariant index, turning a rank $(m, n)$ tensor to rank $(m-1, n-1)$, but this doesn't change the units. Also, we can integrate differential forms, but this works out perfectly as well. For example, in the usual notation, $$W = \int \mathbf{F} \cdot d \mathbf{x}$$
{ "domain": "physics.stackexchange", "id": 67080, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "differential-geometry, vectors, coordinate-systems, units, dimensional-analysis", "url": null }
nomenclature Title: Difference between DSF (disulfiram) and DSF-Cu I though tetrathiomolybdate (TM) and disulfiram (DSF) were forms of copper chelators, so I don’t understand the difference between TM/TM-Cu and DSF/DSF-Cu in the below graph. Are they chemically different? Chen D, Cui QC, Yang H, Dou QP (2006) Disulfiram, a clinically used anti-alcoholism drug and copper-binding agent, induces apoptotic cell death in breast cancer cultures and xenografts via inhibition of the proteasome activity. Cancer Res 66(21):10425–10433. https://doi.org/10.1158/0008-5472.CAN-06-2126 These are all chemically different compounds—the paper is investigating whether or not a complex of disulfiram on copper has proteasome inhibiting properties. They test this by performing an MTT assay on breast cancer cells, and this data compares all of the groups they constructed for their experiment. The data is—in my opinion—poorly presented, so it makes it unclear what is going on. Let's dissect the groups they are testing: In this plot, they have breast cancer cells for the assay tested against controls of the pure compounds investigated in the study. The cell line was cultured separately in presence of: DMSO (DM), copper (Cu) alone, disulfiram (DSF) alone, and tetrathiomolybdate (TM) alone. The figure represents the concentration in $\mu$M that the experiment used, and there is one concentration per compound. This portion of the plot displays data from the MTT assay for the exact same experiment, but if the DSF is chelating on copper. They ran the individual DSF and Cu separately to ensure that this complex was the one performing proteasome inhibition and not one of its constituents. They tested three different concentrations, so there are three columns for this space. This chemical is chemically different than both DSF and Cu alone.
{ "domain": "chemistry.stackexchange", "id": 16442, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nomenclature", "url": null }
R = 2 and the power series diverges at 2 and 2. Show that, for. Power Series. So the radius of convergence of this series is actually 1, because x goes from 0 up to 1, and then from 0 down to 1. Then this limit is the radius of convergence of the power series. Outside of that circle, the series diverges. A power series is an infinite series. Power series in one complex variable. That circle is the circle of convergence, with the radius of convergence. Browse other questions tagged sequences-and-series complex-analysis convergence power-series or ask your own question. The basic facts are these: Every power series has a radius of convergence 0 R1, which depends on the coecients a. The interval of convergence plays an important role in establishing the values of \(x$$ for which a power series is equal to its common function representation. These are the most important series of all! (Taylor, Maclaurin, etc, etc. This theorem called the Ratio Test does not say that necessarily the sequence.$\begingroup\$ Radius of convergence of an analytic function doesn't really exist as a concept: an analytic function has a domain on which it is analytic, and its power series around a point will have a disk of some radius on which it converges, but for a function there's nothing to converge or diverge, hence no radius of convergence. Correct! This is the correct answer. Math 432 - Real Analysis II Solutions to Test 1 Thus, the radius of convergence for this power series is 1. The radii of convergence of these power series will both be R, the same as the original function. the power series converges only for x = c) or to be (i. The same terminology can also be used for series whose terms are complex, hypercomplex or, more generally, belong to a normed vector space (the norm of a vector being corresponds to the absolute value of a number). The radius of convergence can often be determined by a version of the ratio test for power series: given a general power series a 0 + a 1 x + a 2 x 2 +⋯, in which the coefficients are known, the radius of convergence is equal to the limit of the ratio of successive coefficients. (c)Use (a) and (b) and the Alternating Series Estimation Theorem (Section 11. Power series are infinite series of the form
{ "domain": "com.br", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9857180669140008, "lm_q1q2_score": 0.8192727267096109, "lm_q2_score": 0.8311430562234877, "openwebmath_perplexity": 278.51536146426156, "openwebmath_score": 0.9204405546188354, "tags": null, "url": "http://sunpires.com.br/3a2q0cj/pllke.php?xxa=radius-of-convergence-complex-power-series-problems" }
javascript, jquery var div = document.createElement('div'); div.innerHTML = str.trim(); return format(div, 0).innerHTML; } Hopefully this can be optimized to increase its speed, but if it can't then I would at least like some help to clean it up as I am sure this isn't the most effective way to do it. Thanks! Edit: added the process function that was previous missing. Also for clarification I am using regular JSON arrays and objects that usually exceed 100 objects in the array. If you want an example of what that data could look like https://en.wikipedia.org/wiki/GeoJSON#Example has a good structure of some of the data I am parsing (containing both objects and arrays). Continuous repetitive string concatenation is bad for performance because each such operation requires re-hashing of the string due to String interning. Array enumeration using for-in loop is slower than for-of or a standard for loop. Things like obj[key][subkey] may be slow in a long loop so cache them in a variable. Do the proper performance measurements using Devtools Timeline profiler to find bottlenecks. Here's an arguably more readable and hopefully faster example: const parts = []; const group = obj[key];
{ "domain": "codereview.stackexchange", "id": 36293, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery", "url": null }
c#, wpf, active-directory <RowDefinition Height="42px" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid Grid.Row="0"> <Button x:Name="GetUsersButton" Content="Get Users" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75" Click="GetUsersButton_Click" /> <Button x:Name="GetUsersGroupsButton" Content="Get Users' Groups" HorizontalAlignment="Left" Margin="90,10,0,0" VerticalAlignment="Top" Width="103" Click="GetUsersGroupsButton_Click" /> <Button x:Name="GetGroupsButton" Content="Get Groups" HorizontalAlignment="Left" Margin="198,10,0,0" VerticalAlignment="Top" Width="75" Click="GetGroupsButton_Click" /> <Button x:Name="GetDirectReports" Content="Get Direct Reports" HorizontalAlignment="Left" Margin="278,10,0,0" VerticalAlignment="Top" Width="103" Click="GetDirectReports_Click" /> </Grid> <Grid Grid.Row="1"> <DataGrid x:Name="DataGrid" AutoGenerateColumns="True" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" RenderTransformOrigin="2.25,-3.615" MaxHeight="9001" MaxWidth="90000000" ItemsSource="{Binding IsAsync=True}" MinHeight="484" MinWidth="742" /> </Grid> </Grid> </Grid> </Window>
{ "domain": "codereview.stackexchange", "id": 20538, "lm_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, active-directory", "url": null }
fft, fourier-transform, sampling Title: Correction of amplitude after zero padding for upsampling purposes I have time sequence in which the data is sampled at 0.8 Hz. The data is related to chromatography (chemical analysis), that is why the sampling frequency is relatively low. The instrument cannot sample faster at this moment. I was exploring the idea of upsampling by zero padding in the frequency domain as follows in MATLAB. FFT_S=fft(Signal); % FFT of Signal of Interest FFT_ZP=[FFT_S(1:length(t)/2,1); zeros(1000,1); FFT_S(length(t)/2+1:end,1)]; % Zero padding with 1000 zeros. Signal_Up=real(ifft(FFT_ZP)); % Upsampled data The original data consists of 716 points. The upsampled data has 1716 points but the amplitude has reduced - which is undesirable. Is there a simple multiplying factor to correct the amplitude in MATLAB based on total number of points before and after upsampling? EDIT: Fortunately for this analytical chemistry purpose the trade offs of zero padding are not relevant. Qualitatively, in order to keep the amplitude the same, I found that if we double the sampling rate, the amplitude after inverse fft had to be multiplied by 2, if we triple the sampling rate by zero padding, the amplitude had to be multiplied by 3. Ignoring the trade offs, there must be a generalized method to correct the final amplitude based on the initial and final number of data points? Thanks. If you use an 1/N normalized DFT, then you shouldn't have any problems with your amplitude when you take the inverse DFT (with no normalization factor/factor of 1). Consider the case of a pure tone with a whole number of cycles in the frame. Only one bin pair will be non-zero. No matter how many extra zeroes you insert, the inverse DFT will reconstruct the same signal in the same duration, just appropriately upsampled. The amplitude of the signal will be twice the magnitude of of each bin value independent of your sample count.
{ "domain": "dsp.stackexchange", "id": 9307, "lm_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, fourier-transform, sampling", "url": null }
condition will be if the number is less than or equal to 1, then simply return the number. Thia is my code: I need to display all the numbers: But getting some unwanted numbers. This phenomenon is called recursion. Edited: Piyush Gupta on 10 Sep 2020 Help needed in displaying the fibonacci series as a row or column vector, instead of all number. The function first checks if the length is lesser than or equal to 1. In other cases, it makes two adjoining recursive calls with arguments as (length-1) and (length-2) to the gen_seq() function. Very nice! n − 1− √ 5 2! When a function is defined in such a way that it calls itself, it’s called a recursive function. I'd love to be corrected, but I don't believe the Python interpreter is able to unroll recursive algorithms such as this one. Using Loop; Using Recursion; Let’s see both the codes one by one. How to print a Fibonacci series in a reverse order using ... original. If Python Recursion is a topic that interests you, I implore you to study functional languages such as Scheme or Haskell. Python Program to Display Fibonacci Series Using Recursion. Using Loop; Using Recursion; Let’s see both the codes one by one. To understand this demo program, you should have the basic Python programming knowledge. Fibonacci series using loops in python. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. A = \begin{pmatrix}1 & 1 \\ 1 & 0\end{pmatrix}, While memoization can result in impressive performance improvements, it's not really appropriate for this task, when a trivial loop would do what you want. I also invite you to read. Python Program to Write Fibonacci Sequence Using Recursion. This ensures that it can't be run externally, and only from that file. We can generate the Fibonacci sequence using many approaches. In Mathematics, Fibonacci Series in a sequence of numbers such that each number in the series is a sum of the preceding numbers. Send the length as a parameter to our recursive method which we named as
{ "domain": "hpdst.gr", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9579122684798184, "lm_q1q2_score": 0.8043914718134807, "lm_q2_score": 0.83973396967765, "openwebmath_perplexity": 922.600890511762, "openwebmath_score": 0.34707581996917725, "tags": null, "url": "http://ciahs.hpdst.gr/page/page.php?37fbab=fibonacci-sequence-python-recursive" }
Index far a o Indexodd Indexeven bn a 8 27 bn a but46 onereal root tworeal roots Another 8 B d TEB C 3 fzjfzDb 1WE y 2 21 i 20 456 4ft try augno Norealrootsbecauseyoucan't multiplyanumberbyitself4times. College Algebra (10th Edition) answers to Chapter R - Section R. For example, the tenth root of 59,049 is 3 as 3 x 3 x 3 x 3 x 3 x 3 x 3 x 3 x 3 x 3 is 59,049. What test to use? When you're looking at a positive series, what's the best way to determine whether it converges or diverges? This is more of an art than a science, that is, sometimes you have to try several things in order to nd the answer. If then b is the nth root of a ; Example ; Notation ; Index (of the radical) The number n outside of the radical sign ; 3 Writing nth roots as powers and powers as nth roots. Notes on Fast Fourier Transform Algorithms & Data Structures Dr Mary Cryan 1 Introduction The Discrete Fourier Transform (DFT) is a way of representing functions in terms of a point-value representation (a very specific point-value representation). What is a function?. 1 Evaluate nth roots and use rational exponents. For example, the sixth root of 729 is 3 as 3 x 3 x 3 x 3 x 3 x 3 is 729. 86 21 Take fourth roots of each side. n th Roots. 25 different faces laid out in an A3 poster that can be folded down to a size of a business card. 23 = 8 53 = 125 1713 = 5000211 4. Since 2 = 8 , we say that 2 is the cube root of 8. Of course, the presence of square roots makes the process a little more complicated, but certain rules allow us to work with fractions in a relatively. 404-405 4-61 every 3rd; 3 Evaluating Nth Roots. Since the nth root of a real or complex number z is z1/n, the nth root of r cis θ is r1/n cis θ/n. exponent 1/n refers to the nth root numbers: 16^1/4 = 4th root of 16 to power of 1.
{ "domain": "freunde-des-historischen-schiffsmodellbaus.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363494503271, "lm_q1q2_score": 0.8552177872568134, "lm_q2_score": 0.8688267864276108, "openwebmath_perplexity": 558.5759163333647, "openwebmath_score": 0.7313296794891357, "tags": null, "url": "http://zjkf.freunde-des-historischen-schiffsmodellbaus.de/how-to-evaluate-nth-roots.html" }
c#, wpf, mvvm Title: Combobox with multiple itemssources MVVM I'm trying to make a list of either customers or suppliers based on a radio button. I have a solution that works but I want to know if it is a correct solution to work with the MVVM-model. Next to that I want to know if I make correct use of the collecions. If there would be a more efficient way of coding for this part, I'd very happy to hear it. I have one interface (customers and suppliers) which both implement an interface (IStakeholder). In my UI I have a two radio buttons and a combobox. Based on which radio button is used, another list should be displayed in the combobox. In my InputViewModel I use three list, one general for the combobox (CustomersSuppliers), one for customers (CustomerList) and one for Suppliers (SupplierList). The code is found below. To generate the INotifyProperty, I use Fody Weaver. C# - ViewModel public class InputViewModel : BaseViewModel { // Combobox list public IEnumerable<Customer> CustomerList { get; set; } /// <summary> /// List with suppliers to choose from /// </summary> public IEnumerable<Supplier> SupplierList { get; set; } /// <summary> /// List with either customers or suppliers /// Choice depends on radiobox in the View /// </summary> public ObservableCollection<IStakeholder> CustomersSuppliers { get; set; } /// <summary> /// Binds to the Customer Radio Button /// </summary> public bool ButtonCustomerIsChecked { get => _buttonCustomerIsChecked; set { _buttonCustomerIsChecked = value; if(value) CustomersSuppliers = new ObservableCollection<IStakeholder>(CustomerList); } }
{ "domain": "codereview.stackexchange", "id": 28137, "lm_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, mvvm", "url": null }
ros, usb-camera, camera1394, camera, pointgrey Title: unable to get Point Grey USB camera work in ubuntu Hello, I have problem in using POINT GREY FIREFLY MV FMVU-13S2C digital camera to work on Ubuntu 11.04. This is the version of ubuntu. adrian@ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 11.04 Release: 11.04 Codename: natty
{ "domain": "robotics.stackexchange", "id": 11734, "lm_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, usb-camera, camera1394, camera, pointgrey", "url": null }
assembly, x86 Title: A progression of quines A quine is a program whose only job it is to reproduce the source file that was used to create the executable in the first place. This stackoverflow post provides some reasoning about its usefulness. Below I present 5 different quines. The nice quine This program has an embedded copy of its complete source (minus that copy of course). For simplicity I've substituted an asterisk for the carriage return and linefeed codes. I've also avoided the use of embedded dollar characters ($) and single quote characters (') because they would throw off the DOS PrintString function and the FASM parser respectively. org 256 mov ah, 02h ; DOS.PrintChar mov si, text lodsb next: mov dl, al cmp al, 42 ; Asterisk -> CRLF jne char mov dl, 13 int 21h mov dl, 10 char: int 21h lodsb cmp al, 36 ; Dollar jne next mov dl, 39 ; SingleQuote int 21h mov dx, text mov ah, 09h ; DOS.PrintString int 21h mov ah, 02h ; DOS.PrintChar mov dl, 36 ; Dollar int 21h mov dl, 39 ; SingleQuote int 21h mov dl, 13 ; CR int 21h mov dl, 10 ; LF int 21h mov ax, 4C00h ; DOS.Terminate int 21h
{ "domain": "codereview.stackexchange", "id": 36782, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "assembly, x86", "url": null }
c#, sql, sql-server public void ProcessRequest( System.Web.HttpContext ctx ) { // Each http request is handled by two SQL procedure calls. The first gets the name of the handling procedure, the second computes the response. try { using ( Data.SqlClient.SqlConnection sqlconn = GetConn() ) using ( Data.SqlClient.SqlCommand cmd = new Data.SqlClient.SqlCommand( "perfect.GetHandler", sqlconn ) ) { Data.SqlClient.SqlParameter p = null; { /* Set up table of info to be passed to stored procedure */ Data.DataTable t = new Data.DataTable( ); t.Columns.Add( "Kind", typeof( int ) ); t.Columns.Add( "Name", typeof( string ) ); t.Columns.Add( "Value", typeof( string ) ); AddToDataTable( t, 0, ctx.Request.QueryString ); AddToDataTable( t, 1, ctx.Request.Form ); AddToDataTable( t, 2, ctx.Request.Cookies ); t.Rows.Add( 3, "Host", ctx.Request.Url.Host ); t.Rows.Add( 3, "Path", ctx.Request.Path ); t.Rows.Add( 3, "PathAndQuery", ctx.Request.Url.PathAndQuery ); t.Rows.Add( 3, "IpAddress", ctx.Request.UserHostAddress ); p = cmd.Parameters.AddWithValue( "@Info", t ); p.SqlDbType = Data.SqlDbType.Structured; } sqlconn.Open(); cmd.CommandType = Data.CommandType.StoredProcedure; cmd.CommandText = ( string ) cmd.ExecuteScalar();
{ "domain": "codereview.stackexchange", "id": 34274, "lm_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#, sql, sql-server", "url": null }
mars, water Title: What are the most recent minerals modified by water found to date on Mars? There likely was quite a bit of liquid water on the surface of Mars less than 4 billion years ago. We know this because we found rocks that old that have been modified by the presence of water. For example : If the martian blueberries, or hematite spherules found by Opportunity formed by slow evaporation in mineral-rich liquid water, they likely formed 3 billion years ago. Serpentines have been detected by CRISM. What is the most recent rock we know of on Mars that was modified by the presence of liquid water on the surface? If you have access, I would recommend you to read Carter et al. (2013). It is a compilation of all occurrences of hydrous minerals that have been detected on Mars by spectrometers OMEGA (Mars Express/ESA) and CRISM (Mars Reconnaissance Orbiter/NASA). This data was used to investigate the spatial distribution, composition, and age of hydrous minerals on Mars. Regarding age, the most recent hydrous minerals are opal and zeolites of Amazonian age (< 3 Ga): The exposure with the youngest unit age is a series of small cones and dykes or fractures which have been identified thanks to a dust‐free window in the Utopia Rupes region, in a unit of Amazonian age. Both opaline silica and zeolites (or alternatively sulfates) are found there as shown in Figure 7. Zeolites are found mainly on the butte that could constitute a small volcano, as suggested by the presence of radial patterns resembling lava flows, to the southeast especially. Silica is found on an elongated structure which is either a dyke or a structural horst. Of interest is the presence of two small cones exposed in the NE corner displaying opaline silica. Such small cones on Mars have been interpreted either as volcanic vents or mud volcanoes [e.g., Allen, 1979; Farrand et al., 2005]. In both cases, the observation of opaline silica pleads for a local fluid circulation inside a hydrothermal context consistent with volcano‐ice interactions as predicted by previous studies [Allen, 1979; McGill, 2002; Farrand et al., 2005].
{ "domain": "astronomy.stackexchange", "id": 4741, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mars, water", "url": null }
mechanical-engineering Title: What aspects can help a car flip? I am not sure if this is the right place to ask it, but this is a question that I thought today, and it gave me some curiosity to understand. Imagine that a car will curve, we can say the turn is a bit tight , what are the factors that can help it to flip? I was wondering about some aspects: if the car has mass, it has inertia, so while it is curving it tends to keep the motion in the same direction that it was instants before the turn. right? So, if the car has more mass, it has more inertia, and since there is friction, one heavier car would flip easier then one lighter, considering that all other possible variables were equal. Center of gravity, a car with an higher center of gravity would flip easier. The whole inertia of the car distributed to higher heights would be further of the tires(where friction acts), creating angular momentum. The car being thin because it has less surface contact with the ground; The car being lighter. This opposes what I've said in "a)", but a heavier car is more difficult to get off the road. A lighter car has more instability. Am I wrong? In what I'm wrong? What do you think? Thanks for helping. :) A car will flip as soon as the acceleration vector from its center of mass points outside the "footprint" defined by connecting the tire contact patches with lines. Whether or not this occurs has a lot to do with how much lateral force the tires can generate through their friction with the ground — or if they catch on something like a curb. Generally speaking, the mass has little to do with it, because it affects the "grip" of the tires in the same proportion that it contributes to the inertia of the vehicle. The geometry of the vehicle — the length and width of the wheelbase vs. the height of the center of gravity — is the primary factor determining stability. A car with a wide/long stance and a low CG will generally slide rather than flip, unless the wheels catch on something.
{ "domain": "engineering.stackexchange", "id": 1042, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering", "url": null }
c++, queue, deque cb(ab + (init.size() >> 1)), ae(ab + (init.size() << 1)), ce(cb + init.size()) { std::for_each(cb, ce, [&](pointer &p){ p = vatraits::allocate(va, 1); vatraits::construct(va, p, std::move(init.begin()[&p - cb])); }); } ~deque() { clear(); delete []ab; } deque &operator = (const deque &other) { if (this == &other) return *this; if (typename vatraits::propagate_on_container_copy_assignment() && va != other.va) { Alloc newva(other.va); if (other.size() <= size()) { // ---XXXXXX--- to ---YYYY----- std::for_each(cb, cb + other.size(), [&](pointer &p){ vatraits::destroy(va, p); vatraits::deallocate(va, p, 1); p = vatraits::allocate(newva, 1); vatraits::construct(newva, p, other[&p - cb]); }); erase(cbegin() + other.size(), cend()); ce = cb + other.size(); } else if (other.size() <= ce - ab) { // ---XXXXXX--- to -YYYYYYYY--- std::for_each(ce - other.size(), cb, [&](pointer &p){ p = vatraits::allocate(newva, 1); vatraits::construct(newva, p, other[&p - (ce - other.size())]); });
{ "domain": "codereview.stackexchange", "id": 23180, "lm_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++, queue, deque", "url": null }
compilers, parsers, ambiguity Title: What techniques can I use to hand-write a parser for an ambiguous grammar? I'm writing a compiler, and I've built a recursive-descent parser to handle the syntax analysis. I'd like to enhance the type system to support functions as a valid variable type, but I'm building a statically typed language, and my desired syntax for a function type renders the grammar temporarily* ambiguous until resolved. I'd rather not use a parser generator, though I know that Elkhound would be an option. I know I can alter the grammar to make it parse within a fixed number of steps, but I'm more interested in how to implement this by hand. I've made a number of attempts at figuring out the high-level control flow, but every time I do this I end up forgetting a dimension of complexity, and my parser becomes impossible to use and maintain. There are two layers of ambiguity: a statement can be an expression, a variable definition, or a function declaration, and the function declaration can have a complex return type. Grammar subset, demonstrating the ambiguity: basetype : TYPE | IDENTIFIER ; type : basetype | basetype parameter_list ; arguments : arraytype IDENTIFIER | arraytype IDENTIFIER COMMA arguments ; argument_list : OPEN_PAREN CLOSE_PAREN | OPEN_PAREN arguments CLOSE_PAREN ; parameters : arraytype | arraytype COMMA parameters ; parameter_list : OPEN_PAREN CLOSE_PAREN | OPEN_PAREN parameters CLOSE_PAREN ; expressions : expression | expression COMMA expressions ; expression_list : OPEN_PAREN CLOSE_PAREN | OPEN_PAREN expressions CLOSE_PAREN ; // just a type that can be an array (this language does not support // multidimensional arrays) arraytype: : type | type OPEN_BRACKET CLOSE_BRACKET ; block : OPEN_BRACE CLOSE_BRACE | OPEN_BRACE statements CLOSE_BRACE ; function_expression : arraytype argument_list block | arraytype IDENTIFIER argument_list block ; call_expression : expression expressions ; index_expression : expression OPEN_BRACKET expression CLOSE_BRACKET ; expression : function_expression | call_expression | index_expression | OPEN_PAREN expression CLOSE_PAREN ; function_statement : arraytype IDENTIFIER argument_list block ;
{ "domain": "cs.stackexchange", "id": 4888, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "compilers, parsers, ambiguity", "url": null }
Observe that this means $\displaystyle X = \sum_{k=1}^\infty \frac{D_k}{2^k}$ and $\displaystyle 2(X - D_1/2) = 2X-D_1 = \sum_{k=2}^\infty \frac{D_k}{2^k}$ both have the same distribution, since the two sequences $(D_1,D_2,D_3,\ldots)\vphantom{\dfrac11}$ and $(D_2,D_3,D_3,\ldots)$ both have the same distribution. The conditional distribution of $2X-D_1$ given $D_1$ has this same distribution, and since $2X-D_1$ is determined by $D_2,D_3,D_4,\ldots,$ we have $2X-D_1$ independent of $D_1.$ Since $2X-D_1$ is independent of $D_1$ and $2X-D_1$ has the same distribution that $X$ has, we can say \begin{align} F(x) & = \Pr(X\le x) = \Pr(2X-D_1\le x) = \Pr(2X-D_1\le x \mid D_1=1) \\[10pt] & = \frac{\Pr(2X-D_1 \le x\ \&\ D_1=1)}{\Pr(D_1=1)} = \frac{\Pr(1/2 \le X \le \frac{x+1} 2)}{2/3} = \frac{\left( \frac{x+1} 2 \right)^{\log_2 3} - 1/3}{2/3}. \end{align} Is the following true? $$x^{\log_2 3} \, \overset{\Large\text{?}} = \frac{\left( \frac{x+1} 2 \right)^{\log_2 3} -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126525529014, "lm_q1q2_score": 0.8176983027490563, "lm_q2_score": 0.8354835309589074, "openwebmath_perplexity": 123.91246399463388, "openwebmath_score": 0.9581577181816101, "tags": null, "url": "https://math.stackexchange.com/questions/2522278/what-is-the-distribution-of-real-numbers-with-biased-digits" }
where 19.9.18 $\displaystyle L$ $\displaystyle=(1/\sigma)\operatorname{arctanh}\left(\sigma\sin\phi\right),$ $\sigma=\sqrt{(1+k^{2})/2}$, $\displaystyle U$ $\displaystyle=\tfrac{1}{2}\operatorname{arctanh}\left(\sin\phi\right)+\tfrac{1% }{2}k^{-1}\operatorname{arctanh}\left(k\sin\phi\right).$ Other inequalities for $F\left(\phi,k\right)$ can be obtained from inequalities for $R_{F}\left(x,y,z\right)$ given in Carlson (1966, (2.15)) and Carlson (1970) via (19.25.5).
{ "domain": "nist.gov", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9875683509762452, "lm_q1q2_score": 0.8004033238573901, "lm_q2_score": 0.810478913248044, "openwebmath_perplexity": 4566.538273842092, "openwebmath_score": 0.9458876848220825, "tags": null, "url": "https://dlmf.nist.gov/19.9" }
c++, integer, c++17 Or, we could make those limits be template parameters instead, which allows us to define saturating types with non-default limits: /** A saturating integer value. */ template <typename T, std::enable_if_t<std::is_integral_v<T> T> min = std::numeric_limits<T>::min(), std::enable_if_t<std::is_integral_v<T> T> max = std::numeric_limits<T>::max()> class xint_sat_t { public: // We don't need return_type - just use xint_sat_t directly // (T, min and max will be inferred). static const T min_val = min; static const T max_val = max; If we take this approach, we'll need operator= that accepts a T alone, otherwise assignments would need values constructed with matching min and max. Specialize type traits If we want our new type to behave as a normal value type, it's worthwhile to specialize the type traits: namespace std { <template typename T, T min, T max> constexpr is_unsigned<xint_sat_t<T, min, max>> { return is_unsigned<T>(); } } Other candidates for specialization include std::is_signed, std::is_integral, std::is_arithmetic (if we also specialize std::numeric_limits), std::is_exact and so on - the pattern is mostly to forward to the specialization for T, as above. A cast is required in clamp() If I try to assign a uint_sat8_t to a uint_sat32_t variable, I get an error from mismatched ?: arguments. The fix is to cast to T: return val < min_val ? min_val : val > max_val ? max_val : static_cast<T>(val);
{ "domain": "codereview.stackexchange", "id": 28035, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, integer, c++17", "url": null }
Computer Science,,. Success on a TI-84 Calculator to find the answer to a Frequently-Asked question, simply click on button! > x given ) hour that she will receive 4 phone calls received in hour! Financial modeling from the following characteristics: the number of events occurs in a Poisson random is. Of data, and data Science errors for every five pages symbol for average! Are almost 0 killed from kicks by horses λ of the Poisson distribution worksheet or homework.... Order routers and algorithmic trading than one success occurring within a short interval is proportional to the number of that. Period of time, a French mathematician Siméon Denis Poisson in 1837 or! Suppose she received 1 phone call in the next year won ’ be! A period of time with a known average rate events with very low probabilities called a Poisson.! Lower and upper distribution functions of the first possibility of zero accidents and the binomial distribution,.. Was discovered by a receptionist in average within a short interval is independent of successes that occur outside interval! Can be used for calculating the possibilities for an event occurring in a given time interval historically! 19 th century French mathematician, who published its essentials in a random... You also need to know the average rate of success in a time. About it below the form can calculate the variance of the Questions addresses your,! With the given average rate of success would be 1 phone call per hour on average of... Two text boxes Questions addresses your need, refer to Stat Trek 's tutorial on the Poisson is! Most n successes in a period of time, length, volume or area ;. Please fill in questionnaire using Poisson distribution Online ; Poisson distribution Calculator ', please fill questionnaire. Generate the complete work with steps for any corresponding input values to solve Poisson distribution … Poisson distribution in with... 3 x 2, which equals 6 likelihood of how many times an with! Other events 2 calls per half hour poisson distribution calculator cumulative Poisson probability in this article professional Jack. Weather problems in United States x > x given ) is equal to 0.061 see how use! { -2.04 } } { 10 free Calculator 0.368 + 0.368 or 0.736 we discuss how to calculate probability! Thank you for all the effort behind this free Calculator x:
{ "domain": "marqueindia.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464485047916, "lm_q1q2_score": 0.8174722323678324, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 736.8100955836233, "openwebmath_score": 0.7082796096801758, "tags": null, "url": "https://marqueindia.org/bo-ness-nyvu/15d57f-poisson-distribution-calculator" }
c++, c++17, thread-safety I know you intend for the user to do s.value = s.other * 2;… but there is no way to prevent misuse, and it’s such an easy mistake to make. It could be even trickier if the code is s.value() = calculate_value();, and somewhere deep in the call to calculate_value() is a call to Get(). Just don’t do it: don’t let random user code run while holding a lock. Note that you could fix Mutate() by doing something like this: template <typename Func> SettingsStruct Mutate(const Func &transformFunction) { // don't really need optional, just using it to keep the code simple auto s = std::optional<SettingsStruct>{}; // copy settings, then release the lock { auto _ = std::shared_lock{mutex_}; s = settings_; } // do the transform on the copy *s = transformFunction(*s); // now change the actual settings auto _ = std::scoped_lock{mutex_}; settings_ = *s; return settings_; } But holy wow is that wildly inefficient for just changing a setting or two. This is a sign that your abstraction is wrong. Code review #pragma once Don’t use #pragma once. It’s ‘okay-ish’ (widely supported though non-standard) when it works. When it fails… it is absolute nightmarish catastrophe. Pray you never experience a failure of #pragma once. Settings(const Settings &) = delete; Settings &operator=(const Settings &) = delete; Settings(Settings &&) = delete; Settings &operator=(Settings &&) = delete; The convention in C++ is to put the & (or &&) with the type. In other words:
{ "domain": "codereview.stackexchange", "id": 41689, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++17, thread-safety", "url": null }
acid-base, aqueous-solution, solubility, titration, conductivity The reactions ionization of weak acid: $$\ce{HA + H2O <=> H3O+ + A-}\qquad K_\ce{a}=\frac{\ce{[H3O+][A-]}}{\ce{[HA]}} \tag{1} \label{eq:KWeakAcid}$$ ionization of weak base: $$\ce{B + H2O <=> BH+ + OH-}\qquad K_\ce{b}=\frac{\ce{[HB+][OH-]}}{\ce{[B]}} \tag{2} \label{eq:KWeakBase}$$ self-ionization of water: $$\ce{2 H2O <=> H3O + OH-}\qquad K_\ce{w}=\ce{[H3O+][OH-]} \tag{3} \label{eq:KWater}$$ equilibrium of poorly soluble salt: $$\ce{HBA <=> HB+ + A-}\qquad K_\ce{sp}=\ce{[HB+][A-]} \tag{4} \label{eq:KSalt}$$ Charge balance $$\ce{[H3O+] + [HB+] = [OH-] + [A-]}\tag{5}\label{eq:ChangeBalance}$$ Mass balance To mass balance we can use an expression based on amount of substance: Weak acid:
{ "domain": "chemistry.stackexchange", "id": 12365, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acid-base, aqueous-solution, solubility, titration, conductivity", "url": null }
filter-design, python, finite-impulse-response, scipy, highpass-filter Title: Constraints on number of taps in a FIR filter vs. FFT length I want to implement a FIR highpass filter for acoustic signals. I generate the FIR using Python's SciPy code: import numpy as np import scipy # Parameters nfft = 512 # FFT length cutoff = 100 # Cutoff in Hz fs = 16000 # Sampling rate in Hz # Frequency related sizes kbins = int(nfft//2 + 1) # FIR filter via firwin numtaps = 251 taps = scipy.signal.firwin(numtaps, cutoff, pass_zero="highpass", fs=fs) # Compute the filter h in frequency domain using FFT h = np.fft.fft(taps, nfft) h = h[0:kbins] return h Since my application requires working in the frequency domain in RT, the FIR highpass filter is converted to frequency domain (see code above) and applied on frequencies. Thereafter I do the IFFT to get the signal back in time domain. When I use this highpass filter with nfft=4096 it sounds well, but when I use it with nfft=512 it sounds bad, as the speaker is hoarse, like a broken vinyl record. I suspect it is because the given number of taps, 251, is inadequate to small FFT lengths. Therefore I have the following questions: In theory, is the number of FIR taps depend on FFT window length, or can we choose a "magic number" that fits all window lengths? In theory, what are valid numbers of taps ranges for a given FFT length? What is the minimal number of taps and maximal number of taps allowed to a given FFT? By allowed I mean will produce good results and won't add distortion to the signal. Is there a formula or a rule of thumb allowing me to input FFT length and calculate the minimal/maximal/optimal number of taps in the FIR? What is the best number of taps for speech filtering with FFT lengths of 256 to 8192 samples, given fs=16000?
{ "domain": "dsp.stackexchange", "id": 11368, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filter-design, python, finite-impulse-response, scipy, highpass-filter", "url": null }
rotated vector has coordinates (x2, y2) The rotated vector must also have length L. Lesson 15: Solving Vector Problems in Two Dimensions We can now start to solve problems involving vectors in 2D. In this modern era of technology, people want to save their time as much as possible. Find the scalar multiple of a vector 3. The vector product obeys the following properties. They are flexible. Hello, I'm currently working more heavily with Shader Graph. Hence, a unit vector that is perpendicular to both \langle 1, 1, 1\rangle and \langle 1, 0, 0\rangle is$$ \frac{\langle 1, 0, -1\rangle}{\sqrt{2}} = \left \langle \frac{1}{\sqrt{2}}, 0. This vector S is now perpendicular to both R and the P 2 - P 1. The dot-product of the vectors A = (a1, a2, a3) and B = (b1, b2, b3) is equal to the sum of the products of the corresponding components: A∙B = a1*b2 + a2*b2 + a3*b3. Click near the tip of the velocity vector and drag the mouse button. u, in this case, is just i because i is a unit vector along the x-axis. Vector Determine coordinates of the vector u=CD if C[19;-7], D[-16,-5]. The syntax is clear. 7 m/s at an angle of 66 o north of east immediately after the collision. For the 2D case, given A = (x1, y1, 0) and B = (x2, y2, 0), the matrix G is the forward. To represent any position and orientation of , it could be defined as a general rigid-body homogeneous transformation matrix,. Introduction: In this lesson we will examine a combination of vectors known as the cross product. Is there also a way to multiply two vectors and get a useful result? It turns out there are two; one type produces a scalar (the dot product) while the other produces a vector (the cross product). Conic Sections: Hyperbola example. and it will fail to calculate if the input geometry is a point (number of vertices is one). Two circular objects will move
{ "domain": "quadri-canvas.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137868795701, "lm_q1q2_score": 0.80740105517724, "lm_q2_score": 0.822189123986562, "openwebmath_perplexity": 751.5377189819011, "openwebmath_score": 0.6384262442588806, "tags": null, "url": "http://quadri-canvas.it/muhh/2d-vector-calculator.html" }
hadamard, quantum-walks %\sum_I \prod_{\ell=1}^n u_{I_\ell} \equiv \sum_I u_{I} \equiv u_{I_1 I_2} u_{I_3 I_4} \cdots u_{I_{2n-1}I_{2n}},$$ where the short-hand notation $u_I$ denotes the product of matrix elements $u_{\alpha\beta}$ with the indices taken progressively from the $2n$-bit string $I$ (this is way easier to understand in practice than to explain in full generality, I'll give an example in a bit). The sum is taken over all binary strings $I$ of length $2n$ such that
{ "domain": "quantumcomputing.stackexchange", "id": 2853, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "hadamard, quantum-walks", "url": null }
python, python-3.x, random return reval How it works is simple. It creates a random number. It then hashes that number. Then, it .hexdigest()s that. And then returns that. By the way, I tried being descriptive with explaining it, but it kept saying that there was unformated code. Sorry about that. The big description will be in a .md file on the repository. MarkDown file here Development of the module this will be here. Anytime you have a stacked if with basically all of the same comparisions, you should consider another method. Use a dict: The most common way to do this sort of thing is a dict. The dict makes it easy to map a string to a method like: sha_methods = dict( sha1=hashlib.sha1, sha224=hashlib.sha224, sha256=hashlib.sha256, sha384=hashlib.sha384, sha512=hashlib.sha512, ) def hexrandom(minint, maxint, shamode="sha1"): if shamode not in sha_mthods: raise ValueError("Unknown hashlib method {}".format(shamode)) x = str(rand.randint(int(minint), int(maxint))) return sha_methods[shamode](x.encode()).hexdigest() Use a direct method lookup: In this case, since the shamode string matches the method name hashlib, we can use getattr to directly lookup this method like: def hexrandom(minint, maxint, shamode="sha1"): method = getattr(hashlib, shamode, None) if method is None: raise ValueError("Unknown hashlib method {}".format(shamode)) x = str(rand.randint(int(minint), int(maxint))) return method(x.encode()).hexdigest()
{ "domain": "codereview.stackexchange", "id": 29154, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, random", "url": null }
quantum-mechanics, double-slit-experiment, observers Title: Is the beta barium borate crystal an observer in the delayed choice quantum eraser double split experiment? I'm a little confused about the top answer to this question: Variation of delayed choice quantum eraser He says "if you simply detect all signal photons and make no distinction between them, there will be no interference pattern on the screen" But in the standard vanilla double slit experiment with no observer, there is an interference pattern between all the photons. Question. Does this mean the Beta Barium Borate Crystal is effectively an "observer" for the set of all the signal photons that hit D0? If not, then what is?
{ "domain": "physics.stackexchange", "id": 8845, "lm_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, double-slit-experiment, observers", "url": null }
java, matrix, mathematics Title: Adding matrices This is what the code should do: Check if the first dimensions and the second dimensions of each 2-dimensionalarray are the same. If they are not the same, then return a 0x0 2-dimensional array. array, otherwise do the following; Allocate memory for a local 2-dim. array with the same dimensions as one of the 2-dim. array parameters Add each corresponding element in the parameter 2-dim. arrays and store the result in the corresponding element ofthe local 2-dim. array (use nested for loops) Return the local 2-dim. array import java.lang.Math; public class Homework2 { public static void main(String[] args){ int d1 = (int) (Math.random()*(10-3+1)+3); int d2 = (int) (Math.random()*(10-3+1)+3); double[][] doubMatrix1 = new double[d1][d2]; double[][] doubMatrix2 = new double[d1][d2]; double[][] doubMatrix3 = new double[d1][d2]; doubMatrix1 = getdoubMatrix(d1,d2); doubMatrix2 = getdoubMatrix(d1,d2); doubMatrix3 = addMatrices(doubMatrix1, doubMatrix2); } public static double[][] getdoubMatrix(int d1, int d2){ double[][] tempArray = new double[d1][d2]; for(int i =0; i <tempArray.length;i++ ) for(int j =0;j < tempArray[i].length;j++) tempArray[i][j] = Math.random()*(10.0); return tempArray; } public static double[][] addMatrices(double doubMatrix1[][], double doubMatrix2[][]){
{ "domain": "codereview.stackexchange", "id": 17351, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, matrix, mathematics", "url": null }
deep-learning, word-embeddings, pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got torch.FloatTensor instead (while checking arguments for embedding) I have also searched on Stack Overflow as well as Stack Exchange but I found nothing related to this problem. Please help me with this. Any comments would be appreciated! So, this is just half answer, I write it here to be able to format the text clearly. You are facing troubles because you are trying to do something that you shouldn't, which is applying gradient to indices instead of embeddings. When using embeddings (all kinds, not only BERT), before feeding them to a model, sentences must be represented with embedding indices, which are just number associated with specific embedding vectors. Those indices are just values mapping words to vectors, you will never apply any operation on them, especially you will never train them, cause they are not parameters. ['Just an example...'] # text | | Words are turned into indices v [1., 2., 3., 4., 4., 4.] # indices, tensor type long, no sense in applying gradient here | | Indices are used to retrieve the real embedding vectors v [0.3242, 0.2354, 0.8763, 0.4325, 0.4325, 0.4325] # embeddings, tensor type float, this is what you want to train If you want to fine tune BERT for a specific task, I suggest you to take a look to this tutorial BERT-fine-tuning
{ "domain": "datascience.stackexchange", "id": 7209, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "deep-learning, word-embeddings, pytorch", "url": null }
slam, navigation, ros-melodic, 2d-mapping, rtabmap so the map is created, then on map_server terminal, I can see: $ rosrun map_server map_saver map:=proj_map [ INFO] [1551304856.764290592]: Waiting for the map [ INFO] [1551304872.285442346]: Received a 551 X 447 map @ 0.050 m/pix [ INFO] [1551304872.285460183]: Writing map occupancy data to map.pgm [ INFO] [1551304872.289321822]: Writing map occupancy data to map.yaml [ INFO] [1551304872.289390615]: Done The map created: The warnings that it did not receive any data since 5 seconds are normal, as no sensors are publishing topics to rtabmap. Originally posted by matlabbe with karma: 6409 on 2019-02-27 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by Drkstr on 2019-02-27: Ah, looks like I just needed to wait a bit :D Thanks for your response.
{ "domain": "robotics.stackexchange", "id": 32528, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, ros-melodic, 2d-mapping, rtabmap", "url": null }
ros, ros2, ament rosidl_target_interfaces(${PROJECT_NAME}_component ${PROJECT_NAME} "rosidl_typesupport_cpp") rclcpp_components_register_nodes(${PROJECT_NAME}_component "ether_ros2::EthercatCommunicator") set(node_plugins "${node_plugins}ether_ros2::EthercatCommunicator;$<TARGET_FILE:ether_ros2_component>\n") install(TARGETS ${PROJECT_NAME}_component ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) ament_package() Note that the package has been built successfully. How can I resolve this error ? Thank you for your help. Best Regards, Aris. Originally posted by Akron on ROS Answers with karma: 3 on 2021-06-27 Post score: 0 Original comments Comment by gvdhoorn on 2021-06-28:\ Note that the package has been built successfully. that doesn't really say anything in this case: when building shared libraries, the linker will assume that any symbols it can't directly resolve will be present in the execution context into which the shared library will be loaded. So even if you did not link any libraries, it's very likely your package will still build successfully. Comment by Akron on 2021-06-28: Is there any way to determine which symbols create this runtime error ? That's already in the error: Failed to load library: could not load library loadlibrary error: /home/mobile/dev_ws/install/ether_ros2/lib/libether_ros2_component.so: undefined symbol: _ztvn10ether_ros220ethercatcommunicatore _ztvn10ether_ros220ethercatcommunicatore is the mangled version of the symbol. I'm not sure why, but c++filt (which you'd normally use to demangle symbols) can't process it. Is libethercat.so perhaps a C library, and did you perhaps forget to extern C the #includes of the accompanying header?
{ "domain": "robotics.stackexchange", "id": 36587, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros2, ament", "url": null }
python, performance, numpy, simulation, numba a bit and solve this differently without expensive allocations and copying. This is not substantiated by a profiler so far, but it seems advisable regardless. Also memory-related, in geometry.py, the x/y/z_ref variables are redundant if the xyz_ref vector already exists? I'm not 100% sure about whether any difference is intentional or not (c.f. float(...)), but this sounds like an excellent case for using accessors or regular methods to get the individual components of that vector. The pattern if x is None: x = [] is easier to write as x = x or [], as long as there's no difference expected wrt. other non-falsy values (e.g. bool("")). IMO that's usually not the case and the functional way to write it is shorter. In geometry.py, line 134 the enumerate is unnecessary. I'd also say this would look better as a functional definition via sum and map, but that's probably not super important. In populate_coordinates, there's a return in the very nested if block. Definitely make that block a separate method, it's very hard to see where things are due to the deep nesting and the quite hidden return statement. The return in the later try block is also odd and can be removed. I'd also put the parsing of the file into its own method in order to be able to test it separately from other things. Apropos test cases, there's a lot of del calls in those, are they actually helping with memory consumption, or are they more for documentation? Oh, I'd lowercase REQUIREMENTS.txt, that's the usual naming convention for it.
{ "domain": "codereview.stackexchange", "id": 40925, "lm_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, numpy, simulation, numba", "url": null }
problem key, Exponential growth and decay work, Exponential growth and decay, Pc expo growth and decay word problems, Exponential word problems, Exp growth decay word probs. You can recognize if a function represents an exponential growth or decay by looking at the b value of f(x. exponential growth 4. From 2000 - 2010 a city had a 2. In the long run, exponential growth of any kind will overtake linear growth of any kind as well as any polynomial growth. If you don't see any interesting for you, use our search form on bottom ↓. In 1995, two females from a closely related species were introduced into this population, and the number of Florida panthers increased to 87 by 2003. 5 Exponential Equations BI 6. ) Links to Other Pages Precalculus Sample Exams. Exponential Growth:y = a(1 + r)x Exponential Decay:y = a(1 - r)x (x is an exponent, not multiplication)Remember that the original exponential formula was y = abx. Wednesday, 2/4/15 - 5. 41 35 x y growth / decay 4. Chapter 6 : Exponential and Logarithm Functions. Then do problem 4, and extend the idea. Bank accounts that accrue interest represent another example of exponential growth. If you need additional review, watch the optional video. Daily Homework 2. Exponential Growth I can graph exponential growth in the form y= ca x. Exponential growth functions start out growing slowly and then grow faster and faster. EXPONENTIAL GROWTH and DECAY. Exploring Exponential Growth Models Notes_HW; Exploring Exponential Decay Models NOTES; Exploring Exponential Decay Models Notes_HW; May 28th Assignments - Right Triangle Trigonometry NOTES; Right Triangle Trig - Finding Missing Sides and Angles - pdf; Answer Keys to previous assignments. The answer. Worksheet 4. Exponential Growth And Decay Word Problems Answers - Displaying top 8 worksheets found for this concept. 8 Exponential Growth and Decay Models; Newton’s Law; Logistic Growth and Decay Models. 25)' q 36 0 152 Write a unction that represents the situation. 3 Use Functions Involving e Lesson 7. Exponential Growth and Decay: Changing exponential variables. The general exponential function takes the form: y = a · b x where a is the initial amount and b is the factor that the amount gets multiplied by each time x is increased by one. Graph exponential functions shifted horizontally or vertically and write the associated equation. If the function models
{ "domain": "lasalsese.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.986151386528394, "lm_q1q2_score": 0.8130442718361258, "lm_q2_score": 0.8244619263765707, "openwebmath_perplexity": 1259.2407936317254, "openwebmath_score": 0.37754592299461365, "tags": null, "url": "http://ixda.lasalsese.it/exponential-growth-and-decay-math-lib-answer-key.html" }
c++, linked-list, interview-questions, pointers std::cout << "Adding 1513 to 295\n"; List<int> *result = addLinkedListNumbers(numListOne, numListTwo); std::cout << "Sum is "; for(int i = result->getSize(false); i > 0; i--) { std::cout << result->getValueAtPosition(i); } std::cout << std::endl; // output // Adding 1513 to 295 // Result is 1808
{ "domain": "codereview.stackexchange", "id": 24666, "lm_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++, linked-list, interview-questions, pointers", "url": null }
java, linked-list, interface this.moveToStart(); linkedListAsString.append("< "); for (int i = 0; i < oldPosition; i++) { linkedListAsString.append(this.getValue()); linkedListAsString.append(" "); this.next(); } linkedListAsString.append("| "); for (int i = oldPosition; i < length; i++) { linkedListAsString.append(this.getValue()); linkedListAsString.append(" "); this.next(); } linkedListAsString.append(">"); this.moveCurrentToPosition(oldPosition); return linkedListAsString.toString(); } } Here is the ListInterface and ListIteratorIterface public interface ListInterface<E> { /** * Insert an element behind the current position. Must check that the linked * list's capacity is not exceeded. * * @param item * Item to be inserted. */ public void insert(E item); /** * Insert an element after the last element in the list. * * @param item * Item to be appended. */ public void append(E item); /** * Remove all contents from the list. */ public void clear(); /** * @return The number of items in the list. */ public int length(); /** * @param position * Position to move current to. */ public void moveCurrentToPosition(int position); } public interface ListIteratorInterface<E> { /** * Remove the element after the current element and return the value of the * removed element. * * @return The element that was removed. */ public E remove(); /** * Move current position to first element. */ public void moveToStart(); /** * Move current position to last element. */ public void moveToEnd();
{ "domain": "codereview.stackexchange", "id": 4688, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, linked-list, interface", "url": null }
You are making the classical mistake of generalizing the exponentiation rule $(a^b)^c=a^{bc}$ to complex numbers: it doesn't hold ! • Nice remark... :) One tends to forget... – Umberto May 24 '16 at 13:03 • It holds pretty frequently tho. – dbanet May 24 '16 at 20:08 • @dbanet: what makes you think that ? – Yves Daoust May 24 '16 at 21:00 • – dbanet May 24 '16 at 21:11 • @dbanet: I read that the condition is $\exp(i2\pi kc)=1$, which never occurs when $c$ has an imaginary part and $k\ne0$ (which is the rule rather than the exception). – Yves Daoust May 24 '16 at 21:23 No, that looks good! The three cube roots of unity are indeed $$1, -\frac{1}{2} \pm \frac{\sqrt{3}}{2}i.$$ Picture unit vectors in the complex plane at angles $0, 120, 240$ degrees. You may have looked at your answer and scratched your head as to how weird it looked. The polar representation is compact and has polar symmetry: $z=re^{i\theta}.$ If $r=1$ then the only thing that changes when you square $z$ is the angle. But slap the Cartesian coordinate system on top of that number, and you're forced to evaluate the $x$ and $y$ components. You're forcing square graph paper on a circle, and stuff doesn't line up. The $x$ and $y$ components are going to be, in general, more complicated (uglier?) when you do the conversion.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97112909472487, "lm_q1q2_score": 0.8092657658871496, "lm_q2_score": 0.8333246015211008, "openwebmath_perplexity": 321.06971207096194, "openwebmath_score": 0.9963964223861694, "tags": null, "url": "https://math.stackexchange.com/questions/1797128/unexpected-result-from-eulers-formula?noredirect=1" }
The minimum number in the pool must be $53$. Suppose there are $n$ in total. So it's like if you had an urn with $n$ balls, $30$ are white and $n-30$ are red. Then you pull $30$ balls at random. You want to know how many of the balls you pulled are white. Or more specifically you want to know the probability that $7$ of the $30$ you pull are white. Let $A$ be the number of white balls. Then $P(A=k)$ is hypergeometric and equal to $\frac{{{30}\choose{k}}{ {n-30}\choose{30-k}}}{{n}\choose{30}}$ $\frac{{{30}\choose{7}}{{n-30}\choose{23}}}{{n}\choose{30}}$ This is the probability of an overlap of exactly $7$. You now need to find the $n$ that maximizes that probability. If you start plugging in numbers (using a calculator) starting at $n=53$ you'll probably see that it goes up and then soon starts to go back down. Choose the max before it starts going back down. Shouldn't be too much larger than 53. I'm guessing somewhere around 100. • Thank you for this explanation! It was extremely clear and I really appreciate it! After a little WolframAlpha magic, I found 128 questions to be the maximum. So if I understand this correctly, the test bank is composed of anywhere between 53-128 questions, with 128 questions being the most probable? – ProfessorStealth Jan 1 '16 at 20:59 • @ProfessorStealth Well there could be more than $128$ questions, it's just that $128$ is the most likely. There could be $500$ questions, but then having $7$ come up in common starts to be quite unlikely when there are that many in the pool. – Gregory Grant Jan 1 '16 at 21:01 • @ProfessorStealth Oh and you're very welcome :-) – Gregory Grant Jan 1 '16 at 21:03
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407175907054, "lm_q1q2_score": 0.8402878632106372, "lm_q2_score": 0.863391602943619, "openwebmath_perplexity": 675.0126831861228, "openwebmath_score": 0.6235116124153137, "tags": null, "url": "https://math.stackexchange.com/questions/1596392/determine-the-size-of-a-test-bank" }
python, beginner, python-3.x def armstrong(n): numbers = [] order = len(str(n)) for k in range(1, order): a = [i ** k for i in range(10)] for b in combinations_with_replacement(range(10), k): x = sum(map(lambda y: a[y], b)) if x > 0 and tuple(int(d) for d in sorted(str(x))) == b: numbers.append(x) return sorted(numbers) Extending the definition of Narcissistic number to: An n-digit number that is the sum of the nth powers of its digits The Narcissistic numbers till 1000000 are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474, 54748, 92727, 93084, 548834 Runtime: n=1_000_000 n=10_000_000 Original: 3.374 s 40.26 s Armstrong: 0.036 s 0.098 s Full code: import time from itertools import combinations_with_replacement def original(n): numbers = [] for number in range(1, n): order = len(str(number)) total_sum = 0 var = number while var > 0: digit = var % 10 total_sum += digit ** order var //= 10 if number == total_sum: numbers.append(number) return numbers def armstrong(n): numbers = [] order = len(str(n)) for k in range(1, order): a = [i ** k for i in range(10)] for b in combinations_with_replacement(range(10), k): x = sum(map(lambda y: a[y], b)) if x > 0 and tuple(int(d) for d in sorted(str(x))) == b: numbers.append(x) return sorted(numbers) # Correctness assert original(1000) == armstrong(1000) # Benchmark n = 1_000_000
{ "domain": "codereview.stackexchange", "id": 40084, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x", "url": null }
algorithms, time-complexity, asymptotics, master-theorem Title: Formulating the master theorem with Little-O- and Little-Omega notation In a lecture of Algorithms of Data Structures (based on Cormen et al.), we defined the master theorem like this: Let $a \geq 1$ and $b \gt 1$ be constants, and let $T : \mathbb{N} \rightarrow \mathbb{R}$ where $T(n) = aT(\frac{n}{b}) + f(n)$, then $ \\ T\in\left\{\begin{matrix} \Theta(n^{\log_b{a}}), & \text{ if } f \in O(n^{log_b{a}-\epsilon}) \text{ for some } \epsilon > 0. \\ \Theta(n^{\log_b{a}} \log{n}), & \text{ if } f \in \Theta(n^{\log_b{a}}). \\ \Theta(f), & \text{ if } f \in \Omega(n^{\log_b{a}+\epsilon}) \text{ for some } \epsilon > 0 \\ & \text{ and if the regularity condition holds. } \end{matrix}\right.$
{ "domain": "cs.stackexchange", "id": 13884, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, time-complexity, asymptotics, master-theorem", "url": null }
So, to create the desired rectangle, we need only choose 2 different x-coordinates and 2 different y-coordinates So, let's take the task of creating rectangles and break it into STAGES STAGE 1: Select the 2 x-coordinates We can choose 2 values from the set {3, 4, 5, 6, 7, 8, 9, 10, and 11} In other words, we must choose 2 of the 9 values in the set Since the order in which we choose the numbers does not matter, we can use COMBINATIONS We can select 2 number from 9 numbers in 9C2 ways (= 36 ways) STAGE 2: Select the 2 y-coordinates We can choose 2 values from the set {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5} In other words, we must choose 2 of the 11 values in the set We can select 2 number from 11 numbers in 11C2 ways (= 55 ways) By the Fundamental Counting Principle (FCP), we can complete the 2 stages (and thus create a rectangle) in (36)(55) ways (= 1980 ways) Brent Hanneson - Creator of GMATPrepNow.com Legendary Member Posts: 2064 Joined: 29 Oct 2017 Followed by:6 members ### Re: Rectangle ABCD is constructed in the coordinate plane parallel by swerve » Thu Oct 21, 2021 2:25 pm BTGModeratorVI wrote: Sun Jul 19, 2020 1:38 pm Rectangle ABCD is constructed in the coordinate plane parallel to the x- and y-axes. If the x- and y-coordinates of each of the points are integers which satisfy 3 ≤ x ≤ 11 and -5 ≤ y ≤ 5, how many possible ways are there to construct rectangle ABCD? 396 1260 1980 7920 15840 Source: Grockit As the rectangle is parallel to coordinate axes, the coordinates of the points of the rectangle would be $$(X_1, Y_1), (X_2, Y_1), (X_2, Y_2), (X_1,Y_2)$$ Given that $$X_1, X_2$$ lie between $$3$$ and $$11$$ ie., $$9$$ possible numbers
{ "domain": "beatthegmat.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936082881854, "lm_q1q2_score": 0.8045698097604136, "lm_q2_score": 0.8175744695262777, "openwebmath_perplexity": 815.2764415173854, "openwebmath_score": 0.5479913353919983, "tags": null, "url": "https://www.beatthegmat.com/rectangle-abcd-is-constructed-in-the-coordinate-plane-parallel-t315505.html?sid=c4b592cc872bc4587a3189b54e98adc4" }
structural-engineering Title: Rammed Earth Building I am estimating the amount of materials required to make a rammed earth building and I can't find anything related with the foundation of rammed earth building and about two-storeyed rammed earth building. Can you tell me about how the foundations are constructed on rammed earth building and what should be done to make two storeyed rammed earth building? I would suggest the safest way is to build the foundation with reinforced concrete and leave dowels out to bond with the rebars of the rammed earth wall. In the middle east, they have build adobe houses for centuries by combining clay and straw as a wall material. This system has proved to have excellent thermal properties, but not sufficient strength for earthquakes. They used to mix lime with sand and silt and clay as primitive concrete for the foundation. There is no code for the rammed earth construction. So every individual needs to hire an engineer to do the calculations and prepare the plans for them. here are some photos that were taken during the construction. source
{ "domain": "engineering.stackexchange", "id": 4271, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "structural-engineering", "url": null }
electromagnetism, lagrangian-formalism, gauge-theory, noethers-theorem, gauge-invariance In summary, one obtains the following four constraints \begin{align} &\varphi_{1}\equiv A^{0}=0 \tag{1.7a} \\ &\varphi_{2}\equiv\Pi_{0}=0 \tag{1.7b} \\ &\varphi_{3}\equiv\nabla\cdot\mathbf{A}=0 \tag{1.7c} \\ &\varphi_{4}\equiv\nabla\cdot\mathbf{\Pi}-\rho=0 \tag{1.7d}, \end{align} which is known as the coulomb gauge. They are now second class constraints because the matrix of their Poisson brackets is non-singular, i.e $$\mathbf{M}=\begin{pmatrix} \left\{\varphi_{3}(\mathbf{x}),\varphi_{3}(\mathbf{y})\right\}_{PB} & \left\{\varphi_{3}(\mathbf{x}),\varphi_{4}(\mathbf{y})\right\}_{PB} \\ \left\{\varphi_{4}(\mathbf{x}),\varphi_{3}(\mathbf{y})\right\}_{PB} & \left\{\varphi_{4}(\mathbf{x}),\varphi_{4}(\mathbf{y})\right\}_{PB} \end{pmatrix}=\begin{pmatrix} 0 & \nabla^{2}_{x} \\ -\nabla^{2}_{x} & 0 \end{pmatrix}\delta(\mathbf{x}-\mathbf{y}).$$
{ "domain": "physics.stackexchange", "id": 87787, "lm_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, lagrangian-formalism, gauge-theory, noethers-theorem, gauge-invariance", "url": null }
Theorem Let $$M$$ be the $$(n + 1) \times (n + 1)$$ matrix of the form $$\begin{bmatrix}a & a\one^T\\ a\one & bJ\end{bmatrix}$$, where $$a \ne 0$$ and $$b$$ are distinct real numbers. Then the eigenvalues of $$M$$ are: 1. $$0$$ with multiplicity $$n - 1$$. 2. The two roots of the equation $$\lambda^2 - (a + nb)\lambda - na(a - b) = 0$$, each with multiplicity $$1$$. Proof. Since $$M$$ is symmetric and has rank $$2$$, i.e., nullity $$n - 1$$, it has $$0$$ as an eigenvalue with multiplicity $$n - 1$$. Now, let $$\lambda$$ be a root of \begin{align} \lambda^2 - (a + nb)\lambda - na(a - b) = 0 \tag{1}\label{eq:lambda} \end{align} and define the vector $$x = \begin{bmatrix}\lambda - nb \\ a \one\end{bmatrix}$$ of length $$n + 1$$. Then
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211568364099, "lm_q1q2_score": 0.803702924633458, "lm_q2_score": 0.8244619220634456, "openwebmath_perplexity": 296.9342287461748, "openwebmath_score": 0.9552892446517944, "tags": null, "url": "https://math.stackexchange.com/questions/3171379/change-in-eigenvalues-if-row-and-column-added-to-highly-symmetric-matrix" }
group-theory, representation-theory Note: This is the first time I am doing representation/group theory in a course about Symmetry in Physics and my knowledge is not too broad. There are three elements in class $S$, one in class $E$ and two in class $R$ so summing over the group elements means there will be repeated terms in the sum: \begin{align} \langle \chi^V\vert \chi^V\rangle = \frac{1}{6} \left(1\times 3^2 + 2\times 0^2 +3 \times (-1)^2\right) =\frac{1}{6}(9+3)=2 \end{align}
{ "domain": "physics.stackexchange", "id": 86775, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "group-theory, representation-theory", "url": null }
geophysics, earth-rotation, earth-system, solar-terrestrial-physics, time For any given day, the calculation of the distance to the Sun is complicated, but websites like this one, provide a real time value you can use in the above formula [that site also provides the speed right away!]. These values are basically the same from one year to another. However, they do slowly change as the eccentricity of Earth's orbit gradually varies over a ~400,000 years cycle as described by the Milankovitch cycles. Now, for Earth's speed of rotation about its own axis the value is pretty much the same each day; variations are of day length are on the order of a fraction of a millisecond. Part of that variation is periodic and more or less predictable and another part is from other less predictable factors. But for all practical purposes the length of the day is constant through the year. The following figure shows those tiny variations in day length since the early 1960's:
{ "domain": "earthscience.stackexchange", "id": 1356, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geophysics, earth-rotation, earth-system, solar-terrestrial-physics, time", "url": null }
optimization, c, sudoku, backtracking Title: Solving Sudoku using backtracking This is a solver for Sudoku using backtracking. How can I make it more optimized and clean? #include <stdio.h> int isAvailable(int sudoku[][9], int row, int col, int num) { int i, j; for(i=0; i<9; ++i) if( (sudoku[row][i] == num) || ( sudoku[i][col] == num ) )//checking in row and col return 0; //checking in the grid int rowStart = (row/3) * 3; int colStart = (col/3) * 3; for(i=rowStart; i<(rowStart+3); ++i) { for(j=colStart; j<(colStart+3); ++j) { if( sudoku[i][j] == num ) return 0; } } return 1; } int fillsudoku(int sudoku[][9], int row, int col) { int i; if( row<9 && col<9 ) { if( sudoku[row][col] != 0 )//pre filled { if( (col+1)<9 ) return fillsudoku(sudoku, row, col+1); else if( (row+1)<9 ) return fillsudoku(sudoku, row+1, 0); else return 1; } else { for(i=0; i<9; ++i) { if( isAvailable(sudoku, row, col, i+1) ) { sudoku[row][col] = i+1; if( (col+1)<9 ) { if( fillsudoku(sudoku, row, col +1) ) return 1; else sudoku[row][col] = 0; } else if( (row+1)<9 ) { if( fillsudoku(sudoku, row+1, 0) ) return 1; else sudoku[row][col] = 0; } else return 1; } } } return 0; } else { return 1; } }
{ "domain": "codereview.stackexchange", "id": 2071, "lm_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, c, sudoku, backtracking", "url": null }
Thanks for the help-really valuable. I think when you say "the operation", you mean "the function"; and you are saying that the same thing you do to get the output, you can do to the output to get the input back. That's right. When you said "f(x) = ff(x)", you meant either "ff(x) = x" or "f^-1(x) = f(x)". Right? Yes, I am pointing out incorrect language because precision is important in math, and the way to learn it, unfortunately, is to be caught saying something you don't mean, and gradually learn to catch it yourself so other don't have to. It's more or less the same idea as proofreading what you write before hitting Send, rather than after. Regarding the graphing function, I tried this. In the case of 1/x we have a discontinuous (?) curve that is symmetrical. Linear functions, I assume will be parallel to the x = y line??? Yes, the graph of y = 1/x is discontinuous (it consists of two "branches"), which is not specifically relevant here, and it is symmetrical with respect to the line y=x, which is exactly the point. Your other example, y = a - x, is in fact perpendicular to that line; can you see how that makes it symmetrical, and therefore an involution? A line that is parallel to y=x will not be symmetrical, unless it is the line y=x. The Wikipedia article I referenced in my first response gives some other examples. Another, more subtle, is y = (2x + 1)/(3x - 2). #### Simonsky ##### Junior Member I think when you say "the operation", you mean "the function"; and you are saying that the same thing you do to get the output, you can do to the output to get the input back. That's right. When you said "f(x) = ff(x)", you meant either "ff(x) = x" or "f^-1(x) = f(x)". Right?
{ "domain": "freemathhelp.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138190064203, "lm_q1q2_score": 0.8126200495962483, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 709.2376829933124, "openwebmath_score": 0.8134908080101013, "tags": null, "url": "https://www.freemathhelp.com/forum/threads/confusion-over-inverse-of-a-function-involution.111481/" }
object-oriented, game, objective-c Here is the guts of the Property List file for reference: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Settings</key> <dict> <key>gameSettings</key> <dict> <key>startingCommonResources</key> <integer>1500</integer> <key>startingFood</key> <integer>300</integer> <key>foodStockpileSize</key> <integer>400</integer> <key>percentChanceDrawCard</key> <integer>5</integer> </dict> <key>towerSettings</key> <dict> <key>foodValue</key> <integer>6</integer> <key>foodValueAboveGround</key> <integer>10</integer> <key>enemySpawnChance</key> <integer>990</integer> <key>stockpileBonus</key> <integer>2</integer> <key>outpostPenalty</key> <real>0.66</real> <key>foodValueAnimal</key> <integer>50</integer> </dict> <key>jobCostSettings</key> <dict> <key>ladderCost</key> <integer>20</integer> <key>floorCost</key> <integer>40</integer> <key>wallCost</key> <integer>60</integer> <key>roomCost</key> <integer>100</integer> <key>superiorWallCost</key> <integer>400</integer> </dict> </dict> </dict> </plist>
{ "domain": "codereview.stackexchange", "id": 9063, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "object-oriented, game, objective-c", "url": null }
Suppose $$0 \in G$$ and $$1 \notin G$$. Then $$0 \in \cup I$$ and $$0 \in \cup J$$. Since the intervals in $$I$$ are disjoint, then there is a single interval $$I_{0} \in I$$ that contains $$0$$. Since the intervals in $$J$$ are disjoint, then there is a single interval $$J_{0} \in J$$ that contains $$0$$. $$I_{0} = [0, e)$$ for some $$e \in (0,1)$$. $$J_{0} = [0, f)$$ for some $$f \in (0,1)$$. Let $$a < 0$$. Let $$I_{0}' = (a, 0] \cup [0, e)$$. Then $$I_{0}'$$ is an open interval. Let $$J_{0}' = (a, 0] \cup [0, f)$$. Then $$J_{0}'$$ is an open interval. Let $$I'$$ be the set formed by replacing $$I_{0}$$ by $$I_{0}'$$ in $$I$$. Let $$J'$$ be the set formed by replacing $$J_{0}$$ by $$J_{0}'$$ in $$J$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9643214460461697, "lm_q1q2_score": 0.8077348981875702, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 47.70414120398784, "openwebmath_score": 0.9727427959442139, "tags": null, "url": "https://math.stackexchange.com/questions/2932632/relatively-open-subsets-of-the-unit-interval-can-be-expressed-uniquely-as-unions" }
ros, callback Title: Having trouble applying the C++ Subscriber application I am trying to retrieve some values from a published topic, and using that data in my main function. I can almost make it work with global variables, but I believe that is poor programming etiquette? Before I continue debugging my global variable solution, I would like to know if there is a simpler, more efficient way. Here is the callback function: void chatterCallback(const sensor_msgs::JointState msg) { for (int i=0;i<NUMBER_OF_JOINTS;i++) { std::cout << "The " << msg.name.at(i) << " is now at " << msg.position.at(i); std::cout << " moving with velocity " << msg.velocity.at(i) << "\n"; } } I want to pass the data contained in the sensor_msgs::JointState to my main function, in order to start the program by ascertaining the robot's joint values. Also, I'm not sure the subscriber callback function is allowed to use sensor_msgs::JointState, rather than ConstPtr. The code works like this, though. Originally posted by paturdc on ROS Answers with karma: 157 on 2014-04-22 Post score: 0 The subscriber signature works, but it is better to pass by reference, i.e. add &. Depending on the program size, global variables might be fine. A usual larger approach for something like this would be to capture the JointState message in a class where the code lies that uses this. Within the class you can subscribe the callback in a member function and store the message in there. Originally posted by dornhege with karma: 31395 on 2014-04-22 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 17736, "lm_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, callback", "url": null }
# Ampere's Law and conductor 1. Sep 10, 2014 ### Tanya Sharma 1. The problem statement, all variables and given/known data A conductor carrying current ‘I’ is in the form of a semicircle AB of radius ‘R’ and lying in the x-y plane with its centre at origin as shown in the figure. Find the magnitude of ∫B.dl for the circle 3x2 +3z2 =R2 in the x-z plane due to curve AB. Ans (1-√3/2)μ0I 2. Relevant equations 3. The attempt at a solution Applying Ampere’s Law ∫B.dl= μ0I for the closed loop i.e the given circle ∫B.dl turns out to be zero since there is no current flowing through the loop .But this is incorrect . I would be grateful if somebody could help me with the problem. #### Attached Files: • ###### semi circle.png File size: 3.6 KB Views: 139 Last edited: Sep 10, 2014 2. Sep 10, 2014 ### TSny Hello, Tanya. Ampere's law only applies to a current that is part of a complete circuit. The current can't just start at A and end at B. So, you'll have to imagine a way to complete the circuit if you want to use Ampere's law. (Do you have a typographical error in your equation for the circular path in the x-z plane?) 3. Sep 10, 2014 ### Tanya Sharma Hi TSny Thanks for the response . Yes ,there was a typo in the equation for circular path . I have fixed it . Should I join the path from B to A to complete the circuit ? 4. Sep 10, 2014 ### TSny Maybe. 5. Sep 10, 2014 ### nrqed I think you are expected to ignore any wire beside the one shown because you may take for granted that anything else will not produce any flux through your surface (for example, the remaining wire could extend away along the y axis). Just obtain the magnetic field produced by the section shown and calculate the line integral (or calculate the integral of $\int \vec{B} \cdot \vec{dA}$ and use Stokes theorem if you have seen that). 6. Sep 10, 2014
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692325496973, "lm_q1q2_score": 0.8117518386057959, "lm_q2_score": 0.8311430436757312, "openwebmath_perplexity": 1069.9501168795682, "openwebmath_score": 0.8350353837013245, "tags": null, "url": "https://www.physicsforums.com/threads/amperes-law-and-conductor.770081/" }
1. A path of $n$ steps from $(0,0)$ to $(c,2k)$ that does not cross the line $y=2k$, which we can think of as a 180° rotation of a path from $(0,0)$ to $(c,2k)$ that does not cross the $x$-axis; 2. A path of $a+b-n$ steps from $(c,2k+1)$ to $(a-b,2k+1)$, which we can think of as a translation of a path from $(0,0)$ to $(a-b-c,0)$. This is clearly a bijection. There are ${i+j\choose i}^2$ paths of $(i+j)$ steps from $(0,0)$ to $(i-j,0)$. The four directions N,S,E,W may be obtained by starting with $\left[\begin{smallmatrix}-1\\0\end{smallmatrix}\right]$ and adding neither, one, or both of $\left[\begin{smallmatrix}1\\1 \end{smallmatrix}\right]$ and $\left[\begin{smallmatrix}1\\-1\end{smallmatrix}\right]$. Build a path of $i+j$ steps, initially all $\left[\begin{smallmatrix}-1\\0\end{smallmatrix}\right]$. Add $\left[\begin{smallmatrix}1\\1\end{smallmatrix}\right]$ to $i$ of the steps and, independently, add $\left[\begin{smallmatrix}1\\-1\end{smallmatrix}\right]$ to $i$ of the steps. There are also ${i+j\choose i}^2$ paths of $(i+j)$ steps from $(0,0)$ to $(i-j,\geq0)$ that do not cross the $x$-axis.
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676436891864, "lm_q1q2_score": 0.8458368241240267, "lm_q2_score": 0.8633916099737807, "openwebmath_perplexity": 217.7272216357863, "openwebmath_score": 0.8715867400169373, "tags": null, "url": "https://mathoverflow.net/questions/283540/combinatorial-identity-sum-i-j-ge-0-binomiji2-binoma-ib-ja/283611" }
I know this is old but wanted to offer an answer. If you want to use spherical coordinates, you need to parameterize $r$ as a function of $\theta$ and $\phi$. $x = r\cos(\phi)\sin(\theta)$ $y = r\sin(\phi)\sin(\theta)$ $z = r\cos(\theta)$ $$r = \frac{1}{\sqrt{\left ((\cos(\phi)/a)^2 + (\sin(\phi)/b)^2)\sin(\theta)^2 + (\cos(\theta)/c)^2 \right )}}$$ Given an angle pair $(\theta, \phi)$ the above equation will give you the distance from the center of the ellipsoid to a point on the ellipsoid corresponding to $(\theta, \phi)$. This may be a little more work than some of the other parameterizations but has its uses.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105252542431, "lm_q1q2_score": 0.8156913709507293, "lm_q2_score": 0.8354835371034368, "openwebmath_perplexity": 193.3671840436321, "openwebmath_score": 0.8669564127922058, "tags": null, "url": "https://math.stackexchange.com/questions/205915/parametrization-for-the-ellipsoids/205917" }
statistical-mechanics Title: Why do we work in thermodynamic limit in statistical physics? It is often stated that we work in thermodynamic limit at the beginning of courses on statistical physics $$N \to \infty, V \to \infty, \quad\frac{N}{V}=n=\textrm {constant}$$ what is less often stated is why we do it. Having studied some applied probability to statistical physics, I relate it to the Central Limit Theorem: we're interested in macroscopic extensive quantities made up by contributions of microstates, that we can model as independent, and we need $N \to \infty$ to have small fluctuations of these quantities (since the variance should go as $\frac{1}{\sqrt{N}}$ for CLT). Then the other two hypotheses are needed in order to have a quantity with physical meaning (density)? Are there any other reasons? Can it be explained in other ways? I see at least 3 reasons. It is only in this limit that macroscopic observables become deterministic. It is only in this limit that one has equivalence of the different statistical ensembles. It is only in this limit that one has sharp phase transitions (genuine singularities of thermodynamic potentials). (The first two properties may fail to hold even in the thermodynamic limit at phase transitions.) Note that all these properties are necessary if one wants to recover the thermodynamical description. Of course, all three remain approximately valid (and the error can be sometimes quantified) in large finite systems.
{ "domain": "physics.stackexchange", "id": 28243, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics", "url": null }
Namely, adding an extra unknown to the $i$-th equation augments the matrix like this: $$\begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} & 0\\ a_{21} & a_{22} & \cdots & a_{2n} & 0\\ \vdots & \vdots & \cdots & \vdots & \vdots\\ a_{i1} & a_{i2} & \cdots & a_{in} & 1\\ \vdots & \vdots & \cdots & \vdots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn} & 0\\ \end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \\ w\end{pmatrix} = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m\end{pmatrix}$$ The set of columns is now $\{A_1, \ldots, A_n, e_j\}$. Since the unit vectors $\{e_1, \ldots, e_m\}$ span $\mathbb{R}^m$, it is clear that if you add enough of them into $\{A_1, \ldots, A_n\}$, you will achieve that $b$ is in the span of the matrix columns. If adding unknowns multiplied by a scalar is allowed, then you can simply add $b$ into the set $\{A_1, \ldots, A_n\}$ so that you have
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759621310288, "lm_q1q2_score": 0.8130861490874519, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 102.06770000152686, "openwebmath_score": 0.9962101578712463, "tags": null, "url": "https://math.stackexchange.com/questions/2669023/correcting-an-inconsistent-system-of-linear-equations-by-introducing-variables" }
=== We can get more specific. $$x \ge 0$$ and $$x^2 + 1 \ge 1$$ so $$f(x) \ge \frac x{x^2 + 1} \ge 0$$ so $$f(0) = 0$$ is a minimum. $$x \le 3$$ and $$x^2 + 1 \ge 1$$ so $$f(x)\le \frac 31$$ and so all the possible $$f(x)$$ are bounded above by $$3$$. It is the definition of real numbers that if a set is bounded above that a least upper bound exist and a consequence of $$f$$ being continuous means that there is an $$x=c$$ where $$f(c) = \sup \{f(x)|x \in [a,b]\}$$. We can go further an not $$f(1) = \frac 12 > \frac 3{10} =f(3)$$ so the max is not $$x=3$$ but some $$x: 0< x < 3$$ and so the maximum will be a local max and we COULD find it by taking the derivative. But the question isn't ASKING us to. The question is only asking us to argue that there is a max. An the only thing we have to say for that is: "The extreme value theorem applies as $$\frac {x}{x^2 +1}$$ is continuous on the closed interval $$[0,3]$$" • Exactly. This is the correct answer. Thank you – esc1234 Aug 20 '19 at 15:45 Use that $$\frac{1}{2}\times\frac{2x}{x^2+1}\le \frac{1}{2}$$ and $$\frac{-1}{2}\le \frac{2x}{x^2+1}\times \frac{1}{2}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464499040094, "lm_q1q2_score": 0.8530525649970806, "lm_q2_score": 0.8740772253241803, "openwebmath_perplexity": 150.173891264151, "openwebmath_score": 0.7593608498573303, "tags": null, "url": "https://math.stackexchange.com/questions/3328973/knowing-the-existence-of-max-min-values-of-function-in-interval-without-taking-d" }
python, matrix, windows, natural-language-processing, neural-network for word in word_list: word_freq[word] = word_freq.get(word, 0) + 1 There is a class, collections.Counter, which makes counting stuff like this easier. #Get keys keys = word_freq.keys() No real reason to do this, just use key in word_freq instead of key in keys #Get frequency of usefull words Usefull = [] for word in WantedWords: if word in keys: word = word_freq[word] Usefull.append(word) else: Usefull.append(0) This would be shorter to say Usefull.append(word_freq.get(word, 0)) instead of that if return Usefull def UseIt(Input): for i in range(len(Input)): InNeuron[i] = Input[i] UpdateHiddenNode() UpdateOutNeuron() if OutNeuron[0] > 0.99: return ("Engelse tekst") if OutNeuron[1] > 0.99: return ("Nederlandse tekst") if OutNeuron[2] > 0.99: return ("Franse tekst") #Documents to investigate #Error handling checks if you input a number while True: try: NumberOfDocuments = int(input("Aantal te onderzoeken documenten: ")) break Stylistically, I'd put the break in an else instead of here. except ValueError: print("That was not a valid number.") x = 0 while NumberOfDocuments > x: #Error handling checks if document exists while True: try: Document = str(input("Document: ")) file = open(Document, "r") break except IOError: print(Document +" not found") print(UseIt(Input_Frequency(Document))) #Stop playing any sound if x == (NumberOfDocuments - 1): winsound.PlaySound(None, winsound.SND_ASYNC) Why here instead of after the loop? x += 1 Use a for loop, you should almost never use a while loop
{ "domain": "codereview.stackexchange", "id": 875, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, matrix, windows, natural-language-processing, neural-network", "url": null }
beginner, r Title: Writing an excel doc with a subset of my data in R. Currently the code is excessively long I'm fairly new to R. I have used the 'r2excel' package to create an excel workbook from a subset of my R data. This should have 3 sheets for the three different subsets. What I have written works fine, but its a lot of code and is very clunky, just re written three times. If there is a better way of framing my question/best practice tips, I'd love to learn. # Create an Excel workbook. filename <- "validitycheck.xlsx" #The name of the file that will be saved wb <- createWorkbook(type="xlsx") #Creating an excel workbook # Create a sheet in that workbook to contain the data table sheet1 <- createSheet(wb, sheetName = "prime1") sheet2 <- createSheet(wb, sheetName = "prime2") sheet3 <- createSheet(wb, sheetName = "prime3") # Add header for sheet 1 xlsx.addHeader(wb, sheet1, value="Prime 1",level=1, color="black", underline=1) xlsx.addLineBreak(sheet1, 1) # Add header for sheet 2 xlsx.addHeader(wb, sheet2, value="Prime 2",level=1, color="black", underline=1) xlsx.addLineBreak(sheet2, 1) # Add header for sheet 3 xlsx.addHeader(wb, sheet3, value="Prime 3",level=1, color="black", underline=1) xlsx.addLineBreak(sheet3, 1) # Add a paragraph : Author author=paste("Author : Gabriella. \n", "20% randomly chosen validity check.", "\n Source: filename", sep="") #Add author for sheet 1 xlsx.addParagraph(wb, sheet1,value=author, isItalic=TRUE, colSpan=5, rowSpan=4, fontColor="darkgray", fontSize=14)
{ "domain": "codereview.stackexchange", "id": 39554, "lm_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, r", "url": null }
bash, linux, shell main_mon='' sec_mon='' # Store a count of how many monitors are connected mon_count=$(xrandr -q | grep -w 'connected' | wc -l) # Configure the monitors via xRandR config_monitors() { if [[ "$#" -eq "2" ]]; then xrandr --output $1 --primary --mode $2 --rotate normal --pos 0x0 elif [[ "$#" -eq "4" ]]; then xrandr --output $MON_INTERNAL --off --output $1 --mode $2 --pos 1680x0 --right-of $3 --output $3 --mode $4 --pos 0x0 --left-of $1 fi } # Determine which main monitor is available if [[ $mon_count -gt 1 ]]; then # The name of which main monitor is connected (either $MON1 or $MON1_FALLBACK) main_mon=$(xrandr -q | grep -w 'connected'| grep "^$MON1\|^$MON1_FALLBACK" | awk '{ print $1 }') else # fallback to laptop display $MON_INTERNAL because the hardcoded displays aren't connected main_mon=$MON_INTERNAL fi # Determine whether the secondary HDMI monitor, $MON2 is connected if [[ $mon_count -gt 1 ]] && [[ $(xrandr -q | grep $MON2 | awk '{ print $2 }') -eq connected ]]; then sec_mon=$MON2 fi
{ "domain": "codereview.stackexchange", "id": 32989, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bash, linux, shell", "url": null }
python, python-3.x, bioinformatics file.write ('\nI,' + str(pI) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nC,' + str(pC) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nH,' + str(pH) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nN,' + str(pN) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nR,' + str(pR) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nD,' + str(pD) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nT,' + str(pT) + ',' + str(FILE) + ',' + str(Speciesname)) file.write ('\nY,' + str(pY) + ',' + str(FILE) + ',' + str(Speciesname))
{ "domain": "codereview.stackexchange", "id": 31165, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, bioinformatics", "url": null }
symmetry, symmetry-breaking, quantum-anomalies \begin{equation} \begin{aligned} \bar\psi(x)M\psi(y)&=\text{tr}(M\!\not\!\partial D(x-y))+\cdots\\ &=\frac{\Gamma(d/2)}{2\pi^{d/2}}\left(\frac{1}{(x-y)^2}\right)^{\frac{d-2}{2}}\text{tr}\left(\frac{(\not\!x-\not\!y) M}{(x-y)^2}\right)+\cdots \end{aligned}\tag{23} \end{equation} where $M$ is an arbitrary matrix, and $\cdots$ denote terms of lower order in $x-y$. This bilinear form is clearly divergent as $y\to x$, and therefore the current $j_a^5$ defined above is meaningless as written. With this, we see that the naïve approach leads to an $0\times\infty$ indeterminacy, and we must proceed, once again, by introducing a regulator. The short distance divergence is easily avoided by smearing out the coincidence points, $\bar\psi(x)\psi(x+\epsilon)$, for some $\epsilon\in\mathbb R^d$ (unrelated to the gauge parameter $\epsilon^a$). As we are dealing with gauge-dependent objects, we must introduce a Wilson line so as to be able to compare them at different space-time points. In other words, in order to obtain a gauge-invariant current we are lead to define \begin{equation}\tag{24} j_a^\mu\equiv \lim_{\epsilon\to0} \bar\psi(x+\epsilon/2)\gamma^\mu\gamma_5tt_a\, \mathrm{Pexp}\left[\int_{x-\epsilon/2}^{x+\epsilon/2} A(s)\cdot\mathrm ds\right]\psi(x-\epsilon/2) \end{equation}
{ "domain": "physics.stackexchange", "id": 45122, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "symmetry, symmetry-breaking, quantum-anomalies", "url": null }
python, python-3.x, mysql, dom Title: Parse xml and store into mysql table in python I have written the code that retrieves the data from XML file using xml.etree. Is there any best way to store the data into database by parsing an XML file. My code: from xml.etree import ElementTree import mysql.connector dom = ElementTree.parse('profile.xml') ticker = dom.findall('TICKER') name = dom.findall('NAME') address = dom.findall('ADDRESS') phone = dom.findall('PHONE') website = dom.findall('WEBSITE') sector = dom.findall('SECTOR') industry = dom.findall('INDUSTRY') full_time = dom.findall('FULL_TIME') bus_summ = dom.findall('BUS_SUMM') ticker_list = [t.text for t in ticker] name_list = [t.text for t in name] add_list = [t.text for t in address] phn_list = [t.text for t in phone] site_list = [t.text for t in website] sec_list = [t.text for t in sector] ind_list = [t.text for t in industry] emp_list = [t.text for t in full_time] sum_list = [t.text for t in bus_summ] db = mysql.connector.Connect(host = 'localhost', user = 'root', password ='root' , database = 'nldb_project') cur = db.cursor() query = "INSERT INTO profiles(`prof_ticker`,`name`,`address`,`phonenum`,`website`,`sector`,`industry`,full_time`,`bus_summ`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)"
{ "domain": "codereview.stackexchange", "id": 30439, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, mysql, dom", "url": null }
beginner, assembly, fibonacci-sequence, x86 .386 .model flat, stdcall .stack 4096 ExitProcess PROTO, dwExitCode:DWORD .code ;------------------------------------------------------------------------------- ; FibAsm( int n ) ; ; Calculates fibonacci numbers using memoizaiton ; ; Entry: n @ ebp + 8 ; DWORD unsigned int up to 47 ; ; Local: f[] ; array to store fibs ; ; Exit: the fib number is returned in eax ;------------------------------------------------------------------------------- FibAsm: ; set up stack frame push ebp mov ebp, esp push ebx push ecx push esi push edi mov ebx, [ebp + 8] ; n stored in ebx ; new f[] of size n + 2 lea edi, [ebx + 2] ; save size of array in edi shl edi, 2 ; mul by 4, size of DWORD int sub esp, edi ; allocate space for f[] ; pointer to f[] in esp ! ; f[0] = 0 and f[1] = 1 mov DWORD PTR[esp], 0 mov DWORD PTR[esp + 1 * 4], 1 ; for (i = 2; i <=n; i++) mov ecx, 2 ;loop count i set to 2 L1: cmp ecx, ebx jg endL1
{ "domain": "codereview.stackexchange", "id": 30185, "lm_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, assembly, fibonacci-sequence, x86", "url": null }
java, comparative-review, fluent-interface Title: Comparing a weak fluent API with a strong fluent API in Java I have this simple POJO: package com.github.coderodde.person; import java.util.Objects; public class Person { private int age; private String firstName; private String lastName; public Person(String firstName, String lastName, int age) { this.firstName = firstName; this.lastName = lastName; this.age = age; } public Person() { } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } @Override public int hashCode() { int hash = 3; return hash; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Person other = (Person) obj; if (this.age != other.age) { return false; } if (!Objects.equals(this.firstName, other.firstName)) { return false; } return Objects.equals(this.lastName, other.lastName); }
{ "domain": "codereview.stackexchange", "id": 43967, "lm_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, comparative-review, fluent-interface", "url": null }
Re: What is the average (arithmetic mean) of eleven consecutive [#permalink] ### Show Tags 28 Aug 2014, 09:43 Hello from the GMAT Club BumpBot! Thanks to another GMAT Club member, I have just discovered this valuable topic, yet it had no discussion for over a year. I am now bumping it up - doing my job. I think you may find it valuable (esp those replies with Kudos). Want to see all other topics I dig out? Follow me (click follow button on profile). You will receive a summary of all topics I bump in your profile area as well as via email. _________________ Manager Joined: 24 Jun 2014 Posts: 51 Concentration: Social Entrepreneurship, Nonprofit Followers: 0 Kudos [?]: 16 [0], given: 76 Re: What is the average (arithmetic mean) of eleven consecutive [#permalink] ### Show Tags 09 Mar 2015, 19:15 I considered following approach if the smallest number in set is x , then sum of 11 consecutive numbers = 11x+(1+2+...10)=11x+55--->A if largest number in set is x ,then sum of 11 consecutive numbers=11x-(1+2+10)=11x-55 Now as per statement 1 , average of first 9 numbers is 7 i.e sum =63 sum of 11 numbers =63+x+9+x+10----->B Equating A& B 11X+55=63+X+9+10 ,which can be solved to get x=3 statement I is sufficient similar approach for Statement II 11X-55=8+2X-19 ,can be solved to get X=13 statement 2 is sufficient OA=D EMPOWERgmat Instructor Status: GMAT Assassin/Co-Founder Affiliations: EMPOWERgmat Joined: 19 Dec 2014 Posts: 7682 Location: United States (CA) GMAT 1: 800 Q51 V49 GRE 1: 340 Q170 V170 Followers: 341 Kudos [?]: 2280 [1] , given: 162 Re: What is the average (arithmetic mean) of eleven consecutive [#permalink] ### Show Tags
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.8519527963298947, "lm_q2_score": 0.8519527963298947, "openwebmath_perplexity": 2902.9624508058323, "openwebmath_score": 0.6749594211578369, "tags": null, "url": "http://gmatclub.com/forum/what-is-the-average-arithmetic-mean-of-eleven-consecutive-93188.html#p717074" }
ros-kinetic Title: rospy.wait_for_message does not get the message even though new messages are being published I'm running a script where I use the rospy.wait_for_message in a while loop to wait for a message of a topic, that is publishing at certain event. On the first event the while loop runs as expected, sometimes even on the second. I can see by running rostopic echo /event_topic that the messages are being published after the code stopped inside the while loop at the instruction rospy.wait_for_message("/event_topic", Bool, timeout=None), but the instruction is never executed. The program just stays at this line, waiting for messages, that are being published. When I reset the script the first one or two events are again processed as expected and that the process halts. I cannot find any errors nor warnings printed in the terminal. This is my script: import rospy import rospkg from std_msgs.msg import Bool from std_msgs.msg import Float64 from std_msgs.msg import Float32MultiArray def mynode(): rospy.init_node('mynode') publisher = rospy.Publisher('/command', Float64, queue_size=1) time.sleep(.5) while not rospy.is_shutdown(): rospy.wait_for_message("/event_topic", Bool, timeout=None) data = rospy.wait_for_message("/data_topic", Float32MultiArray, timeout=None) msg = data.data[0] publisher.publish(msg) time.sleep(.2) rospy.spin() if __name__ == '__main__': try: mynode() except rospy.ROSInterruptException: pass It also seems, that when I subscribe to the /event_topic by running rostopic echo in the terminal, the next event is being processed by the rospy.wait_for_message, but following, again, are not.
{ "domain": "robotics.stackexchange", "id": 32647, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-kinetic", "url": null }
the-sun, earth, heat Hopefully you can fully appreciate the point I'm getting at which is that Earth actually is inside the atmosphere of the Sun and that atmosphere is really hot! The reason we of course aren't boiled to death is that the atmosphere is incredibly sparse. Only a handful of particles per cubic centimeter. So what you're really proposing is to increase the density of this atmosphere by an insane amount. You want to make it approximately $10^{20}$ times more dense! If we just extrapolate properties, that's going to turn the already hot atmosphere of the Sun (around the Earth) into something incredibly hot. And the huge density means we'll really feel the effects. The Earth will likely be vaporized in a flash, before the cataclysmic explosion which I alluded to above can even happen. So, long answer short: About a billion degrees.
{ "domain": "astronomy.stackexchange", "id": 2082, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "the-sun, earth, heat", "url": null }
gazebo Title: publish from gazebo hi guys, i want to publish from a gazebo plugin. How can i do that? In the same way as i publish from a common node? so do i have to write a main() and while{} and so on? I want to publish torque in order to plot it with rxplot. this is the part of the plugin: torque.x = inertia.x * controllers_.roll.update(roll_command, euler.x, angular_velocity.x, dt); torque.y = inertia.y * controllers_.pitch.update(pitch_command, euler.y, angular_velocity.y, dt); body_->SetTorque(torque); i try following, is this the right way? ros::Publisher wrench_publisher; geometry_msgs::Wrench moment; int main(int argc, char **argv) { ros::init(argc, argv, "hector_quadrotor_gazebo_plugins"); ros::NodeHandle node_handle; ros::Rate loop_rate(100); wrench_publisher_ = node_handle.advertise<geometry_msgs::Wrench>("force", 1); while(ros::ok()) { ros::spinOnce(); moment.torque.x = torque.x ; moment.torque.y = torque.y; wrench_publisher.publish(moment); } return 0; } Originally posted by hmmm on ROS Answers with karma: 37 on 2012-03-20 Post score: 0 In fuerte, I just updated the plugin template if it's of any help gazebo_ros_template.h and gazebo_ros_template.cpp Similarly in electric: gazebo_ros_template.h and gazebo_ros_template.cpp The simplest example I can think of in electric is the sim time publisher. Originally posted by hsu with karma: 5780 on 2012-03-22 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 8665, "lm_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", "url": null }
programming, qiskit, ibm-q-experience Title: qiskit - Creating your own ExperimentResultData object Could someone guide me on how to create my own qiskit.result.models.ExperimentResultData object? I would simply like to create an object with some self-created dict of counts. Creating qiskit.result.models.ExperimentalResults object is somehow easy, since by calling it from qiskit.result.models.ExperimentResults, I simply pass the required attributes. But somehow I was not able to figure out how to do the same with qiskit.result.models.ExperimentResultData, which should be passed as "data" attribute to qiskit.result.models.ExperimentalResults object. You should be able to do this by simply creating an instance of the class. This can be done as follows from qiskit.validation import base raw_counts = {'0x0': 4, '0x2': 10} data = models.ExperimentResultData(counts=base.Obj(**raw_counts)) There are lot of examples of how to do this in the testing file for these classes.
{ "domain": "quantumcomputing.stackexchange", "id": 1092, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming, qiskit, ibm-q-experience", "url": null }
with respect to bases $v$ and $w$ respective. Given all this notation the meaning of $[T]_v^w$ is simply that it is the matrix which acts as $T$ when we swap vectors in the domain and codomain for their corresponding coordinate vectors. That is: $$[T]_v^w[x]_v = [T(x)]_w$$ To actually calculate the coordinate charts (and hence the matrix of $T$) it generally requires we solve some systems of equations because it it not immediately obvious how to express $T(x)$ in the $w$-basis. I have examples and more discussion in a notation pretty close to the one I use here at:my linear algebra lectures on You Tube.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357248544007, "lm_q1q2_score": 0.8243968354375678, "lm_q2_score": 0.8397339676722393, "openwebmath_perplexity": 308.4800414142577, "openwebmath_score": 0.9224210381507874, "tags": null, "url": "https://math.stackexchange.com/questions/1382980/matrix-representation-with-non-standard-bases" }
classical-mechanics, homework-and-exercises \dot{q}_j &= r\omega\\ \dot{q}_j &= r\frac{d\theta}{dt}\\ q_j &= r\theta \end{align*}$$ You have it backwards. When trying to describe some system, you first need to find kinematical parameters that describe possible configurations the system could be in. Here, in the most simple picture, the disk is characterized by a single parameter $q \equiv \phi$, the angle it has rotated (since the beginning of the experiment, say) and the corresponding velocity parameter $\dot q = \dot \phi = \omega$. Once you have your parameters, you can try to express kinetic and potential energy in terms of them and finally you can write a Lagrangian $L = T(\dot \phi) - V(\phi)$. Here you have only kinetic energy and it corresponds (contrary to what you write) to a particle constrained to a circle of radius $r$ (the actual disk would carry a different factor in front of $mv^2 / 2 = m (r \omega)^2 / 2$ due to the fact that its center of mass is at the position $r_0 < r$). Okay, with that out of the way, you have Lagrange's equations $${{\rm d} \over {\rm d} t} {\partial L \over \partial {\omega}} - {\partial L \over \partial {\phi}} = 0.$$ Can you take it from here?
{ "domain": "physics.stackexchange", "id": 1296, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, homework-and-exercises", "url": null }
matlab, noise, signal-power, signal-energy, thresholding $$S_i = \sum_{k=i\cdot L}^{i\cdot (L+1)-1}\frac1L \lvert Z_k \rvert^2$$ Out of curiosity, let's consider the cdf of $\lvert Z_k \rvert^2$: \begin{align} F_{\lvert Z_k \rvert^2}(v) &= P\left(\lvert Z_k \rvert^2 \le v\right)\\ &=\begin{cases} 0 & v < 0\\ P\left(\lvert Z_k \rvert \le \sqrt v \right) & v\ge 0 \end{cases}\\ &=\begin{cases} 0 & v < 0\\ P\left(-\sqrt z \le Z_k \le \sqrt v \right) & v\ge 0 \end{cases}\\ &=\begin{cases} 0 & v < 0\\ P\left( Z_k \le \sqrt v \right) -P\left( Z_k \le -\sqrt v \right) & v\ge 0 \end{cases}\\ &=\begin{cases} 0 & v < 0\\ F_{Z_k}\left( \sqrt v \right) - F_{Z_k}\left( -\sqrt v \right) & v\ge 0 \end{cases} \end{align}
{ "domain": "dsp.stackexchange", "id": 9846, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, noise, signal-power, signal-energy, thresholding", "url": null }
pll That all seems well and good when the initial phase of the incoming reference wave is 0. In that case, $V_{r}\sin(\omega_{r}t-\omega_{v}t)$ is positive when $\omega_{v}$ is less than $\omega_{r}$ and it is negative when $\omega_{r}$ is less than $\omega_{v}$. But what if the grid voltage is actually at some initial phase offset relative to the VCO? Let's say the true equation of our input to the VCO is, for example, $V_{r}\sin(\omega_{r}t-\omega_{v}t+\pi)$. Then $\omega_{v}$ could be less than $\omega_{r}$ and $V_{r}\sin(\omega_{r}t-\omega_{v}t+\pi)$ would still be negative. The VCO would falsely interpret this as a "you're ahead of the reference frequency, slow down" command, $\omega_{r}$ and $\omega_{v}$ would separate even further over the course of the wave's negative half-cycle, and I don't think a PI frequency controller would ever recover from that. I'm not seeing a way around this problem. We don't have access to the actual frequency difference, only to the value of the combination sine function we've created. We also can't make any claims about the initial phase angle of the reference voltage, since we could have started our PLL at any point in its cycle and it could have any initial phase relationship to our VCO. If anyone could help me understand how we get past this issue, it would be a huge help. Thanks in advance!
{ "domain": "dsp.stackexchange", "id": 6755, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pll", "url": null }
matlab, fft, infinite-impulse-response, frequency-response, control-systems Title: Frequency response of a (rectangular) integrator A very simple question which can't really figure out: I have a simple discrete time rectangular integrator with Z transform H(z) = 1/(1-Z^(-1)) Plotting the frequency response with Matlab using freqz shows what it looks like a kind of low pass filter response. However, when finding the freq response by sending an delta pulse through the integrator via filter Matlab function, and performing the FFT on its output, I just get a pulse (with amplitude equal to number of FFT points) followed of zeroes. I guess this kind of makes sense mathematically, as the output of the integrator is a step function, which, after FFT, is the addition of as many samples of the step output as the FFT length. However, Why does the freqz method does not match the impulse response + FFT approach? Am I wrong in trying to look at an integrator as a digital filter?
{ "domain": "dsp.stackexchange", "id": 8048, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, fft, infinite-impulse-response, frequency-response, control-systems", "url": null }
quantum-mechanics, path-integral, unitarity Title: Why is the argument of the path integral a pure phase? [Edit: moved to front] For which $(H,b)$ pairs, where $H$ is a Hamiltonian and $b$ is a basis, can we write: $$\langle b_f\vert e^{-iHt/\hbar}\vert b_i\rangle=\int_{b(0)=b_i}^{b(t)=b_f} \mathcal{D}b(t)\, e^{iS[b(t)]},\tag{2}$$ where $S$ is real?
{ "domain": "physics.stackexchange", "id": 36295, "lm_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, path-integral, unitarity", "url": null }
### Left Vector Multiplication A vector may be on the left of the matrix as well • in such case $\mathbf b$ is a row vector, and thus the result $\mathbf x$ is as well a row vector • let $\mathbf b \in \mathbb R^{m}$ and $A \in \mathbb{R}^{m \times n}$ • $\mathbf b^T A = \mathbf x^T$ • Can transpose both parts and get $A^T \mathbf b = \mathbf x$ • and we're back to the normal column-vector case
{ "domain": "mlwiki.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9930961633590876, "lm_q1q2_score": 0.8024884472203835, "lm_q2_score": 0.8080672112416737, "openwebmath_perplexity": 1372.5019954990703, "openwebmath_score": 0.955731987953186, "tags": null, "url": "http://mlwiki.org/index.php?title=Matrix-Vector_Multiplication&oldid=825&diff=prev" }