text
stringlengths
1
1.11k
source
dict
reinforcement-learning From whaat I know, Target Network Approach allows us to do the following: using Online Network, get scores for each action as the response for the current state. Pick the most appropriate action $a$ and take a note of its score $q$ using that action, "travel" to the next state and get scores from Target Net for even further actions. Select the most appropriate action from step 2) and call it $A$. also, take a note at its score $Q$ Punish OnlineNetwork for any difference between $q$ and $Q$. Note: the gradient flows only through $a$ component of the "output vector" $\{a, b, c, d ...\}$ Please correct me if these steps are wrong Ok, it's simple! Just the "Target network approach": Select an item from Memory Bank Using Target Network, from $S_{t+1}$ determine the index of the best action $A_{t+1}$ and its Q-value Do corrections as usual The "double DQN approach"":
{ "domain": "datascience.stackexchange", "id": 3176, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reinforcement-learning", "url": null }
ds.data-structures I think I know how to provide the queue operations in $\Theta(1)$ time and delete and depth in $\Theta(\lg n)$ time (all expected amortized). Is it possible to do better? My proposed solution is as follows: Maintain a balanced tree with $O(1)$ operations at the ends. Nearly any finger tree will do. This tree will store the keys in queue order at its nodes. Also, annotate every non-spine node with its number of descendants. Keep a hash table mapping keys to pointers to nodes in the tree. To enqueue a key k, add k to the back of the tree. This invalidates $O(1)$ node pointers and creates $O(1)$ new node pointers, so we need only perform $O(1)$ hash table operations. Dequeue is similar.
{ "domain": "cstheory.stackexchange", "id": 993, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.data-structures", "url": null }
of this equation represent the spatial part of the solutions of the wave equation (with an infinite number of eigenvalue λ i and eigenfunction f i pairs). Semi-supervised Learning using Sparse Eigenfunction Bases Kaushik Sinha Dept. It decomposes matrix using LU and Cholesky decomposition. Moreover, the eigenfunction corresponding to the first eigenvalue in the Dirichlet problem does not change sign. <0: The characteristic equation is r2 = 0, with roots r = i p. Another way to view the behavior of eigenvalues is the process of diagonalization. Our later papers [FS2, FS3, FS4, FS5] will study sums of eigenvalues and sums of squares of eigenfunctions, and then pass to spherically symmetric three-dimensional problems by separation of variables. Eigenvalues and Eigenvectors 6. For each eigenvalue ln there exists an eigenfunction fn with n 1 zeros on (a,b). constant multipleof a λ-eigenfunctionis again a λ-eigenfunction. Let A be a square matrix (or linear transformation). EE603 Class Notes
{ "domain": "yiey.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9939024381686516, "lm_q1q2_score": 0.8325125197869129, "lm_q2_score": 0.8376199592797929, "openwebmath_perplexity": 671.162678118703, "openwebmath_score": 0.9039983153343201, "tags": null, "url": "http://hajq.yiey.pw/eigenvalue-and-eigenfunction-pdf.html" }
python, scikit-learn, nltk, gensim The reason I bring this up at all is because most tutorials I find seem to lean toward a binary discernment of text corpa (positive vs negative, spam vs ham). I did see scikit-learn has information on multi-label classification, but I'm not sure I'm going down the right road with it. The word "classification" seems to have different meaning in document analysis than what I would want it to mean. If this question is too vague let me know and I can edit it to be more specific. Except for the OCR part, the right bundle would be pandas and sklearn. You can check this ipython notebook which uses TfidfVectorizer and SVC Classifier. This classifier can make one-vs-one or one-vs-the-rest multiclass predictions, and if you use the predict_proba method instead of predict, you would have the confidence level of each category. If you're looking for performances and you don't need prediction confidence levels, you should use LinearSVC which is way faster.
{ "domain": "datascience.stackexchange", "id": 737, "lm_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, scikit-learn, nltk, gensim", "url": null }
forces, acceleration, vectors, dimensional-analysis \begin{align} \left\|\vec{F}\right\| &= \left\|[10 N, 5 N]\right\| \\ &= \sqrt{(10 N)^2 + (5 N)^2} \\ &= \sqrt{125 N^2} \\ &\approx 11.2 N \end{align} as expected. In other areas of physics, vector components can have different units. In optical ray tracing, the components of a ray vector are a distance and an angle. So, the vector does not have an overall unit. One consequence is that, unlike the force vector example above, the magnitude of a ray vector is meaningless.
{ "domain": "physics.stackexchange", "id": 51084, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "forces, acceleration, vectors, dimensional-analysis", "url": null }
python, cs50 # Remember which user has logged in session["user_id"] = rows[0]["id"] # Redirect user to home page return redirect("/") # User reached route via GET (as by clicking a link or via redirect) return render_template("login.html") @app.route("/logout") def logout(): """Log user out""" # Forget any user_id session.clear() # Redirect user to login form return redirect("/") @app.route("/quote", methods=["GET", "POST"]) @login_required def quote(): """Get stock quote.""" if request.method == "POST": symbol = request.form.get("symbol") if not symbol: return apology("Please fill all the fields.") stock_info = lookup(symbol)
{ "domain": "codereview.stackexchange", "id": 45084, "lm_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, cs50", "url": null }
As a consequence of this issue, our argument does not actually work in the case when the characteristic is three and the semisimple group ${G}$ contains a copy of ${SO(5)}$ (or ${Sp(4)}$), and we have had to modify our paper to delete this case from our results. We believe that such groups still do contain strongly dense free subgroups, but this appears to be just out of reach of our current method. One thing that this experience has taught me is that algebraic groups behave somewhat pathologically in low characteristic; in particular, intuition coming from the characteristic zero case can become unreliable in characteristic two or three.
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9898303422461273, "lm_q1q2_score": 0.8160774286195914, "lm_q2_score": 0.8244619242200082, "openwebmath_perplexity": 145.8741805940518, "openwebmath_score": 0.9032233953475952, "tags": null, "url": "https://terrytao.wordpress.com/tag/algebraic-groups/" }
c++, url-routing if (i == path.size() - 1) { // Wildcard value reaches end if (!lastWildcard->result) return default_; return lastWildcard->result.value(); } else { step = lastWildcard; } } } if (step == nullptr) return default_; Path *wildcard = nullptr; Path *result = find_child(path[path.size() - 1], step->children, true, &wildcard); if(result != nullptr && result->result) return result->result.value(); else if(wildcard != nullptr) { // find wildcard ending and check if it contains a value string_t wildcardName; get_wildcard_name(&wildcard, wildcardName); if(!wildcard->result) return default_; string_t value = path.substr(path.size() - 1); variables.add(wildcardName, value); return wildcard->result.value(); }
{ "domain": "codereview.stackexchange", "id": 38536, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, url-routing", "url": null }
evolution, phylogenetics, speciation, human-evolution Thought Experiment Here is what happened in hypothetical land. Species X exists in happy land. Individuals of X then move to water land. Some more individuals from X move from happy land to H2O land (very similar to water land). Species X undergoes speciation in water land to species Y and speciation of X also occur in the H2O land to species Z. Can Z and Y be the same species with different origins where the niche conditions are the same? As you can imagine, the longer after geographical isolation the more mutations occur and the less likely it is that the new species will be able to breed successfully with similar species. Although the two environments may seem identical, ecology is notoriously complex and chaotic, and so in reality as far as ecology is concerned, they are very different environments. Even the slightest difference between niches will naturally select different traits that could make Z and Y sexually incompatible.
{ "domain": "biology.stackexchange", "id": 4763, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, phylogenetics, speciation, human-evolution", "url": null }
graph-theory Then, for every first-order property, the fraction of all $n$-vertex graphs that satisfy the property, as $n\to\infty$, approaches either 0 or 1. More strongly, there exists an infinite graph, the Rado graph, such that this fraction approaches 0 or 1 exactly when the Rado graph does not or does have the same property, respectively. But when the fraction approaches 1, it still might not be the case that the property holds for all graphs, so this differs somewhat from what you're asking.
{ "domain": "cstheory.stackexchange", "id": 3319, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graph-theory", "url": null }
quantum-mechanics, hilbert-space, operators, notation, linear-algebra Finally, saying that $\langle \psi \vert \hat A\vert \psi \rangle$ is the matrix element of the operator $\hat A$ in $\psi$ is a weirdly worded statement, to say the least, but it can be made more precise and correct. If $\psi$ is a normalized state vector then you can always find a Hermitian operator $\hat O$ such that $\psi$ is one of its eigenstates. Then you can interpret $\langle \psi \vert \hat A\vert \psi \rangle$ as the $\psi\psi$th element of the matrix representation of the operator $\hat A$ in the basis spanned by the eigenstates of the operator $\hat O$. However, generally, such an operator may or may not be of direct physical significance and thus, saying that $\langle \psi \vert \hat A \vert \psi \rangle$ is a matrix element of $\hat A$ in the basis spanned by such an operator is not very useful. A more directly physical and basis independent meaning of $\langle \psi \vert \hat A \vert \psi \rangle$ is that it's the expectation value of the operator $\hat A$ over the
{ "domain": "physics.stackexchange", "id": 68094, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, hilbert-space, operators, notation, linear-algebra", "url": null }
r Chr Start End CMP1 CMP2 CMP3 CMP4 CMP5 CMP6 GMP1 GMP2 GMP3 GMP4 GMP5 GMP6 HSC1 HSC2 HSC3 HSC4 HSC5 HSC6 Mono1 Mono2 Mono3 chr1 16104 16348 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA chr1 96494 96796 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA chr1 271115 271432 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA chr1 273027 273333 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA chr1 274266 274599 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA chr1 402479 402771 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
{ "domain": "bioinformatics.stackexchange", "id": 1331, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "r", "url": null }
quantum-mechanics, operators, hilbert-space, dirac-delta-distributions them along in the context of the differential equation. This is simply because they change the nature of the function on which the singular distribution acts. So basically the problem comes down to
{ "domain": "physics.stackexchange", "id": 26197, "lm_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, operators, hilbert-space, dirac-delta-distributions", "url": null }
electromagnetism, electrons, quantum-electrodynamics, wave-particle-duality Title: If electrons are waves, how do they repel each other? Louis de Broglie said that electrons are waves. But how they repel each other? Electrons aren't waves or particles. Instead they are excitations in a quantum field called the electron field. The interactions between electrons are described by the equations of motion of the electron field. However de Broglie was correct in the sense that if we consider an isolated electron this can be approximately described as a state of the electron field called a Fock state, and this is basically a plane wave. So for an isolated free electron it is a very good description to consider it as a wave. There is more on this in my answer to What is a subatomic particle? if you're interested in pursuing it.
{ "domain": "physics.stackexchange", "id": 51787, "lm_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, electrons, quantum-electrodynamics, wave-particle-duality", "url": null }
python, python-3.x, web-scraping, beautifulsoup Title: Reach certain Wiki page through random links I just read about Wiki game on Wikipedia and wanted to implement it as a fun project for myself using python. Task:To reach Mathematics Wikipedia page using wikipedia hyperlinks randomly. Using Beautiful Soup documentation,I was able to create following crude code which is quite slow for my purpose. import random import requests from bs4 import BeautifulSoup r = requests.get("https://en.wikipedia.org/wiki/Main_Page") soup = BeautifulSoup(r.content) a = [link.get('href') for link in soup.find_all('a')] del a[0:6] while(soup.title.text != 'Mathematics - Wikipedia'): a = [link.get('href') for link in soup.find_all('a')] del a[0:6] if (a == []): add = "/wiki/Special:Random" else: add = random.choice(a) if(add == None): add = random.choice(a) url = "https://en.wikipedia.org/"+add r = requests.get(url) soup = BeautifulSoup(r.content) print(soup.title.text)
{ "domain": "codereview.stackexchange", "id": 37574, "lm_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, web-scraping, beautifulsoup", "url": null }
while positive numbers remain unaffected from zero on the number always! Inverse function as part of the absolute value can not actually be a valid solution to original. The back of your own question to sign method in the back of own! Function converts negative numbers to positive numbers remain unaffected otherwise, check browser. Of polynomials HCF and LCM Remainder theorem argument: functions y = |x| Slideshare uses cookies to improve and... ( i.e value equal to the use of cookies on this website is zero and still be considered.! I 'll do the graphs of absolute value of a number ’ take... To discuss it a bit, before showing the necessary solution method on number... Value = ABS ( number ) Where number is the same as the... Perspective, it will look like this more absolute values returns the nearest integer value of the inverse f\left. Will have an inverse because it passes the horizontal axis as part of the original.. When and if it becomes necessary on the other order, and other
{ "domain": "communitylibrariesnetwork.org", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9693242018339896, "lm_q1q2_score": 0.8295972352686313, "lm_q2_score": 0.8558511524823265, "openwebmath_perplexity": 526.252596960924, "openwebmath_score": 0.6873570680618286, "tags": null, "url": "https://communitylibrariesnetwork.org/cq6bv/6c8d10-how-to-flip-an-absolute-value-function" }
reference-request, proof-techniques, functional-programming, books, software-verification equational reasoning using non-overlapping patterns list induction in chapter 13 but it's not very in-depth. Are there any books or article you can recommend which provide a more detailed overview of formal proving techniques for Haskell, or other functional, code? One of the de facto methods for proving results in functional programming is via Richard Bird's group. In particular, you ask for an in-depth or at least more comprehensive approach to equational reasoning and list induction and this is provided in Lectures on Constructive Functional Programming. More generally, the text "Algebra of Programming", by Bird and de Moor, also deals with the correctness of functional algorithms such as optimisation and dynamic programming problems. If you come across other useful resources for this problem, please mention them and perhaps we can turn this post into a wiki.
{ "domain": "cs.stackexchange", "id": 7299, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reference-request, proof-techniques, functional-programming, books, software-verification", "url": null }
quantum-mechanics, angular-momentum, spectroscopy, symmetry Title: Relation between total orbital angular momentum and symmetry of the wavefunction My question essentially revolves around multi-electron atoms and spectroscopic terms. I understand the idea that the total wavefunction for Fermions should be antisymmetric. Consider as an example, the $2p^2$ electrons in a partially filled p shell; that is, the outer shell of Carbon. The two electrons both have $l=1$, and hence total orbital angular momentum takes the values: $L = L1+L2, L1+(L2-1),...,|L1-L2| = 0,1,2$ and $S = 0,1$
{ "domain": "physics.stackexchange", "id": 918, "lm_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, angular-momentum, spectroscopy, symmetry", "url": null }
# Isn't x/E = y/ E ⇔ x E y deduced, not just x/E = y/ E ⇒ x E y from (a) x/ E≠ Ø, (b) x/E ∩ y/ E ≠ Ø ⇔xEy? "Theorem 3. Let $$\mathscr E$$ be an equivalence relation on a nonempty set $$X$$. Then (a) Each $$x/\mathscr E$$ is a nonempty subset of $$X$$. (b) $$x/\mathscr E \cap y/\mathscr E \neq \emptyset$$ if and only if $$x\mathscr Ey$$. (c) $$x\mathscr Ey$$ if and only if $$x/\mathscr E = y/\mathscr E$$" In the following proof of (c) I don't think it have to be as lengthy as like that "Proof of Theorem 3 (c) It follows immediately from (a) and (b) above that x/$$\mathscr E$$ = y/$$\mathscr E \Rightarrow x \mathscr E$$ y We need to prove that x$$\mathscr E$$y $$\Rightarrow x/\mathscr E = y/\mathscr E$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9559813526452771, "lm_q1q2_score": 0.802770016194628, "lm_q2_score": 0.83973396967765, "openwebmath_perplexity": 677.7553560388831, "openwebmath_score": 0.8865223526954651, "tags": null, "url": "https://math.stackexchange.com/questions/1626126/isnt-x-e-y-e-%e2%87%94-x-e-y-deduced-not-just-x-e-y-e-%e2%87%92-x-e-y-from-a-x-e%e2%89%a0-%c3%98" }
python, graph, statistics, physics #Scipy Optimise cuve_fit Model Produces Expected Values Using A Quintic Polynomial Model def func(x, a, b, c, d, e, f): return a*x**5 + b*x**4 + c*x**3 + d*x**2 + e*x + f #Constants Of Theoretical Model popt, pcov = curve_fit(func, xdata, ydata) print 'Constant Ax^5 is',("%.2f" %popt[0]) print 'Constant Bx^4 is',("%.2f" %popt[1]) print 'Constant Cx^3 is',("%.2f" %popt[2]) print 'Constant Dx^2 is',("%.2f" %popt[3]) print 'Constant Ex is',("%.2f" %popt[4]) print 'Constant F is',("%.2f" %popt[5]), '\n' if test == 6: print 'Testing logarithmic model', '\n' #Scipy Optimise cuve_fit Model Produces Expected Values Using A Logarithmic Model def func(x, a, b): return a*numpy.log(x)+ b #Constants Of Least Squared Theoretical Model popt, pcov = curve_fit(func, xdata, ydata) print 'Constant A is',("%.2f" %popt[0]) print 'Constant Bx is',("%.2f" %popt[1]), '\n'
{ "domain": "codereview.stackexchange", "id": 9513, "lm_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, graph, statistics, physics", "url": null }
particle-physics, standard-model, quantum-electrodynamics, gauge-invariance Title: $U(1)$ Local Gauge Invariance: What do $q$ and $\alpha(x)$ mean? When deriving the existence of the photon, we start with the free Lagrangian $\mathcal L_{\text{free}} = \bar{\psi}\left( i\gamma^{\mu}\partial_{\mu}-m\right)\psi$ and require $U(1)$ local gauge invariance: $\psi(x)\rightarrow \psi^{'}(x) =e^{iq\alpha\left(x\right)}\psi(x)$, etc. Question: What do $q$ and $\alpha\left(x\right)$ mean? In our scriptum, we had the following paragraph:
{ "domain": "physics.stackexchange", "id": 75827, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, standard-model, quantum-electrodynamics, gauge-invariance", "url": null }
calibration, kinect, openni, dynamic-reconfigure, openni-launch Title: Setting calibration for openni Kinect - running into max value I'm trying to calibrate my Kinect so that the RGB and depth data overlap. I am running openni_launch and using dynamic_reconfigure_gui to tweak the values. I have a good value for depth_ir_offset_x (-1.8) but the maximum value for depth_ir_offset_y (10) is insufficient. It looks like depth_ir_offset_y=20 would be ideal, although I am limited to 10. Any ideas on how to break this limit? Also, should I submit this as a bug? Originally posted by bkx on ROS Answers with karma: 145 on 2012-03-30 Post score: 1 Resolved by editing and recompiling openni_camera. Originally posted by bkx with karma: 145 on 2012-04-22 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 8806, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "calibration, kinect, openni, dynamic-reconfigure, openni-launch", "url": null }
fluid-dynamics, mass, kinetic-theory, gas This model assumes that the partial pressure of the gas above the liquid remains constant (i.e. the amount of gas escaping the liquid is negligible compared to the reservoir of gas, and is instantly dissipated away from the surface. For a more complex & accurate model, you'd need to model the diffusion (and possibly advection if there is any gas flow or temperature differences causing natural convection) of the escaped gas within the gas mixture above the liquid. In this case, you would need a boundary condition for the top of the gas, and you would connect the diffusion in the two regimes by conserving total mass flux of gas across the liquid-gas interface.
{ "domain": "physics.stackexchange", "id": 43896, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, mass, kinetic-theory, gas", "url": null }
magnetic-fields, temperature, electrical-resistance source Similar regarding this question about relation of magnetic field generated on an electric current carrying conductor wire for example, with temperature: Increase of entropy (i.e. temperature) leads to partial misalignment of the discrete magnetic moments of the uniform directional flowing electron's current and therefore to a reduction of the generated corresponding magnetic field. In theory, a conductor wire with higher resistivity $ρ$ will generate the same magnetic field strength $B$ around it with distance $r$, with a lower resistivity wire as long as both have the same current value $I$: Magnetic field around wire $$\mathrm{B}=\frac{\mu_{0} \mathrm{I}}{2 \pi \mathrm{r}}$$
{ "domain": "physics.stackexchange", "id": 85418, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetic-fields, temperature, electrical-resistance", "url": null }
equilibrium Title: Equilibrium Constant and Surface Area At equilibrium, the rates of the forward and backward reaction become equal. In a reaction A(s) giving B(g) + C(g) Increasing the surface area of A increases the rate of the forward reaction, but the backward reaction is between two gases and is unaffected. By the time the rate of the backward reaction becomes equal to that of the forward reaction, more of A must have converted into B as compared to how much it did when there was less surface area. Since the activity of a pure solid is unity, it doesn't appear in the expression for K. So K must have increased. The equilibrium constant on the other hand depends on the ∆G standard for a reaction. The standard ∆G is unchanged, so K must be unchanged. How does one resolve these two? In a reaction A(s) giving B(g) + C(g) Increasing the surface area of A increases the rate of the forward reaction, but the backward reaction is between two gases and is unaffected.
{ "domain": "chemistry.stackexchange", "id": 3100, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "equilibrium", "url": null }
force of the wrench passes. As a special case, if the resultant couple 𝑀is perpendicular to the resultant force 𝑅, these two vectors can further be simplified to obtain a single resultant force 𝑅. Determine the magnitude, direction, and location of the resultant force. Draw a Free Body Diagram (FBD), label known and unknowns Simple sketch of isolated particle Sketch all forces that act on the particle Active forces Reactive forces Label known forces with proper magnitude & direction Watch signs –negative means opposite sense from as. Chapter 2 and 3 Particle. Chapter 22 Solutions Problem 1: A +15 microC charge is located 40 cm from a +3. to looser the bolt at A, determine the force P that must be applied perpendicular to the handle of the flex-headed ratchet wrench. That frictional force is in the direction that is opposite the movement of the puck. Determine the magnitude and. The resultant force, F causes the lorry to accelerate forward. Find the magnitude and direction of the
{ "domain": "aranceinn.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.979667647844603, "lm_q1q2_score": 0.8076986803761943, "lm_q2_score": 0.8244619306896956, "openwebmath_perplexity": 431.3631302469679, "openwebmath_score": 0.642760157585144, "tags": null, "url": "http://aranceinn.it/lhkt/determine-the-magnitude-of-the-resultant-force-3d.html" }
3) The green cube is excluded. This gives us the problem of arranging two red cubes, three blue cubes, and three green cubes. The amount arrangements would then be $\frac{8!}{2!2!3!}=560$. Adding up all the possibilities from cases 1, 2, and 3 above would yield $280+420+560=\fbox {\textbf {(D)} 1,260}$ as our answer. ## Quick Solution If you're running out of time, notice that A/B/C are way too small of solutions, and E would make no sense since it would be straight up 8! without restrictions - thus the answer is D. Note, not recommended.
{ "domain": "artofproblemsolving.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.992767236410515, "lm_q1q2_score": 0.8184987817516637, "lm_q2_score": 0.8244619199068831, "openwebmath_perplexity": 466.634031934805, "openwebmath_score": 0.6538372039794922, "tags": null, "url": "https://artofproblemsolving.com/wiki/index.php?title=2019_AMC_10A_Problems/Problem_17&diff=prev&oldid=101872" }
javascript, array // gets all unique keywords per array, based on a pattern function extractUniqueKeywordsFromArrayOfSentences(array, pattern) { var result = {}, temp, i, k; for (i = 0; i < array.length; i++) { // todo: investigate if Object.assign is ES5 result = Object.assign(result, extractUniqueKeywordsFromSentence(array[i], pattern)); } return result; }
{ "domain": "codereview.stackexchange", "id": 26989, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, array", "url": null }
ros-humble, turtlebot3, robot-state-publisher I suspect it is an issue with the robot_state_publisher node, which is launched in the tb3_0 namespace, but still publishes to /tf and /tf_static. ubuntu@ubuntu:~$ ros2 node info /tb3_0/robot_state_publisher /tb3_0/robot_state_publisher Subscribers: /parameter_events: rcl_interfaces/msg/ParameterEvent /tb3_0/joint_states: sensor_msgs/msg/JointState Publishers: /parameter_events: rcl_interfaces/msg/ParameterEvent /rosout: rcl_interfaces/msg/Log /tb3_0/robot_description: std_msgs/msg/String /tf: tf2_msgs/msg/TFMessage /tf_static: tf2_msgs/msg/TFMessage Service Servers: ...
{ "domain": "robotics.stackexchange", "id": 39013, "lm_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-humble, turtlebot3, robot-state-publisher", "url": null }
acid-base Title: How many protons are required to satisfy hydroxyamine's (NH₂OH) lust for protons? I ask because I'm trying to write an equilibrium equation for this reaction and I'm wondering whether an extra 2 protons will be required after one is taken to attack the $\ce{OH}$ group and turn it into $\ce{H_2O}$ in order to convert the freed ammonia (with one proton missing) into a conjugate acid. Well, hydroxylamine is technically amphoteric, meaning it can act as either a Bronsted acid or base. The acidic proton is presumably the one on the oxygen (although the resulting salts are apparently explosively unstable), while the nitrogen is the proton acceptor. I wouldn't expect the oxygen to be basic (which, unless I've misunderstood, seems to be what your question implies), at least not in any measurable way or for any appreciable length of time, given hydroxylamine's instability and tendency to spontaneously decompose in myriad ways. When treated with acid, it forms hydroxylammonium salts,
{ "domain": "chemistry.stackexchange", "id": 473, "lm_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", "url": null }
thermodynamics If both atoms are displaced towards the middle, the molecule has a higher potential energy. The equations of the harmonic oscillator would normally fix the kinetic energy of the atoms in this case. But in a gas with its random kinematics it is totally possible that they have the "wrong" kinetic energies for their relative displacement. So, for the purposes of statistical mechanics, these are 2 further DOFs, making seven.
{ "domain": "physics.stackexchange", "id": 7365, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics", "url": null }
# Prove that if $a \equiv b \pmod{3}$, then $2a \equiv 2b \pmod{3}$. A friend and I are completely stumped on this prompt, and are even having trouble seeing how its statement is true. Any help will be appreciated! Prove that if $a \equiv b \pmod{3}$, then $2a \equiv 2b \pmod{3}$. - Hint: $a = 3n + b$ – Patrick Li Oct 24 '12 at 5:08 If $a-b$ is divisible by 3, then $2a-2b=2\cdot(a-b)$ ... ? – Hagen von Eitzen Oct 24 '12 at 6:27 $a\equiv b\pmod 3 ⇔ 3\mid (a-b)\implies 3\mid n(a-b) ⇔ na\equiv nb\pmod 3$ where $n$ is any integer. Also, $3\mid n(a-b)\implies 3\mid(a-b)$ if $(n,3)=1$ So, $3\mid (a-b) ⇔ 3\mid n(a-b)$ if $(n,3)=1$ Here $n=2,(2,3)=1,$ so, $3\mid (a-b) ⇔ 3\mid 2(a-b)$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668679067631, "lm_q1q2_score": 0.8133272983934475, "lm_q2_score": 0.8289388125473629, "openwebmath_perplexity": 764.026707153652, "openwebmath_score": 0.8851989507675171, "tags": null, "url": "http://math.stackexchange.com/questions/219880/prove-that-if-a-equiv-b-pmod3-then-2a-equiv-2b-pmod3" }
If not a good approach to a single pass through a list is Fold. Here is a function using that: foldMax[list_, p_] := Fold[If[p[##], ##] &, list] This proves to be faster in some cases than using Ordering (in your function): x = RandomReal[9, 5000000]; max[x, Less] // AbsoluteTiming foldMax[x, Less] // AbsoluteTiming {1.209069, 4.32482*10^-6} {0.430025, 4.32482*10^-6}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9653811641488385, "lm_q1q2_score": 0.8106633572227352, "lm_q2_score": 0.83973396967765, "openwebmath_perplexity": 1129.3305817535272, "openwebmath_score": 0.4403035044670105, "tags": null, "url": "https://mathematica.stackexchange.com/questions/69971/max-element-of-a-list-with-a-custom-ordering-function" }
double-slit-experiment, wavefunction-collapse, quantum-eraser Title: What do quantum eraser actually do? From what I know it basically erases which path information so even though the detectors still interact with the photon, but not able to tell which path the photon takes the result is a interference pattern. So what actually did the eraser do to the photon, does it revert the localised wave back to superposition state? Also this which path information, how is it stored in a photon? It is called spontaneous parametric down conversion, creating entangled photon pairs. One of the entangled photons goes directly to the detector, the other goes through a double slit mask. Both detectors are connected to the coincidence counter, making sure only entangled photon pairs are counted.
{ "domain": "physics.stackexchange", "id": 62899, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "double-slit-experiment, wavefunction-collapse, quantum-eraser", "url": null }
mechanical-engineering, dynamics, vibration, modal-analysis, frequency-response Title: Modal Testing and Frequency Response Interpretation I'm studying vibrations in a gearhead, for which I have a general dynamic model of 12 degrees of freedom (only translational coordinates) and I have calculated its natural frequencies. Now I want to try and correlate my model with a physical system. I did some impact testing with a hammer and measured the response with one accelerometer placed on the horizontal direction of the gearheads case. My theory on mechanical vibrations and modal testing is quite basic and I don't know how to proceed and interpret the results of the readings. I tried simulating the forced response in order to correlate the model I'm using to the measurements. For example, in one of the experiments, I hit the gearhead horizontally and measured the response on the opposite side of the gearhead with the accelerometer, in the same axis. In the forced response simulation, I applied a unit force on what would be that equivalent degree of freedom.
{ "domain": "engineering.stackexchange", "id": 1703, "lm_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, dynamics, vibration, modal-analysis, frequency-response", "url": null }
civil-engineering, turbines, energy-efficiency 6m length dedicted to air intake, filters etc. 6.5 m for the gas turbine (13t) 3m for a stack of HX (3.5t) 3 m for the steam engine (3t?) 10m for the condensors (4t) 2-3 m for alternators and motor (10t?) For a total of 31m. This is larger than the size envelope given by in the OP, but not by much. So my conclusion is: You can fit 3MW worth of combined cycle plant on a train car. There's lots of room to improve the whole thing at the HX and condensors, OTOH we need to fit large electrical systems on the train. In summary I believe you could build a combined cycle powered train & you would not have to invent too many components to do it.
{ "domain": "engineering.stackexchange", "id": 1334, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "civil-engineering, turbines, energy-efficiency", "url": null }
programming, quantum-gate, cirq Title: How to use Cirq to transpile circuit to custom native gate set? I am trying to use Cirq to compile arbitrary quantum circuits to custom native gate sets, e.g., to use the Cirq compiler to generate quantum circuits for different quantum computers (IBM, Rigetti, IonQ). If this was possible, most likely the cirq.optimizers has to be used. Can someone help me with this? Thanks in advance! Cirq's target_gate_sets will help. For example, a circuit can be compiled to a CZ gateset by calling cirq.optimize_for_target_gateset(circuit, gateset=cirq.CZTargetGateset()) CompilationTargetGateset can be used to define how to compile a circuit to any custom gateset.
{ "domain": "quantumcomputing.stackexchange", "id": 3586, "lm_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, quantum-gate, cirq", "url": null }
# What is the integral of |x| ? 1. Aug 10, 2011 ### agentredlum The question is in the title. This is not a homework question, just curiousity on my part. 2. Aug 10, 2011 ### HallsofIvy Staff Emeritus If x< 0, then |x|= -x and its integral is $-x^2/2+ C$ If $x\ge 0$, then |x| x and its integral is $x^2/2+ C$ Last edited: Aug 10, 2011 3. Aug 10, 2011 ### disregardthat or |x|x/2 + C 4. Aug 10, 2011 ### ReaverKS How? I thought the whole purpose of the absolute value stemmed back to distances along a number line, therefore you couldn't get a negative value out of the absolute value of a number or a function? 5. Aug 10, 2011 ### Citan Uzuki If x<0, then -x>0. 6. Aug 10, 2011 ### BloodyFrozen 7. Aug 10, 2011 ### Bohrok $$\int|x| dx = \frac{1}{2}x|x| + c$$If you write |x| as √(x2) and use integration by parts, you can find the integral. 8. Aug 10, 2011 ### agentredlum I know HallsofIvy figured it out because calculations were shown, but did the rest of you look it up?
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850832642354, "lm_q1q2_score": 0.8523699339399186, "lm_q2_score": 0.8670357718273068, "openwebmath_perplexity": 1077.1842131615492, "openwebmath_score": 0.8494406342506409, "tags": null, "url": "https://www.physicsforums.com/threads/what-is-the-integral-of-x.520571/" }
quantum-mechanics, homework-and-exercises, atomic-physics only from the point of view of r=0, but the electron is not there in the classical model; and even in the Schrodinger model r=0 is only one infinitesimal point, you would have to considered the expectation value of the energy. what would the wavefunction intersect , does it pass through (0,0)? the s-orbitals do have a non-zero probability density at (0,0), but again that is only one point. I'm quite confused by the idea of having negative energy, does it mean I need infinite energy to get out of the well? No, the electron does not need infinite energy to get out of the well because it does not start at the bottom of the well in the classical model, and has zero probability of starting at the bottom of the well in the Schrodinger because it is only a single point. You need to consider potential energy, kinetic energy and total energy. If you look at the following question and answer you should have a solution to the problem: Hydrogen atom: potential well and orbit radii
{ "domain": "physics.stackexchange", "id": 50361, "lm_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, homework-and-exercises, atomic-physics", "url": null }
special-relativity, inertial-frames Long story, I am reading a famous book about Special Relativity The ABC of Relativity by Bertrand Russell I encountered Lorentz transformation and it is clear that mathematically, it works. Anyway, this is not enough because I want to understand how can I explain its natural origin, how can I explain it using intuition. Mathematics proves the concept, intuition illuminates the idea I am looking for the second, a human explanation... The human explanation is quite straightforward. We have two postulates, the principle of relativity which says that all inertial frames are equivalent and the invariance of c which says that something which moves at c in one inertial frame will move at c in all inertial frames. This is the human intuition. The rest is math. If you start from those two intuitive principles and work out the math, then what comes out is the Lorentz transform. But that is nothing more than the mathematical consequence of the two intuitive postulates.
{ "domain": "physics.stackexchange", "id": 68194, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, inertial-frames", "url": null }
change ( unlike in Calculus )! First 30 minutes with a two-dimensional input, such as this is represented by ∂ f/∂x... Second-Order mixed partials that we can construct to one variable of a function three! Two can be called rst-order partial derivative, the kind of functions you can to! Used as notation for each these solve partial differential equations involving mixed partial is used shorthand! That 's the circumstance for this but I am struggling could someone help into this... Calculate the mixed second-order partial derivative derivative ( also called a mixed derivative differentiate. One variable of a function of two variables function with a two-dimensional input, such as respect to x in... Is simply a partial derivative taken to a second order partial derivatives give the slope of lines!, namely and a decomposition approach based on the mixed derivative refers whether. Second order with respect to first the circumstance for this being true ” refers to whether the second
{ "domain": "rogergering.net", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676490318649, "lm_q1q2_score": 0.8205891822464196, "lm_q2_score": 0.8376199653600371, "openwebmath_perplexity": 569.0135680316656, "openwebmath_score": 0.9039044976234436, "tags": null, "url": "http://rogergering.net/hero-cast-juex/mixed-second-order-partial-derivatives-5697c0" }
beginner, php, security, static, network-file-transfer I would have to disagree with you on that one. Since neigh on everything in your class is static, what's the point of having a class? Especially since you're trying to improve performance. Classes were never meant to improve performance of code, they were introduced to improve performance of development: a good class is reusable, easy to maintain and to some extend it documents itself (type-hinting, short, concise and to the point methods & method-names). In PHP, which is by design, stateless, statics are often just globals in OO-drag. That's, in my view, evidence of bad design. Not only is it hard to unit-test (you know that already), it greatly reduces the chances of your code being re-usable. Thus effectively reducing its OO interface to noise/syntactic sugar or even clutter.
{ "domain": "codereview.stackexchange", "id": 5191, "lm_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, php, security, static, network-file-transfer", "url": null }
blackbody, photon-emission, radiometry The flux from the surface of a blackbody in Watts per square metre per Hertz is given by $$F_{\nu} = \pi B_{\nu},$$ where $B_{\nu}$ is the Planck function. The radiance of a blackbody surface is given by $$\frac{1}{\pi} \int F_{\nu}\ d\nu\ = \frac{\sigma T^4}{\pi}$$ From Wikipedia on the Stefan Boltzmann law.
{ "domain": "physics.stackexchange", "id": 20912, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "blackbody, photon-emission, radiometry", "url": null }
biochemistry, microbiology, astrobiology Elsila, J.E., Glavin, D.P., & Dworkin, J.P. 2009, Meteoritics and Planetary Science, 44, 1323
{ "domain": "biology.stackexchange", "id": 633, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry, microbiology, astrobiology", "url": null }
c++, multithreading, http, server, web-services public: WorkQueue() : finished(false) {} ~WorkQueue() { finished = true; condition.notify_all(); } void addItem(std::unique_ptr<Job> another) { { std::unique_lock<std::mutex> lock{access}; jobs.push(std::move(another)); } condition.notify_one(); } std::unique_ptr<Job> getItem() { std::unique_lock<std::mutex> lock{access}; condition.wait(lock, [this] () { return !jobs.empty() || finished; }); if (finished) { return std::unique_ptr<Job>(nullptr); } std::unique_ptr<Job> nextJob = std::move(jobs.front()); jobs.pop(); return nextJob; } };
{ "domain": "codereview.stackexchange", "id": 18881, "lm_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++, multithreading, http, server, web-services", "url": null }
c, strings, swift for (i = 1; i < argc; i++) { tprntf("%s ", argv[i]); } tprntNewLine(); tprntf("%s", "ABC\t"); tprntf("%d", 12); tprntNewLine(); // enough space for that ;-) tprntf("%s", "DEF\t"); tprntf("%d", 34); tprntNewLine(); // realloc necessary ... tprntf("%s", "GHI\t"); tprntf("%d", 56); tprntNewLine(); // again realloc for testing purposes ... printf("tReturnString at the end:\n>%s<\n", tReturnString); // contains trailing newline return 0; } The call from swift will then be as follows (using CStringArray.swift): let myArgs = CStringArray(["computeIt", "par1", "par2"]) let returnString = mymain(myArgs.numberOfElements, &myArgs.pointers[0]) if let itReturns = String.fromCString(returnString) { print(itReturns) } freeMemory() Revised Version Please find the revised version of my code below. The following things were improved:
{ "domain": "codereview.stackexchange", "id": 17396, "lm_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, strings, swift", "url": null }
java, design-patterns, multithreading, state-machine boolean validHeaderFormat = commsState.isValidClientHeaderFormat(); if (validHeaderFormat) { boolean messageComplete = commsState.checkJsonMessageIntegraty(); log.debug("JsonProcessor: messageComplete: " + messageComplete); String deviceId = commsState.getDeviceId(); FirmwareFile file = database .checkScheduledFirmwareUpgrade(deviceId); if (file != null) { commsState.setScheduledUpdate(true); log.debug("This is a scheduled update for " + deviceId + " for file: " + file); } else { commsState.setScheduledUpdate(false); log.info("Device " + deviceId + ": Not scheduled for an update, scheduledUpgrade returned null"); } } }
{ "domain": "codereview.stackexchange", "id": 12832, "lm_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, design-patterns, multithreading, state-machine", "url": null }
c++, sdl highLowTexture.render(0, 0); winlose.render(335, 70); playAgain.render(325, 300); yesButton.render(300, 350); noButton.render(300 + yesButton.mWidth + 10, 350); SDL_RenderPresent(renderer); Putting that altogether gives something like: bool playAgain(SDL_Renderer* renderer, TTF_Font* font, bool game_was_won) { auto done = false; auto quit = true; // Set everything up, including all pre-rendering, so the loop // is as fast as possible. auto yesButton = LTexture{LTexture::from_surface, "Resources/HiLoYes.png"}; auto noButton = LTexture{LTexture::from_surface, "Resources/HiLoNo.png"}; auto dialogue = std::string{}; if (game_was_won) dialogue = // ... else dialogue = // ... auto const textColor = SDL_Color{ 0, 0, 0 }; auto const textWidth = 250; auto winlose = LTexture{from_text, renderer, dialogue, font, textColor, textWidth}; auto playAgain = LTexture{from_text, renderer, "Play again?", textColor, textWidth};
{ "domain": "codereview.stackexchange", "id": 31380, "lm_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++, sdl", "url": null }
java, object-oriented, calculator, swing for (int i = 0; i < s.length() - 1; i++) { tf.setText(tf.getText() + s.charAt(i)); } if (tf.getText().contains(".")) { point = 1; } else { point = 0; } } } } else if (tf.getText().equals("∞")) { } else if (tf.getText().equals("Invalid input")) { } else if (e.getSource().equals(add)) { a = Double.valueOf(tf.getText()); operator = 1; tf.setText("+"); } else if (e.getSource().equals(sub)) { a = Double.valueOf(tf.getText()); operator = 2; tf.setText("-"); } else if (e.getSource().equals(mul)) { a = Double.valueOf(tf.getText()); operator = 3; tf.setText("×"); } else if (e.getSource().equals(div)) {
{ "domain": "codereview.stackexchange", "id": 33597, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, calculator, swing", "url": null }
deep-learning, comparison, computer-vision, terminology, object-recognition Title: What is the difference between pixel-based object recognition and feature-based object recognition? From my understanding and text I found in research papers online : Pixel-based object recognition: neural networks are trained to locate individual objects based directly on pixel data. Feature-based object recognition: contents of a window are mapped to a feature space that is provided as input to a neural classifier.
{ "domain": "ai.stackexchange", "id": 371, "lm_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, comparison, computer-vision, terminology, object-recognition", "url": null }
ros, usb-camera, camera, usb-cam, usb-cam-node Originally posted by marcoresk on ROS Answers with karma: 76 on 2017-10-15 Post score: 0 usb_cam reads a camera_info_url parameter at startup. From the parameter documentation: ~camera_info_url (string, default: '') An url to the camera calibration file that will be read by the CameraInfoManager class You can use that to provide package:// or file:// urls to the left.yaml and right.yaml that you have. Originally posted by gvdhoorn with karma: 86574 on 2017-10-15 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by marcoresk on 2017-10-15: Thank you very much
{ "domain": "robotics.stackexchange", "id": 29079, "lm_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, camera, usb-cam, usb-cam-node", "url": null }
machine-learning, random-forest, decision-trees, machine-learning-model It's a tedious process to recalculate everything on each iteration, if the historic data is large then this would take too long. The 2022/8 result is obtained with just one path, I would need to rerun the overall process N times and take the average to have a more precise number. I need this to work with machine learning (not necessarily Random Forests), any ideas how to improve/change this process? I ended up using Recurrent Neural Networks, it's a good fit with time series.
{ "domain": "datascience.stackexchange", "id": 5925, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, random-forest, decision-trees, machine-learning-model", "url": null }
$\text{There are: }\:{9\choose5} \:=\:126\text{ all-male committees.}$ Therefore, there are: . $4368 - 126 \:=\:4242\text{ committees with at least one woman.}$ (b) if at least one woman and one man must be on the committee? We must not have all-male committees nor all-female committees. In part (a), we found that are $126$ all-male committees. $\displaystyle\text{We find that there are: }\:{7\choose5} \,=\,21\text{ all-female committees.}$ Therefore, there are: . $4368 - 126 - 21 \:=\:4221\text{ committees}$ . . $\text{with at least one woman and at least one man.}$
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211582993982, "lm_q1q2_score": 0.8165296608955396, "lm_q2_score": 0.8376199613065411, "openwebmath_perplexity": 813.5508100593117, "openwebmath_score": 0.6705612540245056, "tags": null, "url": "http://mathhelpforum.com/discrete-math/177597-counting-inclusion-exclusion-rule.html" }
algorithms, permutations, partitions $\sum_i \ell_i x_{i,j} = \sum_i \ell^*_i x^*_{i,j}$, for all $j$. (This is two ways of representing the length of the $j$th block.) $\sum_j x_{i,j} = 1$ (each subinterval from the first partition ends up in exactly one block) and $\sum_j x^*_{i,j} = 1$. $x_{i,j} = 1 \land x_{i+1,j}=0 \implies x_{i+1,j+1} = 1$ (i.e., each block starts where the previous one ended). This can be expressed as the ILP constraint $x_{i,j} - x_{i+1,j} \le x_{i+1,j+1}$. Similarly for the $x^*$'s. $x_{i,j} = 1 \land x_{i'',j} = 1 \land i < i' < i'' \implies x_{i',j}=1$ (i.e., the subintervals in a block are consecutive). This can be expressed as the ILP constraint $x_{i,j} + x_{i'',j} - 1 \le x_{i',j}$ for all $i,i',i''$ with $i < i' < i''$. Similarly for the $x^*$'s. $x_{1,1} = 1$, $x^*_{1,1} = 1$, $x_{n,k}=1$, $x^*_{n^*,k}=1$.
{ "domain": "cs.stackexchange", "id": 2632, "lm_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, permutations, partitions", "url": null }
genomics, genomes, human-genome That being said, it turns out there are some serious runs of homozygosity (ROH, meaning long regions of the genome that are homozygous) in human populations. This of course will vary widely from population to population, and amongst outbred individuals. This paper has some AMAZING figures that are worth checking out but are a little more involved. Here is a table from this paper which is likewise quite excellent; also, check out figure 3.
{ "domain": "biology.stackexchange", "id": 1333, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genomics, genomes, human-genome", "url": null }
c++, security, linux, openssl MyFile.close(); There's no point calling close() if we're going to ignore its return value! Again, this is important, because there are many factors that can prevent writing a file. system("cd /opt/PW/ && openssl enc -aes-256-ecb -iter 100000 -in test.txt -out test.enc && rm -rf test.txt"); Another system() invocation that should have its return value tested. Why do we not remove the file if the command was unsuccessful? I don't think it's good to leave it lying around when that happens. For the larger view, I think a shell would be a better choice than C++ for writing a program such as this, since it's mostly about coordinating other processes. I don't think we'd need any temporary files at all if we used pipes appropriately to pass data from one command to another, entirely eliminating the file-handling problems we have.
{ "domain": "codereview.stackexchange", "id": 40821, "lm_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++, security, linux, openssl", "url": null }
python, beginner, python-3.x, parsing, csv count_path += 1 ana_alarm_ffd_header = True for line in ana_alarm: col = line.split(",") if str(line[2]).startswith('/'): ana_alarm_key = (col[2] + '|' + col[3] + '|' + col[4] + '|' + col[5]) ana_alarm_time = str(col[0]) if ana_alarm_key in global_dic: if ana_alarm_key not in ana_ffm_track: ana_ffm.write('point' + ',' + str(global_dic[ana_alarm_key]['header8']) + ',' + str(global_dic[ana_alarm_key]['header5']) + ',' + str(global_dic[ana_alarm_key]['header7']) + ',' + 'alarm' + ',' + ',' + '1' + '\n') ana_ffm_track.append(str(ana_alarm_key))
{ "domain": "codereview.stackexchange", "id": 22520, "lm_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, parsing, csv", "url": null }
ros, moveit, ros-melodic, catkin, build box.subframe_names[2] = "corner_1"; ^~~~~~~~~~~~~~ /home/pyro/ws_moveit/src/moveit_tutorials/doc/subframes/src/subframes_tutorial.cpp:133:7: error: ‘moveit_msgs::CollisionObject {aka struct moveit_msgs::CollisionObject_<std::allocator<void> >}’ has no member named ‘subframe_poses’; did you mean ‘plane_poses’? box.subframe_poses[2].position.x = -.025; ^~~~~~~~~~~~~~ plane_poses /home/pyro/ws_moveit/src/moveit_tutorials/doc/subframes/src/subframes_tutorial.cpp:134:7: error: ‘moveit_msgs::CollisionObject {aka struct moveit_msgs::CollisionObject_<std::allocator<void> >}’ has no member named ‘subframe_poses’; did you mean ‘plane_poses’? box.subframe_poses[2].position.y = -.05; ^~~~~~~~~~~~~~ plane_poses
{ "domain": "robotics.stackexchange", "id": 33763, "lm_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, moveit, ros-melodic, catkin, build", "url": null }
electromagnetism, electricity, charge, terminology, conventions Title: What is the difference between poisitive and negative charge? I would like to know what charge actually IS. Not the 'flow of electrons' charge but the charge because of which protons and electrons attract. I want to know why these attract and what the difference is between them. Why do we put a positive on a proton and a negative on an electron? They are 'positive' and 'negative' but what is the difference? When countless experiments pointed towards that only two types of charges exists, then what would we call them? Maybe just type 1 and type 2 for example? No, that leaves open the possibility that a type 3 might exist. Rather let's pick some binary terms. Something like plus and minus. Or day and night. Or positive and negative. It doesn't matter which is called what, we can't see the difference anyways. We just make a choice.
{ "domain": "physics.stackexchange", "id": 41725, "lm_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, electricity, charge, terminology, conventions", "url": null }
python, numpy # Error Constants INVALID_COORDINATES = 'Invalid coordinate!' INSUFFICIENT_DATA = 'Insufficient data recorded' def flyby(latitude, longitude, place='not specified'): print("place ", place) # if invalid coordinate print invalid if latitude < -90 or latitude > 90 or longitude < -180 or longitude > 180: print(INVALID_COORDINATES) return INVALID_COORDINATES querystring = {"api_key": API_KEY, "lat": str(latitude), "lon": str(longitude)} response = requests.request("GET", API, params=querystring) if response.status_code != 200: return response.text json_response = response.json() total_records = json_response.get('count') results = json_response.get('results') # if count < 2, print insufficient if total_records < 2: print(INSUFFICIENT_DATA) return INSUFFICIENT_DATA
{ "domain": "codereview.stackexchange", "id": 35498, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, numpy", "url": null }
ros, shadow-robot, ros-electric Depende de: libqtwebkit4:i386 (>= 2.2~2011week36) pero no va a instalarse Depende de: libstdc++6:i386 (>= 4.6) pero no va a instalarse Depende de: libx11-6:i386 pero no va a instalarse Depende de: libxext6:i386 pero no va a instalarse Depende de: libxss1:i386 pero no va a instalarse Depende de: libxv1:i386 pero no va a instalarse Depende de: libssl1.0.0:i386 pero no va a instalarse Recomienda: sni-qt:i386 pero no va a instalarse Recomienda: libasound2-plugins:i386 pero no va a instalarse E: Dependencias incumplidas. Intente «apt-get -f install» sin paquetes (o especifique una solución).
{ "domain": "robotics.stackexchange", "id": 12659, "lm_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, shadow-robot, ros-electric", "url": null }
c#, performance, linq combinations.Add(sortedValues); return true; } private static int GetCombinationHash(int[] combination) { int hash = 1; unchecked { for (int index = 0, length = combination.Length; index < length; ++index) { int operand = combination[index] + 1; hash += operand * operand * operand * operand * operand; } } return hash; } private static bool CompareCombinations(int[] newCombination, IList<int> extantCombination) { if (newCombination.Length != extantCombination.Count) { return false; } for (int valueIndex = 0, length = newCombination.Length; valueIndex < length; ++valueIndex) { if (newCombination[valueIndex] != extantCombination[valueIndex]) { return false; } } return true; }
{ "domain": "codereview.stackexchange", "id": 7931, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, linq", "url": null }
python-3.x, combinatorics def f(x:float, y:float, a:float)->float: """ param x:float, x coordinate param y:flaot, y coordinate param a:float, paramter of the curve """ return x + (y * a) def main(): """ algorithm: Suppouse arrays are orderd by thier index and NOT the element inside Go through an ordering which meets that (one ordering is enough) add on the function at that point to the sequence """ x = [1.0, 2.0, 3.0] y = [2.0, 3.0, 4.0] a = 2.0 seq = [0.0] * len(x) for row in range(0, len(x) + 1): for col in range(0, len(x) + 1): for at in range(row, col): seq[at] = seq[at] + f(x[at], y[at], a) print(seq) if __name__ == "__main__": main() Disclaimer: Not a Code Reviewer Just some comments: Looks not bad at all; First thing first, read through PEP8 if you like – I should also do that myself ( ˆ_ˆ )
{ "domain": "codereview.stackexchange", "id": 39896, "lm_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-3.x, combinatorics", "url": null }
pcl, ros-hydro Title: With hydro, pcl can be installed alone? Hi, everyone. I'd like to install pcl stand-alone. Could you tell me how to do it ? Since I've installed ros hydro through "desktop-full", pcl(perception_pcl) has also being installed. So I can see libpcl** under /usr/lib. However, pcl/gpu is not found and I cannot try kinfu. I gues that pcl installed with ros has a small part of full-pcl. Then I'd like to install pcl stand-alone. I'm afraid that I will have confliction between pcl installed stand-alone and pcl installed with ros. How can I install pcl stand-alone ? Thanks in advance. Originally posted by moyashi on ROS Answers with karma: 721 on 2014-04-24 Post score: 0 If you want to use KinFu with ROS see my answer in http://answers.ros.org/question/142461/pcl-kinfu-in-ros-hydro/ If you want to try KinFu in a PCL stand-alone version just clone the PCL repository, set DBUILD_GPU=ON and "make" it. There is no reason for "make install".
{ "domain": "robotics.stackexchange", "id": 17767, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pcl, ros-hydro", "url": null }
Your proof seems right, but consulting a more direct proof may help to self-test understanding, so I'll provide one below. Since $$a_n \leq b_n$$ for all $$n$$, any upper bound on all of the $$b_n$$ is also an upper bound on all of the $$a_n$$. In particular, $$\sup b_n$$ is an upper bound on all of the $$a_n$$. By definition, $$\sup a_n$$ is the least upper bound on the $$a_n$$; setting $$k = 0$$, it follows that $$\sup_{ n \geq k} a_n \leq \sup_{n \geq k} b_n.$$ In other words, setting setting $$A_k =\sup_{n \geq k} a_n$$ and $$B_k = \sup_{n \geq k} b_k$$, we've shown that for $$k =0$$, $$A_k \leq B_k.$$ In fact, the same reasoning gives the above inequality, for all values of $$k$$. Taking the limit in $$k$$ then gives $$\limsup a_n \leq \limsup b_n$$, as required.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232947610284, "lm_q1q2_score": 0.8430344750872973, "lm_q2_score": 0.8577681049901036, "openwebmath_perplexity": 215.39909533053796, "openwebmath_score": 0.8982885479927063, "tags": null, "url": "https://math.stackexchange.com/questions/3411882/proof-verification-that-if-a-n-leq-b-n-then-limsup-a-n-leq-limsup-b-n" }
electrostatics, electric-fields, charge, conductors I agree with this right until the sphere is removed and the charges reconfigure. I can see how a much larger amount of charge would reside on the outer surface, and I can see that the charges on the inner surface will initially be repelled away from the inner surface, but is it true that exactly no charge will be on the inner surface? My thought process is that on the inwards bends on the inner surface, it is going to be very hard for charge for to stay there since nearby charges will push them off So if there is a lot charge on the inner surface, a lot of it will leak off from these inwards bends, but it could still accumulate in the outwards bends on the inner surface, and if there is a small enough amount of charge on the inner surface, the charge on the outer surface could hold the charges at those inwards bends in place, making me think the charge distribution could look something like:
{ "domain": "physics.stackexchange", "id": 87775, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, electric-fields, charge, conductors", "url": null }
machine-learning, classification, regression, bioinformatics Here's also a link to a similar question Could I turn a classification problem into regression problem by encoding the classes? To solve the problem of imbalanced classes there are many ways, not just oversampling, you can generate artificial data, add class weights in the loss function, use active learning to gather new data, use models that returns uncertainty score for each prediction (like bayesian networks), I'm sure here is plenty of answers and strategy you can try.
{ "domain": "datascience.stackexchange", "id": 7204, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, classification, regression, bioinformatics", "url": null }
beginner, c, calculator printf("%.2f != %.2f ", a, b); break; case 11: logi_not = TRUE;{ if (logic_and_log_not) printf("%.2f && !%.2f ", a, b); else if (logic_or_log_not) printf("%.2f || !%.2f ", a, b); break; } case 12: logi_and = TRUE; printf("%.2f && %.2f ", a, b); break; case 13: logi_or = TRUE; printf("%.2f || %.2f ", a, b); break; case 14: remain_mod = TRUE; printf("%.0f %% %.0f ", a, b); break; }
{ "domain": "codereview.stackexchange", "id": 26929, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, c, calculator", "url": null }
c++, performance, c++11, c++14 void FiniteField::eliminate(std::vector<std::vector<int>>&a, const int i) { int n = a.size(); for (int j = i + 1; j < n; j++) { if (a[j][i] != 0) { this->eliminateRow(a, i, j); } } } void FiniteField::eliminateRow(std::vector<std::vector<int>>&a, const int i, const int j) { int p = this->div(a[j][i], a[i][i]); int n = a.size(); for (int k = i; k < n; k++) { a[j][k] = this->sub(a[j][k], this->mul(p, a[i][k])); } }
{ "domain": "codereview.stackexchange", "id": 23555, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, c++11, c++14", "url": null }
homework-and-exercises, thermodynamics, orbital-motion, estimation Title: How much would Earth's orbit have to have decayed to explain Global Warming? How much would Earth's orbit have to have decayed to explain the Global Warming data? I've seen many terrestrial based explanations of global warming, but never an orbital one. In summary: no, this is not a plausible mechanism as large enough orbital changes to account for observed changes would change the length of a year really significantly and we'd notice this. The right answer to this would be to understand how the solar forcing (the power at the top of the atmosphere from the Sun) depends on orbital radius (easy) and to understand what the climate response is to this (hard). If I have time later I will add a section to this answer which summarises some of that information. But it turns out you can do a nice physicist's answer which is adequate to show that this is absurd (which doesn't mean it's a bad question!). The simple-minded physicist's answer
{ "domain": "physics.stackexchange", "id": 34032, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, thermodynamics, orbital-motion, estimation", "url": null }
python, performance, object-oriented, file-system, logging Log Source: I imagine you would need some source of the logs for it to work. The easiest source information would be: 03/28/2014 20:52:33 - 12 - logs - error sending log report via email Just copy that a few times into a text file and change the time to see what it does. You could also make multiple text files with multiple days (remember the date is in American format - mm/dd/yyyy). Please remember this is just for me to improve my style of coding. I have the code working completely and it goes as fast as it can go (I would imaging). I just want to know what methods I can use to improve my coding style. Raising useful errors If you have something like this: raise You're doing something wrong. Just calling raise with no additional useful info is not helpful. Preferably, you should do one of the following: Raise a built-in error: raise BuiltInError Raise a built-in error, with an error message: raise BuiltInError("Blah foobar")
{ "domain": "codereview.stackexchange", "id": 15632, "lm_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, object-oriented, file-system, logging", "url": null }
c, networking, socket deserves to be a separate set_socktype() function. So does this: if(ipv6) { if(inet_pton(((struct sockaddr_in6*)_sockaddr_storage)->sin6_family, addr->addr, &((struct sockaddr_in6*)_sockaddr_storage)->sin6_addr) != 1) { err = -2; goto cleanup_error; } } else { /* ipv4 */ if(inet_pton(((struct sockaddr_in*)_sockaddr_storage)->sin_family, addr->addr, &((struct sockaddr_in*)_sockaddr_storage)->sin_addr) != 1) { err = -2; goto cleanup_error; } } Do you see parts of the code that I can reduce? int compare_until_delim(const char *str1, const char *str2, char delim) { /* *str1 != delim xor *str2 == 0 and *str2 != delim xor *str2 == 0 */ while((!(*str1 != delim) != !(*str1 == '\0')) && (!(*str2 != delim) != !(*str2 == '\0'))) { if(*str1 != *str2) return false; str1++; str2++; } if(*str1 != *str2) return false; return true; }
{ "domain": "codereview.stackexchange", "id": 44441, "lm_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, networking, socket", "url": null }
# Proof by induction 1. Oct 30, 2005 I am supposed to prove a conjecture by induction. I have worked out that the series can be described by: a = 2,6,12,20,30 S = 2+8+20+40.... (n^2) + n = (1/3) ((n^3)+3(n^2)+2n) However, i cannot prove it by induction. It seems like there is smth wrong with the K^3. 2. Oct 30, 2005 ### Muzza What series? And what precisely is it that you want to prove? I doubt that you actually want to prove that (n^2) + n = (1/3) ((n^3)+3(n^2)+2n), because that's not true (for all n). 3. Oct 30, 2005 ### benorin This should help
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9740426420486938, "lm_q1q2_score": 0.8074217469540875, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 730.2639541830425, "openwebmath_score": 0.7886816263198853, "tags": null, "url": "https://www.physicsforums.com/threads/proof-by-induction.97443/" }
\right)}}^{2}}dy}}$$. Otherwise, it tries different substitutions and transformations until either the integral is solved, time runs out or there is nothing left to try. Thank you! (a) Since we are rotating around the line $$y=5$$, to get a radius for the “outside” function, which is $$y=x$$, we need to use $$5-x$$ instead of just $$x$$ (try with real numbers and you’ll see). The static moments of the solid about the coordinate planes Oxy,Oxz,Oyzare given by the formulas Mxy=∫Uzρ(x,y,z)dxdydz,Myz=∫Uxρ(x,y,z)dxdydz,Mxz=∫Uyρ(x,y,z)dxdydz. Solution: Draw the three lines and set equations equal to each other to get the limits of integration. Let's get busy going through examples of the numerous applications of integrals. When the "Go!" The Integral Calculator solves an indefinite integral of a function. For each function to be graphed, the calculator creates a JavaScript function, which is then evaluated in small steps in order to draw the graph. Area Between Two Curves.
{ "domain": "academiedubiocontrole.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668701095653, "lm_q1q2_score": 0.804452184698937, "lm_q2_score": 0.8198933425148213, "openwebmath_perplexity": 1279.330310946827, "openwebmath_score": 0.9425788521766663, "tags": null, "url": "http://academiedubiocontrole.org/blog/pioneer-woman-haa/9brkc.php?page=b74b56-application-calcul-int%C3%A9gral" }
general-relativity, singularities I am more puzzled as to why I am not getting an answer to the question I've asked which doesn't involve any analysis but a plain request for information. Did they (R.P and S.H) assume existence of point masses in their model of universe (or objects or whatever it is) or they have assumed smooth matter distributions ? This is a fairly straight forward request for information....I do not understand why I don't get the answer for the question I've asked...rather I get something else. What they proved is that in general relativity time-like world-lines (i.e. real observer paths) terminate in finite proper time i.e. the time experienced by the observer on the object is finite. This occurs forward in time if a trapped surface exists in space time. Such a surface has all light rays converging from it whatever direction they point and is a sign of a black hole. Backwards in time it occurs cosmologically because of the expanding universe. Terminating world-lines usually mean singularities on
{ "domain": "physics.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": "general-relativity, singularities", "url": null }
special-relativity, mass-energy, time-dilation here are some links for those interested Time Dilation Link Mass Energy Link Here is the math: $$(1)\qquad E = m{c}^2$$ $$(2)\qquad \Delta t_1 = \frac{\Delta t_2}{\sqrt{1-\left({\left(\frac{v}{c}\right)}^2\right)}}$$ for easily seeing the binomial expansion of $(2)$ $$let \quad x = {-\left({\left(\frac{v}{c}\right)}^2\right)}$$ rearranging of $(2)$ $$\Delta t_1 = \frac{\Delta t_2}{\sqrt{1+x}}$$ $$\frac{\Delta t_1}{\Delta t_2} = \frac{1}{\sqrt{1+x}}$$ $$\frac{\Delta t_1}{\Delta t_2} = \left({1+x}\right)^{-1 \over 2}$$ $$(3) \qquad \left({1+x}\right)^{-1 \over 2}$$ Applying the binomial expansion on equation $(3)$ to get the following: Fractional power binomial expansion link $$\left({1+x}\right)^{-1 \over 2} = 1{x}^0 + -\frac{1}{2}{x}^1 + \frac{3}{8}{x}^2 + -\frac{5}{16}{x}^3 + \frac{35}{128}{x}^4+ \cdots$$ essentially the coefficients are $${n \choose q}\quad or \quad{-\frac{1}{2} \choose q}$$ where n is $-\frac{1}{2}$ and $q$ incriments up by 1 starting at 0, I think. also
{ "domain": "physics.stackexchange", "id": 76770, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, mass-energy, time-dilation", "url": null }
Workers measure the diagonals. Ex 6.4, 4 If the areas of two similar triangles are equal, prove that they are congruent. Therefore, those two areas are equal. ... Two rectangles are congruent if they have the same length and same breadth. Construction workers use the fact that the diagonals of a rectangle are congruent (equal) when attempting to build a “square” footing for a building, a patio, a fenced area, a table top, etc. The ratio of the two longer sides should equal the ratio of the two shorter sides. called congruent, if they have the same shape and the same size. Technically speaking, that COULD almost be the end of the proof. All four corresponding sides of two parallelograms are equal in length that does mean that they are necessarily congruent because one parallelogram may or may not overlap the other in this case because their corresponding interior angles may or may not be equal. 9.1) , then using a tracing paper, Fig. [2]). I would really appreciate if you help me i dont
{ "domain": "com.au", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9930961635634175, "lm_q1q2_score": 0.8779360282435182, "lm_q2_score": 0.8840392909114836, "openwebmath_perplexity": 747.8878275257739, "openwebmath_score": 0.8698499202728271, "tags": null, "url": "https://www.cbdconstruct.com.au/scum9/2cf2d6-if-two-rectangles-have-equal-areas%2C-then-they-are-congruent" }
meteorology, atmosphere, fluid-dynamics, atmospheric-circulation, vorticity The vorticity term with no component gradients has two additional features. First, we see that it is an odd function of displacement from the Equator; the Northern and Southern Hemispheres give opposite signs. This corresponds to the latitude circle deviating in opposite ways from the geodesic in the two hemispheres. If the "bug" in our example were to be taken as following the rotation of Earth itself, it would appear to be turning clockwise if it were seen from the South Pole (so it woukd be in the Southern Hemisphere) but counterclockwise if seen from the North Pole.
{ "domain": "earthscience.stackexchange", "id": 2736, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "meteorology, atmosphere, fluid-dynamics, atmospheric-circulation, vorticity", "url": null }
classical-electrodynamics, gauge-invariance Title: Confusion about Coulomb Gauge Differential Equations For $\vec{A}$ and $V$ I am currently reading Griffiths, 'Introduction to Electrodynamics', 3rd ed, Chapter 10.1.3, the section on Gauge Invariance, and was reached a point of confusion. In particular, the differential equations that arose from choosing the Coulomb gauge $\nabla \cdot \vec{A}=0$: $$\nabla^2 V=-\frac{1}{\epsilon_0}\rho \tag{10.9}$$ $$\nabla^2\vec{A}-\mu_0\epsilon_0\frac{\partial^2\vec{A}}{\partial t^2}=-\mu_0\vec{J} + \mu_0\epsilon_0\nabla(\frac{\partial V}{\partial t}) \tag{10.11}$$ I am confused about the structure of $\vec A$ and $V$, shouldn't they have some sort of $\nabla \lambda$ and $-\frac{\partial \lambda}{\partial t}$ to account for the gauge choice? Here is my logical progression: We have differential equations directly from Maxwell's equations (no choice of gauge yet):
{ "domain": "physics.stackexchange", "id": 37230, "lm_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-electrodynamics, gauge-invariance", "url": null }
geometric-optics Title: Reflection law (from Fermat's principle) for arbitrary surface Normally reflection law is deduced from Fermat's principle (e.g. here) for a planar mirror. Also some other mirror surfaces can be studied (e.g. here they treat a spherical mirror). Is there some article or book where they treat a general smooth surface to deduce that the incident angle of the ray is the same angle as the reflected angle? If not, could you give me any hint as to how to treat this problem (with geometrical optics)? I appreciate your help. The overall concept of the proof isn't too difficult, especially if you've studied calculus of variations. If we've already proved the case for a planar mirror, it's not difficult to see that any curved mirror surface can be locally approximated by a planar surface (if you zoomed in far enough, the curved mirror would look flat). The same equal-angle reflection law should hold.
{ "domain": "physics.stackexchange", "id": 28298, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geometric-optics", "url": null }
error-correction, stabilizer-code Here's the GAP code used in the search LoadPackage("guava","0",false); TestA:=function(n)local code,H,T,k,w,dim,DminC,DminD,wgt; for k in [2..n-1] do code:=BestKnownLinearCode(n,k,GF(2)); #uncomment this to show for k=10 code is shortened golay #if(k=10)then #code:=BinaryGolayCode(); #code:=ShortenedCode(code,[1,2]); #fi; code:=DualCode(code); code:=EvenWeightSubcode(code); dim:=Dimension(code); Print("n=",String(n,-3)," k=",String(k,-3)," dim=",String(dim,-3)); if(dim>0)then H:=GeneratorMat(code);T:=H*TransposedMat(H); if(T=0*T)then DminC:=MinimumDistance(code); DminD:=MinimumDistance(DualCode(code)); Print(" dC=",DminC);Print(" dD=",DminD); H:=List(H,x->List(x,Int)); # convert from GF(2) matrix to binary matrix wgt:=Collected(List(H,Sum));Print(" weights=");for w in wgt do Print(w[1],",");od; if(DminC>2 and DminD>2)then Print("\n");Print("H=\n");PrintArray(H);fi; fi; fi; Print("\n"); od; return code; end;
{ "domain": "quantumcomputing.stackexchange", "id": 3853, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-correction, stabilizer-code", "url": null }
c, array, interpreter I'll rewrite your next function, too, to show what it could be like: array *new_array_with_dims(int rank, const int *dims) { const int datasz = product_of_dims(rank, dims); struct array *z = malloc(sizeof *z + (2*rank+datasz)*sizeof(int)); z->type = normal; z->rank = rank; z->cons = 0; z->dims = (int *)(z + 1); memmove(z->dims, dims, rank * sizeof(int)); z->weight = z->dims + rank; for (int i = 0, wgt = 1; i < rank; ++i) { z->weight[rank-i-1] = wgt; wgt *= z->dims[rank-i-1]; } z->data = z->weight + rank; return z; } From 23 lines (21 non-blank) to 21 (17 non-blank), and with a nice self-explanatory name (eliminating one additional comment line), and properly const-qualified. I split up the initializations so that we conceptually initialize z first, then z->dims, then z->weight, and finally z->data. This isn't so much of a "good style" versus "bad style" thing; it was just a personal organizational choice.
{ "domain": "codereview.stackexchange", "id": 18856, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, array, interpreter", "url": null }
quantum-field-theory, gauge-theory, quantum-electrodynamics, correlation-functions, ward-identity where $a\equiv g\times v$. If we now take the limit $g\rightarrow 0$, $v\rightarrow \infty$, keeping the product, $a$, constant, we get $$\mathcal L=-{1\over 4}\,F^2+{a^2\over 2}\,A^2+{1\over 2}(\partial \omega)^2-{\mu^2\over 2}\,\omega ^2-\lambda\,v\omega^3-{\lambda\over 4}\, \omega^4+{v^4\,\lambda^2\over 4}$$ that is, all the interactions terms between $A$ and $\omega$ disappear so that $\omega$ becomes an auto-interacting field with infinite mass that is decoupled from the rest of the theory, and therefore it doesn't play any role. Thus, we recover the massive vectorial field with which we started. $$\mathcal L=-{1\over 4}\,F^2+{a^2\over 2}\,A^2$$ Note that in a non-abelian gauge theory must be non-linear terms such as $\sim g A^2\,\partial A\;$, $\sim g^2 A^4$, which prevent us from taking the limit $g\rightarrow 0$.
{ "domain": "physics.stackexchange", "id": 8677, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, gauge-theory, quantum-electrodynamics, correlation-functions, ward-identity", "url": null }
evolution, olfaction With paint you are smelling volatile organic compounds, and many are important biological and/or hazard markers, some are related to rotting meat, others to infection, others to food sources, and others to natural toxic water sources. With burning rubber you have many different smell depending on the rubber, but in each case you are smelling a burning organic polymer which releases organic compounds which again would exist in nature.
{ "domain": "biology.stackexchange", "id": 8387, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, olfaction", "url": null }
quantum-chemistry, computational-chemistry, basis-set, ab-initio Since I am loosing too much time on this problem, which seems to be numerical, I was wondering if there is some standard implementation of Boys function that I can simply use in my code. Do you know any Python or Fortran library containing a good (safe and efficient) implementation of Boys function? If not, there is a simple algorithm that works well in any range of $x$ and is not sensible to numerical errors? I am not aware of any existing Fortran code for direct numerical quadrature of this problem, but it is worth pointing out that Mathematica can perform this integral symbolically: Integrate[t^(2 n) Exp[-x t^2], {t, 0, 1}]
{ "domain": "chemistry.stackexchange", "id": 14938, "lm_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-chemistry, computational-chemistry, basis-set, ab-initio", "url": null }
java, algorithm, strings, programming-challenge, graph public boolean isPossibleSeed() { return incommingEdgeCount == 0 || (incommingEdgeCount == 1 && siblingCount > 0) || incommingEdgeCount > 1; } @Override public String toString() { return value; } boolean solve(int aDepth, int aExpectedDepth, List<Character> aOutput) { visited = true; if (aDepth == aExpectedDepth) { for (int i = value.length() - 1; i >= 0; --i) { aOutput.add(value.charAt(i)); } return true; } else { for (Vertex child : outgoingEdges) { if (!child.visited && child.solve(aDepth + 1, aExpectedDepth, aOutput)) { aOutput.add(value.charAt(0)); return true; } } } visited = false; return false; } }
{ "domain": "codereview.stackexchange", "id": 17975, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, strings, programming-challenge, graph", "url": null }
complexity-theory, np-complete, computer-games Title: Why are some games np-complete? I read the Wikipedia entry about "List of NP-complete problems" and found that games like super mario, pokemon, tetris or candy crush saga are np-complete. How can I imagine np-completeness of a game? Answers don't need to be too precise. I just want to get an overview what it means that games can be np-complete. It just means that you can create levels or puzzles within these games that encode NP-Hard problems. You can take a graph coloring problem, create an associated Super Mario Bros. level, and that level is beatable if and only if the graph is 3-colorable. If you want to see the specific way the NP-Complete problems are translated into the games, I recommend the paper "Classic Nintendo Games are (Computationally) Hard". It's well written and easy to follow.
{ "domain": "cs.stackexchange", "id": 8326, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, np-complete, computer-games", "url": null }
photosynthesis, bioluminescence However, the wavelengths of light by which photosynthesis absorbs its energy are well defined and narrow. As a result, light sources for photosynthetic organisms have to be fairly strong and bright to cover the whole spectrum to provide the necessary light. As a result, your bioluminescent algae will also have to emit light at the desired wavelength to achieve a high photochemical efficiency and provide light to both Photosystem II and Photosystem I which have different wavelength requirements.
{ "domain": "biology.stackexchange", "id": 10151, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "photosynthesis, bioluminescence", "url": null }
ros-kinetic, ubuntu, ubuntu-xenial return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 1392, in wait pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0) File "/usr/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call return func(*args) KeyboardInterrupt
{ "domain": "robotics.stackexchange", "id": 30336, "lm_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, ubuntu, ubuntu-xenial", "url": null }
experimental-physics, measurements, radioactivity, error-analysis, experimental-technique Title: Measuring very long half lives accurately There are already some questions about long half life times for radioactive elements, explaining how to calculate the half life time. Now I am wondering: When you have some radioactive material and you observe the decay, how can you be sure that all individual decays are actually registered by the detectors? Does the background radiation influence the measurement, and how large are the effects? How are experiments for measuring very long half life times (larger than 1 billion years) usually setup? Disclaimer: I've never done the particular class of measurements you ask about, but I have done other low raw-rate, precision measurements (neutrino mixing and weak form-factors). The focus of experimental work for low count rates is multi-pronged:
{ "domain": "physics.stackexchange", "id": 30172, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-physics, measurements, radioactivity, error-analysis, experimental-technique", "url": null }
on the number of different simple. Here are examples of some of most basic truth tables, Truth table for negation ("not") Truth table for conjunction ("and" Truth table for disjunction ("or") Ex a Translate to symbolic form, then construct a truth table to represent the expression:. Truth Tables - Tautology and Contradiction. Contradiction - example 17 5. Create a truth table to determine whether the following statement is contingent, a tautology, or a self-contradiction. In other words, their columns on a truth table are identical. If it is always true, then the argument is valid. contradiction, is a statement which is false regardless of the truth values of the substatements which form it. The minimum number of cases under which a truth table row is declared as a remainder. here they are: a) i found this proposition was a contradiction. Confirmed! The conditional p —+ q and it's contrapositive -Iq —Y -p are logically equivalent. 2 LOGICAL EQUIVALENCE, TAUTOLOGIES & CONTRADICTIONS.
{ "domain": "chiavette-usb-personalizzate.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.970239907775086, "lm_q1q2_score": 0.8545844878495524, "lm_q2_score": 0.8807970904940926, "openwebmath_perplexity": 467.3208727966209, "openwebmath_score": 0.5699777007102966, "tags": null, "url": "http://insd.chiavette-usb-personalizzate.it/contradiction-truth-table.html" }
quantum-mechanics, hilbert-space, operators, momentum, coordinate-systems Title: How to prove radial momentum operator is hermitian? Technically, if we want to prove an operator $\hat{A}$ to be an hermitian,we should prove $ \left< \psi \hat{A}|\psi \right> =\left< \psi |\hat{A}\psi \right>$. It works well in Cartesian coordinate when proving the momentum operator $\hat{p}$. However when dealing with $\hat{p}_r\equiv-i\hbar\left(\frac{\partial}{\partial r}+\frac{1}{r}\right)$ in Spherical coordinate. In Spherical coordinate system, we have: $$ \langle\psi \hat{A} \mid \psi\rangle=\int_{0}^{\infty} \int_{0}^{\pi} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}(\hat{A} \psi)^{\dagger} \psi r^{2} \sin \theta \mathrm{d} \varphi \mathrm{d} \theta \mathrm{d} r=4 \pi \int_{0}^{\infty}(\hat{A} \psi)^{\dagger} \psi r^{2} \mathrm{~d} r $$ Imply $\hat{p}_r$ , then we have: $$ \begin{aligned} & 4 \pi \int_{0}^{\infty}\left(-i \hbar\left(\frac{\partial}{\partial r}+\frac{1}{r}\right) \psi\right)^{\dagger} \psi r^{2} \mathrm{~d} r \\
{ "domain": "physics.stackexchange", "id": 81855, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, hilbert-space, operators, momentum, coordinate-systems", "url": null }
slam, navigation, kinect Title: slam kinect packages Hi Besides gmapping and RGBD SLAM, are there any other packages you can use for SLAM with the Kinect ? Thank you Originally posted by ap on ROS Answers with karma: 42 on 2013-06-19 Post score: 0 Vslam (http://www.ros.org/wiki/vslam), but I wasn't able to install it. Maybe you'll be luckier! There's also Hector Mapping (http://www.ros.org/wiki/hector_mapping), but I read it doesn't work well with the Kinect (you would need a real laser scanner). Originally posted by Zayin with karma: 343 on 2013-06-19 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 14626, "lm_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, kinect", "url": null }
computability, turing-machines, undecidability Another approach is to encapsulate the pair of Turing machines $M_1,M_2$ in one Turing machine $M$, which upon input $0x$ will simulate $M_1$ on $x$, and upon input $1x$ will simulate $M_2$ on $x$ (on the empty input it can arbitrarily halt). There is a simple reduction showing that $EQ_{TM}$ is equivalent to the corresponding problem for $M$, and then you can apply Rice's theorem.
{ "domain": "cs.stackexchange", "id": 2265, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computability, turing-machines, undecidability", "url": null }
special-relativity, inertial-frames, observers, thought-experiment EDIT This program graphs the thought experiment with the horizontal component being position and the vertical component being time. The frame of reference of the train is given in black, and the frame of reference of the embankment is given in red. The yellow lines represent the positions of photons given a particular time. Note that the red points and the black points are not in the same coordinate system. The red points are the black points after the Lorentz transformation.
{ "domain": "physics.stackexchange", "id": 55370, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, inertial-frames, observers, thought-experiment", "url": null }
primes, sieve-of-eratosthenes, rust let test_100m_primes = segmented_sieve(1000000, 350); assert!(test_100m_primes.contains(&999983)); assert!(!test_100m_primes.contains(&999997)); } Documentation of the crate itself should use //! instead of ///. Documenting "A struct" is redundant and listing where a type is used is overly brittle - will you remember to change that when the other location changes? Much of the documentation seems redundant in general. Use meaningful variable names, create meaningful types, and don't duplicate the implementation in comments ("starts at ...", "the argument", etc.). Trailing commas are the prevalent style in Rust. 4-space indents. It may not be what you are used to, but that's what the community and language creators have chosen. It's better to just accept that and integrate. Remember that /// is for user-facing documentation, and // is for the programmer. There's no need to tell the user of your code how the Iterator trait works.
{ "domain": "codereview.stackexchange", "id": 20021, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "primes, sieve-of-eratosthenes, rust", "url": null }
plugin, vimscript, vim nnoremap <silent> <Plug>(go-zoz-navigation) :call winzoz#goZoZ()<cr> if !exists('g:winzoz_no_mappings') nmap <silent> <leader>w <Plug>(go-zoz-navigation) endif The function with the logic (plus a helper function for coloring the command line while the functionality is active) " autoload/winzoz.vim function! winzoz#goZoZ() redrawstatus! echohl Search echo s:make_status_line() echohl None let l:key = '' while l:key !=? "\<Esc>" let l:key = nr2char(getchar()) execute "normal! \<c-w>" . l:key redrawstatus! endw echo '' redrawstatus! endfunction " drawing function function! s:make_status_line() let l:text = 'Go WinZoZ' let l:text .= repeat(' ', (&columns - len(l:text))/2) return repeat(' ', &columns - len(l:text) - 1) . l:text endfunction I'd like some feedback in general, but also on the following points.
{ "domain": "codereview.stackexchange", "id": 39721, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "plugin, vimscript, vim", "url": null }
dataset, named-entity-recognition Title: Tool/dataset for matching first names and nicknames I'm trying to identify the same individuals in a large dataset where sometimes the individuals may be listed by their full first name (e.g., "Michael Douglas") and sometimes by its nickname (e.g., "Mike Douglas"). Does anyone know of a dataset that has (at least) English first names and their corresponding common nicknames? Or a tool that will do such matching for you? I searched for a while and couldn't find anything like this. Maybe this helps. I could not check the content, but it says that it provides a csv mapping names and nicknames. https://github.com/carltonnorthern/nickname-and-diminutive-names-lookup
{ "domain": "datascience.stackexchange", "id": 5296, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dataset, named-entity-recognition", "url": null }
Here are my vague ideas (inspired on how it is coded): $$\sigma(\mathbf{X}) = \frac{1}{1 + \exp(-\mathbf{X})}$$ \begin{split} \mathrm{d} \sigma(\mathbf{X}) & = \frac{-1 \left[ \exp(-\mathbf{X}) \odot \mathrm{d} (-\mathbf{X}) \right]}{\left( 1 + \exp(-\mathbf{X}) \right)^2} =\\ & = \frac{-1 \left[ \exp(-\mathbf{X}) \odot (-\mathbf{1}) \odot \mathrm{d} \mathbf{X} \right]}{\left( 1 + \exp(-\mathbf{X}) \right)^2} = \\ & = \frac{ \mathbf{1} \odot \exp(-\mathbf{X}) \odot \mathrm{d} \mathbf{X} }{\left( 1 + \exp(-\mathbf{X}) \right)^2} = \\ & = \frac{\mathbf{1}}{1 + \exp(-\mathbf{X})} \odot \frac{\exp(-\mathbf{X}) + \mathbf{1} - \mathbf{1} }{1 + \exp(-\mathbf{X})} \odot \mathrm{d} \mathbf{X} =\\ & = \sigma(\mathbf{X}) \odot (\mathbf{1} - \sigma(\mathbf{X})) \odot \mathrm{d} \mathbf{X} \end{split} The result matches how I would code it yet the derivation just does not seem right.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754476918605, "lm_q1q2_score": 0.8225965836325482, "lm_q2_score": 0.8354835432479661, "openwebmath_perplexity": 978.9613359347396, "openwebmath_score": 0.9913309216499329, "tags": null, "url": "https://math.stackexchange.com/questions/2323370/derivative-of-sigmoid-assuming-input-is-a-matrix" }
java, algorithm, sorting //break on negative index to prevent overflow error if (outer+inner<0) { break; } } } Consider for (int i = 1; i < numbers.length; i++) { // insert the ith element in its correct position among the elements up to i for (int j = i; j > 0 && numbers[j - 1] > numbers[j]; j--) { int temp = numbers[j - 1]; numbers[j - 1] = numbers[j]; numbers[j] = temp; } }
{ "domain": "codereview.stackexchange", "id": 27886, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, sorting", "url": null }