Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
49
10.4k
source
dict
image-processing, discrete-signals, interpolation In this formulation, the c0...c3 values can be thought of as the coefficients of an FIR filter which is applied to the sample values. Now it's much easier to see how to derive the routine from the kernel. Consider the kernel with $\alpha = -1$, like so: $$ \psi(x) = \begin{cases} |x|^3 - 2|x|^2 + 1, & \text{ if } 0 \le |x| \lt 1 \\ -|x|^3 + 5|x|^2 - 8|x| + 4, & \text{ if } 1 \le |x| \lt 2 \\ 0, & \text{ if } 2 \le |x| \end{cases} $$ Now evaluate that kernel symbolically at various shifted offsets, keeping in mind that mu ($\mu$) ranges from 0 to 1: $$ \begin{eqnarray} \psi(\mu + 1) &=& -(\mu + 1)^3 + 5(\mu + 1)^2 - 8(\mu + 1) + 4 &=& −\mu^3 + 2\mu^2 - \mu & & (c_0) \\ \psi(\mu) &=& \mu^3 - 2\mu^2 + 1 &=& \mu^3 - 2\mu^2 + 1 & & (c_1)\\ \psi(\mu - 1) &=& (1 - \mu)^3 - 2(1 - \mu)^2 + 1 &=& -\mu^3 + \mu^2 + \mu & & (c_2)\\ \psi(\mu - 2) &=& -(2 - \mu)^3 + 5(2 - \mu)^2 - 8(2 - \mu) + 4 &=& \mu^3 - \mu^2 & & (c_3)\\ \end{eqnarray} $$
{ "domain": "dsp.stackexchange", "id": 380, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, discrete-signals, interpolation", "url": null }
performance, sql, sql-server, xml, stackexchange -- Parse XML <row> node attributes and insert them into their respective columns: INSERT INTO CleanData.Badges ( SiteId, ApiSiteParameter, RowId, UserId, Name, CreationDate, Class, TagBased ) SELECT @SiteId, @ApiSiteParameter, x.r.value('@Id','INT') as Id, x.r.value('@UserId', 'INT') as UserId, x.r.value('@Name', 'NVARCHAR(256)') as Name, x.r.value('@Date', 'DATETIME2') as [Date], x.r.value('@Class', 'INT') as Class, CASE WHEN LOWER(x.r.value('@TagBased', 'NVARCHAR(256)')) = 'true' THEN 1 ELSE 0 END AS TagBased FROM @XML.nodes('/badges/row') as x(r); This answer may also give pointers on how to select values from multiple xml documents combined, allowing you to process RawDataXml.Badges entries from multiple sites as a set.
{ "domain": "codereview.stackexchange", "id": 22115, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, sql, sql-server, xml, stackexchange", "url": null }
javascript, html, ecmascript-6, event-handling, d3.js <div> <input type="text" id="barra-de-texto-para-grafico-1" style="width: 100%;"> </div> </form> <img src="https://sitedeapostas-com.imgix.net/assets/local/Company/logos/betfair_logo_transp.png?auto=compress%2Cformat&fit=clip&q=75&w=263&s=c1691b4034fd0c4526d27ffe8b1e839c" name="grafico-betfair-1"> <form action="" method="post" id="formulario-para-limpar-texto-1"> <div> <button class="button" style="width: 100%;" id="botao-de-limpar-texto-1" onclick="limpar_texto_1()">Limpar Tudo <br/>1</button> </div> </form> <script id="script-para-limpar-dados-1"> function limpar_texto_1() { var btn = document.getElementById('formulario-para-limpar-texto-1'); btn.onclick = function(e){ e.preventDefault(); document.getElementById('barra-de-texto-para-grafico-1').value=""; document.getElementById('barra-de-texto-para-radar-1').value=""; document.getElementById('botao-do-radar-1').click(); document.getElementById("select-box-1").selectedIndex = "0"; }; } </script> </div> <div class="column middle1"> <form action="" method="post" id="formulario-radar-2">
{ "domain": "codereview.stackexchange", "id": 41823, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, html, ecmascript-6, event-handling, d3.js", "url": null }
ocean, oceanography, wind, waves, ocean-currents Taking 10 meters (one of the smallest values in mid-latitudes) for the surface and bottom boundary layer thicknesses, that implies that in water depths shallower than 20 m the two boundary layers overlap. In water depths shallower than that, the transport in the surface layer is no longer perpendicular to the wind direction. The momentum input into the water by the wind (wind stress) is affected by the presence of the bottom and it is directly dissipated by bottom friction. The mixing by the wind (and wave breaking near the surf zone) results in additional mixing through the water column and facilitating well-mixed water columns. Under these conditions the wind-induced currents extend all the way to the bottom with the direction of the flow being a function of bottom depth, wind direction, and bottom slope. The presence of wind-induced currents does not preclude the occurrence of flow in the opposite direction of the wind. A fantastic article summarizing the different flow conditions under different wind and wave fields in shallow water depths is given in Lentz and Fewings (2012). (Reprint) Additional factors to consider are:
{ "domain": "earthscience.stackexchange", "id": 1166, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ocean, oceanography, wind, waves, ocean-currents", "url": null }
quantum-spin, spin-statistics, spin-chains Title: What is the physical interpretation of $\langle S_i^z S_j^z \rangle$? Let's say, that we have some spin system with multiple sites. This system is in a quantum state denoted by $|\psi \rangle$. When we compute e.g. $\langle S_1^z \rangle = \langle \psi | S_1^z | \psi \rangle$, this can be understood as measuring the expected value of spin in the $Z$ axis on the first site. But we can also calculate the value $\langle S_1^z S_2^z \rangle$. What is its physical interpretation? Can we compare this to measuring expected value of combined spins at sites 1 and 2 in the $Z$ direction? The physical interpretation is that this is an approximation to the nearest-neighbor spin-spin interaction energy. A charged particle with spin behaves as a magnetic dipole whose dipole moment is proportional to the spin, and the interaction energy of two magnetic dipoles $\mathbf{m}_1$ and $\mathbf{m}_2$ with separation $\mathbf{r}$ is known to be $$-\frac{\mu_0}{4\pi}\frac{3(\mathbf{m}_1\cdot\hat{\mathbf{r}})(\mathbf{m}_2\cdot\hat{\mathbf{r}})-\mathbf{m}_1\cdot\mathbf{m}_2}{r^3}.$$ If you take the spins to be on a lattice in the $xy$ plane, and oriented at right angles to that plane, then this becomes proportional to $S_1^zS_2^z$.
{ "domain": "physics.stackexchange", "id": 60908, "lm_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-spin, spin-statistics, spin-chains", "url": null }
java, generics, interface Title: Instantiating a run-time implementation of an interface Below is my code that was written for the following task (based on an SO question): Given a Java Collection (of N elements) create an ArrayList, containing N collections of the same type with just one element in each. Here's my code for such method: public static <E> ArrayList<Collection<E>> SplitCollection (Collection<E> col) throws InstantiationException, IllegalAccessException { ArrayList<Collection<E>> listOfCollections = new ArrayList<>(); for(E el: col) { // creating an empty collection of type E Collection<E> colEl = col.getClass().newInstance(); colEl.add(el); listOfCollections.add(colEl); } return listOfCollections; } Is there a better way to create a run-time instance of an implementation class for an interface? Did I overdo anything in light of type erasure? Other code critique? When I decided to use no-argument constructor I was aware that the very existence of one is not (and cannot be) enforced by the interface. As it stated in the docs: All general-purpose Collection implementation classes (which typically implement Collection indirectly through one of its subinterfaces) should provide two "standard" constructors: a void (no arguments) constructor, which creates an empty collection, and a constructor with a single argument of type Collection, which creates a new collection with the same elements as its argument. In effect, the latter constructor allows the user to copy any collection, producing an equivalent collection of the desired implementation type. There is no way to enforce this convention (as interfaces cannot contain constructors) but all of the general-purpose Collection implementations in the Java platform libraries comply. So I was writing my code for general-purpose Collection implementations. I never intended this code to be used for production purposes. I merely wanted to see how far programming to interface together with Generics could get you before you have to use a concrete type and implementation. Two parts to this review: the 1-liner for the newInstance() the general mechanism of the method
{ "domain": "codereview.stackexchange", "id": 8676, "lm_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, generics, interface", "url": null }
genetics, evolution Title: Why does the DNA of Bacillus subtilis not contain DNA families of 20-37 members? I am reading the book "Molecular biology of the Cell, 6th edition" and in chapter one page 18 the following figure is included I am presuming this figure represents all genes within the Bacillus subtilis, which makes me wonder: why are there no families with 20-37 genes? There is a group for 4-19, and one for 38-77. What happened to all sizes in between? Based on the paper (open access) from which this figure was adapted, the 38-77 group consists of 5 gene families with 38, 47, 57, 64 or 77 members. In contrast, there are 284 “families” with 2 members, 91 with 3 members, 42 with 4 members, 25 with 5 members, etc. This is clearer in the original figure: Thus the larger gene families are outliers and there simply exists no gene families in B. subtilis with 20-37 genes (at least by the methodology of this paper).
{ "domain": "biology.stackexchange", "id": 11056, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genetics, evolution", "url": null }
asymptotics, recurrence-relation, master-theorem But now to your computation. Setting $n=2^m$, we obtain as you did $$ T(2^m) = T(\sqrt{2 ^ m}) + 2^m=T(2 ^ {\frac{m}{2}}) + 2^m.\tag{1}\label{eq1}$$ You defined $$S(m) = T(2^m).$$ Then equation $\eqref{eq1}$ should become the following equation, which is different from $S(m)\,$$= S(\frac{m}{2})\,$$ + m$, the wrong equation in the question. $$S(m) = S\left(\frac{m}{2}\right) + 2^m.$$ The equation above falls into the third case of the master theorem, therefore $S(m) \in \Theta(2^m)$. And from this follows $T(n) \in \Theta(n)$.
{ "domain": "cs.stackexchange", "id": 14219, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "asymptotics, recurrence-relation, master-theorem", "url": null }
• Second, define $g:I \times I$ $\rightarrow D, (x,y)\mapsto(x,x)$. Then $r=q\circ g:$ $I \times I$ $\rightarrow \mathbb S^1$ is constant on fibers of $q$, so it descends to the quotient to give a continuous map $M\rightarrow \mathbb S^1$. So $\mathbb S^1$ is a retract of $M$. • Finally, define the homotopy $H:I^3\rightarrow I^2$ by $(x,y,t)\mapsto (x,y)*(1-t) + (x,x)*t$. This is the homotopy showing that $g$ is a deformation retraction. Define the composite map $q\circ H: I^3\rightarrow M$. Note that $q(H(0,y,t))=q(0, y*(1-t))=q(1, 1-y*(1-t))=q(H(1,1-y,t))$. Since this is constant on fibers of the map $q\times id:I^2 \times I \rightarrow M \times I$, it descends to the quotient, and there is a continuous map $F: M \times I \rightarrow M$ such that $F(m,0) = id_M$ and $F(m,1)$ = $q(D) \approx \mathbb S^1$, so this is the desired homotopy.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9755769071055403, "lm_q1q2_score": 0.8086935567405907, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 92.94352243141462, "openwebmath_score": 0.9623719453811646, "tags": null, "url": "https://math.stackexchange.com/questions/1373143/showing-that-mathbb-s1-is-a-deformation-retract-of-the-mobius-strip-rigorou" }
Computing specific Clebsch-Gordan coefficients I am trying to compute some Clebsch-Gordan coefficients with some specific values. My coefficients look like $$\left< L,0;1,\lambda\middle|J,M\right>$$ I know that $$M=0+\lambda=\lambda$$ and that $$J$$ ranges from $$|L-1|$$ to $$L+1$$, so that I have three cases: $$J=L-1$$, $$J=L$$, and $$J=L+1$$. For instance, if I take the second case, I have $$\left< L,0;1,\lambda\middle|L,\lambda\right>$$ I know that the answer should be $$-\frac{\lambda}{\sqrt{2}},~\lambda=-1,0,+1$$ However, I cannot get the expression myself. I was thinking of using the recursion relation given for Clebsch-Gordan, for instance in Sakurai, which is $$\sqrt{(J\mp M)(J\pm M+1)}\left< L,M_L;1,\lambda\middle|J,M\pm1\right> = \sqrt{(L\mp M_L)(L\pm M_L+1)}\left< L,M_L\mp1;1,\lambda\middle|J,M\right>+\sqrt{(1\mp \lambda)(1\pm \lambda+1)}\left< L,M_L;1,\lambda\mp1\middle|J,M\right>$$ For $$J=L$$, $$M=\lambda$$, this becomes
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.971129093889291, "lm_q1q2_score": 0.8050065856069641, "lm_q2_score": 0.8289387998695209, "openwebmath_perplexity": 173.55988036269164, "openwebmath_score": 0.9867859482765198, "tags": null, "url": "https://physics.stackexchange.com/questions/504220/computing-specific-clebsch-gordan-coefficients" }
java, game, swing, awt public class Main extends JFrame { private static int WIDTH_GAME_FRAME = 800; private static int HEIGHT_GAME_FRAME = 700; private GamePanel gamePanel; public Main() throws Exception { this.setTitle("SpaceWar"); this.setLayout(new BorderLayout()); this.setSize(WIDTH_GAME_FRAME, HEIGHT_GAME_FRAME); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); gamePanel = new GamePanel(); this.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent windowEvent) { gamePanel.exitGame(); } }); this.add(gamePanel); this.setResizable(false); this.setVisible(true); } public static void main(String[] args) { try { new Main(); } catch (Exception e) { e.printStackTrace(); } } public static int getWidthGameFrame() { return WIDTH_GAME_FRAME; } public static int getHeightGameFrame() { return HEIGHT_GAME_FRAME; } } GamePanel class package com.company; import java.awt.*; import java.util.LinkedList; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.swing.JPanel; public class GamePanel extends JPanel { public enum stateOfGame {GAME, MENU, HIGH_SCORE} public enum SpaceShipWay {LEFT, RIGHT}
{ "domain": "codereview.stackexchange", "id": 21962, "lm_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, game, swing, awt", "url": null }
newtonian-mechanics, reference-frames, vectors, rigid-body-dynamics, solid-mechanics 2)The second diagram is also the same thing. Typically when we say that the extended body is in equilibrium, we at first add the downward forces in $-y$ axis $P_2+P_3$ just as if the bigger body was a point particle,meaning both the forces $P_2$ and $P_3$ are acting at the same point mass. Then we say for equilibrium we need $P_1=P_2+P_3$. I would have no problem admitting these only if it were a point particle instead of an extended body. But i am finding it hard to digest why we can treat the extended body like a point mass while adding forces. So my main dilemma is to find a proof why we can treat extended objects as if they were point particles while adding forces and also what is the proof that the whole body will experience the same linear effect due to the force which is actually applied at only one certain point of the body. Extended objects, or in general any mass configuration, do obey Newton's second law. You don't have to assume you can treat the system just like a point mass, you can formally treat it as a collection of point masses and show that it obeys the same law. Suppose you have a system that is a collection of masses $m_i$. $m_i$ applies an internal force on $m_j$, which we will denote by $\vec F^\text{int}_{ij}$, "int" standing for internal. An example of internal forces is the elastic forces keeping a rigid body "rigid". In addition to the internal forces, on each mass $m_i$ is an external force $\vec F^\text{ext}_{i}$ Newton's second law applied to mass $m_i$ says $$\vec F^\text{ext}_{i}+\sum_{j\ne i}\vec F^\text{int}_{ji}=\frac{d\vec p_i}{dt}.$$ Adding these for all $i$,
{ "domain": "physics.stackexchange", "id": 94201, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, reference-frames, vectors, rigid-body-dynamics, solid-mechanics", "url": null }
quantum-field-theory $$ In particular, one can show the LSZ reduction formula by putting each $q_i$ on-shell. You can see all this in chapter $10$ of the first volume of Weinberg QFT textbook. Now, if you want to know how to make sense of the state $\phi(x)|0\rangle$ you just need to plug this state into an arbitrary Green's function and work out the residue of various poles. Note that just Lorentz symmetry fixes the projection of this state with the one-particle state, up to an overall normalization: $$ \langle \vec{p},\sigma|\phi_{\alpha}(x)|0\rangle = \sqrt{Z}\,u_{\alpha}(\vec{p},\sigma)e^{-ipx} $$ where this $u$-function is the polarization function, responsible to match the Lorentz index $\alpha$ with the little group index $\sigma$. In interacting theories, $\phi_{\alpha}(0)|0\rangle$ is not parallel to $|\vec{p},\sigma\rangle$, since, by the polology and LSZ reduction formula above, this would mean that the Green's function of more than two points are zero, implying that the S-matrix is trivial. Answering both your questions:
{ "domain": "physics.stackexchange", "id": 49067, "lm_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", "url": null }
radio-astronomy, radio-telescope, instruments Title: How does ALMA produce stable, mutually coherent ~THz local oscillators for all of their dishes? The ALMA (Atacama Large Millimetre/submillimetre Array) radio telescope's band-10 capabaility is now operational, per this answer. That's confirmed by NRAO's First Science with ALMA’s Highest-Frequency Capabilities. According to this site ALMA's bands and frequencies are as follows: band wavelength noise frequency (mm) (K) (GHz) 1 6.0 - 8.5 26 35 - 50 2 3.3 - 4.5 47 65 - 90 3 2.6 - 3.6 60 84 - 116 4 1.8 - 2.4 82 125 - 163 5 1.4 - 1.8 105 163 - 211 6 1.1 - 1.4 136 211 - 275 7 0.8 - 1.1 219 275 - 373 8 0.6 - 0.8 292 385 - 500 9 0.4 - 0.5 261 602 - 720 10 0.3 - 0.4 344 787 - 950 900 GHz (0.9 THz) is quite a high frequency for a radio receiver! Each ALMA dish down-converts received frequency to a baseband of a few GHz before they get digitized and sent to the correlator for digital interferometry, but you still need an ultra-stable local oscillator (LO) for downconversion, and all of the LO's of all of the dishes need to be mutually coherent. That's quite a feat considering they can be tens of kilometers apart! Question: How does ALMA produce stable, mutually coherent ~THz local oscillators for all of their dishes?
{ "domain": "astronomy.stackexchange", "id": 4942, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "radio-astronomy, radio-telescope, instruments", "url": null }
python, beginner Title: Chat using commands I have been learning Python and was trying to make a chat system which can be run by commands. This is my first attempt to write the code. Does this make sense or is it wrong usage of classes? There is a User class which will contain the user of the chat. The Message class is used to send messages and count their length. class User: def __init__(self): self.users = [] def add_remove_user(self,input): command, name = input[:1], input[1:] if command == "+": if not name in self.users: self.users.append(name) elif command == "-": if name in self.users: self.users.remove(name) class Message: def __init__(self,user): self._messages=[] self._user=user def __parseMessage__(self,message): parsedMessage=tuple(message.split(":")) return parsedMessage def send_message(self,inputMessage): user,message = self.__parseMessage__(inputMessage) if user in self._user.users: self._messages.append(message) def sent_messages_count(self): count=0 for message in self._messages: count += len(message) return count class MessageClient: def __init__(self): self.user=User() self.message=Message(self.user) def send(self,inputMessage): if inputMessage[0] == "+" or inputMessage[0] == "-": self.user.add_remove_user(inputMessage) else: self.message.send_message(inputMessage) def sent_message_length(self): return self.message.sent_messages_count() A few comments regarding style (mainly based on PEP8):
{ "domain": "codereview.stackexchange", "id": 8656, "lm_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", "url": null }
z-transform, homework This is a homework problem. "Explain the structure" means that $b[n]$ is zero for certain values of $n$, and has a certain shape. I'm trying to take the inverse $\mathcal Z$-transform of $B(z)$ and $B(-z)$, but I'm not sure how the inverse $\mathcal Z$-transform of $B(-z)$ is related to $b[n]$, so I'm stuck...can anyone give me some advice? Just use the definition of the $\mathcal{Z}$-transform: $$B(z)=\sum_{n=-\infty}^{\infty}b[n]z^{-n}\tag{1}$$ from which it follows that $$B(-z)=\sum_{n=-\infty}^{\infty}b[n](-z)^{-n}=\sum_{n=-\infty}^{\infty}b[n](-1)^nz^{-n}\tag{2}$$ From $(2)$, the sequence that corresponds to $B(-z)$ is $b[n](-1)^n$. Now taking the inverse $\mathcal{Z}$-transform of $$B(z)+B(-z)=2c\tag{3}$$ gives $$b[n]+b[n](-1)^n=2c\delta[n]\tag{4}$$ For odd $n$, the left side of $(4)$ equals zero. For even $n$ it equals $2b[n]$. Consequently, equation $(4)$ can only be satisfied if $b[n]=0$ for even $n$ except for $n=0$, where we require $b[0]=c$: $$b[n]=\begin{cases}c,&n=0\\ 0,&n\text{ even}\end{cases}$$
{ "domain": "dsp.stackexchange", "id": 4011, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "z-transform, homework", "url": null }
javascript, jquery, jquery-ui </div> </div> <h3>Category 2</h3> <div> <div class="faq_subaccordion" id="subaccordion_1"> <h3>Cat 2 - Title 1</h3> <div>Testing Text 1 On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot f</div> <h3>Cat 2 - Title 2</h3> <div>Testing Text 2 rem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad </div> <h3>Cat 2 - Title 3</h3> <div>Testing Text 3 But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself,</div> </div> </div> <h3>Category 3</h3> <div> <div class="faq_subaccordion" id="subaccordion_2"> <h3>Cat 3 - Title 1</h3> <div>Testing Text 1 but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain c</div> <h3>Cat 3 - Title 2</h3>
{ "domain": "codereview.stackexchange", "id": 33227, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, jquery-ui", "url": null }
ros, nao-robot, naoqi, nao process[nao_controller-3]: started with pid [7441] No handlers could be found for logger "rosout" process[nao_behaviors-4]: started with pid [7444] ================================================================================REQUIRED process [nao_sensors-1] has died! process has died [pid 7437, exit code 1, cmd /home/florabranchi/catkin_ws/src/nao_robot/nao_driver/nodes/nao_sensors.py --pip=127.0.0.1 --pport=9559 __name:=nao_sensors __log:=/home/florabranchi/.ros/log/c37b6108-b373-11e3-beca-848f69cd2cc7/nao_sensors-1.log]. log file: /home/florabranchi/.ros/log/c37b6108-b373-11e3-beca-848f69cd2cc7/nao_sensors-1*.log Initiating shutdown! ================================================================================ No handlers could be found for logger "rosout" cannot add process [nao_leds-5] after process monitor has been shut down No handlers could be found for logger "rosout" [nao_behaviors-4] killing on exit [nao_controller-3] killing on exit [nao_walker-2] killing on exit
{ "domain": "robotics.stackexchange", "id": 17402, "lm_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, nao-robot, naoqi, nao", "url": null }
performance, strings, linux, assembly, amd64 inc rax sub rsp, rax dec rax Normally you'd want to keep the stack aligned by 16, and there's no need to change RAX when you want that value later; you could add into a different register. lea rcx, [rax+1 + 15] ; rax+1 for the extra byte, and +15 as part of (x+15)&-16 to round up to the next multiple of 16 and rcx, -16 sub rsp, rcx ; alignas(16) char buf[rax+1] To save code-size, if your string will always be less than 4GiB you can use ecx for LEA and AND (32-bit operand-size is the default in x86-64 machine code with no prefixes). On a CPU without partial-register stalls, and cl, -16 would also work efficiently, since the only bits you're clearing are in the low byte so it works to leave the rest unmodified. Same as and rcx, -16 but without needing a REX prefix. push rbp mov rbp, rsp ... leave That is useful if you variably modify RSP. Otherwise don't do it. Once you fix the algorithm, there's no need to touch stack space.
{ "domain": "codereview.stackexchange", "id": 43808, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, strings, linux, assembly, amd64", "url": null }
python, parsing, console, networking, formatting print 'Address: {0}{1}{2}'.format(HEADER, ip_input, ENDC) print 'Netmask: {0}{1} = {2}{3}'.format(HEADER, submask_from_set_bits(base), base, ENDC) print 'Wildcard: {0}{1}{2}'.format(HEADER, wildcard(base), ENDC) print 'Class: {0}{1}{2}'.format(HEADER, ip_class(IP_32_BIT), ENDC) print '{0}-->{1}'.format(OKGREEN, ENDC) print 'Network: {0}{1}/{2}{3}'.format(OKBLUE, network_address, base, ENDC) print 'HostMin: {0}{1}{2}'.format(OKBLUE, network_min, ENDC) print 'HostMax: {0}{1}{2}'.format(OKBLUE, network_max, ENDC) print 'Broadcast: {0}{1}{2}'.format(OKBLUE, broadcast_address, ENDC) print 'Subnets: {0}{1}{2}'.format(OKBLUE, subnets(base), ENDC) print 'Hosts/Net: {0}{1}{2}'.format(OKBLUE, max_hosts(base), ENDC) Nice tool! And I think it's pretty well done. There's still some room for improvements though ;-) Structure Much of your code is within functions, which is good. But then, roughly half of the code is in the global namespace. It would be better have pretty much everything inside functions. For example:
{ "domain": "codereview.stackexchange", "id": 9454, "lm_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, parsing, console, networking, formatting", "url": null }
electromagnetic-induction Title: self-inductance, back-emf In self-inductance calculations, why the back emf is in negative sign? For example: it is given that the emf induced in the solemoid is 5.0V in the question. E=-L(dI/dt) -5.0=-L(dI/dt)… Something like this. Why there is a negative sign in front of 5.0V ? Thank you. There may be some confusion due to failing to distinguish between the emf $\mathcal{E}$ and the potential difference $v_L$ across the inductor. For example, if a battery of voltage $V$ is connected across an inductor, you will measure a voltage $V$ across the inductor and, in the case of an ideal inductor, you will find that the rate of change of inductor current $i_L$ is (assuming the passive sign convention) $$\frac{di_L}{dt} = \frac{V}{L}$$ since, for an ideal inductor, we have $$v_L = L \frac{di_L}{dt}$$ The associated emf $\mathcal{E}$ is of the opposite sign since it must 'oppose' the applied voltage if the inductor current is to be finite and so, in the above case, we have $$\mathcal{E} = - V = - L \frac{di_L}{dt}$$.
{ "domain": "physics.stackexchange", "id": 30277, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-induction", "url": null }
water, home-experiment, physical-chemistry Argument: Oxygen is replaced by Carbon dioxide. So, there is the same amount of gas added than taken away. Therefore, heat alone most be responsible for the water level change. Source of the Error: A simplified and wrong chemical equation is used, which does not take into account the quantitative changes. The chemical equation has to be balanced correctly. It is not true that each oxygen molecule is replaced by one carbon dioxide molecule during the burning process; two oxygen molecules result in one carbon dioxide molecule and two water molecules (which condense). Remember oxygen is present in the air as a diatomic molecule. [A reader clarifies the water condensation in an email to me as follows: If the experiment were done with the sealing fluid able to support a temperature greater than 212 F and the whole system held above this temperature then the water product of combustion would remain gaseous and the pressure within the vessel would increase as a result of three gaseous molecules for every two prior to combustion and the sealing fluid would be pushed out.] Argument: Carbon dioxide is absorbed by the water. Thats why the oxygen depletion has an effect. Source of the Error: This idea is triggered from the fact that water can be carbonized or that the oceans absorb much of the carbon dioxide in the air. But carbon dioxide is not absorbed so fast by water. The air would have to go through the water and pressure would need to be applied so that the carbon dioxide is absorbed during the short time span of the experiment. Argument: The experiment can be explained by physics alone. During the heating stage, air escapes. Afterwards, the air volume decreases and pulls the water up. Source of the Error: the argument could work, if indeed the heating of the air would produce enough pressure that some air could leave. In that case, some air would be lost through the water. But one can observe that the water level stays up even if everything has gone back to normal temperature (say 10 minutes). No bubbles can be seen. Argument: It can not be that the oxygen depletion is responsible for the water raising, because the water does not rise immediately. The water rises only after the candle dims. If gas would be going away, this would lead to a steady rise of the water level, not the rapid rise at the end, when the candle goes out.
{ "domain": "physics.stackexchange", "id": 2148, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "water, home-experiment, physical-chemistry", "url": null }
java, spring What kind of naming is better style? Actually #1 is called smurf naming (here is a question about it on Programmers.SE). One thing to consider: Do you have to work with more than one ViewOptions at the same time (or at the same source file)? If that's true having a more specific name would help. Two possible advantages of smurfier names: There aren't multiple editor tabs with the same filename. You don't have to use full package names to declare two ViewOptions in the same source file. So I made a DatatablesOptions class for the general usecase and if I need additional fields I extend the DatatablesOptions class. Check Effective Java, Second Edition, Item 16: Favor composition over inheritance if you don't know already. Try to format the code in a way which avoid unnecessary horizontal scrolling. It would make it esasier to read. @RequestParam (value="iDisplayStart")int startLine, @RequestParam (value="iDisplayLength")int linesPerPage, @RequestParam (value="iSortCol_0")int columnToSort, @RequestParam (value="sSearch", required = false) String searchString, Some of the parameters have a space between the closing parentheses (...false) String) , some of them doesn't (...th")int linesPerPage). You can find another inconsistencies too. It should be consistent. Modern IDEs have autoformat, they do a really good job here, use them.
{ "domain": "codereview.stackexchange", "id": 6240, "lm_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, spring", "url": null }
newtonian-gravity, acceleration, units, dimensional-analysis, textbook-erratum Title: Is the gravitational acceleration 9.8 m s$^{-1}$? I'm really new to science and physics so I apologize in advance if this question is too easy to be asked on this site. I'm retaking high school physics and and I'm using a site that claims covers the whole curriculum of grade 10. I was always told that gravity = 9.8 m s$^{-2}$ but I recently saw a website where they state that the gravitational acceleration is 9.8 m s$^{-1}$ and I'd just like some clarity on if they're wrong or right or how this works because nowhere on Google can I find anything related to the negative one? And seeing as I just started out I don't want to follow a site for the next two years that's gonna teach me a lot of wrong information. Here's a link to where I found it on the site, it's fairly close to the end of the page, the last row in the table under the heading "Constants in equations". Any clarification would be appreciated. The website made a mistake. Every object subject to a constant force will accelerate uniformly in time, having a characteristic acceleration which must have SI units $\text m/\text s^2,$ which is to say that "acceleration is a rate of change in velocity per unit time." Now, generally a force will only impact an object inversely as its mass increases, $a = F/m,$ so if you kick a big massive object and a little object exactly the same, the little object will start to move much faster than the big one. This equation means that the units of force are $\text{kg m}/\text s^2.$ Gravity near the surface of a planet happens to be an approximately constant force for any single object, because the planet's radius is so much larger than the heights that the object is ascending or descending and the size of the object and so forth. However the force of gravity does scale with the mass of that object, $F = m g$ for some constant $g$ that depends on the mass of the planet and its radius, but not on the falling objects.
{ "domain": "physics.stackexchange", "id": 40163, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-gravity, acceleration, units, dimensional-analysis, textbook-erratum", "url": null }
gravity, black-hole Title: Why isn't the star that created the black hole a black hole? If the mass of a black hole is creating so much gravity that light cannot escape, why isn't the mass of the star that created the black hole (before it went supernova) trapping light as well? By all accounts, that pre-supernova star should have boatloads more mass than the black hole post supernova, right? Doesn't the star lose most of it's mass when going supernova? You are correct in saying that a star loses a lot of its mass in a supernova. However, there is a reason why the star still becomes a black hole. Actually, I suppose the question here is "Why doesn't a star become a black hole before it even undergoes a supernova?" There is a reason for a supernova (I'll assume you're talking about type II supernovae, which result from incredibly massive stars). Stars undergo nuclear fusion, and this leads to "thermal pressure", which counteracts the force of gravity. Without this pressure, gravity would indeed make a sufficiently large star collapse upon itself. Gravitational collapse occurs when there is not enough pressure to counteract gravity; the result is a spectacular supernova. So stars only become black holes (or other compact objects, such as neutron stars) when they cannot produce enough energy to counteract the force of gravity due to their own mass. As for the first part of your question (sorry for answering in reverse), light in the area of a black hole cannot escape if it is inside its event horizon or on a trajectory towards it. The radius of the event horizon for a non-rotating black hole is its Schwarzschild radius, which is proportional to the mass of the black hole. The reason this is non-applicable in stars is because the Schwarzschild radius in stars is deep inside its interior, and there is not a strong enough gravitational field to produce an event horizon to trap any light near it. Thermal pressure reference: https://en.wikipedia.org/wiki/Gravitational_collapse I hope this helps.
{ "domain": "astronomy.stackexchange", "id": 712, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity, black-hole", "url": null }
general-relativity, differential-geometry, metric-tensor, geodesics we can deform these curves into each other in some continuous way, constructing a family (an infinite, and in fact continuous family) of curves, all of which go between the same two points; We can assign a length to each curve in the family, using the metric (which defines the curvature as well). And now we can find the curve which is shortest from the family of curves, and this curve is a geodesic connecting the two points. This curve is the equivalent of a straight line. So, I've skated over a bunch of things here: the metric of GR is technically a pseudometric and this means that in most interesting cases (timelike geodesics) you actually want to find the longest curve; the shortest (longest) curves may not be unique; there is another notion of straight line which is a curve which is (locally) parallel to itself (technically if you drag the tangent vector to the curve along it, it remains a tangent vector to the curve) -- in GR these curves are the same curves defined by being extrema of length. There is a lot of other detail I have omitted here -- I'm trying not to drown you in detail -- but I hope this gets the idea across.
{ "domain": "physics.stackexchange", "id": 29914, "lm_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, differential-geometry, metric-tensor, geodesics", "url": null }
beginner, go, http, server Title: Go web application with a mock user repository I'm new to go and struggling to create structure of web application. I read about clean architecture and Ben Johnsons blog post about package layout. Now i want to put it all together. This is just scratch. Service abstraction looks redundant but in real project there will be services that contains more than one repository. What is your opinion in structuring project like this? And how i bootstrap it together. import ( "fmt" "html/template" "log" "net/http" "strconv" ) type user struct { name string } type userRepository interface { getByID(id int) (*user, error) } type userService struct { userRepository userRepository } func (us *userService) findUser(id int) (*user, error) { return us.userRepository.getByID(id) } type mockUserRepo struct{} func (mr *mockUserRepo) getByID(id int) (*user, error) { return &user{"John Doe"}, nil } type safeHandlerFunc func(http.ResponseWriter, *http.Request) error type mainHandler struct { //session //logger view *template.Template } func (h *mainHandler) handle(sh safeHandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { w.Header().Set("x-custom-header", "random") if err := sh(w, r); err != nil { //return some error view //log error http.Error(w, err.Error(), http.StatusInternalServerError) return } } } type userHandler struct { *mainHandler userService *userService }
{ "domain": "codereview.stackexchange", "id": 29266, "lm_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, go, http, server", "url": null }
gazebo, simulation, ros-melodic, ur10, robot Title: Simulation deteriorates over time, robot arms do not go to the same position Hi! I'm currently running a ROS network (ROS Melodic, Ubuntu 18.04) using the ARIAC 2019 simulation interface. I have the competition going on a loop, and two UR10 arms that run on independent threads. In the beginning of the Gazebo simulation, the robot arms pick up the parts on the conveyor belt just fine, but over time, they don't seem to go back to the same position. In fact, three minutes into the simulation, the robot arm hardly ever picks up parts even though it's the same code, just running on a loop. After checking the topic that contains the arms' joint states, I've come to the conclusion that the arm doesn't reach the same position as I'm specifying when publishing to the topic. Has anyone else experienced something similar? (i.e. after running a simulation on Gazebo where the robot actions are all looped/the same, the behavior is not consistent/deviates more and more away from expected/preferred behavior)
{ "domain": "robotics.stackexchange", "id": 35375, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, simulation, ros-melodic, ur10, robot", "url": null }
return(ev_tau) } ev_max_geo(n = 1600, q = 0.5) ## [1] 11.97705 The solution is, rounding, 12! We can go a little bit further with R and verify via Monte Carlo that this is correct. We can simulate $$10,000$$ experiments each starting with $$1600$$ coins ruin_exp <- function(n, q, max_k = 1e5){ k <- 0 while(n > 0 && k <= max_k){ n <- rbinom(1, size = n, prob = q) k <- k + 1 } return(k) } set.seed(220206) tau <- rep(NA, 10000) for(i in seq_along(tau)){ tau[i] <- ruin_exp(n = 1600, q = 0.5) } summary(tau) ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 8.00 11.00 12.00 11.96 13.00 27.00 In fact, we have the following approximation to the distribution of $$\tau$$: library(ggplot2) library(fazhthemes) hist_tau <- ggplot(data = data.frame(tau = tau), aes(x = tau, y=..density..)) + geom_histogram(fill = "steelblue4", color = "steelblue4", alpha = 0.3, binwidth = 1, center = 0) + geom_vline(xintercept = 12, color = "chocolate2") + labs(x = "Rounds", y = "Density", title = "Number of rounds before running out of heads", subtilte = "starting with 1600 fair coins") + scale_x_continuous(breaks = 0:max(tau)) + lucify_theme_classic() plot(hist_tau)
{ "domain": "fazepher.me", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9891815503903563, "lm_q1q2_score": 0.822151368676656, "lm_q2_score": 0.8311430478583168, "openwebmath_perplexity": 483.4831218388756, "openwebmath_score": 0.9218857288360596, "tags": null, "url": "https://www.fazepher.me/post/2022-02-06_wstats_puzzle_01/" }
The subspace $\Sigma(\omega_1)$ is the $\Sigma$-product of $\omega_1$ many copies of the real line $\mathbb{R}$. The $\Sigma$-product of separable metric spaces is monolithic (see here). The $\Sigma$-product of first countable spaces is Frechet-Urysohn (see here). Thus $\Sigma(\omega_1)$ has both of these properties. Since the properties of monolithicity and being Frechet-Urysohn are carried over to subspaces, the function space $C_p(\omega_1+1)$ has both of these properties. The key to the discussion is then to show that $C_p(\omega_1+1)$ is homeopmophic to a subspace of the $\Sigma$-product $\Sigma(\omega_1)$. ____________________________________________________________________ Connection to $\Sigma$-product We show that the function space $C_p(\omega_1+1)$ is homeomorphic to a subspace of the $\Sigma$-product of $\omega_1$ many copies of the real lines. Let $Y_0$ be the following subspace of $C_p(\omega_1+1)$: $Y_0=\left\{f \in C_p(\omega_1+1): f(\omega_1)=0 \right\}$ Every function in $Y_0$ has non-zero values at only countably points of $\omega_1+1$. Thus $Y_0$ can be regarded as a subspace of the $\Sigma$-product $\Sigma(\omega_1)$.
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.982013792143467, "lm_q1q2_score": 0.8028694095441469, "lm_q2_score": 0.8175744739711883, "openwebmath_perplexity": 132.8723141429801, "openwebmath_score": 0.9472842812538147, "tags": null, "url": "https://dantopology.wordpress.com/category/compact-space/" }
pressure, fluid-statics, vacuum, buoyancy, lift $$ \Delta E = 4\pi dR \left( P((R+a)^2-R^2) - 1\text{atm}(R+a)^2 \right) $$ If $\Delta E < 0$, the device will be crushed down to a smaller size by atmospheric pressure. Thus, in order to have the device be stable, the following inequality must be satisfied. $$ \Delta E = 4\pi dR \left( P((R+a)^2-R^2) - 1\text{atm}(R+a)^2 \right) \geq 0 $$ Therefore: $$ P \geq 1\text{atm} \frac{(R+a)^2}{(R+a)^2-R^2} $$ Now let's compute the mass of this thing. Suppose that the density of air at atmospheric pressure is $\rho$. The total mass of air displaced by your balloon will be: $$ \frac{4\pi}{3}\rho(R+a)^3 $$ On the other hand, the mass of the balloon, ignoring the mass of the balloon fabric, will be: $$ \rho \frac{P}{1\text{atm}} \frac{4\pi}{3} ((R+a)^3-R^3) $$ (Since density is proportional to pressure.) This is equal to: $$ \frac{4\pi}{3} \rho ((R+a)^3-R^3) \frac{(R+a)^2}{(R+a)^2-R^2} $$ $$ =\frac{4\pi}{3} \rho (R+a)^3 \frac{(R+a)^3-R^3}{(R+a)^3} \frac{(R+a)^2}{(R+a)^2-R^2} $$ $$
{ "domain": "physics.stackexchange", "id": 60998, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pressure, fluid-statics, vacuum, buoyancy, lift", "url": null }
End of proof for all non-square $n$. The following simple Mathematica script will generate single $a,b$ for fairly big non-square $n$ very fast (it follows the proof, word by word): ABPair[n_] := Module[ {x, y, a, b, a1, b1, a2, b2}, pellSolutions = Solve[x^2 - n y^2 == 1, {x, y}, Integers] /. C[1] -> 1; pellSolutions = {x, y} /. pellSolutions; {a1, b1} = First[Select[pellSolutions, #[[1]] > 0 && #[[2]] > 0 &, 1]]; {a2, b2} = If[Mod[a1, 2 n] == 1 && Mod[b1, 2] == 0, {a1, b1}, {a1^2 + n b1^2, 2 a1 b1}]; a = (n (a2 + 1) - b2)/2; b = (b2 n^2 - a2 + 1)/(2 n); {a, b, (a^2 + b)/(b^2 + a)} ]; For example: ABPair[5613] {60584278414870816497213, 808653403020126409200, 5613} The third number is just a check that the calculated numbers are valid. In other words: $$\frac{60584278414870816497213^2+808653403020126409200}{60584278414870816497213+808653403020126409200^2}=5613$$ The script is lightning fast even for $n$ with 12 digits: ABPair[561044335534] See Sil's solution for quadratic $n$. Case closed :)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.989347490102537, "lm_q1q2_score": 0.8428773588753683, "lm_q2_score": 0.8519527944504227, "openwebmath_perplexity": 454.4931966335784, "openwebmath_score": 0.9150367379188538, "tags": null, "url": "https://math.stackexchange.com/questions/2802933/prove-or-disprove-that-for-any-n-in-mathbbn-there-exist-a-b-in-math" }
thermodynamics, energy, statistical-mechanics, entropy, calculus $$ where the label $0$ means that the partial derivatives have been evaluated at $(x_0,y_0,z_0)$. From this definition, it is immediate to see that $(x-x_0)=dx$, and similarly for $dy$ and $dz$. From the definition and recalling Leibnitz's rule for the derivative of a product, it follows that $$ d(f\cdot g)=f\cdot dg+g \cdot df $$ for every pair of functions $f$ and $g$. In particular, if $f$ is the function assigning $x$ to a point $(x,y,z)$, it is clear that $$ d(x\cdot f)= f\cdot dx + x \cdot df $$ i.e., the differential of the independent variable $x$ does appear (and does not vanishes). Regarding the change of variables, as physicists, we tend to be sloppy with mathematical notation. Strictly speaking, a change of variables, like the case of passing from $E(S,V,N)$ to $E(T,V,N)$, introduces a new function, and it is quite misleading to use the same symbol for both. Just as an illustration, let's consider the case of $$ E(S) = S^4 $$ We introduce $T=\frac{dE}{dS}=4S^3$, that can be inverted to give $S=\left(T/4\right)^{\frac13}$. Expressing $E$ as a function of $T$ gives $$ E(S(T))=\left( \frac{T}{4} \right)^{\frac43}. $$
{ "domain": "physics.stackexchange", "id": 91398, "lm_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, energy, statistical-mechanics, entropy, calculus", "url": null }
cc.complexity-theory, circuit-complexity, sat, context-free variables are expressed with the regular expression $d = (+|-)1(0|1)^*$ and that the (regular) language (over $\Sigma = \{0,1,+,-,\land,\lor\})$ used to represent CNF formulas is: $S = \{ d^+ (\lor d^+)^*(\land (d^+ (\lor d^+)^*))^* \}$; just note that $S$ grabs all well-formed CNF formulas up to variable renaming. For example $\varphi = (x_1 \lor x_2) \land -x_3$ is written as: $s_{\varphi} = +1 \lor +10 \land -11 \in S$ (the $\lor$ operator has the precedence over $\land$). Suppose that $L = \{ s_{\varphi} \in S \, \mid $ s.t. the corresponding formula $\varphi$ is satisfiable $\}$ is CF . If we intersect it with the regular language: $R = \{ +1^a \land -1^b \land -1^c \mid a,b,c > 0 \}$ we still get a CF language. We can also apply the homomorphism: $h(+) = \epsilon$, $h(-) = \epsilon$ and the language remains CF. But the language we obtain is: $L' = \{ 1^a \land 1^b \land 1^c \mid a \neq b, a \neq c\}$, because if $a=b$ then "source" formula is $+x_a \land -x_a \land -x_b$ which is unsatisfiable (similarly if $a=c$). But $L'$ is a well known non CF language $\Rightarrow$ contradiction.
{ "domain": "cstheory.stackexchange", "id": 3848, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, circuit-complexity, sat, context-free", "url": null }
python, optimization, algorithm, primes The code given below illustrates some of the points made here. import math, timeit def is_prime_new_slowest(n): if n < 2: return False if n == 2 or n == 3: return True if n%2 == 0 or n%3 == 0: return False sqr = math.sqrt(n) #This is insignificant as it is outside the loop if sqr == int(sqr): return False sqrtp1 = sqr + 1 #Note that sqrtp1 is a float i = 1 while i*6 < sqrtp1: # Comparison of floats adds some time if n % (i*6-1) == 0 or n % (i*6+1) == 0: return False #Unnecessary arithmetic i += 1 return True def is_prime_new_slow(n): if n < 2: return False if n == 2 or n == 3: return True if n%2 == 0 or n%3 == 0: return False sqrtp1 = int(math.sqrt(n) + 1) i = 6 while i < sqrtp1: if n % (i-1) == 0 or n % (i+1) == 0: return False i += 6 return True def is_prime_new_fast(n): if n < 2: return False if n == 2 or n == 3: return True if n%2 == 0 or n%3 == 0: return False sqrtp1 = int(math.sqrt(n)+1) for i in xrange(6, sqrtp1, 6): if n % (i-1) == 0 or n % (i+1) == 0: return False return True def is_prime_old_slow(n): if n < 2: return False if n == 2: return True if n%2 == 0: return False sqrtp1 = int(math.sqrt(n) + 1) i = 3 while i < sqrtp1: if not n%i: return False i += 2 return True
{ "domain": "codereview.stackexchange", "id": 2832, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, optimization, algorithm, primes", "url": null }
parsing, r 80 /T (node2) 81 >>] 82 /T (hierarchy) 83 >> 84 << 85 /V () betweenHierarch 86 /T (betweenHierarch) 87 >> 88 << 89 /V /Off RadioGroup 90 /T (RadioGroup) 91 >> 92 << 93 /V /Off checkBox 94 /T (checkBox) 95 >>] 96 >> 97 >> 98 endobj 99 trailer 100 101 << 102 /Root 1 0 R 103 >> 104 %%EOF I tried to wrap my head around this file format (what a weird one?!) and came to the realization that it is a lot easier to build the tree structure if you read the file from the bottom-up, would you agree? Based on that, I came up with this much simpler implementation where I only maintain a stack (last in, first out) of field names. The output is the same for your example data and I hope I did not miss anything. fdfAnnotate <- function(fdfLines) { fields <- vector(length = length(fdfLines), mode = "character") store <- NULL for (i in rev(seq_along(fdfLines))) { line <- fdfLines[i] if (grepl("/V", line)) { fields[i] <- paste(store, collapse = ".") store <- head(store, -1) } else if (grepl("/T [(]", line)) { name <- sub(".*[(](.*)[)].*", "\\1", line) store <- c(store, name) } else if (grepl("/Kids \\[", line)) { store <- head(store, -1) } } data.frame(fdfLines, fields, stringsAsFactors = FALSE) }
{ "domain": "codereview.stackexchange", "id": 33291, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "parsing, r", "url": null }
programming-languages, education, typing, research Title: How can I explain to my parents that I study programming languages? I am currently finishing my MSc in computer science. I am interested in programming languages, especially in type systems. I got interested in research in this field and next semester I will start a PhD on the subject. Now here is the real question: how can I explain what I (want to) do to people with no previous knowledge in either computer science or related fields? The title comes from the facts that I am not even able to explain what I do to my parents, friends and so on. Yeah, I can say "the whole point is to help software developers to write better software", but I do not think it is really useful: they are not aware of "programming", they have not clue of what it means. It feels like I am saying I am an auto mechanic to someone from the Middle Ages: they simply do not know what I am talking about, let alone how to improve it. Does anyone have good analogies with real-world? Enlightening examples causing "a-ha" moments? Should I actually show a short and simple snippet of code to 60+ year-old with no computer science (nor academic) experience? If so, which language should I use? Did anyone here face similar issues? If you have a few minutes, most people know how to add and multiply two three-digit numbers on paper. Ask them to do that, (or to admit that they could, if they had to) and ask them to acknowledge that they do this task methodically: if this number is greater than 9, then add a carry, and so forth. This description they just gave of what to do that is an example of an algorithm. This is how I teach people the word algorithm, and in my experience this has been the best example. Then you can explain that one may imagine there are more complex tasks that computers must do, and that therefore there is a need for an unambiguous language to feed a computer these algorithms. So there has been a proliferation of programming languages because people express their thoughts differently, and you're researching ways to design these languages so that it is harder to make mistakes.
{ "domain": "cs.stackexchange", "id": 8986, "lm_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-languages, education, typing, research", "url": null }
# How can you prove that $1+ 5+ 9 + \cdots +(4n-3) = 2n^{2} - n$ without using induction? Using mathematical induction, I have proved that $$1+ 5+ 9 + \cdots +(4n-3) = 2n^{2} - n$$ for every integer $n > 0$. I would like to know if there is another way of proving this result without using PMI. Is there any geometric solution to prove this problem? Also, are there examples of problems where only PMI is our only option? Here is the way I have solved this using PMI. Base Case: since $1 = 2 · 1^2 − 1$, the formula holds for $n = 1$. Assuming that the formula holds for some integer $k ≥ 1$, that is, $$1 + 5 + 9 + \dots + (4k − 3) = 2k^2 − k$$ I show that $$1 + 5 + 9 + \dots + [4(k + 1) − 3] = 2(k + 1)^2 − (k + 1).$$ Now if I use hypothesis I observe. \begin{align} 1 + 5 + 9 + \dots + [4(k + 1) − 3] & = [1 + 5 + 9 + \dots + (4k − 3)] + 4(k + 1) −3 \\ & = (2k^2 − k) + (4k + 1) \\ & = 2k^2 + 3k + 1 \\ & = 2(k + 1)^2 − (k + 1) \end{align} $\diamond$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854120593484, "lm_q1q2_score": 0.8476673453138205, "lm_q2_score": 0.8740772286044094, "openwebmath_perplexity": 434.2709530743684, "openwebmath_score": 0.9760461449623108, "tags": null, "url": "https://math.stackexchange.com/questions/1802846/how-can-you-prove-that-1-5-9-cdots-4n-3-2n2-n-without-using-ind/1803633" }
c#, design-patterns, entity-framework Generic repository Below is the implementation of the IRepository for my web app, I think it has a pretty standard structure. I swap this out for another implementation when testing the service classes. I don't think there is much to say about it other than what i mentioned above. internal class RepositoryBase<TEntity> : IRepository<TEntity> where TEntity : class { private bool isDisposed; private DbSet<TEntity> dbSet; public DbSet<TEntity> DbSet { get { return dbSet; } } private RequestboxEntities requestboxContext; public RepositoryBase(RequestboxEntities requestboxContext) { this.requestboxContext = requestboxContext; this.dbSet = requestboxContext.Set<TEntity>(); } public IQueryable<TEntity> GetAll() { return dbSet; } public IQueryable<TEntity> GetWhere(System.Linq.Expressions.Expression<Func<TEntity, bool>> predicate) { return dbSet.Where(predicate); } public TEntity GetSingle(System.Linq.Expressions.Expression<Func<TEntity, bool>> predicate) { return dbSet.Single(predicate); } public TEntity GetSingleOrDefault(System.Linq.Expressions.Expression<Func<TEntity, bool>> predicate) { return dbSet.SingleOrDefault(predicate); } public void Add(TEntity entity) { dbSet.Add(entity); } public void Delete(TEntity entity) { dbSet.Remove(entity); } public virtual void Dispose(bool isManuallyDisposing) { if (!isDisposed) { if (isManuallyDisposing) requestboxContext.Dispose(); } isDisposed = true; } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } ~RepositoryBase() { Dispose(false); } }
{ "domain": "codereview.stackexchange", "id": 7201, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, design-patterns, entity-framework", "url": null }
c#, lookup Edit The code inside the loop is this one (in this case I don't even omit code as I'm not sure if it's possible what you suggest p.s.w.g). I am using reflection as only some of the classes that inherit from plan have the ProviderId property. foreach (var plan in plans) { var offeringDetail = new OfferingDetail(); if (plan.GetType() == typeof (OwnedProductSummary)) { var productSummary = plan as OwnedProductSummary; offeringDetail = _offeringBLL.GetById(productSummary.OfferingID); } if (plan.GetType() == typeof (OwnedServiceSummary)) { var serviceSummary = plan as OwnedServiceSummary; offeringDetail = _offeringBLL.GetById(serviceSummary.OfferingID); } // For the other types of summary will be 0 var providerId = offeringDetail.ProviderID; offeredPlans .Add(new Tuple<int, string>(providerId, plan.Name)); } Once you've gotten your code into a ILookup you can just call Item property (which in C# is called with [...]) to get all values with a given key. So the Check can be entirely replaced by using the ILookup like this: ILookup<int, string> plansLookup = ... IEnumerable<string> plansForProvider = plansLookup[providerId]; // Finds all plans for this provider
{ "domain": "codereview.stackexchange", "id": 3635, "lm_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#, lookup", "url": null }
dwarf-planets Title: What is the percent flattening in Haumea? I've recently noticed that in Wikipedia articles such as Pluto (Link), there's this number that says how much flattened it is (Definition Here). In Pluto, it's >1%. Haumea, which is a very flattened dwarf planet, actually doesn't have this information on Wikipedia, and I haven't been able to find it online. It would be great if someone could find this info (and it's source as well), because I can't seem to find it anywhere. Thanks in advance! That would be because Haumea is a Triaxial ellipsoid. It's dimensions are different in every cardinal direction. The term 'flattening' only makes sense for the biaxial ellipsoids, because two of the axes are the same and one is different (in the case of Pluto, the equatorial axis is 1% larger, hence 1% flattened). The concept of 'flattened' doesn't make terribly much sense when all three axes are different. Haumea's axis ratios are approximately 1 : 0.75 : 0.5, if that's the information you're after.
{ "domain": "astronomy.stackexchange", "id": 3235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dwarf-planets", "url": null }
c#, beginner, console, tic-tac-toe I would inline the variable you called torf and declare playerInput in a out variable declaration like this. if (Int32.TryParse(Console.ReadLine(), out int playerInput) && playerInput is >= 1 and <= 9) { playerInput--; // Make it a 0-based index. ... } I used pattern matching to test if the value is in a valid range. But you can replace it by a classic Boolean expression if you prefer or if you are using a pre C# 9.0 version. You differentiate two cases doing the same with a small exception (shown with the new identifiers): if (player == 0) { board[playerInput] = "x"; SwitchPlayer(); PrintBoard(); WinCondition(); Tie(); } else { board[playerInput] = "o"; SwitchPlayer(); PrintBoard(); WinCondition(); Tie(); } This can easily be simplified by declaring a new field playerMark as array. Since we're at it, we can do the same for player names. This saves us the base-0 to base-1 conversion of player numbers for display and could easily be extended to store real names. static readonly char[] playerMark = { 'x', 'o' }; static readonly string[] playerName = { "1", "2" }; It becomes board[playerInput] = playerMark[player]; PrintBoard(); WinCondition(); Tie(); SwitchPlayer(); // Doing this after printing winner! Even without this new static field, you could move all but the first line out of the if-else statement, since they are exactly the same in both cases: if (player == 0) { board[playerInput] = 'x'; } else { board[playerInput] = 'o'; } PrintBoard(); WinCondition(); Tie(); SwitchPlayer();
{ "domain": "codereview.stackexchange", "id": 40783, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, console, tic-tac-toe", "url": null }
machine-learning, probability, decision-theory, probability-distribution Title: Why is the entire area of a join probability distribution considered when it comes to calculating misclassification? In the image given below, I do not understand a few things 1) Why is an entire area colored to signify misclassification? For the given decision boundary, only the points between $x_0$ and the decision boundary signify misclassification right? It's supposed to be only a set of points on the x-axis, not an area. 2) Why is the green area with $x < x_0$ a misclassification? It's classified as $C_1$ and it is supposed to be $C_1$ right? 3) Similarly, why is the blue area a misclassification? Any $x >$ the decision boundary belongs to $C_2$ and is also classified as such... The misclassifications that could arise if $\hat{x}$ is used as decision boundary are: a) Classifying a point as $C_2$ when actually it was $C_1$ -- which will only happen when $x > \hat{x}$ as only the points greater than $\hat{x}$ are being classified as $C_2$. b) Classifying a point as $C_1$ when actually it was $C_2$ -- which will only happen when $x < \hat{x}$ as only the points less than $\hat{x}$ are being classified to be from class $C_1$. 2) Why is the green area with x < x0 a misclassification? If we label a point -- the $x$ which is from the interval on the horizontal axis which corresponds to the green area -- which is a probability as being from either class then there is a good chance that it could be misclassified. This is because both the joint distributions' curves are above the axis for that interval on the axis and have some area (probability) for that interval on the horizontal axis. There is a positive probability that a point that was drawn from the interval (a subset of the sample space, an event), which corresponds to the green area, was drawn from either of the two joint distributions or belongs to either of the two classes $C_1$ and $C_2$. The probability is the area under the curve.
{ "domain": "ai.stackexchange", "id": 1311, "lm_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, probability, decision-theory, probability-distribution", "url": null }
c++, parsing for (auto token: tokenize(sample)) { std::cout << token << '\n'; } } You can do this by making a function tokenize() that returns a class that has two functions, begin() and end(), that both return a token iterator. Here is a possible way to do this: class TokenRange { std::string_view data; public: class Iterator { std::string_view data; public: Iterator(std::string_view data = {}): data(data) {} Iterator& operator++(); std::string_view operator*() const; friend bool operator==(const Iterator&, const Iterator&) = default; }; TokenRange(std::string_view data): data(data) {} Iterator begin() { return Iterator(data); } Iterator end() { return {}; } };
{ "domain": "codereview.stackexchange", "id": 45417, "lm_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++, parsing", "url": null }
magnetic-monopoles, dirac-string, dirac-monopole Title: Dirac string on (periodic) compact space For a non-compact space, the Dirac string can be defined as a line joining the Dirac monopole to infinity (or another Dirac monopole). The region where the gauge connection is ill-defined. (as can be seen in Goddard and Olive's review) But, for a (periodic) compact space, How could I define the Dirac string on this space, since there is no “infinity”? In a compact orientable space the total magnetic charge (or electric change for that matter) must be zero by Gauss's law. All the magnetic field lines leaving the monopoles must go somewhere, so they collect on equal amount of anti-monopoles. The proof of the statement is simple--- you take a small sphere with no magnetic charge inside, and consider it the boundary of what you would locally call the outside region. The total charge on the outside must be zero too. When the net magnetic charge is zero, the Dirac string can be chosen consistently to end on magnetic charge. When the space is not orientable, the argument applies to its double-cover, so that the Dirac string can go between monopoles and their complementary image. A non-orientable space itself must be covered by several overlapping charts, and in the case of a nonorientable space, you can make the Dirac string be on one chart and not be on another. To see that the cases I am talking about are not vacuous, consider a Klein bottle cross a circle, (a periodic box in x,y,z of unit size, with the x-coordinate identified in the opposite sense across the period). The double cover is the torus. Then place a single magnetic charge at the center of the Klein bottle. The magnetic field changes sign under a reflection of a coordinate perpendicular to the field, and maintains its sign under a reflection of the coordinate parallel to the field direction (this strange behavior becomes obvious if you consider the magnetic field as a 2-index antisymmetric tensor). So the magnetic field of a monopole in the Klein bottle cross a circle is consistent--- it is the same as the magentic field of a monopole and anti-monopole in the torus double-cover.
{ "domain": "physics.stackexchange", "id": 2177, "lm_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-monopoles, dirac-string, dirac-monopole", "url": null }
Solution ## Using the section formula, if a point $$(x,y)$$ divides the line joining the points $$({ x }_{ 1 },{ y }_{ 1 })$$ and $$({ x }_{ 2 },{ y }_{ 2 })$$ in the ratio $$m:n$$, then $$(x,y) = \left( \dfrac { m{ x }_{ 2 } + n{ x }_{ 1 } }{ m + n },\dfrac { m{ y }_{ 2 } + n{ y }_{ 1 } }{ m + n } \right)$$Point $$P(9a - 2 , -b)$$ divides the line segment joining the points $$A(3a + 1 , -3)$$ and $$B(8a , 5)$$ in the ratio $$3 : 1$$ . But , the coordinates of $$P$$ are $$(9a - 2 , -b )$$ . Using section formula , we have $$9a - 2 = \dfrac{3(8a) + 1 (3a + 1)}{3 + 1}$$ $$= \dfrac{24a + 3a + 1}{4}$$ $$\Rightarrow \,36 a - 8 = 27 a + 1$$ $$\Rightarrow \,36a - 27a = 8 + 1$$ $$\Rightarrow \,9a = 9$$ $$\Rightarrow \,a = \dfrac{9}{9} = 1$$ And$$-b = \dfrac{3(+5) + 1(-3)}{3 + 1}$$ $$\Rightarrow \,-b = \dfrac{+15 - 3}{4} = \dfrac{12}{4}$$ $$\Rightarrow \,b = -3$$ Hence , $$a = + 1$$ and $$b = -3$$  Mathematics Suggest Corrections 0 Similar questions View More People also searched for View More
{ "domain": "byjus.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462187092608, "lm_q1q2_score": 0.8122786490196279, "lm_q2_score": 0.8221891370573386, "openwebmath_perplexity": 103.12603702424761, "openwebmath_score": 0.804653525352478, "tags": null, "url": "https://byjus.com/question-answer/if-point-p-9a-2-b-divides-the-line-segment-joining-the-points-a-3a/" }
This same subgroup $G'$ can be defined as the subgroup of $G$ generated by all the commutators $[x,y]=xyx^{-1}y^{-1}$. Notice that groups exist (though it's not easy to find an example) where the set of all commutators is strictly smaller than the commutator subgroup. So, to answer your question, the set of all commutators is generally not called the commutator subgroup. - The names "conmutator subgroup" or "derived subgroup" refer to the subgroup generated by the commutator set of the group and generally $G'$ or $[G,G]$ denote this subgroup generated by the set of commutators and not the set itself. - We all have to admit that the name "commutator subgroup" is badly chosen as you already mentioned commutators themselves do not serve a group in general. (I can also support this idea with +1 of one of my professors.) In addition, "commutator subgroup" measures how much non-commutative a group is. - I don't think commutator subgroup is such a bad name. What would you call it? – Ittay Weiss Sep 22 '13 at 11:02 I do not have any idea for an alternative now. But I suppose and observe that this name is sometimes being misleading for beginners. In general, naming is a really hard thing especially in mathematics as it requires a very broad perspective, foreseeing and knowledge. – Metin Y. Sep 22 '13 at 11:12 I disagree that the name is bad. I find it completely logical that the smallest subgroup containing all commutators is called the commutator subgroup. – Tobias Kildetoft Sep 22 '13 at 11:28
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126531738088, "lm_q1q2_score": 0.8259308148215398, "lm_q2_score": 0.8438951025545426, "openwebmath_perplexity": 208.38079114766126, "openwebmath_score": 0.8302231431007385, "tags": null, "url": "http://math.stackexchange.com/questions/501101/why-is-the-set-of-commutators-called-commutator-subgroup" }
qiskit, ibm-q-experience 'name': 'jq_34', 'unit': 'GHz', 'value': 0.0016159955057034297}, {'date': datetime.datetime(2021, 6, 22, 16, 20, 7, tzinfo=tzlocal()), 'name': 'zz_34', 'unit': 'GHz', 'value': -3.547813333704521e-05}, {'date': datetime.datetime(2021, 6, 22, 16, 20, 7, tzinfo=tzlocal()), 'name': 'jq_12', 'unit': 'GHz', 'value': 0.001915672600199012}, {'date': datetime.datetime(2021, 6, 22, 16, 20, 7, tzinfo=tzlocal()), 'name': 'zz_12', 'unit': 'GHz', 'value': -9.390005618575403e-05}]}
{ "domain": "quantumcomputing.stackexchange", "id": 4406, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "qiskit, ibm-q-experience", "url": null }
php, mysql, linux, sqlite //write test: $start = microtime(true); if ($type=='sqlite') //sqlite test { $db = new SQLite3("benchmark.db"); $db->exec('create table temp(t text)'); $db->exec("begin"); $stmt = $db->prepare("insert into temp values(:id)"); for($i=0;$i<$iterations;$i++) { $stmt->bindValue(':id', $payload, SQLITE3_TEXT); $stmt->execute(); //$db->exec("delete from temp"); }; $db->exec("commit"); } else if ($type=='mysql') //mysql test { $mysqli = new mysqli($mysqlserver, $mysqlusername, $mysqlpassword, $mysqldatabase); $mysqli->query('create table temp(t varchar(108000))'); $mysqli->query('begin transaction'); for($i=0;$i<$iterations;$i++) $mysqli->query("insert into temp values('{$payload}')"); $mysqli->query('commit'); } else // Disk I/O { $fname = chr(rand(0,57)+65).chr(rand(0,57)+65).chr(rand(0,57)+65).chr(rand(0,57)+65).'.txt'; for($i=0;$i<$iterations;$i++) file_put_contents($fname,$payload); } $wtime=round((microtime(true) - $start)*1000);
{ "domain": "codereview.stackexchange", "id": 8076, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, mysql, linux, sqlite", "url": null }
python However, there is no difference to what would happen if you just say self.strength = 10 instead of self.change_stat("strength", 10). Regarding the need for global for the player character, there isn't. Just return the chosen class from the character_select function: def character_select(): barbarian = Character("Barbarian", 20, 10, 10) archer = Character("Archer", 10, 20, 10) wizard = Character("Wizard", 10, 10, 20) print("Welcome to TEST TEXT ADVENTURE RPG. Choose a character!") print("(A): " + barbarian.print_stats()) print("(B): " + archer.print_stats()) print("(C): " + wizard.print_stats()) while True: user_answer = input().upper() if user_answer == "A": return barbarian elif user_answer == "B": return archer elif user_answer == "C": return wizard else: print("Invalid input! Try again.") You could make it even nicer if you used a dictionary: from collections import OrderedDict def character_select(): classes = OrderedDict([("A", Character("Barbarian", 20, 10, 10)), ("B", Character("Archer", 10, 20, 10)), ("C", Character("Wizard", 10, 10, 20))]) print("Welcome to TEST TEXT ADVENTURE RPG. Choose a character!") for key, cls in classes.items(): print("({}): {}".format(key, cls.print_stats())) while True: user_answer = input().upper() try: return classes[user_answer] except KeyError: print("Invalid input! Try again.") You can then use it like this in your main function: def main(): player_class = character_select() print(player_class.print_stats())
{ "domain": "codereview.stackexchange", "id": 25293, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
organic-chemistry, reaction-mechanism, carbonyl-compounds Title: Mechanism for decarboxylation Propose a mechanism for the following transformation. I gather that this mechanism might be similar to decarboxylation of keto acids: However, I am unsure of how to begin. In acidic media, the ester carbonyl will be protonated and the carbonyl carbon attacked by a water molecule. The intermediate will have a proton abstracted by a water molecule and the ethoxy group will be protonated (it can happen either by intermolecular reaction with an H3O+ or by an intramolecular reaction with a proton migration from the protonated intermediate after the water attack). The carbonyl is restored and an ethanol molecule leaves the structure. A subsequent proton abstraction by water forms the carboxylic acid, which will then suffer decarboxylation following the mechanism you presented above. (I'm sorry about my ChemDraw, I suck at drawing even on a computer).
{ "domain": "chemistry.stackexchange", "id": 8973, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, reaction-mechanism, carbonyl-compounds", "url": null }
By the intermediate value theorem, there must be an $x$ between $t_+$ and $t_-$ such that $f(x)-\bar{f}=0$, which is the same as $$\int_a^bf(t)\,g(t)\,\mathrm{d}t=\bar{f}\int_a^bg(t)\,\mathrm{d}t=f(x)\int_a^bg(t)\,\mathrm{d}t\tag{3}$$ Let $h(x)$ be an antiderivative of $g(x)$, so that $h'(x)=g(x)$. Then using the substitution $$u=h(t)\Rightarrow du=g(t)\,dt$$ we get $$\int_{h^{-1}(a)}^{h^{-1}(b)}f(t)\,du=f(x)\int_{h^{-1}(a)}^{h^{-1}(b)}du=f(x)(h^{-1}(b)-h^{-1}(a))$$ which we can validate using the IVT for integrals. • Unfortunately, this proof only works for $g(t)>0$ on $[a,b]$, or at best $g(t)=0$ at countably many points, since it relies on $h^{-1}(x)$, which may not exist if $h$ is not 1-1, since it may not be strictly increasing. Marvis' proof is more general. Dec 15 '12 at 23:07
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692318706084, "lm_q1q2_score": 0.8339903125098577, "lm_q2_score": 0.8539127529517043, "openwebmath_perplexity": 50.282521075561824, "openwebmath_score": 0.978905200958252, "tags": null, "url": "https://math.stackexchange.com/questions/259563/how-to-prove-this-mean-value-property-int-ab-ftgtdt-fx-int-ab-gtdt" }
We conclude that the condition ${A_r(p_1,\dots,p_r)}$ is automatically satisfied when ${r+\beta \leq s}$, and so the ${r}$ summand in (23) can be restricted to the range ${r > s - \beta}$. Next, note that if ${d = p_1 \dots p_r \in {\mathcal E}_r}$ for some ${z > p_1 > \dots > p_r}$, then from (20) we have $\displaystyle p_1 \dots p_{r'-1} p_{r'}^{\beta+1} \leq D$ for all ${1 \leq r' < r}$ with the same parity as ${r}$, which implies (somewhat crudely) that $\displaystyle p_1 \dots p_{r'-1} p_{r'}^{\beta} \leq D$ for all ${1 \leq r' < r}$, regardless of parity (note that the ${r'=1}$ case follows since ${p_1 \leq z = D^{1/s} \leq D}$). We rearrange this inequality as $\displaystyle \frac{D}{p_1 \dots p_{r'}} \geq \left( \frac{D}{p_1 \dots p_{r'-1}}\right)^{\frac{\beta-1}{\beta}}$ which iterates to give $\displaystyle \frac{D}{p_1 \dots p_{r-1}} \geq D^{(\frac{\beta-1}{\beta})^{r-1}}.$ On the other hand, from the definition of ${{\mathcal E}_r}$ we have $\displaystyle p_1 \dots p_{r-1} p_r^{\beta+1} > D$ which leads to a lower bound on ${p_r = p_*(d)}$:
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682444653242, "lm_q1q2_score": 0.8012947666000314, "lm_q2_score": 0.8104789155369048, "openwebmath_perplexity": 248.19796379327, "openwebmath_score": 0.9931489825248718, "tags": null, "url": "https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/" }
organic-chemistry, reaction-mechanism, photochemistry The part of the system that reacts isn't just the single excited electron (that would just be a plain old radical reaction). Pericyclic reactions are quite special: they involve the cyclic movement of quite a number of electrons. So, in fact, it is not the single excited electron that reacts: it is the four electrons, three unexcited and one excited, which collectively react. So, the followup question is: why does the "3 unexcited + 1 excited" configuration react (I'll abbreviate that to 3u1e), whereas the "4 unexcited + 0 excited" configuration (4u0e) doesn't react? To truly understand this requires one to delve into MO theory. In particular, you need to understand molecular symmetry and electronic states: it's not the individual electron's states which matter (i.e. which electron is in which orbital†) but rather the total state of the molecule (loosely speaking, the product of all the orbitals). But I will try to give a flavour of the explanation here. The first part of this explanation is given in the form of correlation diagrams, and you may likely find it in the textbooks mentioned above. Essentially, what it says is this: the electronic state of the reactants must "map to", or "transform into", the electronic state of the products. There are many possible states for the reactants: for example, we have 4u0e, 3u1e, 2u2e, ..., and likewise, the electronic states for the product are similar: we have 4u0e, 3u1e, ...‡ It turns out that, based on symmetry arguments, the 4u0e reactant configuration maps to the 2u2e product configuration, which is very much uphill in terms of energy. On the other hand, the 3u1e reactant configuration maps to the 3u1e product configuration. Both are high in energy compared to the ground state, but relatively speaking, they are fairly close, so the activation energy for the forward reaction is not too high, and the reaction can proceed. The tradeoff is that you need to start from an excited state of the reactant, and that's where the light comes in.
{ "domain": "chemistry.stackexchange", "id": 16065, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, reaction-mechanism, photochemistry", "url": null }
php, strings, array Title: Check for correct number of elements in exploded string Let's say I've got this string: $str = '1-2-3'; and I explode this like so: $strSplit = explode('-', $str); what would be the best way to check if I've got the correct number of elements and whether they are numeric (because the input can vary)? Straightforward, I would say something like this: if (isset($strSplit[0]) && is_numeric($strSplit[0]) && isset($strSplit[1]) && is_numeric($strSplit[1]) && isset($strSplit[2]) && is_numeric($strSplit[2]) { // some code } But you could also do: if (count($strSplit) === 3 && is_numeric($strSplit[0]) && is_numeric($strSplit[1]) && is_numeric($strSplit[2])) { // some code } You can use some array functions to check for the is_numeric part, but that seems fussy, less readable and is probably slower. I could be wrong, though... There are several options. My favorite (based on readablity and simplicity) is using array_filter to remove everything that is not a number from the array and then comparing with the original to see if anything changed, then using count to make sure you have the correct number of elements: $str = '1-foo-3'; $strSplit = explode('-', $str); if(count($strSplit) == 3 && $strSplit == array_filter($strSplit, 'is_numeric')){ // array is numeric // run code } else { // array is non-numeric }
{ "domain": "codereview.stackexchange", "id": 7637, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, strings, array", "url": null }
for (unsigned int p_x = 1; p_x <= size; p_x++) for (unsigned int p_y = 1; p_y <= p_x; p_y++) { // reduce to a proper fraction unsigned int factor = gcd(p_x, p_y); unsigned int deltaX = p_x / factor; unsigned int deltaY = p_y / factor; unsigned int found = 0; // assume Q is "below" P int q_x = p_x - deltaY; int q_y = p_y + deltaX; while (q_x >= 0 && q_y <= (int)size) { found++; q_x -= deltaY; q_y += deltaX; } // assume Q is "above" P q_x = p_x + deltaY; q_y = p_y - deltaX; while (q_y >= 0 && q_x <= (int)size) { found++; q_x += deltaY; q_y -= deltaX; } // mirror along y=x when p_y < p_x if (p_x != p_y) found *= 2; result += found; } std::cout << result << std::endl; return 0; } This solution contains 13 empty lines, 15 comments and 2 preprocessor commands. # Benchmark The correct solution to the original Project Euler problem was found in less than 0.01 seconds on an Intel® Core™ i7-2600K CPU @ 3.40GHz. (compiled for x86_64 / Linux, GCC flags: -O3 -march=native -fno-exceptions -fno-rtti -std=gnu++11 -DORIGINAL) See here for a comparison of all solutions. Note: interactive tests run on a weaker (=slower) computer. Some interactive tests are compiled without -DORIGINAL. # Changelog March 15, 2017 submitted solution # Hackerrank My code solves 11 out of 11 test cases (score: 100%) # Difficulty Project Euler ranks this problem at 25% (out of 100%). Hackerrank describes this problem as medium.
{ "domain": "stephan-brumme.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305381464927, "lm_q1q2_score": 0.8262284351256403, "lm_q2_score": 0.8577681068080749, "openwebmath_perplexity": 312.78527714212385, "openwebmath_score": 0.4312850534915924, "tags": null, "url": "https://euler.stephan-brumme.com/91/" }
closed field, $A = k[x, y]$, $B = k[x, y, z]/(x^2-y, z^2-x)$. \item $A = {\mathbf Z}$, $B = {\mathbf Z}[i, 1/(2 + i)]$. \item $A = {\mathbf Z}$, $B = {\mathbf Z}[i, 1/(14 + 7i)]$. \item $k$ is an algebraically closed field, $A = k[x]$, $B = k[x, y, 1/(xy-1)]/(y^2-y)$. \end{enumerate} \end{exercise} \begin{exercise} \label{exercise-image} Let $A$ be a ring. Let $B = A[x]$ be the polynomial algebra in one variable over $A$. Let $f = a_0 + a_1 x + \ldots + a_r x^r \in B = A[x]$. Prove carefully that the image of $D(f)$ in $\Spec(A)$ is equal to $D(a_0) \cup \ldots \cup D(a_r)$. \end{exercise} \begin{exercise} \label{exercise-images} Let $k$ be an algebraically closed field. Compute the image in $\Spec(k[x, y])$ of the following maps: \begin{enumerate} \item $\Spec(k[x, yx^{-1}]) \to \Spec(k[x, y])$, where $k[x, y] \subset k[x, yx^{-1}] \subset k[x, y, x^{-1}]$. (Hint: To avoid confusion, give the element $yx^{-1}$ another name.) \item $\Spec(k[x, y, a, b]/(ax-by-1))\to \Spec(k[x, y])$. \item $\Spec(k[t,
{ "domain": "github.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9873750529474512, "lm_q1q2_score": 0.8026049065130083, "lm_q2_score": 0.8128673133042217, "openwebmath_perplexity": 113.17356744429497, "openwebmath_score": 0.9986513257026672, "tags": null, "url": "https://github.com/stacks/stacks-project/blob/master/exercises.tex" }
acid-base, corrosion, iron As a side question, is there any recommendation on the best possible ways to prevent flash rust? I've seen/read many ideas which I think probably work to varying degrees of success, mainly to get the tank dry as quickly as possible then coat it with an oil/wd40/fogging oil/kerosene. I've just discovered water based corrosion inhibitors and was thinking these might be the ultimate best option, so after going through whatever process I need to, as a final step I would rinse with a corrosion inhibitor? You might want to migrate this question to Motor Vehicle Maintenance and Repair SE for a more practical and less theoretical range of answers. That being said, plain water is sufficient for rinsing out any remaining acetic acid. (It's a gas tank, not lab equipment.) However, unless you take further steps to stop the tank from rusting while in service, your efforts will all be wasted. The tank rusted because of water in fuel, most likely due to condensation of water from humid air as the tank "breathes". You now have bare, clean steel with no protection from future rust. Forget the oil / kerosene / what have you. Its protective effect will last only until the first fuel-up, when the gasoline will dissolve it. I suggest that you coat the interior of the tank with a product that is designed for the purpose, such as POR-15 Fuel Tank Sealer. I've used it. It works. It will completely coat the inside of the tank with a hard polymer coating that is impervious to fuel and water, and it will prevent any future rust.
{ "domain": "chemistry.stackexchange", "id": 17013, "lm_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, corrosion, iron", "url": null }
analytical-chemistry, mass-spectrometry To calculate the specific $M/M+2$ ratio for a molecule containing only $n$ carbon atoms, all you need is to get the ratio for first and third terms in the binomial: $\begin{equation} \begin{aligned} (0.989\times m[^{12}C] + 0.011\times m[^{13}C])^n ={} & \ \ \ \ \ \color{#0000ff}{ \binom {n} {0}(0.989\times m[^{12}C])^n} \\ & + \binom {n} {1}(0.989\times m[^{12}C])^{n-1} \times (0.011\times m[^{13}C]) \\ & + \color{#0000ff}{\binom {n} {2}(0.989\times m[^{12}C])^{n-2} \times (0.011\times m[^{13}C])^2} \\ & +\ ...\\ \end{aligned} \end{equation}$ The ratio is then: $$\frac{\binom {n} {0}0.989^n}{\binom {n} {2}0.989^{n-2} \times 0.011^2}=\frac{2\times 0.989^2}{n(n-1)\times 0.011^2}$$ Technically this only holds if there are no other elements which contain multiple isotopes, though it will hold approximately if the other elements only have very rare alternate isotopes, such as hydrogen (99.98% hydrogen-1, 0.02% hydrogen-2).
{ "domain": "chemistry.stackexchange", "id": 9317, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "analytical-chemistry, mass-spectrometry", "url": null }
computer-architecture, memory-management, simulation, memory-hardware Title: Is it reasonable to model row buffers in DRAM corresponding to the same bank ID as one big row buffer? I'm creating a simple row buffer simulator to go along with a simple cache simulator in order to count hits and misses in the row buffer. Whenever a cache block isn't in the cache I want to go look for it in the row buffers of the main memory and record whether it is present of not. How accurate would it be to have just one long "row buffer" struct containing all the data found in all the individual row buffers of each corresponding bank in each DRAM chip? Say that each chip has 8 banks, I would then have to create 8 of these extra long row buffers to simulate these chips. This idea is based on the understanding that all these chips work in unison, so that if I want to load the cache block at address 0, the row buffers of bank 0 in each chip would fill with data from addresses starting at address 0 in chip 0, and ending at address 0 + (length of row buffer * number of DRAM chips) in the last chip. It would assume a row interleaved address mapping (with consecutive rows in consecutive banks) for simplicity's sake. Are there any major misunderstandings about how DRAM works that causes this to be a very bad way to model row buffer behavior or is this a reasonable simplification? I'd also like to underscore that simplicity is the main goal here. EDIT added clarification on question posted in comments below:
{ "domain": "cs.stackexchange", "id": 14322, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computer-architecture, memory-management, simulation, memory-hardware", "url": null }
python, numpy, simulation, clustering, matplotlib ''' This Function generates evenly spaced points within the given GeoDataFrame. The parameter 'spacing' defines the distance between the points in coordinate units. ''' # Get the bounds of the polygon minx, miny, maxx, maxy = polygon.bounds # Now generate the entire grid x_coords = list(np.arange(np.floor(minx), int(np.ceil(maxx)), spacing)) y_coords = list(np.arange(np.floor(miny), int(np.ceil(maxy)), spacing)) grid = [Point(x) for x in zip(np.meshgrid(x_coords, y_coords)[0].flatten(), np.meshgrid(x_coords, y_coords)[1].flatten())] # Finally only keep the points within the polygon list_of_points = [point for point in grid if point.within(polygon)] return list(zip([point.x for point in list_of_points],[point.y for point in list_of_points]))
{ "domain": "codereview.stackexchange", "id": 35483, "lm_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, simulation, clustering, matplotlib", "url": null }
c, unix // +1 for the NULL terminator. return build_string(p_head, string_length + 1); } if (string_length == 0) { // Initialize list. p_head = p_tail = (char_node_t*) malloc(sizeof(char_node_t)); p_head->c = current_character; p_head->p_next = p_tail->p_next = NULL; } else { // Append one character node to the list. p_tmp = (char_node_t*) malloc(sizeof(char_node_t)); p_tmp->c = current_character; p_tmp->p_next = NULL; p_tail->p_next = p_tmp; p_tail = p_tmp; } ++string_length; } } /******************************************************************************* * Processes a file. * *******************************************************************************/ static void process_file(FILE* file) { char* line; while ((line = my_getline(file))) { puts(trim_inplace(line)); free(line); } fclose(file); }
{ "domain": "codereview.stackexchange", "id": 12932, "lm_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, unix", "url": null }
c++, linked-list, iterator const_iterator begin() const; const_iterator end() const; Notice the extra const on the end of the function name. This is an indication that this call will not modify the object so the compiler will allow this method to be called when the object is const (ie actually const or being accessed via a const reference). The iterator returned from these calls should also be slightly different from normal iterators in that they can read from the container but will not allow modification of the container. Third thing to note is the use of void. This is uncommon in C++ (it means the same but is rarely used (best to not use it but not going to make any difference if you do)). Note this is different from the C meaning of void as a parameter. Sentential Your use of sentenals is fine for simple types of T. But will not work for anything with a complex constructor. You should have a different object that does not have the T data load for your sentential. Also most implementations only use a single sentential object. The pointers of the sentinel wrap around to point at itself. This way begin always points to the first element (or the sentinel if it is empty). While end always points at the sentinel. Then sentinel->next is the first element while sentinal->last is the last element (which could be itself if there are no elements). If that was confusing I provide an example here. https://codereview.stackexchange.com/a/28393/507 elem_iter It looks good (I have not read in detail). But it is a bit more complex than it needs to be. If you change your implementation to use a single sentinel then your iterator becomes much simpler. Identifiers Quick note on identifiers. User defined types usually (and people could argue against this) have an initial uppercase letter. This makes it easy to identify user defined types over objects. If I was going to do it here is where I would start: Empty List ############# /-># sentenal #<-\ \--#Prev Next#--/ #############
{ "domain": "codereview.stackexchange", "id": 13004, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, linked-list, iterator", "url": null }
though they are misnomers, since the prefix arc is the abbreviation for arcus, while the prefix ar stands for area. \Lleftarrow, \longleftarrow Detail Value; Name: dot product: Description: Function symbol \precnsim Export (png, jpg, gif, svg, pdf) and save & share" The dot product of the vectors \vc{a} (in blue) and \vc{b} (in green), when divided by the magnitude of \vc{b}, is the projection of \vc{a} onto \vc{b}. Letters are rendered in italic font; numbers are upright / roman. \supset Learn about the conditions for matrix multiplication to be defined, and about the dimensions of the product of two matrices. \vartriangle \pitchfork \curlyeqsucc Best not to discover why! \nleftarrow \nRightarrow \frown Next story The Length of a Vector is Zero if and only if the Vector is the Zero Vector; Previous story Prove that the Dot Product is Commutative: \mathbf{v}\cdot \mathbf{w}= … formulas, graphs). \sideset{}{'}\sum \Delta \gnapprox \diagup \triangle \bigotimes \cdot \rightharpoonup Find the dot product of two vectors. \vee or \lor \grave{x} The operation is supposed to be combining two like vectors, so the answer is no. \rightrightarrows \wedge or \land \upharpoonright or \overleftrightarrow{xxx} \cos \boxminus \otimes \leftrightarrow Home > Latex > FAQ > Latex - FAQ > LateX Derivatives, Limits, Sums, Products and Integrals LateX Derivatives, Limits, Sums, Products and Integrals Saturday 5 December 2020 , … \ll, \lll or \llless \succapprox \approxeq The dot product gives us a very nice method for determining if two vectors are perpendicular and it will give another method for determining when two vectors are parallel. \leftarrowtail \npreceq LaTeX forum ⇒ Math & Science ⇒ Multiplication Dot Information and discussion about LaTeX's math and science related
{ "domain": "fnfsurplus.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9579122744874228, "lm_q1q2_score": 0.8023664422912158, "lm_q2_score": 0.837619961306541, "openwebmath_perplexity": 3984.808390044718, "openwebmath_score": 0.9823776483535767, "tags": null, "url": "https://fnfsurplus.com/45meu/87ff8e-dot-product-latex" }
organic-chemistry, acid-base, aromatic-compounds, amines, phenols The phenyl ring has an enormous effect on the acidity of phenol, due to the resonance effect. It stabilizes the oxygen anion by more than 5 orders of magnitude, compared to, e.g., methanol (pK$_a$ = 15.5) or benzyl alcohol (15.4) or ethanol (15.9). (Interesting that phenylethanol (pK$_a$ = 14.81) is more acidic than benzyl alcohol. This suggests that the methyl group in ethanol is more electron-donating than the benzyl group in benzyl alcohol; this agrees with the discussion in #3 below, for phenethylammonium ion.) The phenyl ring has a much smaller effect on the amine molecule-ion; no resonance, just inductive. The pK$_a$ of benzylammonium ion (9.34) can be compared with, e.g.:
{ "domain": "chemistry.stackexchange", "id": 15483, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, acid-base, aromatic-compounds, amines, phenols", "url": null }
electromagnetism, magnetic-fields, electric-fields, maxwell-equations Title: Do the relations between E/B and D/H contain higher order multipole terms? Jackson writes in section 1.4 (third edition) that \begin{align*} D_\alpha &= \epsilon_0 E_\alpha + \left(P_\alpha - \sum_\beta \frac{\partial Q'_{\alpha\beta}}{\partial x_\beta} + \ldots \right) \\ H_\alpha &= \frac{1}{\mu_0} B_\alpha - (M_\alpha + \ldots ) \end{align*} and adds, The quantities $\mathbf{P}$, $\mathbf{M}$, $Q'_{\alpha\beta}$, and similar higher order objects represent the macroscopically averaged electric dipole, magnetic dipole, and electric quadrupole, and higher moment densities of the material medium in the presence of applied fields. In section 6.6 he derives these relations and states for D, The third and higher terms are present in principle, but are almost invariably negligible.
{ "domain": "physics.stackexchange", "id": 21690, "lm_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, magnetic-fields, electric-fields, maxwell-equations", "url": null }
• Hi, does the choice of $g$ have anything to do with which orbit an element belongs to? Say, for $S_3$ acting on $T= \{1,2,3\}$ x $\{1,2,3\}$, the identity permutation would produce the diagonal orbit which would contain all elements of $T$? – sugoi_overload Feb 13 '18 at 14:18 • I don't think either part of the question makes sense as written. The orbit of $\omega \in \Omega$ is the set $\{\omega^g : g \in G\}$ of the all of the elements of $\Omega$ one can "reach" via the action of $G$. The orbit decomposition depends only on the action itself, there's no choice of an element $g \in G$ in the picture. – Travis Feb 13 '18 at 15:08 • The action of $S_3$ on $\Omega := \{1, 2, 3\}$ by permutations is transitive, so we know that this action has a single orbit, $\Omega$. This means that the induced action on $\Omega \times \Omega$ acts transitively on the diagonal $\Delta=\{(1,1),(2,2),(3,3)\}$, because if $g$ maps $x$ to $x'$, then it also maps $(x,x)$ to $(x',x')$. – Travis Feb 13 '18 at 15:11 • Oh, okay. So, in this case, the $S_3$ has 2 orbits on $T$, the diagonal $\Delta$ and $T$ \ $\Delta$, since these are the two "unique" sets produced by applying each $g \in G$ to the elements of $T$? – sugoi_overload Feb 13 '18 at 23:07
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9511422241476943, "lm_q1q2_score": 0.8158594597249419, "lm_q2_score": 0.8577681013541613, "openwebmath_perplexity": 119.34791559644233, "openwebmath_score": 0.9509938955307007, "tags": null, "url": "https://math.stackexchange.com/questions/2647532/orbits-of-the-action-of-g-on-omega-%C3%97-omega" }
electromagnetic-radiation, photons, radiation, photon-emission Title: Why do electrons come to ground state even after giving absorbing energy? Imagine you have a hydrogen placed under sunlight, now if we look at 1st shell of hydrogen, it has energy of $-13.6$ev now for 2nd shell we have energy of $-3.4$ev. 1st shell -> $-13.6$ev 2st shell -> $-3.4$ev 3rd shell -> $-1.5$ev 4th shell -> $-0.85$ev The the continous power from sun is more than enough to send knock electrons out of hydrogen atom, even if we assume the power from sun is not "ample" enough at once, for eg: electron in 1st shell need $+10.2$ev so it can jump into 2nd shell, say sun gives $+5.2$ev at $t = 1s$ so this energy will increase kinetic energy of electron, at $t = 2s$ sun gives $+5.2$ev so electron now jumps into 2nd shell and remaining energy will be used to increase kinetic energy of electron. This process can go on until electron is completely removed from atom? Why doesn't something like this happen? There are also other processes that return the electron into the lower energy states: most notably spontanous emission (when electron lowers its energy and emits a photon), but also various kinds of other interactions, such as collisions with other hydrogen atoms. The drive towards lower energy then wins - this is what thermodynamics and statistical physics teach us.
{ "domain": "physics.stackexchange", "id": 89105, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, photons, radiation, photon-emission", "url": null }
So we don't know at $a_{2n}$ and $a_{2n+1}$ are convergent, only that they have a convergent subsequence. • You are right . But how about this approach : $a_{2n}$ is a subsequence of $a_n$ .So $a_{4n}=a_{2(2n)}$ and $a_{2(2n+1)}$ are subsequences of $a_{2n}$ and hence bounded by $M_1$ and $M_2$ respectively . Similarly $a_{4n+1}=a_2{2n}+1$ and $a_{4n+3}=a_{2{2n+1}}$ are bounded by $M_3$ and $M_4$ . So $a_n$ is bounded by $M_1+M_2+M+M_3+M_4$ . Does it work ? – Suman Kundu Jun 3 '17 at 20:39 • @SumanKundu now you're assuming that $a_{2(2n)}$ is convergent, which isn't necessarily the case. – Omnomnomnom Jun 3 '17 at 20:43 • That still doesn't work because, for $a_{2n}$, for example, we know that it has some convergent subsequence, not that every subsequence is convergent. So it may happen at $a_{4n}$ is not convergent, but some other subsequence is. – idontseethepoint Jun 3 '17 at 20:43 • Ahh ! Now i understand . Thank you . – Suman Kundu Jun 3 '17 at 20:45
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137868795702, "lm_q1q2_score": 0.8266843956468175, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 144.51380306282067, "openwebmath_score": 0.9396863579750061, "tags": null, "url": "https://math.stackexchange.com/questions/2308610/if-a-n-is-any-real-sequence-then-fraca-n1a-n-has-a-convergent" }
4. Is it possible to code this efficiently so that I can get an answer by a simulation? From what I remember I tried MATLAB and Mathematica but it just took so frigging long I had to kill them without knowing the answer and go back to paper and a pencil. I didn't try C++ or FORTRAN. In Mathematica I did try to "optimize" it as much as I could using its built-in functions but too slow. For MATLAB, I couldn't see how to vectorize it so just had to write a loop which is of course a bad idea. Any efficient algorithms? Any ideas? 5. More of a theoretical question, is there any way to prove that another fixed after $n=1$ even exists over $\mathbb{N}$? Using the recursive relation above we see that $f(999,999,999)=900,000,000$ and $f(9,999,99,999)=10,000,000,000$ so $f(n)>n$ and then I just narrow the interval until I get $f(n)=n$. If we considered the smooth continuation of $f(x)$ over $\mathbb{R^+}$ then yes the intermediate value theorem guarantees us the fixed point ($f(x)-x$ has an $x$-intercept because it switches sign). But how do we know, how can we prove that the fixed point is EXACTLY on an integer? I mean I know the answer must exist because the question was posed but frankly I am a little surprised that there is another integer after one where the integer exactly equals the number of times "1" is needed to get there. 6.Can we say anything about the long term behavior of $f$? Like will $f(n)$ be always greater than $n$ after the second fixed point or will it oscillate going above and below $n$ arbitrarily many times as $n$ tends to infinity? Are there any other fixed points? Are there any other fixed points over the natural numbers? Any way to find them all? Does the smooth continuation of $f$ to the reals have a closed form expression? What would it be? Thanks!
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9674102552339747, "lm_q1q2_score": 0.8040563060414199, "lm_q2_score": 0.831143045767024, "openwebmath_perplexity": 179.87471125661276, "openwebmath_score": 0.7787449955940247, "tags": null, "url": "http://math.stackexchange.com/questions/264013/a-function-over-the-integers-and-its-fixed-points/270169" }
python, python-3.x, networking # The Go Ahead (GA) command is to be issued when the Telnet client has sent all # data to the printed and no input from the keyboard is waiting to support # "lockable" keyboards at a half-duplex connection, for instance, the IBM 2741: # it is locked when the other end is sending. The GA command unlocks it again. # The GA command's purpose is not to signalize an EOL; usually, the machine # has other mechanisms for handling and identifying such a state, so a GA # command would be superflous. # Other Telnet commands: # - IP (Interrupt Process): interrupt process due to an infinite loop, for # example # - AO (Abort Output): abort output of text. Example: cat test.txt, where # test.txt is so huge, it takes some seconds to print # all the content. If an AO is issued in between, the # rest of the output is discarded and the shell awaits # the next command. # - AYT (Are You There): issued to check responsiveness of the local system # when, for example, a computation takes very long. # - EC (Erase Character): deletes the most recent character in the data stream. # Takes control characters into account. # - EL (Erase Line): delete the current line of input. # Valid control characters. All other control characters are ignored by the NVT. # "\r\n" is a newline, "\r\x00" is a pure carriage return, as specified by # RFC 854. PORT = 23 # Old CtrlChars class. #class CtrlChars(enum.Enum): # NUL = "\x00" # LF = "\n" # CR = "\r" # RFC 5198 ADVISES AGAINST using the lower control characters; they "SHOULD # NOT be used unless required by exceptional circumstances." # BEL = "\a" # BS = "\b" # HT = "\t" # VT = "\v" # FF = "\f"
{ "domain": "codereview.stackexchange", "id": 18379, "lm_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, networking", "url": null }
c#, beginner, object-oriented, design-patterns return result; } } And this class is the "result" of the character counting. It has properties which can be used to find the number of different types of characters as well as a method which returns a ReadOnlyDictionary<char, uint> that can be used to find the number of times each specific character occurs: class CharacterCountResult { // Unicode special characters. public uint ControlCount { get; private set; } public uint HighSurrogateCount { get; private set; } public uint LowSurrogateCount { get; private set; } // Textual special characters. public uint WhiteSpaceCount { get; private set; } public uint SymbolCount { get; private set; } public uint PunctuationCount { get; private set; } public uint SeparatorCount { get; private set; } //Letters, digits, numbers. public uint LetterCount { get; private set; } public uint DigitCount { get; private set; } public uint NumberCount { get; private set; } public uint LetterAndDigitCount { get; private set; } public uint LowercaseCount { get; private set; } public uint UppercaseCount { get; private set; } private Dictionary<char, uint> _characterDictionary = new Dictionary<char, uint>();
{ "domain": "codereview.stackexchange", "id": 10277, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, object-oriented, design-patterns", "url": null }
I have no doubt that many slick solutions will be given here. I'll try to post an elementary one; which uses perhaps the most straightforward approach I can imagine. (The only things that are needed are some algebraic manipulation and basic properties of rational numbers; such as that the only solution of $x^2=6y^2$ in $\mathbb Q$ are $x=y=0$.) This is equivalent to showing that if $$a+b\sqrt6=c\sqrt3+d\sqrt2$$ then $a=b=c=d=0$. By squaring both sides of the above equation we get \begin{align*} a^2+6b^2+2ab\sqrt6&=3c^2+2d^2+2cd\sqrt6\\ 2(ab-cd)\sqrt6=3c^2+2d^2-a^2-6b^2 \end{align*} Since $a,b,c,d\in\mathbb Q$, this implies \begin{align*} ab-cd&=0\\ 3c^2+2d^2-a^2-6b^2&=0 \end{align*} which is the same as \begin{align*} ab&=cd\\ 3c^2+2d^2&=a^2+6b^2 \end{align*}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540722737479, "lm_q1q2_score": 0.8096435537572182, "lm_q2_score": 0.8267117855317474, "openwebmath_perplexity": 426.22503597245486, "openwebmath_score": 0.9249665141105652, "tags": null, "url": "http://math.stackexchange.com/questions/96946/how-to-prove-1-sqrt2-sqrt3-and-sqrt6-are-linearly-independent-ove?answertab=active" }
speed-of-light, time, faster-than-light, time-dilation Title: Does the Einsteins theory of a clock tower observed from a tram really explain time dilation? We were shown a video in our class about time dilation which explained a Einstein's theory - the one where he was travelling in a tram and realized that if he travels at light speed, time will flow differently for him. He hypothesized this as the movement of the hands of the clock seemed to get slower with increase in the trams speed. He thought that if he is able to travel at light speed, the hands of the clock will freeze for him. But, on this, I thought that as Einstein would be travelling at the speed of light, the light reflected from the clock will never reach his eyes. The light reflected from the clock before he achieves light speed, will be the last he sees of the clock's original state, hence, to him, the hands of the clock will appear still, while actually they still will be moving. Time still will be flowing, irrespective of the hands' apparent positions, and at the same rate; only Einstein would not be able to view the indicator(i.e. clock hands) showing this! Could someone please explain why the theories above are right/wrong? First, the time of flight of light is irrelevant to time dilation (due to uniform relative motion) so I understand why this is confusing to you. The essential nature of time dilation due to uniform relative motion is that, relative to Einstein, the clock is moving (with speed $v \lt c$) and so, Einstein must use two, spatially separated and synchronized clocks, at rest with respect to him, to observe the elapsed time according to the tower clock. Initially, the tower clock is (instantaneously) co-located with the first of Einstein's clocks and it records the current time as well as the time given by the tower clock. Some time later, the tower clock is (instantaneously) co-located with the second of Einstein's clocks and it records the current time as well as the time given by the tower clock. Now, Einstein computes the elapsed time, as found by his two clocks, by subtracting the second clock's recorded times from the first clock's recorded times.
{ "domain": "physics.stackexchange", "id": 52324, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "speed-of-light, time, faster-than-light, time-dilation", "url": null }
ros, catkin, catkin-package, rosbuild Title: Can wet package depend on dry package? Hi everyone, I am wondering if wet package can depend on dry package? Thanks Originally posted by AdrianPeng on ROS Answers with karma: 441 on 2013-03-10 Post score: 2 Nope. The old rosmake (dry) system is aware of the catkin ecosystem, but not the other way around. Originally posted by fergs with karma: 13902 on 2013-03-10 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by Boris on 2013-03-10: Is the main reason for this is to get rid of rosmake as quick as possible? Comment by fergs on 2013-03-10: The main reason would be so that the new system doesn't have all the terrible hacks the old system had underneath it. The new system is more linux-like with a more standard build/install structure -- making it aware of the older, non-standard approach would cause a massive mess. Comment by jackcviers on 2014-12-13: So, what if the packages you need are only provided as dry packages? Do you have to convert them first? Comment by joq on 2014-12-13: Either that, or use rosmake for your package. Comment by William on 2014-12-15: The other reason catkin pkgs do not depend on rosmake is that they don't provide all of the necessary exported information for catkin packages to build on top of them automatically. However, rosmake packages do export pkg-config files, which you could try to use, but at your own risk.
{ "domain": "robotics.stackexchange", "id": 13285, "lm_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, catkin, catkin-package, rosbuild", "url": null }
mechanical-engineering, statics $$\tan^{-1}(\frac{\sin(20)}{\cos(20)})=20°$$ Which is wrong as the answer given in the book is that the angle is $82.7°$ and the reaction force is $0.474mg$, I am aware that this entire method is a hackjob but I have no clue on how to tackle this question properly, are the reaction forces I drew the problem or is it my working onwards? How would I tackle this problem properly? The problem is that the angle between T and the 20 degrees is not only 20 degrees but 20 + 40=60 deg. Look at the triangles that are formed.
{ "domain": "engineering.stackexchange", "id": 3861, "lm_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, statics", "url": null }
species-identification, ichthyology, limnology, aquatic-biology, freshwater-biology Title: What kind of fish is this? Spotted or largemouth? I don't know if this is a weird looking largemouth bass or a spotted bass. It was caught in southern Oklahoma. Please help! Thanks. This looks like a spotted bass (Micropterus punctulatus). Here's an image showing some quick differences between some common bass species: Using the above photo and this source to guide our judgment we can see your specimen appears to: Have a jaw that does not go posterior to the eye (as it otherwise would in a largemouth). Have rows of pigment towards its ventral side (below the "lateral line"). Not have the typical darker horizontal line of scales characteristic of the largemouth bass . Have smaller-sized cranial scales (those around the eye) characteristic of the spotted bass. If you can provide additional pictures of the following, I can provide a more definitive ID: Both dorsal fins -- if the 2 dorsal fins are connected, it would further suggest a spotted bass (as largemouth bass dorsal fins are not typically connected) Tongue -- evidence of a tooth patch is more likely on the spotted bass. According to the International Game Fish Association: Spotted bass can be found throughout the central and lower Mississippi basin to the Gulf of Mexico (from Texas to the Florida panhandle), including Georgia, Alabama, Tennessee, Kentucky and other nearby states where it occurs naturally or has been introduced.
{ "domain": "biology.stackexchange", "id": 6628, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "species-identification, ichthyology, limnology, aquatic-biology, freshwater-biology", "url": null }
\right\}$ At the time of testing, test 4 and 12 as invalid values … Similar observations can be made to the equivalence class {4,8}. This testing technique is better than many of the testing techniques like boundary value analysis, worst case testing, robust case testing and many more in terms of time consumption and terms of precision of the test … Click or tap a problem to see the solution. {\left( {b,c} \right),\left( {c,a} \right),}\right.}\kern0pt{\left. maybe this example i found can help: If X is the set of all cars, and ~ is the equivalence relation "has the same color as", then one particular equivalence class consists of all green cars. A text field permits only numeric characters; Length must be 6-10 characters long; Partition according to the requirement should be like this: While evaluating Equivalence partitioning, values in all partitions are equivalent that’s why 0-5 are equivalent, 6 – 10 are equivalent and 11- 14 are equivalent. Objective of this Tutorial: To apply the four techniques of equivalence class partitioning one by one & generate appropriate test cases? Let $$R$$ be an equivalence relation on a set $$A,$$ and let $$a \in A.$$ The equivalence class of $$a$$ is called the set of all elements of $$A$$ which are equivalent to $$a.$$.                  R1∪ R2= {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1), (2, 3), (3, 2)}. Let us make sure we understand key concepts before we move on. $\require{AMSsymbols}{\forall\, a,b \in A,\left[ a \right] = \left[ b \right] \text{ or } \left[ a \right] \cap \left[ b \right] = \varnothing}$, The union of the subsets in $$P$$ is equal, The partition $$P$$ does not contain the empty set $$\varnothing.$$ We will see how an equivalence on a set partitions the set into equivalence classes. We know
{ "domain": "spacebd.biz", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9637799399736476, "lm_q1q2_score": 0.8373578084299698, "lm_q2_score": 0.8688267660487573, "openwebmath_perplexity": 526.3073391422087, "openwebmath_score": 0.5353816151618958, "tags": null, "url": "http://spacebd.biz/1nbqnla/bec524-equivalence-class-examples" }
python, python-3.x, csv Title: Create csv file for each id value and write all data rows to csv with same id I have a text file which is tab delimited: 1 324 2344 1 8372 1234 2 62 12 2 872 12111 2 1211 28736 3 87636 198272 The first "column" contains the id value and the rest containing data. I would like a csv file to be created for each id value so in this example, there would be 3 csv files. And for each csv file, I would like it to contain all rows of data with the same id. So when id = 1, the csv file will contain the 2 rows of data; when id = 2, the csv file will contain 3 rows etc. I have a script which achieves this but I don't think it's very efficient as it stores all unique id values in a list, iterates through this list, for each iteration it reads the text file line by line and if the first element in the line matches the id value, it creates a csv and writes all rows of data with the same id. But if there's 20 id values in the list, it will read the text file 20 times. For small text files, it's not a problem but for larger files, I'm wondering if it would be more efficient to only read the text file once and then create the relevant csv files according to id. So could this script be improved? import csv id_list = [] mylines = [] source_file = 'path/to/source_file.txt' target_directory = 'save/to/target_directory/' with open (source_file, 'rt') as myfile: # Get and store ids for line in myfile: data = line.split() if data[0] in id_list: pass else: id_list.append(data[0])
{ "domain": "codereview.stackexchange", "id": 43045, "lm_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, csv", "url": null }
deep-learning, pytorch, model-selection, image, noise elif NET_TYPE =='UNet': net = UNet(num_input_channels=input_depth, num_output_channels=3, feature_scale=4, more_layers=0, concat_x=False, upsample_mode=upsample_mode, pad=pad, norm_layer=nn.BatchNorm2d, need_sigmoid=True, need_bias=True) elif NET_TYPE == 'identity': assert input_depth == 3 net = nn.Sequential() else: assert False return net
{ "domain": "datascience.stackexchange", "id": 9643, "lm_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, pytorch, model-selection, image, noise", "url": null }
python 2. Revised code I've chosen to make the function always update its argument, and fixed all the problems noted above. class TooLongError(ValueError): pass def pad(seq, target_length, padding=None): """Extend the sequence seq with padding (default: None) so as to make its length up to target_length. Return seq. If seq is already longer than target_length, raise TooLongError. >>> pad([], 5, 1) [1, 1, 1, 1, 1] >>> pad([1, 2, 3], 7) [1, 2, 3, None, None, None, None] >>> pad([1, 2, 3], 2) ... # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... TooLongError: sequence too long (3) for target length 2 """ length = len(seq) if length > target_length: raise TooLongError("sequence too long ({}) for target length {}" .format(length, target_length)) seq.extend([padding] * (target_length - length)) return seq
{ "domain": "codereview.stackexchange", "id": 5864, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
Let $x \in V_1 \cap V_2$, then $x \in V_1$ and $x \in V_2$. Hence $x = (v_1,0_{V_2})$ for some $v_1 \in V_1$ and $x = (0_{V_1},v_2)$ for some $v_2 \in V_2$. Since both $x$ is in the intersection, the $x$ must be a vector in the form of both $V_1,V_2$. So $$x = (v_1,0_{V_2}) = (0_{V_1},v_2)$$ for some $v_1 \in V_1, v_2 \in V_1$. However $v_1$ is forced to be equals to $0_{V_1}$ only and $v_2$ is forced to be equals to only $0_{V_2}$ as well because the simplest way is to say that the $0$ vector of any vector space is unique. Or can i also say suppose not, the $v_1$ inside the intersection does not satisfy $v_1 \neq 0_{V_1}$, then the problem will be that $(v_1,0_{V_2})$ will definitely not be in $V_2$ since all elements in $V_2$ must exhibit the form of $(0_{V_1},v_2)$ where $0_{V_1}$ is fixed. And subsequently it contradicts the fact that $(v_1,0_{V_2})$ is in $V_2$ as well. • By the identification, $(0_{V_1},0_{V_2}) = 0_{V_1} = 0_{V_2}$. – Kenny Lau Aug 28 '17 at 12:14 • The zero vector is indeed $(0_{V_1}, 0_{V_2})$. – Shaun Aug 28 '17 at 12:22
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682458008671, "lm_q1q2_score": 0.8083099209926614, "lm_q2_score": 0.8175744739711883, "openwebmath_perplexity": 72.10114546977736, "openwebmath_score": 0.9633256196975708, "tags": null, "url": "https://math.stackexchange.com/questions/2408686/consider-v-v-1-times-v-2-v-1-v-2-v-1-in-v-1-v-2-in-v-2-o" }
ros, jackal, ros-kinetic, rostopic Here you need add the jackal IP and the host name for the jackal. For example like : 192.168.y.y cpr-jackal-0001 where you replace .y.y with what you got with ifconfig in the ssh-ed window. After this you can create a simple bash script called remote-jackal.sh with only the following lines inside: export ROS_MASTER_URI=http://cpr-jackal-0001:11311 # Jackal's hostname export ROS_IP=192.168.x.x # Your laptop's ethernet IP address where you replace .x.x with what you got with ifconfig in the first step. Now for every terminal that you want to use/connect with the jackal's ROS master you just need to source the remote-jackal.sh file you created like: source remote-jackal.sh After this when you type rostopic list your should get the published topics. Originally posted by pavel92 with karma: 1655 on 2018-07-11 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by dkrivet on 2018-07-11: This has worked. Thank you very much!
{ "domain": "robotics.stackexchange", "id": 31244, "lm_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, jackal, ros-kinetic, rostopic", "url": null }
• Thank you for the most enlightening answer. To see why there is a smooth map $A$ taking $\mathbf R$ to the space of linear isometries of $\mathbf R^3$ such that $f=e^A$, I have the following rather non-elementary argument. We equip $SO(3)$ by a bi-invariant metric (this can be done since $SO(3)$ is compact). Then we know that that the exponential map of $SO(3)$ when $SO(3)$ is thought of as a Lie group is same as the exponential map at the identity of $SO(3)$ when $SO(3)$ is thought as a Riemannian manifold. Now the Cartan-Hadamard theorem implies that $\exp:T_I(SO(3))\to SO(3)$ is a smooth... Jun 17 '17 at 10:44 • ... covering map. Thus $f:\mathbf R\to SO(3)$ admits a smooth lifting to yield the desired smooth map $A$, and we are done. If you have a more elementary argument then can you please post it? Thanks. Jun 17 '17 at 10:45 • My reasoning is inaccurate. For me to apply the Cartan-Hadamard theorem I need to show that the sectional curvature of $SO(3)$ is always non-positive. The reverse is true. All sectional curvatures of $SO(3)$ are non-negative. In fact, the universal cover of $SO(3)$ is $S^3$ and thus what I said is clearly wrong. So can you please give a justification of the existence and smoothness of $A$? Thanks. Jun 17 '17 at 15:03
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232919939075, "lm_q1q2_score": 0.8253100985648071, "lm_q2_score": 0.839733963661418, "openwebmath_perplexity": 107.3453099851722, "openwebmath_score": 0.8953630924224854, "tags": null, "url": "https://math.stackexchange.com/questions/2324998/definition-and-existence-of-angular-velocity" }
quantum-mechanics, homework-and-exercises, perturbation-theory This is the claim that I'm having difficulty verifying. Since we can't say anything about how $O_{1}$ commutes (or fails to commute) with $H$, I've been stuck for a while. Most of my attempts fail to reproduce this identity. Does anyone have a suggestions for how to proceed? Also for those who are curious regarding which sources use this fact, you might look at Xiao-Gang Wen's book (Quantum Field Theory of Many-Body Systems), Chapter 2. We start from the equation of time evolution: $$|\psi(t)\rangle = T\left(e^{-i\int_{-\infty}^{t}dt'H(t')}\right)|\psi\rangle$$ Now, we need to evaluate the exponential with the following Hamiltonian: $$H(t) = H_0 + f(t)O_1$$ while paying attention to the time ordering. To do this, for convenience, let us consider the (time-ordered) exponential part alone, and express the integral as a Riemann sum (with the limit implicitly assumed): $$T (e^{-i \sum_{j} \Delta t_j (H_0+f(t_j)O_1)})$$ $$ = \prod_{j} e^{-i \Delta t_j (H_0+f(t_j)O_1)}$$ where the time ordering is implicitly assumed in the product: we act with the lower $j$ factors first (i.e. on the right), then go to higher values of $j$. Now, as the perturbation $f(t_j)O_1$ is weak at all times, we can re-express each exponential factor as follows (where we neglect the commutator between $-i\Delta t_j H_0$ and $-i\Delta t_j f(t_j) O_1$, which is second order in $\Delta t_j$):
{ "domain": "physics.stackexchange", "id": 21276, "lm_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, perturbation-theory", "url": null }
\end{bmatrix}\\ \end{align} then $$u\cdot w=\det\begin{bmatrix} v_{1,1}&v_{2,1}&\cdots&v_{n-1,1}&w_1\\ v_{1,2}&v_{2,2}&\cdots&v_{n-1,2}&w_2\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ v_{1,n}&v_{2,n}&\cdots&v_{n-1,n}&w_n \end{bmatrix}$$ If we replace $w$ by any of the $v_j$, the determinant will be $0$ because of duplicate columns; thus, $u\cdot v_j=0$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232899814556, "lm_q1q2_score": 0.8125115990208194, "lm_q2_score": 0.8267117876664789, "openwebmath_perplexity": 590.1451391153727, "openwebmath_score": 0.9019871354103088, "tags": null, "url": "https://math.stackexchange.com/questions/137362/how-to-find-perpendicular-vector-to-another-vector" }
javascript, jquery, stackexchange, bookmarklet var rawRepProfit = mean([ transformQuestionScore(question.score), transformQuestionAskerRep(question.owner.reputation), transformQuestionViewVelocity(views / deltaTimeCreation), transformQuestionViews(views), Math.min(averageAnswerScore, 20) ]) * 15; var owner = question.owner; var acceptRate = owner.hasOwnProperty("accept_rate") ? owner.accept_rate : 50; rawRepProfit += (acceptRate / 100) * 15; appendHTML(question.question_id, "Estimated Reputation Profit: " + Math.round(rawRepProfit) + ((rawRepProfit >= 90) ? " or more" : "")); } function scoreQuestions(questions, answers) { questions.items.forEach(function (question) { var thisQuestionsAnswers = answers.items.filter(function (answer) { return answer.question_id == question.question_id; }); var data = { question: question, answers: thisQuestionsAnswers }; calculateRepProfitEstimate(data); calculateCompetitionRating(data); }); } var questionsToQuery = Array.from(document.querySelectorAll(".question-summary")).map(function(question) { var id = question.id; id = id.substr(id.lastIndexOf("-") + 1); return id; });
{ "domain": "codereview.stackexchange", "id": 27188, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, stackexchange, bookmarklet", "url": null }
infinite-impulse-response, z-transform where a, b, and c would be replaced by their numeric values or if you're competent in the symbolic math capability, you could instead obtain a pure symbolic result for the coeffients $d_k$, which would therefore give you a way to compute LCCDE coefficients from pole-zero products of $H(z)$ in a rather roundabout way. Finally, the computations for a power of $z^{-1}$ products is basicly the same if you describe the product as $$P(z) = (1 - az^{-1})(1-bz^{-1})(1-cz^{-1})$$ and, $$P(z) = d_0 + d_1 z^{-1} + d_2 z^{-2} + d_3 z^{-3} $$ where again $$d[k] = (1 -a)\star(1 -b)\star(1-c)$$
{ "domain": "dsp.stackexchange", "id": 3847, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "infinite-impulse-response, z-transform", "url": null }
more details $\sum_{k=1}^{n}\dfrac{1}{k(k+1)(k+2)(k+3)} = \sum_{k=1}^{n} \dfrac{1}{3} (\dfrac{1}{k(k+1)(k+2)} - \dfrac{1}{(k+1)(k+2)(k+3)})$ $= \dfrac{1}{3} [\sum_{k=1}^{n} \dfrac{1}{k(k+1)(k+2)} - \sum_{k=1}^{n} \dfrac{1}{(k+1)(k+2)(k+3)}]$ $= \dfrac{1}{3} [\sum_{k=0}^{n-1} \dfrac{1}{(k+1)(k+2)(k+3)} - \sum_{k=1}^{n} \dfrac{1}{(k+1)(k+2)(k+3)}]$ $= \dfrac{1}{3} (\dfrac{1}{1*2*3} - \dfrac{1}{(n+1)(n+2)(n+3)})$ - +1: Even though the question says first n terms, this can easily be adapted for that. –  Aryabhata Sep 27 '10 at 14:09 @Moron Thank for your comment –  Branimir Sep 27 '10 at 14:15 @Branimir: You are welcome! And I see you joined today, welcome to this site :-) –  Aryabhata Sep 27 '10 at 14:20 so tricky!!! :) –  BBischof Sep 27 '10 at 14:21 Say n = 2, then 1/24 + 1/180 = 1/20 where as your solution is giving 1/18 - 1/72 = 1/24 ?! –  Quixotic Sep 27 '10 at 14:49 show 3 more comments
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462185318104, "lm_q1q2_score": 0.8189469589879035, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 1237.0112724672895, "openwebmath_score": 0.8604430556297302, "tags": null, "url": "http://math.stackexchange.com/questions/5558/find-the-sum-to-n-terms-of-the-series-displaystyle-frac1-1-2-3-4-frac" }
OF THE BASE 11. $\begingroup$ You can splits it in two triangle and a central rectangle, now you know all the shapes has the known second moment of area, you need to evaluate it for the rectangle and one of the triangles, the second triangle has the same second are of moment, then apply the Steiner theorem (parallel axis theorem). I Average value of a function. 날짜: 2006년 4월 23일 (원본 올리기 일시) 출처: No machine-readable source provided. The moment of inertia about a diameter of a sphere of radius 1m and mass 1kg is found by evaluating the integral 3 8 1 −1 (1−x2)2dx. Find the moment of inertia about any of its sides. Introduction. I y'4 = 1/36 4(4) 3 = 256/36 cm 4 : Distances from Global Centroid : These can be used with the following equations to find the moments of inertia of the entire cross section with respect to the centroid of the cross section. For basic shapes there are tables that contain area moment of inertia equations which can be viewed … Continue reading "Area Moment of Inertia". Today we will see here the method to determine the moment of inertia for the triangular section about a line passing through the center of gravity and parallel to the base of the triangular section with the help of this post. Determine the moment of inertia of this of this semicircular sheet. This causes the cantilever to appear too soft, as shown in figure 7. (8), derived in the moment of inertia example, the moment of inertia of the disk is = at 5 digits Therefore, the moment of inertia of the disk is 12. Imagine suspending the semicircle such that the axis of rotation is at the apex of the triangle. When solving for the moment of inertia of a composite area, divide the composite area into basic geometric elements (rectangle, circle, triangle, etc) for which the moments of inertia are known. 014, where M and R are Mercury’s mass and radius. We can relate these two parameters in two ways: For a given shape and surface mass density, the moment of inertia scales as
{ "domain": "ricominciodalmesdi.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9883127413158322, "lm_q1q2_score": 0.8257190309516621, "lm_q2_score": 0.8354835432479661, "openwebmath_perplexity": 410.50764068409853, "openwebmath_score": 0.6430168151855469, "tags": null, "url": "http://lwwx.ricominciodalmesdi.it/moment-of-inertia-of-triangle-about-apex.html" }
thermodynamics, statistical-mechanics, pressure, ideal-gas You know that the number of moles is conserved. Hence, using the ideal gas equation, you can find a relationship involving just pressures and temperatures. But the confinement won't take place spontaneously, as you suggest: "Consider another container with the same volume and slowly mix these both gases from those containers into this new one." You'll have to do work to squash 2 volumes $V$ of gas into volume $V$. This stops internal energy being conserved even if the mixing is adiabatic, so a nice easy equation is denied you. But internal energy would be conserved if the final volume of the mixture were allowed to be $2V$, provided that the mixing were adiabatic. If you further assume that the molar heat capacity of the two gases is the same, you get a very simple result for the final pressure in terms of the initial pressures.
{ "domain": "physics.stackexchange", "id": 86006, "lm_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, statistical-mechanics, pressure, ideal-gas", "url": null }
Draw a picture of the rectangle $$1\leq x\leq 3, 1\leq y\leq 3$$ and of the boundary line $$8-x-y=3 \Leftrightarrow y=5-x$$. Notice that below the line (and staying in the rectangle) $$\min(8-x-y,3)=3$$ and above the line in the rectangle $$\min(8-x-y,3)=8-x-y$$. Also notice that $$\min(8-x-y,3)=3$$ in the rectangle $$1\leq x\leq 2,1\leq y\leq 3$$. So, we can split it up as: $$\int_1^2\int_1^3\int_1^32\,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x+\int_2^3\int_1^{5-x}\int_1^32\,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x+\int_2^3\int_{5-x}^3\int_1^{8-x-y}2\,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347883040039, "lm_q1q2_score": 0.8141242216130534, "lm_q2_score": 0.8354835350552604, "openwebmath_perplexity": 223.36037324399823, "openwebmath_score": 0.996893584728241, "tags": null, "url": "https://math.stackexchange.com/questions/3491616/evaluating-a-triple-integral-where-one-bound-is-a-function-of-two-variables" }
beginner, c, strings, caesar-cipher Title: Message decoder I've built a C decoder program. The length of an encoded message will be given and the message itself in the following line. All the characters of the message will be in uppercase letters. The task is to print out the decoded message. Encoding: A->B, B->C...Y->Z, Z->A (well, you get the idea) #include<stdio.h> main() { int size; scanf("%d", &size); char str[size]; scanf("%s", str); for (int i=0; i<size; i++) { if (str[i]!='Z') { str[i] -= 1; } else { str[i] -= 25; } printf("%c", str[i]); } return 0; } Is this efficient enough? Could this be done in a simpler and more efficient way? Also, should I use gets() instead of scanf() to take the string as input? Note that some of the things in my code are not valid C (e.g. not using int() before main(), variable declaration within loop conditional statement). But, my compiler ignores them. I'm a lazy person; I like to type less. I'm well-aware of the fact, nonetheless. That's not a bad program, despite the number of suggestions I'm about to make. I do recognize you're a learner, and a young learner at that. There are several levels at which we can analyze this program. One is checking the current implementation. Another is considering whether it is portable. We can question whether the interface is good — should humans be made to count? And there are alternative algorithms that could be used. Some of the points I'm about to make are related to style. Although you can write programs in C in all sorts of ways, some of them are easier to read than others. What you show is not bad, but it isn't wholly consistent (and consistency is very important — and hard!). Analyzing the current implementation — line by line. #include<stdio.h>
{ "domain": "codereview.stackexchange", "id": 23671, "lm_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, strings, caesar-cipher", "url": null }
homework-and-exercises, newtonian-mechanics, forces, mass, centripetal-force Title: Problems of Rotational Body at Uniform Speed In this figure, $1.5 \;\text{kg}$ mass is connected to a $2 \;\text{kg}$ mass through a inflexible string. The $1.5 \;\text{kg}$ mass is on the surface of a table and through a hole on the table the string went down and $2 \;\text{kg}$ mass is hanging from that string. $1.5 \;\text{kg}$ mass is now rotating at a uniform speed and it's coefficient of sliding friction $\mu_k=0.2$ Questions: Write down Newton's Equation for the $1.5 \;\text{kg}$ mass moving at a uniform speed. My Attempt: I think they are asking for Equations of Angular Motion (What else could be?). But if something is moving at uniform speed, does it mean it has uniform angular velocity? If so, then the only equation I can think about is $\theta= \theta_0 + \omega t$ where $\theta_0$ and $\theta$ are the initial and final position of the $1.5 \;\text{kg}$ mass respectively. Is my assumption correct? How can I improve it? What is the work done due to the rotation of the uniform speed of $1.5 \;\text{kg}$ mass? My Attempt: Now I am a bit confused here. In the original context, they mention about coefficient of sliding friction. That means there is friction present in our consideration. If I only consider work done due to centripetal force, it would be $0$ because of $90°$ angle. But if friction is present, should we consider extra torque is applied to the $1.5 \;\text{kg}$ mass to keep it's speed uniform? If we want to keep $2 \;\text{kg}$ mass stationary on its place (which is hanging) then what should be the speed of $1.5 \;\text{kg}$ mass?
{ "domain": "physics.stackexchange", "id": 80824, "lm_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, newtonian-mechanics, forces, mass, centripetal-force", "url": null }
optics, particle-physics, visible-light Title: Weight gain of prism due to light passing through When a beam of light passes through a prism parallel to the base of the prism, the light slows down and hence its wavelength decreases. This, in turn, increases its momentum. Does this change in momentum exert a force on the prism, thereby increasing its weight? We could ask by how much the normal contact force changes if the light travels through the prism. Suppose for simplicity the light enters one side of the prism and is refracted to the horizontal (parallel to the base), before leaving the prism such that the setup is symmetrical. If the light travels toward the prism at angle $\theta$ below the horizontal, and leaves the prism at $\theta$ below the horizontal, then the change in momentum of a single photon is $\Delta p = \frac{2E}{c}\sin{\theta}$. If $n$ photons are "deflected" per second, then our force equals $F = \frac{2nE}{c}\sin{\theta}$. In the case that the prism rests on a surface, this force would act upward and the result would be a reduction in the necessary normal reaction force! To use this relation we'd also need to figure out what "$n$" is. If the power of the beam is $P$, then $n=\frac{P}{E}$. So we could actually simplify our answer to $F = \frac{2P}{c}\sin{\theta}$. Top pan balances measure the weight of an object via the normal contact force. If this decreases, this reading will decrease (though please do note that the weight itself is not changing!). Perhaps this is what you meant?
{ "domain": "physics.stackexchange", "id": 63686, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, particle-physics, visible-light", "url": null }
ros Title: Rosed Cmakelist.txt? I am learning ROS at the moment using the tutorial available here on this page. http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv I am so far, but for some reason not come past opening the CMakeList.txt using rosed roscpp it says that it cannot find the package eventhough i am inside the folder. I've changes the package.xml... I changed using nano, and tried to make a rosmsg show of the num.msg i've created at the begining, but the output is not as should be.. What is wrong here.... I not even able to my way to the folder beginner_tutorials ..... using rosmsg show The output I get when i rosmsg show beginner_tutorials/Num is
{ "domain": "robotics.stackexchange", "id": 20759, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
z-transform, poles-zeros Title: Finite length truncated exponential sequence $\mathcal Z$-transform, zeros over circle explanation I'm looking at an example on how to obtain the $\mathcal Z$-transform from a finite length truncated exponential sequence, namely: $$x[n] = \begin{cases} a^N &\text{for} & 0 \leq n \leq N-1\\[2ex] 0 & \text{otherwise} \end{cases} $$ The $\mathcal Z$-transform from that sequence is: $$ \frac {1}{z^{N-1}} \cdot \frac {z^{N} - a^N}{z - a} $$ It can be seen that there are $N-1$ poles at the origin and $N-1$ zeros at $z = a$ (because the pole in $z=a$ is cancelled by a zero). My doubt is on the location of the zeros over the $z$-plane. I know that the $N-1$ zeros at $z = a$ can be expressed as: $z = a\cdot1\ \text{and}\ 1 = e^{j2\pi k}$ so: $$ z_k = ae^{j2\pi k}\quad\text{with}\quad k = 1,2,\ldots,N-1 $$ Yet in the example I'm looking at, they say that the zeros are located at $$z_k = ae^{j\frac{2\pi k}{N}}\quad\text{with}\quad k = 1,2, \ldots, N-1$$
{ "domain": "dsp.stackexchange", "id": 5394, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "z-transform, poles-zeros", "url": null }
quantum-mechanics, fourier-transform, conventions So you identify $$\left< \mathbf{x}|\mathbf{y} \right> = \delta^{(n)} (\mathbf{x}-\mathbf{y})$$ I hope this illustrates a bit how fundamental the appearance of this delta function is. Not a coincidence :)
{ "domain": "physics.stackexchange", "id": 21454, "lm_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, fourier-transform, conventions", "url": null }
c, reinventing-the-wheel, formatting, io // full wrapper for vio void io(const char* fmt, ...) { va_list va; va_start(va,fmt); vio(fmt,0,va); va_end(va); } // print "only" wrapper for vio void print(const char* fmt, ...) { va_list va; va_start(va,fmt); vio(fmt,1,va); va_end(va); } file: exampleUsage.c // format specifiers to be customized before including io.h // #define IO_INPUT_TOK '%' // uncomment and change the '%' to your own token // #define IO_OUTPUT_TOK '$' // uncomment and change the '$' to your own token #include "io.h" /* ---- Format Specifiers ---- [ default ] change the '$' if you have customized it! == == For Output == == - $i : integer - $c : charachter - $f : float - $d : double - $.nf : prints n number of points after main value [ float ] ( n needs to be 0-9 ) - $.nd : prints n number of points after main value [ double ] ( n needs to be 0-9 ) - $u : unsigned integer - $p : pointers - $x : hexadecimal conversion from int - $li : long - $lu : long unsigned - $ll : long long - $LL : long long unsigned - $s : string change the '%' if you have customized it! == == For input == == - %i : integer - %c : charachter - %f : float - %d : double - %u : unsigned integer - %li : long int - %lu : long unsigned [int] - %ll : long long [int] - %lL : long long unsigned [int] - %s : string */
{ "domain": "codereview.stackexchange", "id": 43449, "lm_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, reinventing-the-wheel, formatting, io", "url": null }
biochemistry, lab-techniques, cloning, sterilisation Title: When is strict sterile technique necessary? Cloning vs. protein expression Background: I have previously worked with RNA, and then we use laminar flow hoods for any work where we do plating or inoculation of cultures while applying sterile technique. I am now working in a biochemistry lab. I'm told that I can work on a lab bench, while doing basic cloning for production of plasmids in E.coli, and don't need to use a Bunsen burner as long as I apply sterile technique (and in most cases I don't see people sterilizing the bench with enthrall prior to work). However, if I do any work which relates to expression of proteins - then I should use the Bunsen-burner while applying sterile technique. Question: Is it really so that you don't even have to use a Bunsen-burner while plating (normal E.coli: XL1-blue cells)? in this case, why? Are there not always something in the lab which can grow on kanamycin plates? We don't use white/blue screening, we simply spread XL1-blue cells onto LB plates with kanamycin - then pick a averaged sized colony to make a LB-culture. It seems to me that we are just lucky that we usually pick the right colony (which we do confirm by sequencing after mini-prep). Short answer is it never hurts to practise thorough aseptic technique. My general rule of thumb is, if I'm opening a culture of bacteria (plates, eppendorfs, tubes etc.) I do it under a bunsen - the exception being if I plan to lyse the cells anyway. For protein purification, sterile technique is important if you plan to store the sample for a while. Proteases in the environment and on your sample/self can make short work of destroying all your hard work.
{ "domain": "biology.stackexchange", "id": 6495, "lm_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, lab-techniques, cloning, sterilisation", "url": null }
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
3