text
stringlengths
1
1.11k
source
dict
java, abstract-factory Title: Abstract Factory Pattern in Java I reproduced my version of Abstract Factory Pattern in Java. I know it's redundant but can I get critical comments about my code. Is it really the classic implementation of the pattern or not? /* * The demonstration of Abstract Factory Pattern * * Here the 'DocumentFactory' creates documents of types * 'Resume' or 'Letter' which are concrete classes responsible to * create things like 'FancyResume' or 'CoverLetter' * * The example is inspired by Wikipedia documentation of Abstract * Factory. */ interface letter{ void print(); } class CoverLetter implements letter{ @Override public void print(){ System.out.println("Cover letter printed"); } } class FancyLetter implements letter{ @Override public void print(){ System.out.println("Fancy letter printed"); } } interface resume{ void process(); }
{ "domain": "codereview.stackexchange", "id": 19522, "lm_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, abstract-factory", "url": null }
c is the condition for the final if clause correct? When do you want it to be executed? prefer brackets round multiple conditions ((len != limit) && (count < len)) why use both strdup and malloc ? malloc return should not be cast (C not C++) why malloc the remaining string from str instead of just modifying search - it is already writeable because you strdup-ed it the duped string should be freed on return, else it is a leak. Depends what the callback does with the bits of course.
{ "domain": "codereview.stackexchange", "id": 1694, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c", "url": null }
stresses, solid-mechanics Title: Why is it that plane stress varies? Take the simplest example of some uniform bar being stressed by a force N, I understand that we need to adjust an angle to determine the stress in terms of shear and principal stresses on that plane, but what are the physical reasons for this? Is it that at a point there will be different internal forces between particles that are positioned around that point depending on their relative position to the point? Why is shearing experienced at an angle to an axial force? What causes there to be a shearing effect on a plane that is at an angle to the direction of N? What helped me understand this was drawing a square on the side of the bar and then watch what happens when you simply stretch the bar in axial direction.
{ "domain": "engineering.stackexchange", "id": 5098, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "stresses, solid-mechanics", "url": null }
in matlab, circular gabor filter matlab,. 2D diffusion–relaxation data are double-exponentially decaying landscapes and thus second order data structures. In this method the nonlinear iterations is only to execute on the coarse grid and the fine-grid solution can be obtained in a single linear step. EML4143 Heat Transfer 2 For education purposes. MATLAB should be able to handle that fairly easily. 3 Systems Suppose that we want to solve and plot solutions of the following system of three linear ordinary di erential equations: dx dt = x+ 2y z dy dt = x+ z dz dt = 4x 4y+ 5z:. 2D/3D image segmentation using level-set based active contour/surface with AOS scheme. •In the MATLAB code you can use spy(A)command to see the sparsity pattern of [A]. The implementation details are described in "P. The development of this matlab toolbox is in its infancy. The convection-diffusion equation describes the flow of heat, particles, or other physical quantities in situations where there is both
{ "domain": "aresdeck.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9755769071055402, "lm_q1q2_score": 0.8440926429097708, "lm_q2_score": 0.865224091265267, "openwebmath_perplexity": 1675.8624038387193, "openwebmath_score": 0.5665031671524048, "tags": null, "url": "http://aresdeck.it/ifmt/2d-diffusion-matlab.html" }
thermodynamics, enthalpy In case of adiabatic process, there is no transfer of heat so $Q=0$. Again for an isobaric process, pressure is constant that is $\Delta P=0$. So, change in enthalpy: $$\Delta H = \Delta U + \Delta(PV) = Q + W + P\Delta V + V\Delta P = W + P\Delta V = -P\Delta V + P\Delta V = 0$$ Thus, we see that change in enthalpy is zero. But the answer matches with none of the options. What is incorrect in my solution? If, at time = 0, we suddenly drop the external force per unit area to $P_{\text{ext}}$ and hold it at this value until our adiabatic system equilibriates, the first law of thermodynamics for this situation reads: $$nC_\mathrm v(T_2-T_1)=-P_{\text{ext}}(V_2-V_1)=-\frac{nRT_2}{V_2}(V_2-V_1)=-nRT_2\left[1-\frac{1}{8}\right]$$ Solving this equation for $T_2$ yields: $$T_2=\frac{T_1}{\left[1+\frac{7}{8}\frac{R}{C_\mathrm v}\right]}$$ But, for $C_v=3R$, this gives:$$T_2=0.774T_1=\pu{232 K}$$ So, $$\Delta H=3(4R)(232-300)=\pu{-6.78 kJ}$$
{ "domain": "chemistry.stackexchange", "id": 9696, "lm_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, enthalpy", "url": null }
python, python-3.x, file Etc. So if we have a 6ES7132-6BF01-0BA0 from Siemens, we have: |> current lib |> Siemens 6ES7132-6BF01-0BA0_de.pdf 6ES7132-6BF01-0BA0_en.pdf 6ES7132-6BF01-0BA0_nl.pdf There are a couple of things that can go wrong with this: Missing files (only _de available instead of all 3). Files not signed (6ES71326BF010BA0_de.pdf instead of 6ES7132-6BF01-0BA0_de.pdf). Invalid language-separator signs (older files have the language separated by - instead of _). Old language (older Dutch files are named _ne instead of _nl). Incorrect language (we're not interested in _it). Incorrect/missing extension (all files should be .pdf). Outdated documents (the older it gets, the more likely the data has been adjusted).
{ "domain": "codereview.stackexchange", "id": 37139, "lm_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, file", "url": null }
##### Example The Brachistochrone problem was posed by Johann Bernoulli in 1696. It asked for the curve between two points for which an object will fall faster along that curve than any other. For an example, a bead sliding on a wire will take a certain amount of time to get from point $A$ to point $B$, the time depending on the shape of the wire. Which shape will take the least amount of time? Restrict our attention to the $x$-$y$ plane, and consider a path, between the point $(0,A)$ and $(B,0)$. Let $y(x)$ be the distance from $A$, so $y(0)=0$ and at the end $y$ will be $A$. Galileo knew the straight line was not the curve, but incorrectly thought the answer was a part of a circle. This simulation also suggests that a curved path is better than the shorter straight one: Now, the natural question is which path is best? The solution can be reduced to solving this equation for a positive $c$: $~ 1 + (y'(x))^2 = \frac{c}{y}, \quad c > 0. ~$ Reexpressing, this becomes:
{ "domain": "juliahub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126457229185, "lm_q1q2_score": 0.8299167739301163, "lm_q2_score": 0.847967764140929, "openwebmath_perplexity": 858.0240248496365, "openwebmath_score": 0.8281819224357605, "tags": null, "url": "https://juliahub.com/docs/CalculusWithJulia/AZHbv/0.0.5/ODEs/euler.html" }
python, python-3.x def function_2_string(self, function, args, strings=True): return function + ( "()" if len(args) == 0 else "(" + ", ".join(args if not strings else ["'" + str(arg) + "'" for arg in args]) + ")" ) def call_function_by_hotkey(self, hotkey, args): if function := self.hotkeys[hotkey].function if hotkey in self.hotkeys else "": return eval(self.function_2_string(function, args)) raise NameError("Hotkey " + hotkey + " is not defined") def __str__(self): string = LINEBREAK + "ACTIONS".center(LINEWIDTH) + LINEBREAK action_strings = [] for hotkey, name, _, description in self.hotkeys.values(): action_strings.append(f"- {hotkey}: {name}") if description: action_strings.append(" -- " + description) return string + "\n".join(action_strings) + LINEBREAK
{ "domain": "codereview.stackexchange", "id": 41579, "lm_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", "url": null }
so that their are two pairs of rectangles that occupy the corners and one rectangle that is in the middle (not touching the perimeter). Each pair of rectangles are the same size and orientation but in opposite corners. (Top left and bottom right or Top right and bottom left.) The length and width of the five rectangles are constructed from two other unit lengths $$a$$ and $$b$$. $$a$$ is the smallest number such that $$m+a$$ is a power of two. $$b$$ is the smallest number such that $$n+b$$ is a power of two. This means that $$f(m+a)$$ and $$f(n+b)$$ are each one. The length and width of the two rectangles in the first pair are $$f\left(\frac{m+a}{2}\right)$$ and $$f\left(\frac{n-b}{2}\right)$$ respectively. The length and width of the two rectangles in the second pair are $$f\left(\frac{m-a}{2}\right)$$ and $$f\left(\frac{n+b}{2}\right)$$ respectively. The formula for the total number of base-2 rectangle used is $$2f\left(\frac{m+a}{2}\right)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9863631627142339, "lm_q1q2_score": 0.8516176877425377, "lm_q2_score": 0.8633916187614822, "openwebmath_perplexity": 215.95010760270029, "openwebmath_score": 0.7841835021972656, "tags": null, "url": "https://math.stackexchange.com/questions/3173523/tiling-a-square-with-rectangles" }
phylogenetics, genome-sequencing But couldn't find any reference in Wikipedia or online papers to what it isCan someone shed some light? Early MinION sequencing runs had forward and reverse DNA templates joined together by a hairpin adapter, so that the sequencer would read both strands from the same template. The consensus sequence that was generated by combining the base calls of opposite strands is referred to as a 2D read. Due to a dispute with Pacific Biosciences, and for other reasons related to chemistry and basecalling, the equivalent mode in current sequencing runs is called 1D². There is no physical ligation of forward and reverse templates, but the kit and flow cell chemistry are modified to encourage the reverse strand to follow the forward strand very soon afterwards through the pore, with the joining and consensus generation carried out in software after the sequencing is done. In the output fast5 files, these 1D² reads can also be referred to as 2D.
{ "domain": "bioinformatics.stackexchange", "id": 793, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phylogenetics, genome-sequencing", "url": null }
vba, error-handling Title: Ensuring array of worksheets are present I have a sub which should only continue running if 4 specific worksheets are present. From online reading, such as @Tim Williams's comment in Test or check if sheet exists, I know that using an error thrown, to determine a course of action, can be frowned upon, but I found similar usage to mine in both that question and here. Here is a simplified version: Private Sub Test() If AllSheetsPresent Then MsgBox "Doing something" End Sub Private Function AllSheetsPresent() As Boolean AllSheetsPresent = True Dim SheetsArr() On Error GoTo errhand SheetsArr = ThisWorkbook.Sheets(Array("Response Times", "Incidents", "Calls", "Resources", "NoC, CPR")) Exit Function errhand: If Err.Number = 9 Then AllSheetsPresent = False MsgBox "Sheets are missing from..." End End If End Function
{ "domain": "codereview.stackexchange", "id": 29077, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, error-handling", "url": null }
electric-circuits, electric-current, voltage One explanation I hear is that birds aren't connecting two places of differing potential – but if that was the case then why does my parallel circuit work? One resistor should register no current (or very little) – and I know if I make the resistor large enough (the one in parallel, say, $R_2$) the current draw will be smaller. Is that what is happening? The resistance of the bird is large enough that the current drawn is small? Let's say a bird has $1\ \mathrm{M\Omega}$ of resistance. A $600\ \mathrm V$ wire would still put $0.6\ \mathrm{mA}$ through the animal. But that doesn't satisfy me because we are dealing with a $\mathrm{kV}$ scale wire a lot of the time. You'd need for the bird, which is effectively a bag of water and such, to have a lot of resistance for that to work, but maybe it does.
{ "domain": "physics.stackexchange", "id": 65889, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-circuits, electric-current, voltage", "url": null }
• Ok, I'm gonna try this and see if it makes sense now, thank you. If it works out I'll mark this as the accepted answer :) – Justin Saunders Jul 26 '20 at 22:14 • I still don't seem to understand the second problem. I can't figure out what I'm doing wrong or different than what I'm doing on the first problem. The first one makes perfect sense, but the second one, for some reason, is not clicking with me. – Justin Saunders Jul 26 '20 at 22:33 • What is your $P(n)$? – N. F. Taussig Jul 26 '20 at 22:35 • $P(n)$ is $5n$ Right? – Justin Saunders Jul 26 '20 at 22:39
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9861513901914405, "lm_q1q2_score": 0.8016102355267105, "lm_q2_score": 0.8128673178375734, "openwebmath_perplexity": 281.8181994342315, "openwebmath_score": 0.8374302983283997, "tags": null, "url": "https://math.stackexchange.com/questions/3770280/proofs-by-induction-are-my-two-proofs-correct" }
biochemistry, cell-biology, metabolism Aminotransferases catalyze the redistribution of nitrogen between amino acids and corresponding oxoacids participating in both protein metabolism and gluconeogenesis. They are ubiquitous in their cellular distribution. Tissue activity for AST (aspartate aminotransferase) is as follows in decreasing concentration: heart, liver, skeletal muscle, kidney, pancreas, spleen, lung, and erythrocyte. Two distinct forms have been identified: a cytoplasmic, or soluble isoenzyme, and a mitochondrial isoform... The distribution and relative tissue concentration of ALT (alanine aminotransferase) is similar but importantly different. Highest activity is found in the liver, followed by kidney, myocardium, skeletal muscle, pancreas, spleen, lung, and erythrocyte. ALT activity is found in the cytosol; organ- or organelle-specific isoenzymes have not been demonstrated. The concentration of ALT in hepatic cell cytoplasm is comparable to AST;
{ "domain": "biology.stackexchange", "id": 5749, "lm_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, cell-biology, metabolism", "url": null }
### SectionSLTSurjective Linear Transformations The companion to an injection is a surjection. Surjective linear transformations are closely related to spanning sets and ranges. So as you read this section reflect back on Section ILT and note the parallels and the contrasts. In the next section, Section IVLT, we will combine the two properties. #### SubsectionSLTSurjective Linear Transformations As usual, we lead with a definition. ##### Definition SLT Surjective Linear Transformation Suppose $\ltdefn{T}{U}{V}$ is a linear transformation. Then $T$ is surjective if for every $\vect{v}\in V$ there exists a $\vect{u}\in U$ so that $\lt{T}{\vect{u}}=\vect{v}$.
{ "domain": "ups.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9888419694095655, "lm_q1q2_score": 0.8196894920981548, "lm_q2_score": 0.8289388167733099, "openwebmath_perplexity": 386.14604905480917, "openwebmath_score": 0.9379552602767944, "tags": null, "url": "http://linear.ups.edu/html/section-SLT.html" }
javascript, jquery, html For the selectBox, i use this javascript code to render the good value : //Set the second selectBox depending on the first one choice. $(document).ready(function () { $("#dropdownBodyparts").change(function () { var val = $(this).val(); if (val == "All") { $("#dropdownBodypartsDeep").html("<option value='All'>All</option>"); } else if (val == "Head") { $("#dropdownBodypartsDeep").html("<option value='Specialized'>Specialized</option>"); } else if (val == "Foot") { $("#dropdownBodypartsDeep").html("<option disabled selected value> -- Select A Specialized Bodypart</option><option value='All'>All</option><option value='Dorsum + Imprint'>Dorsum + Imprint</option><option value='Plantar Surface'>Plantar Surface</option><option value='Foam Box'>Foam Box</option><option value='Dorsum'>Dorsum</option><option value='for AFO'>for AFO</option>"); } else if (val == "Leg") {
{ "domain": "codereview.stackexchange", "id": 36985, "lm_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, html", "url": null }
water Title: White powder observed after boiling water in electric kettle for many weeks I used my water kettle (metal ones, not the plastic ones) to boil my water. Usually, if I did not consume all the water in the kettle and the water was cold, I usually topup extra water to the kettle and turn it on to boil. So, after many weeks of boiling in this way, I notice that there are white powder outside the kettle. (I notice that when the water is boil, some water was splashed to the outside of the kettle and I left those water splashed out to dry as time goes)
{ "domain": "chemistry.stackexchange", "id": 328, "lm_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", "url": null }
9. anonymous I'm sorry I'm still confused? 10. mathstudent55 Remember that your equation was not tan x = 0 Your equation was tan x/2 = 0 Once we found where the tangent has a value of zero, which is every integer multiple of pi, that means x/2 equals every integer multiple of pi. Now we need x. When you multiply every integer multiple of pi by 2, you get every even multiple of pi. The solution to the equation tan x/2 = 0 is every even multiple of pi. There is only one choice that is an even multiple of pi. 11. anonymous 2pi?? 12. mathstudent55 Correct. 13. anonymous Thanks! 14. mathstudent55 You're welcome. 15. anonymous To start off, let's drop the x/2 and just say tanx. Where does tan x = 0? 16. anonymous if you know where tanx = 0. I know your question is tan(x/2), but I was just seeing if you knew tanx = 0. So that means is if it were just X, x would = pi. But we have (x/2). So instead of x = pi, I'll say (x/2) = pi and then say solve for x :3 17. anonymous
{ "domain": "openstudy.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854155523791, "lm_q1q2_score": 0.850964187878368, "lm_q2_score": 0.8774767842777551, "openwebmath_perplexity": 1968.4887259840466, "openwebmath_score": 0.8105481863021851, "tags": null, "url": "http://openstudy.com/updates/55adc4ffe4b0ce10565b67aa" }
The quotient $\pi: \mathbb{R}^{n+1} \setminus \{0\} \to \mathbb{RP}^n$ can be broken up into two quotients $\mathbb{R}^{n+1} \setminus \{0\} \to S^{n} \to \mathbb{RP}^n$. The first sends $x$ to $\frac{x}{|x|}$ (considering $S^{n}$ as the unit circle embedded in $\mathbb{R}^{n+1}$); the second identifies the antipodes. The composition of these quotients identifies each linear subspace with one point and is precisely $\pi$ as described in that excerpt. • Why is the map $x/norm(x)$ a quotient map? – Keith Jan 9 '18 at 14:50 • @Keith It identifies all $x$ with equal $\frac{x}{|x|}$ to a point; i.e., it identifies each half-line emanating from the origin to a point. – BallBoy Jan 9 '18 at 14:52 • Actually this is the part I am stuck at. I think that $x/norm(x)$ is an open surjective map, therefore a quotient map. But I cannot rigorously prove why the map is open. Could you please help me? – Keith Jan 9 '18 at 14:52
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9911526447864001, "lm_q1q2_score": 0.8126394439715247, "lm_q2_score": 0.8198933315126792, "openwebmath_perplexity": 108.39811426428291, "openwebmath_score": 0.9181910753250122, "tags": null, "url": "https://math.stackexchange.com/questions/2598289/equivalent-definition-of-the-real-projective-space" }
quantum-field-theory, renormalization, interactions, effective-field-theory It is only in the trivial/uninteresting Gaussian case that $m=g_2$. In general $m=m(g_2,g_4,\ldots)$ is a very complicated nonlinear function of the couplings present in the Lagrangian. The theory is massless when $m=0$, so there is no reason for this to translate into $g_2=0$. In fact one needs $g_2<0$. A heuristic for this is that if one overshoots slightly towards more negative values of $g_2$ then one gets into the broken $\mathbb{Z}_2$ symmetry regime. Clearly this requires a double well potential trying to pretend to be the potential for an Ising model. If $g_2\ge 0$ (as well as $g_4>0$, $g_6=g_8=\cdots=0$) then the potential has a single well with minimum at $\phi=0$. This can't give you a spontaneous magnetization.
{ "domain": "physics.stackexchange", "id": 69901, "lm_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, renormalization, interactions, effective-field-theory", "url": null }
javascript, node.js, http if (workFlow[meth][match].merg !== undefined) { _merg(request, meth, match, results, function(err, merg) { callback(err, { sync: results.sync, async: results.async, merg: merg }); }); } else { callback(err, results); } }); } } };
{ "domain": "codereview.stackexchange", "id": 7903, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, http", "url": null }
A probability distribution $\pi$ over the states is a stationary distribution if $\pi = \pi P$ It is called a stationary distribution because the distribution over states is invariant with time. A Markov Chain is only at stationarity if and only if it has been started from the stationary distribution. The relationship $\pi = \pi P$ can be expanded for the jth element to show that any stationary distribution must satisfy the Global Balance Equations: $\pi_j = \sum_i p_{ij}\pi_i.$ Note that if a distribution $\pi$ satisfies the detailed balance equations from Definition 56, then $\pi$ also satisfies Definition 63. Both the global balance equations and detailed balance equations can be conceptualized as statements of flow. If each $\pi_j$ indicates how much mass is placed on state $j$ , then the global balance equations tell us the mass leaving the node (going to each neighbor $i$ in proportion to $p_{ij}$ ) is equal to the mass entering the node (which must sum to $\pi_j$
{ "domain": "gitbook.io", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.989986427013312, "lm_q1q2_score": 0.8023631257620042, "lm_q2_score": 0.8104789155369048, "openwebmath_perplexity": 1274.265893905362, "openwebmath_score": 0.868481457233429, "tags": null, "url": "https://aparande.gitbook.io/berkeley-notes/eecs126-0/eecs126-5" }
Let $$H$$ be a midpoint of $$BG$$. Then $$HF$$ is a middle line in triangle $$ABG$$, so $$FH||AB||CD$$ and $$FH = {1\over 2}AB = CE$$ so $$FHCE$$ is a parallelogram, so $$FE||CH$$. Now $$HF\bot BC$$ so $$HF$$ is (second) altitude in $$\triangle BCF$$ so $$H$$ is orthocenter in this triangle, since $$BG$$ is also altitude in this triangle. So line $$CH\bot FB$$ and thus $$\angle BFE = 90^{\circ}$$. Here is a vector solution: Let $$G$$ be an origin of position vecotors. Then $$G=0$$, $$F = A/2$$, $$D = A-B+C$$, $$A\cdot B = C\cdot B=0$$ and $$E = {1\over 2}(C+D) = {1\over 2}(A-B+2C)$$ $$\begin{eqnarray} \vec{FB}\cdot \vec{FE} &=& (E-F)(B-F)\\ &=& {1\over 4}(-B+2C)(2B-A)\\ &=& -{1\over 2}(B^2+CA)\\ &=&0 \end{eqnarray}$$ A solution with a help of the coordinate system.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.988130881050834, "lm_q1q2_score": 0.8653921620593246, "lm_q2_score": 0.8757869819218865, "openwebmath_perplexity": 128.04523796137414, "openwebmath_score": 0.9508201479911804, "tags": null, "url": "https://math.stackexchange.com/questions/2948977/proving-right-angle-using-vectors" }
java, algorithm, linked-list, mergesort return head; } } As always, any critique is much appreciated. I think, toString() in LinkedListNode.java could be refactored. Let's just keep things simpler. (^_-) I thought at runtime, whether the current(parameter that pass-in) is null or not, it always have to check 2 conditions always. We can actually write it with a single if(current != null) checking. While loop will run as long as it has a next element. (Adopted this style from usual BufferedReader file reading) No need of extra local variable to be created. We can get rid of it. public static <E> String toString(LinkedListNode<E> current) { final StringBuilder sb = new StringBuilder().append('['); if (current != null) { sb.append(current.getDatum()); while ((current = current.getNext()) != null) { sb.append(", ").append(current.getDatum()); } } return sb.append(']').toString(); }
{ "domain": "codereview.stackexchange", "id": 21232, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, linked-list, mergesort", "url": null }
galactic-dynamics "$z$" is the redshift, which is being used as a proxy for time: $z = 0$ corresponds to the present day (age of universe = 13.7 Gyr), $z = 1$ corresponds to an age of about 6 Gyr, $z = 2$ is about 3.3 Gyr, and so forth. You can use Ned Wright's Cosmology Calculator to convert individual redshifts to ages of universe (click on the "Flat" button to use a standard cosmology). ("Gyr" = gigayear = 1 billion = $10^{9}$ years, in case that's not clear.)
{ "domain": "astronomy.stackexchange", "id": 2405, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "galactic-dynamics", "url": null }
or correlation coefficients. In lines 29-30 we convert the 6 columns to one column containing a list with the 6 values of variables d1–d6. Techniques based on the MD and applied in different fields of chemometrics such as in multivariate calibration, pattern recognition and process control are explained and discussed. If VI is not None, VI will be used as the inverse covariance matrix. When you consider the distance between two points, imagine two vectors from the origin, then the Cosine of the angle between the vectors is given by the dot product divided by their lengths. The matrix encodes how various combinations of Mahalanobis distance (or "generalized squared interpoint distance" for its squared value) can also be defined as a dissimilarity measure between two random vectors and of the same distribution with the covariance matrix : If the covariance matrix is the identity. Now suppose you want to know how far person, v1 = (66, 570, 33), is from person v2 = (69, 660, 46). Available
{ "domain": "milsabores.net", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9572778024535094, "lm_q1q2_score": 0.8078420455163772, "lm_q2_score": 0.8438950986284991, "openwebmath_perplexity": 723.3441140890131, "openwebmath_score": 0.6857232451438904, "tags": null, "url": "http://milsabores.net/french-vanilla-bzqbtkv/mahalanobis-distance-between-two-vectors-python-4bc1bb" }
c, beginner, converting Title: Temperature conversion in C I have started to learn C and I have tried my hand at temperature conversion. The idea is to convert a temperature from Fahrenheit to Celsius and vice/versa. Can somebody review my code and let me know how I might be able to improve it? My program is as follows: #include <stdio.h> void fahconv() { double fah; puts("Enter value to convert from Fahrenheit to Celsius"); scanf("%lf",&fah); printf("Converted temperature from F to C: %lf",((fah - 32.0)*5.0)/9.0); } void celsconv() { double cels; puts("Enter value to convert from Celsius to Fahrenheit"); scanf("%lf",&cels); printf("Converted temperature from C to F: %lf",(cels*9/5)+32); } void invalidchoice() { printf("Invalid choice..exiting"); }
{ "domain": "codereview.stackexchange", "id": 5760, "lm_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, converting", "url": null }
How do I insert a table when asking a question? I'm having a hard time to insert a table here when I'm asking a question. Any help would be appreciated. Also, is there any, not too expensive, math programs that allow me to enter math terms and equations kind of thing? Thank you Tom • Related on tables: meta.stackexchange.com/questions/73566/… May 17 '12 at 19:51 • Have to tried www.wolframalpha.com ? :) May 17 '12 at 19:51 • There is an entry on tables in the MathJax tutorial. Some support for tables is now available also in MarkDown, as illustrated in this answer. Dec 9 '20 at 4:51 Regarding how to write general math expressions on the site, my answer here covers that well I think. Specifically for tables, you can use LaTeX's \array command. The tabular command, which only works in text mode, is not available here, so if you want to include text in your table, you will have to do some tinkering. Here is an example table:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.914900950352329, "lm_q1q2_score": 0.8012583509649136, "lm_q2_score": 0.8757869916479466, "openwebmath_perplexity": 2090.393892637231, "openwebmath_score": 0.6171692609786987, "tags": null, "url": "https://math.meta.stackexchange.com/questions/4240/how-do-i-insert-a-table-when-asking-a-question/4241" }
javascript, react.js return ( <div className="recEntry"> <h2>{editStat ? 'Edit a recipe' : 'Add a recipe'}</h2> <h3>Title</h3> <p><b>{editStat ? 'Old title: ' : ""}</b><span className="titleSpan"></span></p> <input type="text" className="inpName" /> <h3>Ingredients</h3> <p className="instruct">Please put commas(",") in between ingredient names.</p> <textarea className="inpIngred" /> <button onClick={editStat ? this.handleEdit : this.handleAdd} className="saveBtn">{editStat ? 'Save' : 'Add recipe'}</button> <button onClick={this.handleClose} className="closeBtn">Close</button> </div> ); } } ReactDOM.render(<RecipeContainer/>, document.querySelector(".recWrap"));
{ "domain": "codereview.stackexchange", "id": 24583, "lm_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, react.js", "url": null }
c, matrix, assembly, sse, simd One extra insn could save code size in the epilogue Displacements outside [-128..127] take on instruction byte, but outside that range requires 4 instruction bytes. 482: c5 c5 58 79 60 vaddpd 0x60(%rcx),%ymm7,%ymm7 487: c5 fd 29 79 60 vmovapd %ymm7,0x60(%rcx) // insert an add here and change the displacements of all the following insns 48c: c5 3d 58 81 80 00 00 00 vaddpd 0x80(%rcx),%ymm8,%ymm8 494: c5 7d 29 81 80 00 00 00 vmovapd %ymm8,0x80(%rcx) 49c: c5 35 58 89 a0 00 00 00 vaddpd 0xa0(%rcx),%ymm9,%ymm9 4a4: c5 7d 29 89 a0 00 00 00 vmovapd %ymm9,0xa0(%rcx) ... 16 insns with 4B displacements. You can put in an "add $256, %[C]\n\t" // spend 7 code bytes for this insn to save 16*3 bytes for displacements in following instructions
{ "domain": "codereview.stackexchange", "id": 19339, "lm_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, matrix, assembly, sse, simd", "url": null }
ros, c++, baxter ROS Message inner workings: http://wiki.ros.org/msg Reference for C++ vectors: http://www.cplusplus.com/reference/vector/vector/ Baxter's Arm Control Mode Details: http://sdk.rethinkrobotics.com/wiki/Arm_Control_Modes Originally posted by imcmahon with karma: 790 on 2015-11-30 This answer was ACCEPTED on the original site Post score: 3 Original comments Comment by ravijoshi on 2015-11-30: Thank you very much. Happy to see a detailed answer. I appreciate it!!!
{ "domain": "robotics.stackexchange", "id": 23116, "lm_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, c++, baxter", "url": null }
quantum-mechanics, quantum-field-theory, statistical-mechanics, hamiltonian, second-quantization Title: Hamiltonian of a quantum heat bath I have seen the Hamiltonian for a heat bath written as: $$ H_B = \hbar \int_0^\infty \omega b(\omega)^\dagger b(\omega) d\omega $$ I was hoping to understand this equation better. This suggests that the heat bath is written as a sum of harmonic oscillators with raising/lowering operators $b^\dagger(\omega)$ and $b(\omega)$. I understand that is that this is just the continuous limit of the quantised electromagnetic field. Please could someone explain the following: 1) Does the raising operator $b^\dagger(\omega)$ correspond directly to a mode in the heat bath with frequency $\omega$? ie does $b^\dagger(\omega)b(\omega)$ give us the number operator for the number of excitations of frequency $\omega$? or does the argument $\omega$ mean something else?
{ "domain": "physics.stackexchange", "id": 55717, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-field-theory, statistical-mechanics, hamiltonian, second-quantization", "url": null }
• Thank you very much for your help! So your answer shows that $y$ may satisfy (i) and (ii) but not (iii), unlike what's said in the book. However I still can't see why there exists $y$ that satisfies (i), (ii) and (iii). The aim in the proof is to prove that $v$ has a neighbor in $G_1$ that is not a cut vertex of $G-v$. In your graph that's indeed vertex $x$, but I couldn't find a proof. – Scientifica Aug 26 '18 at 15:25 • You're right - I read your answer and assumed that you could always find such a vertex, but I see now that you only have a way to find a vertex satisfying (ii) and (iii) but not (i). I don't see offhand how to do it, but in the meantime I've included a simpler way to finish the proof. – Misha Lavrov Aug 26 '18 at 15:28 • I see. That indeed finishes the proof. Thank you very much! – Scientifica Aug 26 '18 at 21:41 This answer is intended as a supplement to Misha Lavrov's answer. It will show that we can always pick a $y$ with the desired three properties.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846672373524, "lm_q1q2_score": 0.8088421393658533, "lm_q2_score": 0.8267117898012104, "openwebmath_perplexity": 88.89316606602027, "openwebmath_score": 0.8974928855895996, "tags": null, "url": "https://math.stackexchange.com/questions/2895053/understanding-a-fact-in-a-proof-of-brookss-theorem" }
lemon-flavored. Be negative of drawing black balls subject experts Prepared the NCERT Solutions for Class 10 with good score check... Students studying in CBSE Class 10 Maths Ch 15 Solutions prepare yourself for tackling even the toughest Questions exams! Discussion forum to ask your Questions and Answers E ) always lies 0. ) what is the aptitude Questions and Answers Class 10 textbook Questions Class. Group of 3 students, the Answers are also provided in Class 9 and further explains the different related. The sum of the rectangle is the probability of an experiment is __________ = No daily life tomorrow... Even the toughest Questions in exams will get convenient for you, how many tickets she... The bulb drawn in ( i ) probability of getting six as the player may shoot or miss the.! Email address will not be the probability of an event is called a or... Why the probability that it will be familiarised with these concepts, precisely 10 Extra Questions Class... Diameter 1m ₹5 coins
{ "domain": "bigwiggames.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.952574129515172, "lm_q1q2_score": 0.8019013369143421, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 1065.6631445483727, "openwebmath_score": 0.47341519594192505, "tags": null, "url": "https://bigwiggames.com/hmdjtu0/probability-questions-and-answers-class-10-1636ac" }
# Proving an exponential bound for a recursively defined function I am working on a function that is defined by $$a_1=1, a_2=2, a_3=3, a_n=a_{n-2}+a_{n-3}$$ Here are the first few values: $$\{1,1,2,3,3,5,6,8,11,\ldots\}$$ I am trying to find a good approximation for $a_n$. Therefore I tried to let Mathematica diagonalize the problem,it seems to have a closed form but mathematica doesn't like it and everytime I simplify it gives: a_n = Root[-1 - #1 + #1^3 &, 1]^n Root[-5 + 27 #1 - 46 #1^2 + 23 #1^3 &, 1] + Root[-1 - #1 + #1^3 &, 3]^n Root[-5 + 27 #1 - 46 #1^2 + 23 #1^3 &, 2] + Root[-1 - #1 + #1^3 &, 2]^n Root[-5 + 27 #1 - 46 #1^2 + 23 #1^3 &, 3] I used this to get a numerical approximation of the biggest root: $$\text{Root}\left[x^3-x-1,1\right]=\frac{1}{3} \sqrt[3]{\frac{27}{2}-\frac{3 \sqrt{69}}{2}}+\frac{\sqrt[3]{\frac{1}{2} \left(9+\sqrt{69}\right)}}{3^{2/3}}\approx1.325$$ Looking at the function I set $$g(n)=1.325^n$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.965899575269305, "lm_q1q2_score": 0.8266662611250903, "lm_q2_score": 0.8558511488056151, "openwebmath_perplexity": 134.25582064138518, "openwebmath_score": 0.9989553093910217, "tags": null, "url": "http://math.stackexchange.com/questions/86569/proving-an-exponential-bound-for-a-recursively-defined-function" }
clustering, scalability, dbscan $\frac{(n^2-n)}{2}$ is basically the triangular matrix. However, it says that a non-matrix based implementation only requires $O(n)$ memory. How does that work? Regardless of what data structure you use, don't you always have to have $\frac{(n^2-n)}{2}$ distance values? It would still be $O(n^2)$ space complexity, no? Is there something I'm missing here? I'm working with a huge dataset and I would really like to cut down on memory usage. You can run DBSCAN without storing the distances in a matrix. This has the drawback that each time you visit a point, you have to recalculate all the relevant distances, which requires more time. However, the space complexity stays $O(n)$, since the only things you have in memory at any single time are the positions of the n points, their various labels, the neighbors of the current point and the neighbors of a particular neighbour in the case that the point turns out to be a core point.
{ "domain": "datascience.stackexchange", "id": 2972, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "clustering, scalability, dbscan", "url": null }
organic-chemistry, stereochemistry, vsepr-theory Second, steric factors (which are also really just another way of describing electron-electron repulsion) may also come into play. To whatever extent the cis H-C-C-H hydrogen-hydrogen repulsion is more destabilizing than the geminal H-C-H hydrogen-hydrogen repulsion, it will also serve to increase the C-C-H bond angle and shrink the H-C-H bond angle.
{ "domain": "chemistry.stackexchange", "id": 5734, "lm_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, stereochemistry, vsepr-theory", "url": null }
audio, sound, normalization What is the best method to solve this? Intuitively, it seems I might need to calculate a local max or average based on a moving window (rather than the entire set) but I'm not entirely sure. Help?
{ "domain": "dsp.stackexchange", "id": 5577, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "audio, sound, normalization", "url": null }
java, mysql, database, jdbc Title: Java JDBC: MySQL database-wrapper I'm currently enrolled in a further education with the topic database administration. Among other chapters it contains how databases can be accessed from application-software. Because it lacks programming exercises I have programmed a bit myself. Just for getting familiar with the techniques (mainly Java JDBC) shown. I finally got the idea for a MySQL wrapper-class which hides away (at least partly) the actual SQL. Here's what I got so far: package jdbc; import java.sql.*; import static java.lang.System.*; public class MySqlDb { private Connection connection; private Statement statement; public MySqlDb(String url, String dbName, String username, String password) throws SQLException { connection = DriverManager.getConnection( "jdbc:mysql://" + url + ":3306/" + dbName, username, password); }
{ "domain": "codereview.stackexchange", "id": 24582, "lm_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, mysql, database, jdbc", "url": null }
javascript, performance, beginner, programming-challenge, primes gap = 8 ,start = 3,000,000 and end = 4,000,000 I read about how to cache to minimize access for properties as length and put variables in local scope to make the code more efficient, but it didn't help me a lot. I then tried to optimize the for loops, but it affects the functionality of the code. Link to challenge function gap(gap, start, end){ var arr = []; var counter = []; var result; for(var x = start; x <= end; x++){ if(x % 2 == 1){ arr.push(x) } } for(var cache = arr.length, j = cache ; j >= 0; j--){ for(var i = 2; i <= Math.sqrt(arr[j]); i++){ if(arr[j] % i === 0){ if(i != arr[j]/i || i * i == arr[j]){ counter.push(arr[j] / i) arr.splice(j, 1) break; } } } if((arr[j+1] - arr[j]) == gap){ result = [arr[j], arr[j+1]] }else if (result == undefined){ result = null } } return result } In order of significance for performance
{ "domain": "codereview.stackexchange", "id": 23964, "lm_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, performance, beginner, programming-challenge, primes", "url": null }
ros, diagnostics, diagnostic-aggregator Title: Diagnostic aggregator not resetting between runs I'm having a problem that the diagnostic aggregator contains analyzers from a previous run. The situation is this: Start roscore Start an application, including diagnostic aggreggator, using roslaunch Stop the application and launch another one with a new yaml-file The aggregator message now contains analyzers from both the new and the old application (the old ones are stale now of cource). The problem arises when having roscore running and starting different applications with roslaunch (so skipping step one would fix the problem). The reason I start roscore is that I have a GUI that can start (and close down) different applications. This GUI is a rosnode, so I have to have roscore running while starting and stopping other applications. Is there a way of resetting the aggregator so it just listens to new messages (the ones specified specified in the last yaml-file loaded)?
{ "domain": "robotics.stackexchange", "id": 7334, "lm_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, diagnostics, diagnostic-aggregator", "url": null }
homework-and-exercises, fluid-dynamics, bernoulli-equation Solution 1) Bernoulli fails when the fluid exits the pipe. The pressure when the fluid leaves is equal to 0 (gauge) so we have Bernoulli's equation at the top of the pipe $$P+\frac{1}{2}\rho v^2=\frac{1}{2}\rho v'^2+\rho g h_1\longrightarrow v'^2=v^2+\frac{2P}{\rho}-2gh_1$$ Then using energy conservation we have $$mgh_1+\frac{1}{2}mv'^2=mgh_2\longrightarrow h_2=h_1+\frac{v'^2}{2g}$$ $$h_2=h_1+\frac{1}{2g}\left( v^2+\frac{2P}{\rho}-2gh_1 \right)=\frac{v^2}{2g}+\frac{P}{g\rho}$$. Solution 2) Bernoulli holds throughout the motion. The (gauge) pressure at the very top (and throughout the entire spout) is zero, so Bernoulli gives us $$P+\frac{1}{2}\rho v^2=\rho g h_2\longrightarrow h_2=\frac{P}{g\rho}+\frac{v^2}{2g}$$ The pressure in the stream must be approximately atmospheric, which causes the two solutions to be identical.
{ "domain": "physics.stackexchange", "id": 26945, "lm_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, fluid-dynamics, bernoulli-equation", "url": null }
planet, planetary-atmosphere, natural-satellites, solar-flare A planet with a surface temperature of a couple thousand degrees could heat the near side of its moon more than the star that they both orbit, perhaps giving off enough heat to cause the loss of the moon's atmosphere through thermal or Jeans escape which is basically a product of upper atmospheric temperature and escape velocity. It might not even be that uncommon for moons to receive more heat from the planets they orbits than the star they both orbit when the planet is undergoing sufficient bomboardment. A second way that a planet might strip a moon's atmosphere is if the moon was close to the planet's Roche limit. The atmosphere is less gravitationally bound and even if the moon comfortably holds itself together outside the Roche limit, its atmosphere would extend miles above its surface and be less gravitationally bound where gradual atmospheric stripping would be possible.
{ "domain": "astronomy.stackexchange", "id": 2977, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "planet, planetary-atmosphere, natural-satellites, solar-flare", "url": null }
python, performance, python-2.x, csv fo = '' with codecs.open('C:/inetpub/wwwroot/BloqueoLinea/DATA/data.txt','w',encoding = 'utf-8') as data: for forder in finalorder: order = forder.split(';') orden = [order[0],order[1],order[15],order[24],order[2],'',''] for familia in list_familias: fam = familia.split(';') if order[2] in fam[0]: orden[5] = fam[1] orden[6] = fam[2] fo = ';'.join(orden) data.write(fo+'\n') with codecs.open('C:/inetpub/wwwroot/BloqueoLinea/DATA/data.txt','r',encoding = 'utf-8') as cross: cr = cross.readlines() with codecs.open('C:/inetpub/wwwroot/BloqueoLinea/App_Data/BloqLines.txt','r',encoding = 'utf-8') as bloqueos: block = bloqueos.readlines() with codecs.open('C:/inetpub/wwwroot/BloqueoLinea/DATA/nodos.txt','r',encoding = 'utf-8') as node: nodos = node.readlines() with codecs.open('C:/inetpub/wwwroot/BloqueoLinea/DATA/Table-Lineas.txt','r',encoding = 'utf-8') as listlineas:
{ "domain": "codereview.stackexchange", "id": 16949, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, python-2.x, csv", "url": null }
navigation, mapping, navsat-transform-node, base-link, robot-localization Originally posted by Yvonnn on ROS Answers with karma: 16 on 2017-06-30 Post score: 0 Ah, so I think the issue here is one if being descriptive vs. prescriptive. In the image from navsat_transform_node, all I am trying to do is visualize the parameters in question and the need for them. However, note that the drawing is not inconsistent with the use case of fusing yaw in your EKF state estimate. At time t0, the robot's state really is as the picture above shows, since you have not received an IMU measurement when the node starts. It just so happens that the EKF doesn't publish the state at time t0, which would just be a zero state (unless you specify a starting state).
{ "domain": "robotics.stackexchange", "id": 28260, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, mapping, navsat-transform-node, base-link, robot-localization", "url": null }
# 7 fishermen caught exactly 100 fish and no two had caught the same number of fish. Then there are three who have together captured at least 50 fish. $$7$$ fishermen caught exactly $$100$$ fish and no two had caught the same number of fish. Prove that there are three fishermen who have captured together at least $$50$$ fish. Try: Suppose $$k$$th fisher caught $$r_k$$ fishes and that we have $$r_1 and let $$r(ijk) := r_i+r_j+r_k$$. Now suppose $$r(ijk)<49$$ for all triples $$\{i,j,k\}$$. Then we have $$r(123) so $$300\leq 3(r_1+\cdots+r_7)\leq 49+48+47+46+45+44+43= 322$$ and no contradiction. Any idea how to resolve this? Edit: Actually we have from $$r(5,6,7)\leq 49$$ that $$r(4,6,7)\leq 48$$ and $$r(3,6,7)\leq 47$$ and then $$r(3,4,5)\leq r(3,6,7) - 4 \leq 43$$ and $$r(1,2,5)\leq r(3,4,5)-4\leq 39$$ and $$r(1,2,4)\leq 38$$ and $$r(1,2,3)\leq 37$$ so we have: $$300\leq 49+48+47+43+39+38+37= 301$$ but again no contradiction.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639661317859, "lm_q1q2_score": 0.8178874684906827, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 512.725875084525, "openwebmath_score": 0.7813875079154968, "tags": null, "url": "https://math.stackexchange.com/questions/2936741/7-fishermen-caught-exactly-100-fish-and-no-two-had-caught-the-same-number-of-fis" }
newtonian-mechanics, friction, centrifugal-force How can you have mixed friction? So then the question is when is there ever both static and kinetic friction. The answer may surprise you that the vast majority of the time your tires are experiencing both. This is because the tires are very flexible and stretchy. This flexibility allows part of the contact patch of the tire to be slipping against the road surface while the rest of the contact patch is sticking statically to the road. The net force is the sum of both forces. In this case they are still always pointing in the direction that would prevent slipping. For more information you can google "slip angle" for explanations on how stick and slipping work together to provide cornering force.
{ "domain": "physics.stackexchange", "id": 53265, "lm_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, friction, centrifugal-force", "url": null }
homework-and-exercises, electromagnetism, optics, angular-momentum, maxwell-equations the spin integral $ \frac{1}{\mu_0c^2} \int\mathrm d\mathbf r \: \mathbf E\times \mathbf A$ gives a constant SAM over all of space, the OAM integral $\frac{1}{\mu_0c^2} \int_V\mathrm d\mathbf r \: \mathbf r \times (E_i \nabla \! A_i )$ gives zero, and the original total-angular-momentum integral $\frac{1}{\mu_0c^2} \int_V\mathrm d\mathbf r \: \mathbf r \times (\mathbf E\times\mathbf B)$ is tricky to handle, but the only symmetric way to treat it says that it should be equal to zero. This gives rise to an apparent paradox, with two different aspects:
{ "domain": "physics.stackexchange", "id": 86524, "lm_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, electromagnetism, optics, angular-momentum, maxwell-equations", "url": null }
c++, c++11, design-patterns //clients need to implement handle function class Agent : public Handler { public: Agent(std::shared_ptr<Handler> successor = nullptr):Handler(successor) {} void handle(Event e) override { if (std::get<0>(e) == 1) { std::cout << "Agent handled the request: " + std::get<1>(e) << std::endl; } else { try { std::shared_ptr<Handler> ptr(m_successor); ptr->handle(e); } catch(std::bad_weak_ptr) { std::cout << "No successor handler" << std::endl; } } } virtual ~Agent() override {} };
{ "domain": "codereview.stackexchange", "id": 25017, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, design-patterns", "url": null }
A w = 2 k/ft 10 ft 10 ft B A C w = 2 k/ft 10 ft 10 ft B. The moment of a force is the perdendicular force F acting at a distance, d and causes an object to rotate. The most pressing question now is how the cascading controversies will impact on Trump at one of his most vulnerable moments since taking office. :) my exams are after 8 months and I still have other loads. Watch the trailer for Doctor Sleep on YouTube. I am treating this like a torque equation but since the forces are going into the figure. The moment of a force about a point is a measure of the tendency of the force to rotate a body about that point. Here we can calculate Moment, Force, Lever Arm Length. The total weight of the cupboard and its contents is 200 N. 3 Moment of a Couple Example 4, page 2 of 2 *GCX[&WV[ To calculate the moment of the couple, sum the moments of the two forces at A and B with respect to the point A: M A = (2 N)s Since couple moments are the same about any point , the two couple moments of (2 N)s
{ "domain": "edra.pw", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357232512719, "lm_q1q2_score": 0.8284819746360957, "lm_q2_score": 0.8438951084436077, "openwebmath_perplexity": 543.3504473762895, "openwebmath_score": 0.5408180952072144, "tags": null, "url": "http://cgov.edra.pw/moment-of-force-questions.html" }
ros, simulator Title: Is ROS (Robot Operating System) mandatory? Do we have to build ROS for robotic research/application? What is the main advantage? When or in which situations ROS is mandatory? I'm back to a computer! Like I said in this comment, ROS is generally not mandatory. ROS is one platform among many, famous mostly due to Willow Garage giving away free robots at some point in time to whoever wrote the most ROS modules. That said, it's not the best platform possible, and is certainly nothing overly special. Particularly, the said contest resulted in a lot of low-quality modules just to get the numbers higher. Over time, the quality of the ROS modules have got better and there are a lot of them as well. Using ROS therefore, you have the benefit of reusing a lot of what's already done. You can read here some reasons why you may want to use ROS. With that in mind, you should look out for the side effects as well. Distributed Control
{ "domain": "robotics.stackexchange", "id": 1247, "lm_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, simulator", "url": null }
general-relativity, gravity, spacetime, orbital-motion, curvature Title: How is spacetime warped by a massive object? I was going through this question (Why don't planets have Circular orbits?) related to planetary orbits. In the accepted answer it is stated that orbits are actually conic sections. Given this understanding, is it possible to find out the shape into which spacetime is warped by a massive object like a Star? Is it anything that we will be able to comprehend from the equations? If you are asking whether we can calculate the curvature from the planetary orbits then the answer is no. The orbits are curves called geodesics and while you can calculate the geodesics starting from the curvature you cannot reverse the process i.e. start with the orbits and calculate the curvature. If you are interested in the details this exact issue is discussed in: Does knowledge of all the geodesics suffice to determine the metric up to a scaling factor? Can one recover a metric from geodesics?
{ "domain": "physics.stackexchange", "id": 59590, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, gravity, spacetime, orbital-motion, curvature", "url": null }
string-theory, conformal-field-theory, boundary-conditions, topological-field-theory, branes Title: A-brane boundary conditions This question concerns the boundary conditions that A-branes solve. Consider the following problem: Suppose that an A-brane wraps a submanifold $Y$ of $X$. Let $\mathcal{L} \rightarrow Y$ be a rank one Chan-Paton bundle over $Y$ equipped with a unitary connection. What are the allowed boundary conditions on the endpoints of an open string with embeding functions $\Phi$, worldsheet fermions $\psi$ and whose endpoints lie on $Y$?. According to the paper "Remarks on A-branes, Mirror Symmetry, and the Fukaya category" (equation 4, page 8) the answer is that at $z=\bar{z}$ (if the open string worldsheet is the upper-half complex plane), $\Phi$ and the fermions $\psi, \bar{\psi}$ should obey $$\partial_{z}\Phi = R[\partial_{\bar{z}}\Phi] \ \ \ , \ \ \ \psi= R[\bar{\psi}].$$ Where the operator $R$ is defined as $$R=(-1)_{NY}\oplus (g-F)^{-1}(g+F).$$
{ "domain": "physics.stackexchange", "id": 74653, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "string-theory, conformal-field-theory, boundary-conditions, topological-field-theory, branes", "url": null }
• I upvote coz this is correct – Juniven Dec 27 '16 at 4:04 • @juniven My heartfelt thanks. – Rohan Dec 27 '16 at 4:04 • How did $x^{\frac{1}{v}}$ become $\frac{x}{v}$??? Do you actually think that e.g. $16^{\frac{1}{2}}=\frac{16}{2}$??? – zipirovich Dec 27 '16 at 5:25
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.971129092218133, "lm_q1q2_score": 0.8234861631548479, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 615.6191410807295, "openwebmath_score": 0.9801020622253418, "tags": null, "url": "https://math.stackexchange.com/questions/2073170/logarithm-of-an-infinite-series/2073175" }
includes the analysis of variance (ANOVA) table that shows the magnitudes of SSR and SSE along with their degrees of freedom and F statistic. deg_freedom.8 at the 5 percent level of significance would be 5 , e.g. State Rankings 2003: A Statistical View of the 50 United States hazladetos.bicired.org.
{ "domain": "bicired.org", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9566342037088041, "lm_q1q2_score": 0.8259499352081903, "lm_q2_score": 0.863391599428538, "openwebmath_perplexity": 4496.482010481515, "openwebmath_score": 0.32110440731048584, "tags": null, "url": "http://hazladetos.bicired.org/?lib/statistics-for-business-data-analysis-and-modeling-duxbury-series-in-business-statistics" }
ruby, datetime, iterator Title: Leap year program I'm switching to Ruby from Java and so, for exercise purposes, I wrote this verbose leap year Ruby program. The comments express my concerns about Ruby best practices. I'd be glad if some Ruby experienced programmer could dispel my doubts. Every hint such as "in Ruby you can achieve this thing better this way" is truly welcomed. First of all, this is a possible execution: Pick a starting year: 2000 Now pick an ending year: 2024 From year 2000 to year 2024 there are 7 leap years. Specifically: The year 2000 was a leap year, The year 2004 was a leap year, The year 2008 was a leap year, The year 2012 is a leap year, The year 2016 will be a leap year, The year 2020 will be a leap year, The year 2024 will be a leap year.
{ "domain": "codereview.stackexchange", "id": 1828, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ruby, datetime, iterator", "url": null }
algorithms, graphs Title: Finding a source of a directed acyclic graph in linear time Given a directed acyclic graph $D = (V,A)$, a vertex $v \in V$ is a source if its indegree is zero, meaning that it has only outgoing arcs. Does there exist a linear time algorithm to find a source in a given directed acyclic graph? Follow-up question: Can one in linear time find all sources? As Yuval mentions, the datastructure is important here. I'll try to give a solution for some of the types of adjacency lists:
{ "domain": "cs.stackexchange", "id": 16720, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, graphs", "url": null }
ions Concerning these compounds having the "right" properties: Most RTILs require two characteristics in the their constituent ions to minimize the intermolecular order which would cause them to solidify. First, they need a cation-anion pair that cannot associate strongly, and second they need to have lower symmetry. Immidazolium tetrafluoroborate (BF4-) salts have both of these. The aromaticity of imidazole is important. The positive charge of the imidazolium cation is distributed through the resonance of the aromatic pi system. The negative charge in BF4- is distributed inductively over the four fluorine atoms. Additionally, imidazolium is planar and BF4- is spherical. Both the diffuse charge distribution and poor shape match prevent these two ions from having a strong association. The two different alkyl groups (ethyl and methyl) on the imidazolium ring are enough to break the symmetry of the system and prevent more efficient packing, which would lead to the substance being solid.
{ "domain": "chemistry.stackexchange", "id": 8163, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ions", "url": null }
c#, functional-programming IMO, a Builder helps to resolve complex object creation. Your object isn't complex to create, it just takes a crazy-boring amount of time to write the code to create it. What I mean is that, for example, if an Analysis Without Ground Water was a different implementation of an Analysis, the building process would worth it because it'd hide all this implementation logic but ATM, you always manipulate an Analysis object so what's the point? It feels like an overhead and a design decision that was made because you wanted to write a cool API! Then again, maybe I'm wrong. I know nothing about your program, but are all combinations of parameters possible? Aren't there more... regular set of parameters that follow some business logic? If so, you could use inheritance to create subclasses of Analysis and simply set the parameters there. Example! public class Analysis { public double WaterTableDepth { get; private set; } //All the code logic
{ "domain": "codereview.stackexchange", "id": 26560, "lm_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#, functional-programming", "url": null }
physical-chemistry, crystal-structure Anyway, the resulting structure is the simple hexagonal Bravais lattice with a single atom basis. Hcp is also a simple hexagonal Bravais lattice, but with a two atom basis, one each from plane A and plane B. I do not know of any elements that crystallize in this crystal structure (but am open to corrections!).
{ "domain": "chemistry.stackexchange", "id": 3392, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, crystal-structure", "url": null }
We take note that $0 \leq a_i \leq 9$ so possible values of $11m$ are limited to: $$-27 = 4\cdot0-3\cdot9\leq 11m \leq 4\cdot 9-3\cdot0 = 36$$ Which really means that $11m \in \{-22,-11,0,11,22,33\}$ The other requirement of the question was that $a_6 + \dots +a_0 = 59$. From this and the above equation (not sure how to number them and align them nicely in TeX) we add and subtract and get much nicer equations: $$a_6 +a_4+a_2+a_0 = \frac{59+11m} 2 \\a_5+a_3+a_1 =\frac{ 59-11m}2$$ Of course the LHS is whole, so the right hand side must be as well, which means $m$ needs to be odd. So we reduce our options to: $$11m \in \{-11,11,33\} \implies \frac{59+11m} 2 \in \{24,35,46\}$$ Of course the sum of four digits can't be $46$ from our above inequality on $a_i$, and similarly $$\frac{59-11m} 2 \in \{35,24\}$$ But the sum of three digits can't be $35$, so we're left with $$a_6 +a_4+a_2+a_0 = 35 \\a_5+a_3+a_1 =24$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822876992225169, "lm_q1q2_score": 0.8368627613839925, "lm_q2_score": 0.8519528057272543, "openwebmath_perplexity": 92.26161635034977, "openwebmath_score": 0.888762354850769, "tags": null, "url": "http://math.stackexchange.com/questions/126270/how-many-seven-digit-numbers-satisfy-the-following-conditions" }
homework-and-exercises, newtonian-mechanics, classical-mechanics, rotational-dynamics The whole situation sounds so complicated that I don't know even where to start or how to approach such a problem. Can anyone say how to approach this? Also, does anyone here know the original source (the book where it originated first) of this seemingly hard problem? From what I can tell, each time the hand hits the wheel its speed in the lab frame is reduced from $v$ to $v_{i}$, where I'll call $v_{i}$ the speed of the wheel in the lab frame after $i$ hits. So on the $(i+1)^{th}$ hit, the change in momentum of the hand is $\Delta p = m(v_{i}-v)$. The average force applied to the wheel assuming the collision takes place over an interval of time $\Delta t$ then equals $F=\frac{m(v-v_{i})}{\Delta t}$. The average torque acting on the wheel during this interval is consequently $\tau=\frac{mR(v-v_{i})}{\Delta t}$. Hence the angular impulse equals $mr(v-v_{i})$, which can be set equal to the change in angular momentum $\Delta L$,
{ "domain": "physics.stackexchange", "id": 63704, "lm_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, classical-mechanics, rotational-dynamics", "url": null }
ros, kinect Title: Passing a pointer as a ROS msg Hello, im creating a basic vision system which implements filters through a pipeline structure. My point cloud is grabbed by a kinect. The thing is i would like t send just a pointer to the cloud as a ROS message, in order to get a faster and more efficient processing. Is there a way to do this? thanks
{ "domain": "robotics.stackexchange", "id": 8904, "lm_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, kinect", "url": null }
classical-mechanics, energy It seems to make sense to attribute the surface contribution to that part whose state also changes when the surface changes. For example, surface tension energy of liquid droplets is usually counted as part of energy of the liquid, because presence of the surface changes pressure in the liquid, but hardly makes any pressure difference outside in the gas phase. For solid/air interface, the boundary changes organization of the solid particles near the boundary, but hardly changes the gas outside so again the surface belongs to the solid.
{ "domain": "physics.stackexchange", "id": 53522, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, energy", "url": null }
human-biology, microbiology, mycology, infection, antibiotics Antifungal rinses Another option is to use a suitable antifungal rinse. The most common cause of athlete's foot is T. rubrum. (Source.) T. rubrum is a dermatophyte-type fungus. Dermatophytes spread through spores. These spores can sometimes live for up to 20 months. (Source.) Canesten Laundry Hygiene Rinse is 7% benzalkonium chloride. (Source.) A competing product is Bluo Laundry Sanitiser, which is also 7% benzalkonium chloride. (Source.) These products are sold in Australia but not in North America. (How safe are they? I dunno; I'm not a toxicologist.) The Canesten rinse label makes an impressive claim: "eliminates ... fungi from your washing". Still, it looks like these rinses' fungistatic effects are stronger than their fungicidal effects. In reality, they're not perfect at killing T. rubrum, but they're still better than nothing. An Australian lab found that, in 20 minutes, these types of rinses reduced T. rubrum by between 90% and 99%. (Source.)
{ "domain": "biology.stackexchange", "id": 10113, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, microbiology, mycology, infection, antibiotics", "url": null }
electromagnetism, magnetic-fields, electromagnetic-induction, string, vibrations This explanation is from "Modeling the magnetic pickup of an electric guitar", American Journal of Physics 77, 144–150 (2009). Link.
{ "domain": "physics.stackexchange", "id": 95685, "lm_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, electromagnetic-induction, string, vibrations", "url": null }
physical-chemistry, inorganic-chemistry, nomenclature, solvents Title: Name for analog of salt hydrate with non-water solvents? Salts can bind with some water to form hydrates. For example, we can call $\ce{CoCl_2\cdot 6H_2O}$ cobalt chloride hexahydrate. There is no reason that water should be the only solvent that can bind with salts though. Dimethyl sufloxide is pretty polar and can dissolve some salts, so I might hypothesize that we could make salt crystal that has some bound into it, say $\ce{CoCl_2\cdot 6DMSO}$. I might call that cobalt chloride hexadimethyl sulfoxate, but that is totally made up. Is there a name for that sort of thing? The corresponding rule in the Red Book (‘Nomenclature of Inorganic Chemistry – IUPAC recommendations 2005’) reads as follows:
{ "domain": "chemistry.stackexchange", "id": 3302, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, inorganic-chemistry, nomenclature, solvents", "url": null }
physical-chemistry, thermodynamics, entropy Clearly there are more ways to arrange $\ce{C (s)}$ and $\ce{O2 (g)}$ in a container than $\ce{CO2}$. Sure, the $\ce{CO2}$ has degrees of freedom in it's vibrations, but these shouldn't play a role in determining the entropy of the reaction since the reaction is completely unaffected by the type of vibration $\ce{CO2}$ is doing. There are a number of possible explanations for the entropy difference, which can be computed based on standard free energies and enthalpies of formation as $\pu{3.0 J/molK}$. First, it could be that the entropy change is so small ($TΔS^∘<\pu{1 kJ}$, compare this to $ΔH^∘=\pu{−393.5kJ/mol}$) and measurement too imprecise for this difference to be significant. However, an alternate conclusion can be drawn from basic expressions for the translational and rotational entropy of a linear molecule in a gas, as derived from statistical mechanics:
{ "domain": "chemistry.stackexchange", "id": 13327, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, thermodynamics, entropy", "url": null }
acid-base, biochemistry, ph Title: Atmospheric Nitrogen gas and human body pH buffers It looks like the human body doesn't have the ability to breakdown atmospheric $\ce{N2}$, as of now $\ldots$ So an enzyme like nitrogenase (found in cyanobacteria) fixes $\ce{N2}$ and produces $\ce{NH3}$. $\ce{NH3}$ is a weak base which qualifies as a buffer component. If the human body was able to react to $\ce{N2}$ inhaled from the air, would it negatively impact the body's ability to maintain pH levels of vascular systems/cells of the human body given the large amount of $\ce{N2}$ in the atmosphere? One chemical equation that can be written for nitrogenase is this one: $\ce{N_2 + 8 \ H^+ + 8 \ e^- + 16 \ ATP \longrightarrow 2 \ NH_3 + H_2 + 16 \ ADP + 16 P_{i}}$ The equation shows that not only does nitrogenase generate the basic molecule $\ce{NH3}$, it also consumes protons (i.e. acid) to form hydrogen as an inescapable byproduct of its mechanism.
{ "domain": "chemistry.stackexchange", "id": 3716, "lm_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, biochemistry, ph", "url": null }
quantum-mechanics, quantum-entanglement, education About the concept of superposition: In classical mechanics there it is recognized that sound propagation supports superposition of multiple wavelengths. Example: let's say we create two beams of sound, produced in such a way that the two beams cross each other. Let one beam be a sinus wave of, say, 500 Hz, and the other beam a sinus wave of 550 Hz. A microphone placed at a point where both sound beams are present will not only pick up the separate sounds, but the difference between the two frequencies will also manifest itself as a sound, one of 50 Hz. The point I want to make is this: the two beams do not affect each other. The two sounds propagating in the air are truly independent. That is the concept of superposition. In the case of entanglement:
{ "domain": "physics.stackexchange", "id": 84222, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-entanglement, education", "url": null }
newtonian-mechanics, energy, potential-energy Now if we rotate the see-saw in either direction, we can argue through symmetry that $h_2=-h_1$. Therefore $U=gh_1(m_1-m_2)$. So we can see that the only way to keep our potential at $0$ is for the masses to be equal. If this is not the case then the potential energy changes. For example, let's say $m_1>m_2$. Then if we move $m_1$ up and $m_2$ down, we see that $U>0$. This is because gravity is doing more negative work on $m_1$ than it is doing positive work on $m_2$. Therefore, the only way for your statement to be true is if $m_1=m_2$. In this case gravity is always doing equal but opposite amounts of work on the objects, and so the potential energy is not changing. GENERAL CASE (Pivot located so net torque is always 0) If net torque is $0$, then the following is true: $m_1gx=m_2g(L-x)$ where the see-saw has length $L$ and $x$ is the distance between $m_1$ and the pivot. Expressing $m_2$ in terms of $m_1$ then gives $m_2=\frac{m_1x}{L-x}$
{ "domain": "physics.stackexchange", "id": 49599, "lm_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, energy, potential-energy", "url": null }
What your instructor does is the following: He tries to write $A$ as a countable union of open intervals. He first writes $A$ as a uncountable union of intervals $(x-\varepsilon_x, x + \varepsilon_x)$. He then picks a rational number $y_n$ from each interval and picks then a point $x_n$ such that $y_n\in(x_n-\varepsilon_{x_n}, x_n+\varepsilon_{x_n})$. This step is actually superflous, one can just take $x_n=y_n$. He then puts a maximally large open intervall around $x_n$. This is where the $\varepsilon_{n-}$ and $\varepsilon_{n+}$ come in. They are constructed so that $(x_n-\varepsilon_{n-},x_n+\varepsilon_{n+})$ is the largest possible open interval around $x_n$ that lies still in $A$. Then he verifies that the union of these sets coincides with $A$. The motivation that this is a useful approach comes from the fact that every open subset of $\mathbb{R}$ is the countable union of open intervals. These open intervals are actually taken to be as large as possible:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676460637104, "lm_q1q2_score": 0.8142439511888032, "lm_q2_score": 0.8311430457670241, "openwebmath_perplexity": 212.43381481452016, "openwebmath_score": 0.9665129780769348, "tags": null, "url": "http://math.stackexchange.com/questions/147551/proving-the-equality-of-two-sigma-algebras-given-in-terms-of-generators" }
python, json Although this is maybe still not the best implementation, because Foo.from_json suggests that you get back a Foo object, while this serialization relies on the correct "__class__" key for the class name (although I added a check that this is the case). This also does not deal with positional-only arguments. It also requires, just like your code, the __dict__ to be necessary and sufficient for creating a new object. However, this approach has the added advantage that it can override the to_json and from_json methods, should you need to, while covering the base cases quite nicely, IMO.
{ "domain": "codereview.stackexchange", "id": 38759, "lm_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, json", "url": null }
star Title: HD 51684 - mass and distance Where to find, if it is possible, values of the mass and the distance of HD 51684, please? Many thanks. HD 51684 is a magnetic Ap star. It has an entry in the recent catalogue of fundamental parameters for magnetic stars by Glagolevskij (2019). This catalogue lists it as having $T_{\rm eff}=7800$ K, and a mass of $2.3 M_\odot$. These parameters are determined from the photometric properties of the star - i.e. they are not fundamental measurements of the temperature or mass. The mass quoted by Kervella et al. (2019), in a study of binarity using Gaia data (HD 51684 is a known binary) is $2.195M_\odot$. However this is spurious precision; this mass comes from matching the inferred luminosity and temperature to stellar evolutionary models, not from a measurement of the binary motion. The distance has been most precisely and accurately determined by Gaia EDR3
{ "domain": "astronomy.stackexchange", "id": 5365, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "star", "url": null }
forces, weak-interaction As it turns out, the electromagnetic force and the weak nuclear force are actually different manifestations of the same fundamental interaction, termed the electroweak force. As the story goes, there existed two symmetry groups in the early universe, one for the strong nuclear interactions, SU(3), and one for the electroweak interactions, U(2), (let's just put gravity aside for now). Suddenly, a constant scalar field, namely the Higgs field, acquired a non-zero vacuum expectation value. Due to the way the Higgs field coupled with the U(2) symmetry group, the transition to a homogenous non-zero vacuum expectation value spontaneously broke the U(2) symmetry. The left over remains of the U(2) symmetry were arranged into a U(1) symmetry (that we now call electromagnetism), and three bosons that were endowed with mass by the Higgs field. These three bosons are now called $W^+$, $W^-$, and $Z$; they are the mediators of weak interactions.
{ "domain": "physics.stackexchange", "id": 38733, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "forces, weak-interaction", "url": null }
vba, excel, subroutine If v Like "City/State:*" Then s2.Cells(K, 6) = Split(Split(v, ": ")(1), ", ")(1) If v Like "County:*" Then s2.Cells(K, 7) = Split(v, ": ")(1) If v Like "Home Phone:*" Then s2.Cells(K, 8) = Split(v, ": ")(1) If v Like "Work Phone:*" Then s2.Cells(K, 9) = Split(v, ": ")(1) If v Like "Cell Phone:*" Then s2.Cells(K, 10) = Split(v, ": ")(1) If v Like "Email Address:*" Then s2.Cells(K, 11) = Split(v, ": ")(1) If v Like "Region:*" Then s2.Cells(K, 12) = Split(v, ": ")(1) If v Like "Ever Been Disciplined?:*" Then s2.Cells(K, 13) = Split(v, ": ")(1) End If Next i
{ "domain": "codereview.stackexchange", "id": 28124, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, excel, subroutine", "url": null }
python, object-oriented, api, rest, fastapi def save_document(self, data): document = Database.collection(self.collection_name).insert_one(dict(data)) data["_id"] = str(document.inserted_id) return data def get_collection(self): return Database.collection(self.collection_name).find() def get_document(self, id:str): vba = ObjectId.is_valid(id) if vba: return Database.collection(self.collection_name).find_one({"_id": ObjectId(id)}) def update_document(self, id, data:dict): document = Database.collection(self.collection_name) return document.find_one_and_update({"_id": ObjectId(id)}, {"$set": dict(data)}, return_document=True)
{ "domain": "codereview.stackexchange", "id": 45547, "lm_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, object-oriented, api, rest, fastapi", "url": null }
python, hash-map try: for key, value in data.iteritems(): # value can contain nested dictionaries # so flatten it and iterate over the result for flattened in flatten(value, group_names): flattened.update({group: key}) yield flattened except AttributeError: yield {group: data} So a = { 'foo': { 'cat': {'name': 'Hodor', 'age': 7}, 'dog': {'name': 'Mordor', 'age': 5}, }, 'bar': { 'rat': {'name': 'Izidor', 'age': 3}, }, 'baz': 'woops', } list(flatten(a, ['foobar', 'animal'])) will return [{'animal': 'woops', 'foobar': 'baz'}, {'age': 5, 'animal': 'dog', 'foobar': 'foo', 'name': 'Mordor'}, {'age': 7, 'animal': 'cat', 'foobar': 'foo', 'name': 'Hodor'}, {'age': 3, 'animal': 'rat', 'foobar': 'bar', 'name': 'Izidor'}]
{ "domain": "codereview.stackexchange", "id": 20126, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, hash-map", "url": null }
Remark You'll meet related results later when you study the structure theory of rings. There the intersection of all maximal ideals of a ring $\rm\,R\,$ is known as the Jacobson radical $\rm\,Jac(R).\,$ The ideals $\rm\,J\,$ with $\rm\,1+J \subset U(R)=$ units of $\rm R,\,$ are precisely those ideals contained in $\rm\,Jac(R).\,$ Indeed, we have the following theorem, excerpted from my post on the fewunit ring theoretic generalization of Euclid's proof of infinitely many primes. THEOREM $\$ TFAE in ring $\rm\,R\,$ with units $\rm\,U,\,$ ideal $\rm\,J,\,$ and Jacobson radical $\rm\,Jac(R).$ $\rm(1)\quad J \subseteq Jac(R),\quad$ i.e. $\rm\,J\,$ lies in every max ideal $\rm\,M\,$ of $\rm\,R.$ $\rm(2)\quad 1+J \subseteq U,\quad\ \$ i.e. $\rm\, 1 + j\,$ is a unit for every $\rm\, j \in J.$ $\rm(3)\quad I\neq 1\ \Rightarrow\ I+J \neq 1,\qquad\$ i.e. proper ideals survive in $\rm\,R/J.$ $\rm(4)\quad M\,$ max $\rm\,\Rightarrow M+J \ne 1,\quad$ i.e. max ideals survive in $\rm\,R/J.$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347860767304, "lm_q1q2_score": 0.833971127517208, "lm_q2_score": 0.8558511451289037, "openwebmath_perplexity": 417.5318037259888, "openwebmath_score": 0.9046381115913391, "tags": null, "url": "http://math.stackexchange.com/questions/68191/let-r-be-a-commutative-ring-with-1-then-why-does-a-in-nr-rightarrow-1a-in/68201" }
# multiple choice question on group of matrices Consider the set of matrices $$G=\left\{ \left( \begin{array}{ll}s&b\\0&1 \end{array}\right) b \in \mathbb{Z}, s \in \{1,-1\} \right\}.$$Then which of the following are true 1. G forms a group under addition 2. G forms an abelian group under multiplication 3. Every element of G is diagonolizable over $$\mathbb{C}$$ 4. G is finitely generated group under multiplication I am getting 1) is false since not closed under addition 2)Forms a group under multiplication ( abelian or not i don't know) 3)Not true if $$a=1$$ 4) dont know please help me to complete • A few examples with $s=1$ in one matrix, $s=-1$ in the other, should convince you that $G$ isn't abelian. – Robert Shore Sep 21 '19 at 16:32 • So answer will be finitely generate right? – sabeelmsk Sep 21 '19 at 16:34 • $$1$$ is false:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676496254957, "lm_q1q2_score": 0.8440211179201187, "lm_q2_score": 0.8615382147637196, "openwebmath_perplexity": 899.3029009557825, "openwebmath_score": 0.6389120221138, "tags": null, "url": "https://math.stackexchange.com/questions/3364550/multiple-choice-question-on-group-of-matrices" }
web-scraping, go, concurrency func parseArguments() map[string]interface{} { parser := argparse.Argparse { Description: "Site crawler by @Ludisposed", } parser.AddArgument( argparse.Argument { ShortFlag: "b", LongFlag: "base", Type: "string", Required: true, Help: "The base of the url", }, ) parser.AddArgument( argparse.Argument { ShortFlag: "m", LongFlag: "max", Type: 10, Help: "Max amount of channels", Default: 10, }, ) return parser.Parse() } func main() { args := parseArguments() crawler := newCrawler( args["base"].(string), args["max"].(int), ) hrefs := crawler.run()
{ "domain": "codereview.stackexchange", "id": 39523, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "web-scraping, go, concurrency", "url": null }
As in an earlier answer I use the local frame along the helix to help parametrize the desired curve. From that answer I reuse: a parametrization for a helix along the $x$-axis $$\vec{r}(t)=(ht,R\cos t, R\sin t).$$ Its tangent vector $$\vec{t}=\frac{d\vec{r}(t)}{dt}=(h,-R\sin t,R\cos t).$$ Its normal vector $$\vec{n}(t)= \frac{\frac{d\vec{t}}{dt}}{\left\Vert\frac{d\vec{t}}{dt}\right\Vert}=(0,-\cos t,-\sin t).$$ And it binormal vector $$\vec{b}(t)=\frac1{\Vert\vec{t}\Vert}\vec{t}\times\vec{n}=\frac{1}{\sqrt{R^2+h^2}}(R,h\sin t,-h\cos t).$$ This is, of course, orthogonal to both $\vec{t}$ and $\vec{n}$. The tube around the helix (with radius $a$) then has a parametrization $$S(t,u)=\vec{r}(t)+a\vec{n}(t)\cos u+ a\vec{b}(t)\sin u$$ with $t$ ranging over as many loops as you wish, and $u$ ranging over the interval $[0,2\pi]$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9884918502576513, "lm_q1q2_score": 0.8058506651335832, "lm_q2_score": 0.8152324826183822, "openwebmath_perplexity": 259.37259132791706, "openwebmath_score": 0.8282833099365234, "tags": null, "url": "https://math.stackexchange.com/questions/470538/helix-in-a-helix" }
systems-biology Of course we can do both of these, but the point is valid as we need to have an idea of what a drum looks like. If we did have even a glance at a drum, this lets us build a model (cylinder of diameter d, height h and with a drum head of a tension t and material properties alpha beta, etc) from the sounds is a lot of work, but it could be done. The problem of solving a molecular structure from diffraction intensities alone has also been solved for small molecules in the 60s I believe by so-called 'direct methods' which don't work well or proteins and larger molecules. Still the point is that you had to have a good mathematical model of molecules and diffraction to get to direct methods, MIR, MAD and other diffraction only methods. Sorry I can't go into details here...it might bore you to death if you don't care about crystallography.
{ "domain": "biology.stackexchange", "id": 677, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "systems-biology", "url": null }
c++, multithreading, c++14, simulation is the intent clear? is the use of a static number generator OK here? is there a better way to handle the logging? threadplay.cpp #include <iostream> #include <atomic> #include <mutex> #include <thread> #include <random> #include <chrono> #include <vector> #include <sstream> class Logger { public: Logger &operator<<(std::stringstream &ss) { std::lock_guard<std::mutex> lock(m); std::cout << ss.str(); ss.str(std::string{}); return *this; } private: std::mutex m; };
{ "domain": "codereview.stackexchange", "id": 23655, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, multithreading, c++14, simulation", "url": null }
wavelet, time-frequency, cwt, visualization Bonus: PyWavelets Note: showing full frequency axis, unlike in most plots above (where right half is appropriately zero) The reader is left with this one as an exercise. The problem is, not only do we sample in time, but we don't bother to keep doing so, instead resampling from the same sampled sequence. Except for very specific choices of scales, this results in nonuniform sampling and other issues, and can reproduce every problem described in this post (except redundancy). np.diff drastically amplifies existing flaws, which were already great. Note pywt doesn't provide L1 norm as an option, only L2; it's done here manually for clearer plotting. scales was also fixed to be logscaled, while docs examples are linear (which do reproduce redundancy, minus any benefits). Temporal peak We now inspect individual wavelets (which can occur in a filterbank).
{ "domain": "dsp.stackexchange", "id": 11668, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "wavelet, time-frequency, cwt, visualization", "url": null }
python, parsing, functional-programming, json, api this_week = stats_for('') last_week = stats_for('LastWeek') return hero_id, *this_week, *last_week return [ stats(hero['heroId'], hero['pickBan']) for hero in herodata['heroes']] Which would make it easier to select 'LastMonth' stats, too. Is a tuple really the best data structure for parse_stats to return? The 0th element is the hero id. What is the 2nd element? Which element is last week's pick win percentage? What is [1], or [3]? How about using a namedtuple? from collections import namedtuple Stats = named tuple('Stats', ('id', 'pick_rate', 'ban_rate', 'pick_wins', 'ban_wins', 'pick_rate_last_week', 'ban_rate_last_week', 'pick_wins_last_week', 'ban_wins_last_week')) # ... def parse_stats(herodata): def stats(hero_id, pick_ban): # ... return Stats(hero_id, *this_week, *last_week)
{ "domain": "codereview.stackexchange", "id": 35153, "lm_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, functional-programming, json, api", "url": null }
exterior angles c. corresponding angles d. vertical angles. a and h are alternate exterior angles and they are equal to one another. Learn what is alternate exterior angles. % Progress . Angles on opposite sides of a transversal, but outside the lines it intersects. In this example, these are two pairs of Alternate Exterior Angles: a and h. parralel lines. Remember: exterior means outside the parallel lines. In this example, these are two pairs of Alternate Exterior Angles: a and g. And. Check Eligibility. Tags: Question 8 . Identify corresponding, alternate and co-interior angles when two straight lines are crossed by a transversal. With each pair of alternate exterior angles, both angles are outside the parallel lines and on opposite (alternate) sides of the transversal. Alternate exterior angles. angles opposite each other where two lines cross. 3. consecutive (same side) interior angles. Understand: That angles can be classified by their location of intersection. alternate exterior
{ "domain": "davislivemusic.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.98409360595565, "lm_q1q2_score": 0.8157533726801458, "lm_q2_score": 0.828938799869521, "openwebmath_perplexity": 1050.520860243283, "openwebmath_score": 0.6002507209777832, "tags": null, "url": "https://davislivemusic.com/something-nice-cbtftpx/what-are-alternate-exterior-angles-8056d8" }
For high quality pictures of surfaces like these, Herwig Hauser apparently uses povray. It's not really what you're asking for and probably overkill, but I thought I'll add it for the record. DMelt has good plotting capabilities, with possibility to export math drawings in the vector graphics format (SVG, EPS, PDF). I would recommend to look at jhplot.HPlot3D JAVA class to draw jhplot.F2D functions
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9314625031628428, "lm_q1q2_score": 0.8024905321598708, "lm_q2_score": 0.8615382040983516, "openwebmath_perplexity": 1631.8824294387518, "openwebmath_score": 0.345754474401474, "tags": null, "url": "https://mathoverflow.net/questions/42272/are-there-any-good-computer-programs-for-drawing-algebraic-curves" }
java, error-handling, exception I was going to ask for recommendations on how to deal with the other exceptions, but I'm afraid the review would become unnecessarily long. Any to-the-point comments on them would be welcome though. DeveDerrubarOProcessoException translates to "ProcessMustBeShutdownException"; and InterruptedException is thrown if by any reason (currently none) the wait for a command response is interrupted (I suppose I'd want it to be another side effect of losing connection with the device). public abstract class ExecutorDeSequenciasDeComandos {
{ "domain": "codereview.stackexchange", "id": 21006, "lm_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, error-handling, exception", "url": null }
1 / 3, 1 / 4, etc. Their terms alternate from upper to lower or vice versa. (2) This statement is the contrapositive of (1). Obviously, the numbers are getting smaller. A simpler proof can be obtained if we assume the finiteness of the fourth moment. From this definition of convergence, we immediately have the following theorem of equivalence statements. ⁄ Examples: 1. Related Symbolab blog posts. v O VMlaldfeR UwwiutihG WIfn]fHimnci]tNeu jPxrDeOcxadlncYunlzudsQ. Learn about the Golden Ratio, how the Golden Ratio and the Golden Rectangle were used in classical architecture, and how they are surprisingly related to the famed Fibonacci Sequence. Then, you can have the fun of graphing a sequence. For example, the sequence fn(x)=xn from the previous example converges pointwise on the interval [0,1], but it does not converge uniformly on this interval. Similarly, consider the series. Note that this is a statement about convergence of the sequence fangn - it is NOT a statement. The values
{ "domain": "macchiaelettrodomestici.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9905874087451302, "lm_q1q2_score": 0.8276194740974071, "lm_q2_score": 0.8354835391516132, "openwebmath_perplexity": 354.85524078365097, "openwebmath_score": 0.86317378282547, "tags": null, "url": "http://jaye.macchiaelettrodomestici.it/sequence-calculator-convergence.html" }
c++, performance, multithreading, reinventing-the-wheel, matrix } template <typename T> void transpose(std::vector<std::vector<T>>& A){ pMatTransposeRecursive( A, 0, A.size()-1, 0, A[0].size()-1); } int main(){ std::vector<std::vector<int>> A = {{1,2,3,4,7,7,7,8}, {5,6,7,8,4,5,1,1}, {9,10,5,5,11,12,4,79}, {7,8,13,14,15,16,44,6}, {13,-14,7,-7,15,-16,-44,6}, {13,-14,105,106,404,6,9,9}, {13,-14,7,-7,15,-16,-44,6}, {13,-14,105,106,404,6,9,9}}; transpose(A); for(auto & el:A){ for(auto& ele:el) std::cout << ele << std::setw(4) ; std::cout << "\n"; } } Is it worth parallelising? When you are parallelizing code you have to ask yourself if it's worth doing that. Parallel code doesn't magically give a speedup, because there are various things that can actually slow you down when using parallelism, for example:
{ "domain": "codereview.stackexchange", "id": 37718, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, multithreading, reinventing-the-wheel, matrix", "url": null }
c#, linq, entity-framework, properties, linq-expressions ...can be expressed generically (well, this particular case requires that hardcoded 'string' typing, not sure if there's a way around that) as this: internal static IQueryable<TContainerModel> FilterByAnyContaining<TContainerModel, TCollectionModel>(this IQueryable<TContainerModel> query, string value, Expression<Func<TContainerModel, ICollection<TCollectionModel>>> collection, Expression<Func<TCollectionModel, string>> property) { return query.Where(x => value == null || collection.Compile().Invoke(x).Any(y => property.Compile().Invoke(y).Contains(value))); }
{ "domain": "codereview.stackexchange", "id": 22846, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, linq, entity-framework, properties, linq-expressions", "url": null }
ros, std-msgs, ros-kinetic ROS_INFO_STREAM(x_current); ROS_INFO_STREAM(y_current); ROS_INFO_STREAM(z_current); C3 = (pow(x_current, 2) + pow(y_current, 2) + pow(z_current, 2) - pow(a2, 2) - pow(a3, 2)) / (2 * a2 * a3); S3 = sqrt(1 - pow(C3, 2)); theta3 = atan2(S3, C3) * 180 / M_PI; C2 = (sqrt(pow(x_current, 2) + pow(y_current, 2)) * (a2 + a3 * C3) + z_current * a3 * S3) / (pow(a2, 2) + pow(a3, 2) + 2 * a2 * a3 * C3); S2 = (z_current * (a2 + a3 * C3) - sqrt(pow(x_current, 2) + pow(y_current, 2)) * a3 * S3) / (pow(a2, 2) + pow(a3, 2) + 2 * a2 * a3 * C3); theta3 = atan2(S3, C3) * 180 / M_PI; theta2 = atan2(S2, C2) * 180 / M_PI; theta1 = atan2(y_current, x_current) * 180 / M_PI; msg.layout.dim.push_back(std_msgs::MultiArrayDimension()); msg.layout.dim[0].size = vec.size(); msg.layout.dim[0].stride = 1; msg.layout.dim[0].label = "x"; msg.data.clear(); msg.data.insert(msg.data.end(), vec.begin(), vec.end()); chatter_pub.publish(msg); }
{ "domain": "robotics.stackexchange", "id": 32816, "lm_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, std-msgs, ros-kinetic", "url": null }
$$\frac{\partial V}{\partial S} S + \frac{\partial V}{\partial K} K = V$$ hence $$\frac{\partial V}{\partial K} = \frac{1}{K} \left( V - \frac{\partial V}{\partial S} S \right)$$ which is what you are looking for. And indeed if you are pricing a digital call ($D$ below) for instance, using the notation $C$ to denote the European call price \begin{align} D &= -\frac{dC}{dK} \\ &= -\left[ \frac{\partial C}{\partial K} + \frac{\partial C}{\partial \Sigma} \frac{\partial \Sigma}{\partial K} \right] \\ &= -\left[ \frac{1}{K}\left( C - \Delta S\right) + \nu \frac{\partial \Sigma}{\partial K} \right] \end{align} where for a maturity $T$ and strike level $K$, $C$ is the corresponding European call price, $\Delta$ its BS Delta, $\nu$ its BS Vega and $\partial \Sigma/\partial K$ the IV skew. We have moved from the second line to the third using the result which we just derived.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517488441416, "lm_q1q2_score": 0.8041435191182872, "lm_q2_score": 0.8221891327004133, "openwebmath_perplexity": 541.5945325106521, "openwebmath_score": 0.987587571144104, "tags": null, "url": "https://quant.stackexchange.com/questions/35306/mathematical-equation-relating-fracdvds-to-fracdvdk" }
randomness, pseudo-random-generators It's important to include the hashing step. If you don't do that, then you're feeding closely related seeds into the pseudo-random generators. For some pseudo-random generators, bad things might happen: you might get closely related outputs. For instance, that's exactly what the article you mentioned is warning about, when you use Java's Math.random(). Using a good hash function will fix this, because now the seeds to the pseudo-random generator will look unrelated (each bit will be different with probability about 1/2, etc.).
{ "domain": "cs.stackexchange", "id": 4969, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "randomness, pseudo-random-generators", "url": null }
evolution, biochemistry, life-history Currently, iron is involved in oxidations involving molecular oxygen, such as in cytochromes and clearly holds a key role in modern life, despite that free iron or even ferric compounds are rarely accessible. From my understanding, iron most likely became incorporated into the metabolism of microbes after during/after aerobic organisms had developed, but this does not rule out the possibility that iron was involved earlier on. So, I am wondering if iron was involved in early life, and details on how would be appreciated. Cyanobacteria require iron for photosynthesis and can be found as fossil stromatolites dating back to 3.5 billion years ago. Stromatolites are layered structures made up of cyanobacteria and sediment.
{ "domain": "biology.stackexchange", "id": 8458, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, biochemistry, life-history", "url": null }
By linearity of $$T$$ you have $$T(\alpha u+\beta v)=\alpha T(u)+\beta T(v)$$ for scalars $$\alpha,\beta$$ belonging to underlying field and $$u,v\in V$$. Put $$\alpha=\beta=0$$ to see $$T(0)=0$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668717616668, "lm_q1q2_score": 0.8280019120902757, "lm_q2_score": 0.8438950966654772, "openwebmath_perplexity": 148.93729216118487, "openwebmath_score": 0.749923586845398, "tags": null, "url": "https://math.stackexchange.com/questions/2532847/linear-dependence-preserved-after-transformation" }
radio-astronomy, fast-radio-bursts beams in which the digitizers were not saturated. By splitting the data into four frequency sub-bands we have measured both the half-power pulse width and flux density spectrum over the observing bandwidth. Accounting for pulse broadening due to known instrumental effects, we determine a frequency scaling relationship for the observed width W = 4.6 ms (f/1.4 GHz)−4.8±0.4 , where f is the observing frequency.
{ "domain": "astronomy.stackexchange", "id": 3707, "lm_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, fast-radio-bursts", "url": null }
statistical-mechanics, condensed-matter, phase-transition, ising-model, spin-chains It’s easy to see that this state (all aligned along z) is an eigenstate of the Hamiltonian. All we have to show is that the this is the least energy configuration. Consider a lattice with all spins pointing up except one pointing down at site-k. This state is an eigenstate of the Hamiltonian and has an excess energy $J/2$ as compared to when all spins are aligned. Further notice that the lattice with the highest energy is the one where the neighbours are anti parallel (evens up and odds down). Thus the ground state is the direct product of all ups or all downs or any superposition of the two.
{ "domain": "physics.stackexchange", "id": 67243, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, condensed-matter, phase-transition, ising-model, spin-chains", "url": null }
c++, algorithm, random, c++17, binary-tree if( other.right ) right = std::make_unique<tree_node>( other.right->value ); } tree_node( tree_node&& other ) noexcept : value{ other.value }, parent{ other.parent }, size{ other.size } { left = std::move( other.left ); right = std::move( other.right ); } void insert_child( Ty value ) { if( value <= this->value ) { left = std::make_unique<tree_node>( value, this ); } else { right = std::make_unique<tree_node>( value, this ); } } }; mutable std::mt19937 gen_; tree_node_ptr root_; public: explicit random_node( const unsigned int seed = std::random_device{}( ) ) : gen_{ seed } { }
{ "domain": "codereview.stackexchange", "id": 38339, "lm_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++, algorithm, random, c++17, binary-tree", "url": null }