text
stringlengths
1
1.11k
source
dict
general-relativity, gravitational-waves (Moreover, like light, gravitational waves have two polarizations, usually denoted $+$ and $×$, with deformations along those axes, and each LIGO detector is also incapable of detecting $×$ waves when its arms are aligned along $+$. For astronomical sources this is less important, as we don't expect a particular polarization from a random source in the sky, but the effect is still there.) This directional sensitivity is one of the main reasons why people are building more detectors, including a new detector in India and links to the existing VIRGO facilities. (The other reason being, of course, that more detectors allow for better coincidence detection, so less chances of spurious signals, as well as a better ability to pinpoint the spatial origin of the signals.)
{ "domain": "physics.stackexchange", "id": 34803, "lm_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, gravitational-waves", "url": null }
quantum-algorithms, resource-request, clifford-group Title: Review paper on depth, qubits and $T$ gates number on Clifford+T decomposition for various "typical" algorithms My question I am looking for some review paper, or a list of different papers providing concrete numbers about the depth, number of qubits and number of $T$ gates required on the Clifford+T basis for usefull quantum algorithms (quantum Fourier transform, Grover, HHL, any other you can think of). I am not looking for asymptotic behaviors as I would like to have an idea of the concrete numbers for typical problem sizes. This question is "simple" but I haven't found any paper summarizing it nicely so far, and there are some papers providing only half of the numbers required (for instance the number of qubits but not the depth).
{ "domain": "quantumcomputing.stackexchange", "id": 3428, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-algorithms, resource-request, clifford-group", "url": null }
c++, object-oriented, design-patterns, datetime, polymorphism explicit DigitalStopWatch(int x, int y) { setStopWatchXY(x, y); } }; class SegmentedStopWatch final : public StopWatch { public: virtual void printTime() override; explicit SegmentedStopWatch(int x, int y) { setStopWatchXY(x, y); } private: Digit m_stopWatchDigits[6]; void printDigitAtLoc(Digit digArr[], int index, int x, int y) const; void printColon(int x, int y); void printSeconds(); void printMinutes(); void printHours(); void set(Digit digArr[], int startIndex, int unit); void setDigitsToCurrentTime(); void setSeconds(); void setMinutes(); void setHours(); }; class Factory { public: virtual std::unique_ptr<StopWatch> createStopWatch(int stopWatchXPos = 0, int stopWatchYPos = 0) const = 0; };
{ "domain": "codereview.stackexchange", "id": 26303, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, object-oriented, design-patterns, datetime, polymorphism", "url": null }
a <- matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1), 9, 4) a ## [,1] [,2] [,3] [,4] ## [1,] 1 1 0 0 ## [2,] 1 1 0 0 ## [3,] 1 1 0 0 ## [4,] 1 0 1 0 ## [5,] 1 0 1 0 ## [6,] 1 0 1 0 ## [7,] 1 0 0 1 ## [8,] 1 0 0 1 ## [9,] 1 0 0 1 a.svd <- svd(a) a.svd$d ## [1] 3.464102e+00 1.732051e+00 1.732051e+00 1.922963e-16 ds <- diag(1/a.svd$d[1:3]) # take the first 3 values, since the 4th is almost zero u <- a.svd$u v <- a.svd$v us <- as.matrix(u[, 1:3]) vs <- as.matrix(v[, 1:3]) a.ginv <- vs %*% ds %*% t(us) round(a %*% a.ginv %*% a,0) # round just for pretty print ## [,1] [,2] [,3] [,4] ## [1,] 1 1 0 0 ## [2,] 1 1 0 0 ## [3,] 1 1 0 0 ## [4,] 1 0 1 0 ## [5,] 1 0 1 0 ## [6,] 1 0 1 0 ## [7,] 1 0 0 1
{ "domain": "ul.pt", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9752018398044143, "lm_q1q2_score": 0.8018003548766387, "lm_q2_score": 0.8221891327004132, "openwebmath_perplexity": 8614.690130796489, "openwebmath_score": 0.6164302229881287, "tags": null, "url": "http://www.di.fc.ul.pt/~jpn/r/svd/svd.html" }
python, python-3.x finally: cnx_msql.commit() cur_psql.close() cur_msql.close() I don't know if the function description is accurate but this is an idea. Note that I am passing connection instances cnx_msql and cnx_psql as arguments to the function (I prefer to avoid global variables). The idea is to better isolate the blocks, also avoid the proliferation of variables and at the same time limit their scope.
{ "domain": "codereview.stackexchange", "id": 38476, "lm_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 }
ros, tutorial, pr2, transform Originally posted by jy on ROS Answers with karma: 3 on 2013-08-12 Post score: 0 Original comments Comment by Tully on 2013-08-12: Please provide more information for us to be able to help you better. What are you running? Do you get the error once or continuously? What is the actual error output? What are the code snippets you are running and what are the variations. Your problem is that you are constructing the listener inside the callback. This means that you do not give it time to build up it's buffer. That's why if you query it quickly, it reports it does not exist. And with a timeout, it builds up a buffer of new information, but it will never hear about the past where you queried it. I recommend rereading the tf and time tutorial linked from the tutorial you linked to. Originally posted by tfoote with karma: 58457 on 2013-08-12 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by jy on 2013-08-12: Thanks so much!
{ "domain": "robotics.stackexchange", "id": 15232, "lm_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, tutorial, pr2, transform", "url": null }
Think of it like this: 1. A definite integral has the form $$\int_a^b f(x) dx = G(b) - G(a),$$ where $a, b$ are fixed real numbers. The result will be a real number. 2. Now you allow one of them, say $b$, to be variable. This then gives you an integral FUNCTION of the form $$I_a (x) = \int_a^x f(t) dt = G(x) - G(a).$$ Two words on notation: I changed the integration variable from $x$ to $t$ to avoid confusion as $x$ now denotes the upper limit of the integral. Furthermore, since the integral function depends on the lower limit $a$ (different $a$'s will give different functions), I stressed this dependence by writing $I_a$ for the function.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9559813501370537, "lm_q1q2_score": 0.8236144657444876, "lm_q2_score": 0.8615382147637196, "openwebmath_perplexity": 163.43392694127087, "openwebmath_score": 0.937096893787384, "tags": null, "url": "https://math.stackexchange.com/questions/2327215/antiderivatives-and-the-indefinite-integral" }
evolution, theoretical-biology, evolutionary-game-theory In short... In short, I can't say much else than just "read more about game theory". However, you might want to cite exactly Dawkins so that we can understand exactly how he describes the specific game at play and comment on the expected outcome.
{ "domain": "biology.stackexchange", "id": 8524, "lm_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, theoretical-biology, evolutionary-game-theory", "url": null }
I drew the two circles, but both the points $P_1$ and $P_2$ coincide with the point $A$. Is this method of solving the question correct? • I think P1 is supposed to be the point opposite P1. In other words $P_1,O_1, A$ form a diameter. – fleablood Jul 28 '18 at 15:25 • Does the question suggest that line $O_1A$ should be extended to meet the circle $C_1$ again at $P_1$ (so that $AP_1$ is a diameter of the circle)? – Malkin Jul 28 '18 at 15:25 • @EMalkin I don't see how it can mean anything else. $O1$ is the center of the $C_1$ and $A$ is also on $C_1$. Any line through a center, which $O_1A$ is intersects the circle exactly twice (forming a diameter). The implication is $A$ is a different point than $P_1$ so it must be the other point. Even if $A$ could be the same as $P_1$ the question asks for the maximum number of $6$ possible points so it seems we must consider the points being different to have more of them. – fleablood Jul 28 '18 at 15:29 # Analysis & Solution
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9852713874477227, "lm_q1q2_score": 0.8252829834273004, "lm_q2_score": 0.8376199633332891, "openwebmath_perplexity": 135.95929170718668, "openwebmath_score": 0.7732656598091125, "tags": null, "url": "https://math.stackexchange.com/questions/2865323/intersecting-circles" }
drugs, medicinal-chemistry In 1999, Teague distinguished between lead-like and drug-like hits, and combinatorial library collections. 20 Lead-like hits are characterized as having lower molecular weights (<350), activity (>0.1 µM), and clog P values (<3). The lower values give lead-like compounds room to grow into an optimized, high-affinity drug that still satisfies Lipinski’s rules. Drug-like hits have higher molecular weights (>350) and clog P values (>3) but still modest affinity (~0.1 µM). The definition of lead-like has since been used as a preliminary filter for selecting more promising hits from a screen.
{ "domain": "chemistry.stackexchange", "id": 8469, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "drugs, medicinal-chemistry", "url": null }
ros Title: Simple question on setting bounce properties (URDF) Hi all, I'm trying to model a ball. I'm not having any luck with making it bounce. I try to set the restitution coefficient in my URDF code, but when I look at the properties of the ball in Gazebo (ball1 -> ball -> link -> collision -> surface) the restitution_coefficient is still equal to zero. I'm running Fuerte on Ubuntu 12.04. The URDF: <robot name="my_ball"> <link name="ball"> <inertial> <origin xyz="0 0 0" /> <mass value="0.0027" /> <inertia ixx="0.00000072" ixy="0.0" ixz="0.0" iyy="0.00000072" iyz="0.0" izz="0.00000072" /> </inertial> <visual> <origin xyz="0 0 0"/> <geometry> <sphere radius=".040" /> </geometry> </visual> <collision> <origin xyz="0 0 0"/> <geometry> <sphere radius=".040" /> </geometry> <surface> <bounce restitution_coefficient = "1"/> </surface> </collision>
{ "domain": "robotics.stackexchange", "id": 12359, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
vba, excel Case Is = "$B$103" If DATAENTRY.Range("B103") <> vbNullString Then CIFNum = DATAENTRY.Range("B103").value wireTypeIs = "Incoming" CIFGrab CIFNumber:=CIFNum, WireType:=wireTypeIs Else DATAENTRY.Range("B104:B107") = vbNullString End If Case Is = "$B$205" EntryB205 Case Is = "$B$206" If DATAENTRY.Range("B206").value <> vbNullString Then CIFNum = DATAENTRY.Range("B206").value wireTypeIs = "OutGoingDDALoan" CIFGrab CIFNumber:=CIFNum, WireType:=wireTypeIs Else DATAENTRY.Range("B207:B211") = vbNullString End If Case Is = "$B$227" EntryB227 Case Is = "$B$269" EntryB269 Case Is = "$B$306" EntryB306 Case Is = "$B$307" If DATAENTRY.Range("B307") <> vbNullString Then
{ "domain": "codereview.stackexchange", "id": 37442, "lm_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", "url": null }
nlp, bert, huggingface Nevertheless, you can have good results using GPT-2: https://github.com/openai/grade-school-math https://github.com/openai/grade-school-math/blob/master/grade_school_math/train.py I recommend starting with the smallest model (124M parameters). It should be enough if it is just a chatbot to solve classic maths problems. https://huggingface.co/gpt2
{ "domain": "datascience.stackexchange", "id": 11621, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nlp, bert, huggingface", "url": null }
soft-question, nuclear-physics, computational-physics, software, data Title: Reading ensdf files I understand that this is more of a computing question, but I still think the appropriate place to ask it is here. The Evaluated Nuclear Structure Data Files are on the internet, available for public use, and viewable online: http://www.nndc.bnl.gov/ensdf/ You can view any dataset online, or download them. My question is, after I download a dataset, what application can I use to view it? I've tried searching on the internet for an appropriate application but nothing obvious crops up. Anyone who's previously needed to analyze nuclear data files will perhaps have used these datasets and may know how to help. They open as text files after you unzip them. You can open them with excel to parse the data
{ "domain": "physics.stackexchange", "id": 24789, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "soft-question, nuclear-physics, computational-physics, software, data", "url": null }
ds.algorithms, optimization, ds.data-structures Find the 2D maximal point set. Let us call it the set $M$. Find the convex hull of $M$. Let us call it $co(M)$. The preprocessing time for the two step is $O(n \log n)$. Now, for the line: $c_i \cdot x + y = 0$, you need to find the point in $M$ that is farthest from the line. That point must lie on the boundary of $co(M)$. Note that distances of the points on the convex hull first increase and then decrease. You need to find that point on the boundary where this transition happens. It can be done in $O(\log n)$ time using binary search.
{ "domain": "cstheory.stackexchange", "id": 5231, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.algorithms, optimization, ds.data-structures", "url": null }
physical-chemistry, equilibrium I applied the concentration after equilibrium in $\ce {Kc} $, so I got: $\ce {2.48.10^{-3} = [0.1-x].[0.031-x].[0.25+x]^{-1}} $ After calculate the equation above, I got $\ce {x = 0.1111 M}$. Then my question is: if $\ce {x = 0.1111 M} $, so $\ce {[ClF] = -0.0801 M} $ and $\ce {[F2] = -0.0111 M} $. The concentration is negative. Is it possible? Are my steps incorrect or the answer is correct? The equation $2.48\times 10^{-3} = \frac{(0.1-x)(0.031-x)}{0.25+x}$ is correct, but it simplifies to a second degree polynomial, so it has two solutions, not one. You just picked the incorrect root (negative concentrations have no physical meaning). Can you find the right answer now?
{ "domain": "chemistry.stackexchange", "id": 876, "lm_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, equilibrium", "url": null }
digital-communications, self-study, information-theory Title: Entropy of a dynamical system and source code length The entropy of a source $H(S)$, gives you the average codeword length to encode a given source alphabet. i.e. it is the average number of bits per symbol required to encode the information in the source. If: $p_0=3/5$ and $p_1=2/5$ (close probabilities) with $H=0.971 \textrm{ bits/symbol}$, then there's more information than compared to the 2nd case where $p_0=3/4$ and $p_1=1/4$ yielding $H = 0.8113 \textrm{ bits/symbol}$ to encode. Following are the problems that I am facing and I will be very grateful for a detailed answer.
{ "domain": "dsp.stackexchange", "id": 3815, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "digital-communications, self-study, information-theory", "url": null }
• Yes, only $L_3$ was incorrect. Thanks for the guidance sir! Mar 12 '16 at 13:20 • @user314580 you're welcome. But bubba is right. Upvoting / accepting answer is a nice way of approving efforts. Mar 12 '16 at 13:42 • Must I register to do so? Mar 12 '16 at 14:08 • @user314580 No, simply click the "up" or "down" array over/beneath the score of a post. If the post is an answer to a question you asked, you can also accept one answer (note: you can upvote multiple answers, but "accept" only one). This can be done by clicking the checkmark below the score number. Mar 12 '16 at 15:18 I assume that $\Pi_3$ means the space of all polynomials of degree 3. This space has dimension $4$, so, if we can show that $L_0$, $L_1$, $L_2$, $L_3$ span it, then we're done.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429151632046, "lm_q1q2_score": 0.8592995928153118, "lm_q2_score": 0.8723473663814338, "openwebmath_perplexity": 176.20250079135542, "openwebmath_score": 0.9466203451156616, "tags": null, "url": "https://math.stackexchange.com/questions/1694189/showing-lagrange-polynomials-form-a-basis-for-pi-3" }
c++, algorithm, primes, sieve-of-eratosthenes } } else if ((p - 19) % 30 == 0) { for (g = l - (f6 - f1); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } for (g = l - (f6 - f2); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } for (g = l - (f6 - f3); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } for (g = l - (f6 - f4); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } for (g = l - (f6 - f5); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } for (g = l + (f7 - f6); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } for (g = l + (f8 - f6); g < n1_m; g += (f9 - f1)) { prmLst[g] = true; } } else if ((p - 23) % 30 == 0) {
{ "domain": "codereview.stackexchange", "id": 43791, "lm_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, primes, sieve-of-eratosthenes", "url": null }
electrostatics, charge, gauss-law I managed to find the electric field through the origin to be $\frac{-\rho_l a h}{\epsilon_0 (h^2+a^2)^{3/2}}$ which was correct according to the solution presented. However, then I became a bit confused on how to calculate the surface charge density at the origin, since I can't recall any formula that would help me do that. I first thought of using the displacement field for this, however, since there's no information about permittivity given in the problem, I knew that can't be right. I then turned to Gauss law, but calculating the divergence of my electric field would just be $0$ and so that would give me a surface charge density of $0$.
{ "domain": "physics.stackexchange", "id": 93361, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, charge, gauss-law", "url": null }
The solution is known to be $$\hat x = (A'A)^{-1}A'y$$ — see for example chapter 3 of these notes ### More Columns than Rows¶ This is the $$n \times k$$ case with $$n < k$$, so there are fewer equations than unknowns In this case there are either no solutions or infinitely many — in other words, uniqueness never holds For example, consider the case where $$k=3$$ and $$n=2$$ Thus, the columns of $$A$$ consists of 3 vectors in $$\mathbb R ^2$$ This set can never be linearly independent, since it is possible to find two vectors that span $$\mathbb R ^2$$ (For example, use the canonical basis vectors) It follows that one column is a linear combination of the other two For example, let’s say that $$a_1 = \alpha a_2 + \beta a_3$$ Then if $$y = Ax = x_1 a_1 + x_2 a_2 + x_3 a_3$$, we can also write $y = x_1 (\alpha a_2 + \beta a_3) + x_2 a_2 + x_3 a_3 = (x_1 \alpha + x_2) a_2 + (x_1 \beta + x_3) a_3$ In other words, uniqueness fails ### Linear Equations with Julia¶
{ "domain": "quantecon.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9927672363035179, "lm_q1q2_score": 0.8022226543462614, "lm_q2_score": 0.8080672135527632, "openwebmath_perplexity": 292.48710622759694, "openwebmath_score": 0.9709522724151611, "tags": null, "url": "https://lectures.quantecon.org/jl/linear_algebra.html" }
string-theory, topology $$ \int_{\partial M}\omega = \int_M d\omega. $$ This is seen in Gauss' law. For a cocycle we then have a form $\omega \ne d\xi$, it is not the result of a coboundary, but where it is closed with $d\omega = 0$. Physically this means the field content of fields is not due to another field. This has some bearing of gauge invariance with ${\bf A}\rightarrow {\bf A} + {\bf d}\xi$ is such that $d^2\xi = 0$ gives gauge invariance. This is a topological form of a similar thing, and is seen in BRST quantization. The argument for p-cycles is that fields are not due to special conditions on a boundary, but are purely topological. This removes the need for auxiliary conditions in the theory.
{ "domain": "physics.stackexchange", "id": 31144, "lm_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, topology", "url": null }
machine-learning, probability In order for this to be achievable, some assumptions must be held:
{ "domain": "datascience.stackexchange", "id": 5449, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, probability", "url": null }
algorithms, complexity-theory, time-complexity, search-algorithms Otherwise, ask whether it is inside the 7 by 7 square at the bottom right corner. If yes, inquire an appropriate square to determine whether it is on the top row of that 7 by 7 square except the top left cell. If yes, we are left with 6 cells on the same row; otherwise we are left with 7 cells on the same column. Now start binary search. Otherwise, inquire an appropriate square to determine whether it is on the top row of the original 8 by 8 square except the top left cell. If yes, we are left with 7 cells on the same row; otherwise we are left with 8 cells on the same column. Now start binary search.
{ "domain": "cs.stackexchange", "id": 14138, "lm_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, complexity-theory, time-complexity, search-algorithms", "url": null }
c++, performance, c++11, tree int main() { /* Test code */ //root_node.key = 1; insert_bst(2, "Node #2"); insert_bst(3, "Node #3"); std::cout << query_bst(3) << '\n'; } Finally, here is the same code without all the comments: #include <iostream> struct Node { int key; Node *leftnode; Node *rightnode; std::string value; Node(int tkey, const std::string& tvalue) : leftnode(nullptr), rightnode(nullptr), key(tkey), value(tvalue) {} }; Node root_node(1, "Node #1"); // Binary search tree std::string query_bst(const int key) { Node *cur_node = &root_node; while (cur_node != nullptr) { if (key == cur_node->key) { return cur_node->value; } if (key < cur_node->key) { /* value already returned, no need for else */ cur_node = cur_node->leftnode; } else { cur_node = cur_node->rightnode; } } return ""; // Return empty string if not found }
{ "domain": "codereview.stackexchange", "id": 20307, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, c++11, tree", "url": null }
c++, stream, c++20 Block format $$ \begin{array}{l|c|l} \text{name} & \text{length in bytes} & \text{description} \\ \hline \text{signature} & 4 & \text{fixed 0xfecaadbe} \\ \text{data} & 248 & \text{the data} \\ \text{checksum} & 4 & \text{checksum of block as 32-bit unsigned value} \\ & & \text{with same endian-ness as signature} \\ \hline \text{Block} & 256 & \text{total block size} \\ \end{array} $$ Questions The code I have works as intended, but I'm left with the nagging feeling that it is fundamentally the wrong approach. For instance, in this code, the entire data is read and created as a std::strstream but I can anticipate that at some point I am going to want to process things on the fly, as from a named pipe or TCP stream where rewinding won't be possible. I thought about chaining two independent streams, one which feeds the other but I'm not sure how to approach that. Should I derive my own ostream? Two ostreams? Maybe streambuf? encode.cpp #include <iostream> #include <fstream>
{ "domain": "codereview.stackexchange", "id": 37546, "lm_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++, stream, c++20", "url": null }
ros2 Originally posted by Mrmara on ROS Answers with karma: 71 on 2023-02-01 Post score: 0 Original comments Comment by stevemacenski on 2023-02-01: You didn't provide your error message. Yes my bad, I am going to correct the question. Anyway I realized the problem. Just forgot to add inside bt_navigator params plugin_lib_names those specific nodes. Thanks for answearing Originally posted by Mrmara with karma: 71 on 2023-02-02 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 38252, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2", "url": null }
angular-momentum, velocity $$ \vec{L} = I \cdot \vec{\omega} $$ To put a long story short, the ice-skater increases $\omega$ when contracting herself because on the system as a whole, there is no torque. Let's assume the ice-skater is a cylinder, for which one can find $I = \frac{m}{2}r^2$, so that $L = \frac{m}{2} r^2 \omega$. When the ice-skater is reducing her radius, we find a $\omega$-gain of $$ \frac{\omega_2}{\omega_1} = \frac{r_1^2}{r_2^2}. $$
{ "domain": "physics.stackexchange", "id": 34940, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "angular-momentum, velocity", "url": null }
decision boundary problem. Hauptseminar für Informatiker: Single-layer neural networks decision boundary, then the points are said to implemented by a perceptron and are called. In this paper, single layer topology is developed with appropriate learning algorithm to solve non-linear problem like XOR or circular decision boundary problems. I could really use a tip to help me plotting a decision boundary to separate to classes of data. The Perceptron Learning Rule was really the first approaches at modeling the neuron for learning purposes. Maximum-likelihood and Bayesian parameter estimation techniques assume that the forms for the underlying probability densities were known, and that we will use the training samples to estimate the values of their parameters. I think the most sure-fire way to do this is to take the input region you're interested in, discretize it, and mark each point as positive or negative. It is a model of a single neuron that can be used for two-class classification
{ "domain": "youlifereporter.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9857180656553329, "lm_q1q2_score": 0.825657134006785, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 961.3748683124404, "openwebmath_score": 0.6365987062454224, "tags": null, "url": "http://mzei.youlifereporter.it/perceptron-decision-boundary.html" }
javascript, node.js, rest, mongodb, mongoose res.send({ portfolio: portfolio.name, cumulativeReturns: returns }); })(); })); // place a buy trade router.post('/buy/:portfolioName', errorHandlerMiddleware((req, res) => { /* Request body includes: Trade object, including ticker, type, quantity, price TODO: - validations for - ticker match - trade type == sell, - shares - quantity > 0 always - resultant shares > 0 always */ // validating request body; const { error } = validations.validateTradeRequest(req); if (error) { throw customError(400, "Bad Request; re-check the request body."); } else { // mismatch of type; if (req.body.type != "buy") { throw customError(400, "Bad request; type must be 'buy'.") }
{ "domain": "codereview.stackexchange", "id": 39254, "lm_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, rest, mongodb, mongoose", "url": null }
python, algorithm, multithreading, graph, depth-first-search def check_path_issues(path): """Helper function to test the condition of the path list Looks for a None in the path list to indicate that there is nothing more to explore from there""" return (path == None) or (type(path) == list and None in path) # ## Algorithm for solving the simple graph # def is_simple_graph(ddegrees): """Check if the graph is simple from its dictionary of counts: All edges are of degree 2 Input: ddegrees""" unique_counts = list(set(get_counts_from_dict(ddegrees))) return len(unique_counts) == 1 and 2 in unique_counts def solve_simple_graph(graph, path): """Main algorith used to solve a simple graph Initializes the path list if it hasn't been initialized then moves from one edge to the next removing each edge from a temporary graph until the graph is empty""" # Base case if path and not graph: return graph, path simple_graph = graph[:] #Temp graph
{ "domain": "codereview.stackexchange", "id": 26080, "lm_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, algorithm, multithreading, graph, depth-first-search", "url": null }
c++ Also, in your version, if a balance or account number is 0, will that end the loop? (I haven't tried it, but it seems like it could.) I mistakenly thought that the operator>>() would return the value in question, but in fact it returns a reference to the stream you're reading from. As such, if you want to check the validity, you need to explicitly check that the balance you read in was not 0. Update: So, as you can see, it's hard to get these things right. As Loki Astari pointed out, I messed it up not once, but twice (so far!). My main point, though, is that while putting a stream read into the condition of the while loop may work, it's going to get cumbersome quickly as your data model grows. Right now it's only 2 pieces of data, but in the future, you might have names and addresses or phone numbers, or linked accounts, etc. Also, if you want to report back specific errors, it can get hard if all you know is that 1 of 2 or 5 or 10 pieces of data was bad. Which one? Is it recoverable?
{ "domain": "codereview.stackexchange", "id": 25580, "lm_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 }
By inspection the eigenvalues are the entries along the diagonal for this upper triangular matrix. \begin{align*} \lambda_1 = 3 \qquad \lambda_2 = 2 \qquad \lambda_3 = 5 \end{align*} When $\lambda_1 = 3$ we have: $$A - 3I = \begin{bmatrix} 3-3 & 1 & 4 \\ 0 & 2-3 & 6 \\ 0 & 0 & 5-3 \\ \end{bmatrix} = \begin{bmatrix} 0 & 1 & 4 \\ 0 & -1 & 6 \\ 0 & 0 & 2 \\ \end{bmatrix} = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}$$ \begin{align*} x_1 = 1 \: (free \: variable) \qquad x_2 = 0 \qquad x_3 = 0 \\ \end{align*} $$v_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix} \qquad (matches \: answer \: in \: text)$$ When $\lambda_2 = 2$ we have: $$A - 2I = \begin{bmatrix} 3-2 & 1 & 4 \\ 0 & 2-2 & 6 \\ 0 & 0 & 5-2 \\ \end{bmatrix} = \begin{bmatrix} 1 & 1 & 4 \\ 0 & 0 & 6 \\ 0 & 0 & 3 \\ \end{bmatrix} = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}$$ \begin{align*} x_1 = -x_2 \qquad x_2 = 1 \: (free \: variable) \qquad x_3 = 0 \\ \end{align*} $$v_2 =
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226277483183, "lm_q1q2_score": 0.8417423304940443, "lm_q2_score": 0.8615382147637196, "openwebmath_perplexity": 321.08975195653005, "openwebmath_score": 0.9997081756591797, "tags": null, "url": "https://math.stackexchange.com/questions/1624236/finding-eigenvectors-of-a-3x3-matrix-7-12-15" }
inorganic-chemistry, stereochemistry, coordination-compounds, synthesis, stereoselectivity Hamm in 1952 had shown that trans—cis Isomerization using UV-vis spectroscopy ($trans \rightarrow cis$; Ref.1). According to Hamm, all previous workers have prepared trans-isomer because its lack of solubility. Yet, the existence of cis- and trans-isomers has been first recognized by Werner and has presented the preparation methods of two isomers individually (Ref.2), thus it is not true that the your concept of only the cis-stereoisomer forms. Werner had mentioned that aqueous solution of trans-isomer is stable only in the cold temperatures. That may be the reason why only cis-isomer forms in solid state preparations because the preparation needs heating at high temperature. Using the method given by Werner, trans-dioxalatodiaquochromate(III) isomer has been prepared and its crystal structure has been studied (Ref.3 & 4).
{ "domain": "chemistry.stackexchange", "id": 12246, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, stereochemistry, coordination-compounds, synthesis, stereoselectivity", "url": null }
c, library, bloom-filter return hash32 ^ (hash32 >> 16); } #endif Possible extra calls to hash functions If you look at the SET_BIT macro, it uses k twice: #define SET_BIT(bf, k) (bf->buf[k >> 4] |= 1 << (k % 16)) The way you use SET_BIT is like this: #define H_b(pointer, bytes) (FNV1A_Hash_WHIZ((void *)pointer, bytes)) #define G(in, scalar, pointer, bytes, size) (abs(in[0] + scalar * H_b(pointer, bytes)) % size) SET_BIT(bf, G(hash, i, &data, sizeof(data), bf->mbits)); So in the final expansion of SET_BIT(), you will be calling FNV1A_Hash_WHIZ() twice. Now, your compiler may be smart enough to realize that FNV1A_Hash_WHIZ() has no side effects, so it can be called only once. When I tested your code, I found the following: gcc was able to optimize the code to only call FNV1A_Hash_WHIZ() once. However, when I took the hash function out of the header and put it in a separate .c file, then gcc was not able to optimize the extra call away, and it ended up with two calls instead.
{ "domain": "codereview.stackexchange", "id": 21673, "lm_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, library, bloom-filter", "url": null }
newtonian-mechanics, forces, free-body-diagram Title: Minimum force required to push a car up a slope I have a problem calculating the force required to push my car up an inclined road. My car has 1200 kg mass, the road angle is 4 degrees (7 percent slope) and static coefficient of friction between tires and dry asphalt is around 0.9 The following picture is the forces acting on the car:
{ "domain": "physics.stackexchange", "id": 86651, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, forces, free-body-diagram", "url": null }
decoherence, terminology-and-notation Title: What's the difference between T1 and T2? I learned that T1 is relaxation time (time from $|1\rangle$ to $|0\rangle$) and T2 is coherence time. The relaxation is a specific case of decoherence. What's the difference between them and what's the exact meaning of coherence time T2? T2 is so-called dephasing time. It describes how long the phase of a qubit stays intact. In your words, it is time from $|+\rangle= \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ to $|-\rangle= \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$, or conversely. Just note that both T1 and T2 are not actually "time from state x to state y" but rather decay constants. Probability that a qubit will stay in state $|1\rangle$ after time $t$ is given by formula $$ P(|1\rangle) = \mathrm{e}^{-\frac{t}{T1}}. $$ Similarly for T2. Both times T1 and T2 are together called decoherence times.
{ "domain": "quantumcomputing.stackexchange", "id": 1268, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "decoherence, terminology-and-notation", "url": null }
homework-and-exercises, kinetic-theory Title: Averaging component of speed in speed distribution Homework problem: The molecules in a gas travel with different velocities. A particular molecule will have velocity $\vec v$ and speed $v = |\vec v|$ and will move at angle $\theta$ to some chosen fixed axis. It has been given that the number of molecules in a gas with speeds between $v$ and $v + dv$ and moving at angles between $\theta$ and $\theta + d\theta$ to any chosen axis is given by $$\frac{1}{2} n f(v) \sin(\theta) d\theta,$$ where $n$ is the number of molecules per unit volume and $f(v)$ is some function of $v$ only, but NOT necessarily the Maxwell-Boltzmann distribution. Show by integration that, $$\langle u^2\rangle= \frac{1}{3} \langle v^2\rangle$$, where $u$ is any Cartesian component of $v$, e.g. $v_x$, $v_y$, or $v_z$.
{ "domain": "physics.stackexchange", "id": 63392, "lm_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, kinetic-theory", "url": null }
ros, cmake wpa_supplicant_node.cpp:(.text.ZN13ros_interface10fillRosBssERN19wpa_supplicant_node4Bss_ISaIvEEER7wpa_bss[ros_interface::fillRosBss(wpa_supplicant_node::Bssstd::allocator<void >&, wpa_bss&)]+0x1dd): undefined reference to wpa_parse_wpa_ie' CMakeFiles/wpa_supplicant_node.dir/src/nodes/wpa_supplicant_node.cpp.o: In function ros_interface::fillRosResp(wpa_supplicant_node::ScanResult_std::allocator<void >&, wpa_scan_results&)': wpa_supplicant_node.cpp:(.text.ZN13ros_interface11fillRosRespERN19wpa_supplicant_node11ScanResult_ISaIvEEER16wpa_scan_results[ros_interface::fillRosResp(wpa_supplicant_node::ScanResultstd::allocator<void >&, wpa_scan_results&)]+0x9e): undefined reference to wpa_scan_get_ie' wpa_supplicant_node.cpp:(.text._ZN13ros_interface11fillRosRespERN19wpa_supplicant_node11ScanResult_ISaIvEEER16wpa_scan_results[ros_interface::fillRosResp(wpa_supplicant_node::ScanResult_<std::allocator<void> >&, wpa_scan_results&)]+0x28c): undefined reference to wpa_scan_get_vendor_ie'
{ "domain": "robotics.stackexchange", "id": 19605, "lm_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, cmake", "url": null }
ions, aqueous-solution Now, the charge is distributed even more. We can have other species like $\ce{H7O3+}$, $\ce{H15O7+}$, etc. Note that there are crowding issues as well - this is why $\ce{H_{103}O_{51}+}$ probably doesn't exist. Basically, the "original" $\ce{H+}$ is being solvated. The solvation delocalises the charge and forms extra bonds, reducing the net potential energy and increasing stability. That's basically it. It's similar to what happens when you dissolve any ionic compound in water.
{ "domain": "chemistry.stackexchange", "id": 64, "lm_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, aqueous-solution", "url": null }
rotational-dynamics, reference-frames, rigid-body-dynamics, moment-of-inertia The definition of ${\rm I}_A$ depends on the vector form of the parallel axis theorem and it takes one of the two following forms $${\rm I}_{A}={\rm I}_{C}-m[\vec{c}\times][\vec{c}\times]={\rm I}_{C}+m\left(\left(\vec{c}\cdot\vec{c}\right){\rm 1}-\vec{c}\odot\vec{c}\right) \tag{5}$$ where $[\vec{c}\times]$ is a 3×3 skew symmetric matrix representing the cross product operation, or $\cdot$ the dot product, $\rm 1$ the 3×3 identity matrix and $\odot$ the vector outer product. The additional components are always symmetric and equal to the following when working out the math for $\vec{c}=\pmatrix{x & y & z}$ $$ -[\vec{c}\times][\vec{c}\times] = \left(\vec{c}\cdot\vec{c}\right){\rm 1}-\vec{c}\odot\vec{c} = \begin{bmatrix} y^2+z^2 & -x y & -x z \\ -x y & x^2+z^2 & -y z \\ -x z & -y z & x^2+y^2 \end{bmatrix} $$ Since we are adding the symmetric matrix ${\rm I}_C$ to a symmetric matrix for parallel axis contribution, the result is also a symmetric matrix and hence diagonalizable.
{ "domain": "physics.stackexchange", "id": 94885, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rotational-dynamics, reference-frames, rigid-body-dynamics, moment-of-inertia", "url": null }
meteorology, geophysics, planetary-science, atmosphere-modelling, geoengineering The accuracy of current weather predictions is better for forecasts 5-10 days ahead. So, this may give enough time to do controlled simulations before and after our intervention. Based on that we may act on to, for example, increase precipitation (e.g. through controlled spraying of condensation nuclei) where there is drought, hit and disperse hurricanes or change their directions before they hit and damage cities etc. How wrong can one be to think like that? The bad part about geo-engineering are the unknown unknowns. Our climate models are wrong. All models are wrong, but some are useful.. Our models are useful, but not quite useful enough to trust them when they tell us massively spraying stuff into the stratosphere or the oceans is mostly harmless. Our models can't properly reproduce our current climate. They agree about some trends, but there's lots of stuff that they're missing.
{ "domain": "earthscience.stackexchange", "id": 1973, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "meteorology, geophysics, planetary-science, atmosphere-modelling, geoengineering", "url": null }
windows Title: Issue with running on windows with miniconda3 install After running the following commands (Windows 11, Miniconda3): >> conda create -n ign-ws >> conda activate ign-ws >> conda install libignition-gazebo6 --channel conda-forge Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.12.0 latest version: 4.14.0 Please update conda by running $ conda update -n base -c defaults conda ## Package Plan ## environment location: C:\Users\XXXX\.conda\envs\ign-ws added / updated specs: - libignition-gazebo6 The following packages will be downloaded:
{ "domain": "robotics.stackexchange", "id": 4668, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "windows", "url": null }
c++, parsing record temp; temp.section = tsection; temp.name = tname; temp.value = tdefault; records.push_back (temp); return tdefault; } ConfigReader::ConfigReader (const std::string & file) : records() { readfile (file); } ConfigReader::ConfigReader() : records() { } The syntax of the config file is simple: [video] width = 1920; etc; What should I change? Improve? Are there any errors? (Well, there is one in parse.) Use standard algorithms where applicable. For instance, trim could be rewritten: std::string& trim(std::string& s) { auto is_whitespace = [] (char c) -> bool { return c == ' ' || c == '\t'; }; auto first_non_whitespace = std::find_if_not(begin(s), end(s), is_whitespace); s.erase(begin(s), first_non_whitespace); auto last_non_whitespace = std::find_if_not(s.rbegin(), s.rend(), is_whitespace) .base(); s.erase(std::next(last_non_whitespace), end(s)); return s; }
{ "domain": "codereview.stackexchange", "id": 4093, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, parsing", "url": null }
javascript, beginner, object-oriented, dom Beyond that, I didn't really explored them but I guess you probably could use better ways when: moving tasks between tables handling start/stop and computing time elapsed
{ "domain": "codereview.stackexchange", "id": 20562, "lm_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, beginner, object-oriented, dom", "url": null }
steel, elastic-modulus, traction (Pardon my Paint skills, I'm more of a CAD guy) As for the accommodation zone, as niels nielsen suggests, extrapolate the elastic zone to the x-axis and disregard the data to the left of that line. Below is an image illustrating:
{ "domain": "engineering.stackexchange", "id": 2044, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "steel, elastic-modulus, traction", "url": null }
algorithms, time-complexity, combinatorics, permutations The counters associated with $i$ will be $C^{(h)}_i$ for some suitably chosen values of $h$. In particular, if the binary expansion of $i$ has $\ell_i$ zeros in its least significant bit, then we will keep $\ell_i$ counters $C^{(0)}_i, C^{(1)}_i, \dots, C^{(\ell_i-1)}_i$. (If $\ell_i=0$, we keep no counters). The intuition is that adding $1$ to $C_i^{(h)}$ corresponds to adding $1$ to each of the $2^h$ "original counters" $C_i, C_{i+1}, \dots, C_{i+2^{h}-1}$. In particular we say that $C_i^{(h)}$ covers $C_i, C_{i+1}, \dots, C_{i+2^{h}-1}$. See the figure for a graphical example with $n=16$.
{ "domain": "cs.stackexchange", "id": 18656, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, time-complexity, combinatorics, permutations", "url": null }
c#, object-oriented, game, multithreading, collision class Keyboard() { private readonly Keys[] keysToWatchFor; private bool keepThreadAlive;//or use cancel token like you did before public Keyboard(params Keys[] keysToWatchFor) { this.keysToWatchFor = keysToWatchFor; }
{ "domain": "codereview.stackexchange", "id": 7158, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, object-oriented, game, multithreading, collision", "url": null }
slam, navigation, ros-kinetic, stereo-camera, rtabmap /right/image_mono/compressedDepth /right/image_mono/compressedDepth/parameter_descriptions /right/image_mono/compressedDepth/parameter_updates /right/image_mono/theora /right/image_mono/theora/parameter_descriptions /right/image_mono/theora/parameter_updates /right/image_raw_color/compressed /right/image_rect /right/image_rect/compressed /right/image_rect/compressed/parameter_descriptions /right/image_rect/compressed/parameter_updates /right/image_rect/compressedDepth /right/image_rect/compressedDepth/parameter_descriptions /right/image_rect/compressedDepth/parameter_updates /right/image_rect/theora /right/image_rect/theora/parameter_descriptions /right/image_rect/theora/parameter_updates /right/image_rect_color /right/image_rect_color/compressed /right/image_rect_color/compressed/parameter_descriptions /right/image_rect_color/compressed/parameter_updates
{ "domain": "robotics.stackexchange", "id": 31707, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, ros-kinetic, stereo-camera, rtabmap", "url": null }
python, python-3.x def filecopy(source, target, hashcheck = False, hashtype = 'md4', buffersize = 1024, overwrite = True, consoleoutput = False): if not platform.system() == 'Windows': raise Exception('Incorrect OS') if not hashtype in ['md4','md5', 'sha1']: raise Exception('HashType must be ["md4" | "md5" | "sha1"]') if not os.path.exists(source): raise Exception('Source File not Found') if not isinstance(buffersize, int): raise Exception('Buffer Size must be int') if buffersize > 1048576: raise Exception('Buffer Size > 1MB (1048576 bytes)') if os.path.isdir(target): raise Exception('Target must be a File not a Directory') if os.path.exists(target) and (not overwrite): raise Exception('Target File exists') if not os.path.exists(os.path.dirname(target)): raise Exception('Target Directory does not exists')
{ "domain": "codereview.stackexchange", "id": 22972, "lm_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 }
# WLOG “WLOG” (or “WOLOG”) is an acronym which stands for “without loss of generality.” WLOG is invoked in situations where some property of a model or system is invariant under the particular choice of instance attributes, but for the sake of demonstration, these attributes must be fixed. For example, we might want to prove something about open intervals $(a,b)$ of the real number line. But the proof might become too tedious if $a$ and $b$ were arbitrary real numbers, so in the proof we simply assume that $a=0$ and $b=1$, and without loss of generality, the same arguments apply to general intervals $(a,b)$. Depending on the proof, the loss of generality might be accomplished by translating and scaling the interval to $(0,1)$ before carrying out the argument, and then translating and rescaling back to $(a,b)$ afterwards.
{ "domain": "planetmath.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936050226357, "lm_q1q2_score": 0.8179225561983642, "lm_q2_score": 0.831143045767024, "openwebmath_perplexity": 374.036999885993, "openwebmath_score": 0.8860009908676147, "tags": null, "url": "https://planetmath.org/WLOG" }
Choosing the rightmost vector $b$ as the row sum of $A$ yields an exact solution of the same form as the solution to the full matrix system. b = sum(A,2); bDist = sum(ADist,2); xEx = ones(n,1); xDistEx = ones(n,1,'distributed'); In the same way as with full matrices, you can now solve this system of linear equations directly using mldivide and check the error between the obtained result and its expected value. x = A\b; err = abs(xEx-x); xDist = ADist\bDist; errDist = abs(xDistEx-xDist); figure subplot(2,1,1) semilogy(err,'o'); title('System of Linear Equations with In-Client Sparse Matrices'); ylabel('Absolute Error'); xlabel('Element in x'); ylim([10e-17,10e-13]) subplot(2,1,2) semilogy(errDist,'o'); title('System of Linear Equations with Distributed Sparse Matrices'); ylabel('Absolute Error'); xlabel('Element in x'); ylim([10e-17,10e-13])
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969679646668, "lm_q1q2_score": 0.8131512119288289, "lm_q2_score": 0.8267117919359419, "openwebmath_perplexity": 573.6838931208047, "openwebmath_score": 0.6473777294158936, "tags": null, "url": "https://nl.mathworks.com/help/parallel-computing/examples/Use-Distributed-Arrays-to-Solve-Systems-of-Linear-Equations-with-Direct-Methods.html" }
ros -- ~~ - roscreate -- ~~ - rosgraph -- ~~ - roslang -- ~~ - roslint -- ~~ - rosmake -- ~~ - rosmaster -- ~~ - rosmsg -- ~~ - rospack -- ~~ - roslib -- ~~ - rosparam -- ~~ - rospy -- ~~ - rosserial (metapackage) -- ~~ - rosserial_client -- ~~ - rosserial_msgs -- ~~ - rosserial_python -- ~~ - rosservice -- ~~ - rostime -- ~~ - roscpp_serialization -- ~~ - python_qt_binding -- ~~ - roslaunch -- ~~ - rosunit -- ~~ - rosconsole -- ~~ - pluginlib -- ~~ - qt_gui_cpp -- ~~ - resource_retriever -- ~~ - rosconsole_bridge -- ~~ - roslz4 -- ~~ - rosbag_storage -- ~~ - rostest -- ~~ - rqt_action -- ~~ - rqt_bag -- ~~ - rqt_bag_plugins -- ~~ - rqt_common_plugins (metapackage) -- ~~ - rqt_console -- ~~ - rqt_dep -- ~~ - rqt_graph -- ~~ - rqt_gui -- ~~ - rqt_logger_level -- ~~ - rqt_moveit -- ~~ - rqt_msg -- ~~ - rqt_nav_view -- ~~ - rqt_plot -- ~~ - rqt_pose_view -- ~~ - rqt_publisher -- ~~ - rqt_py_console -- ~~ - rqt_reconfigure
{ "domain": "robotics.stackexchange", "id": 26369, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
complexity-theory, reductions Assume that we want to use the search problem $S$ to solve the search problem $R$. On an input $x$ for $R$, we first compute $g(x)$ which is an input for $S$. Then we use $S$ to find an $S$-solution $y$ for $g(x)$, i.e. $(g(x),y)\in S$. Finally we compute $h(x,y)$ to obtain an $R$-solution for $x$. Now if we want to preserve the number of solutions between these two search problems, we can make sure that for every $x$, the function $h(x,\cdot)$ that computes an $R$-solution for $x$ from an $S$-solution $y$ for $g(x)$ is a bijection. The difference should be clear now: not only the number of $R$-solutions for $x$ and $S$-solutions for $g(x)$ are equal, there is an efficient bijection between those solutions.
{ "domain": "cs.stackexchange", "id": 1025, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, reductions", "url": null }
performance, programming-challenge, haskell Sample implmentation Finally, here's a sample implementation. module Main where import Data.Set (Set) import qualified Data.Set as S -- This is a partial function parseInt :: String -> Integer parseInt (op:s) = case op of '+' -> read s '-' -> (-1) * read s -- There is a hole here, assuming valid input findRepeatingFrequency :: Integer -> Set Integer -> [Integer] -> Integer findRepeatingFrequency acc seen (x:xs) = if acc `S.member` seen then acc else findRepeatingFrequency (acc + x) (S.insert acc seen) xs partOne :: [Integer] -> Integer partOne = sum partTwo :: [Integer] -> Integer partTwo ints = findRepeatingFrequency 0 S.empty $ cycle ints main :: IO () main = do file <- readFile "input.txt" let input = filter (not . null) $ words file let ints = map parseInt input print $ partOne ints print $ partTwo ints
{ "domain": "codereview.stackexchange", "id": 32765, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, programming-challenge, haskell", "url": null }
ros, navigation, dwa-local-planner # Forward Simulation Parameters sim_time: 1.7 #1.5 # 1.7 vx_samples: 20 # 3 vy_samples: 1 #1 # diff drive robot, there is only one sample vtheta_samples: 40 # 20 # Trajectory Scoring Parameters path_distance_bias: 32.0 # 32.0 - weighting for how much it should stick to the global path plan goal_distance_bias: 12.0 # 24.0 - wighting for how much it should attempt to reach its goal occdist_scale: 0.02 # 0.01 - weighting for how much the controller should avoid obstacles forward_point_distance: 0.325 #0.325 # 0.325 - how far along to place an additional scoring point stop_time_buffer: 0.2 # 0.2 - amount of time a robot must stop in before colliding for a valid traj. scaling_speed: 0.25 # 0.25 - absolute velocity at which to start scaling the robot's footprint max_scaling_factor: 0.2 # 0.2 - how much to scale the robot's footprint when at speed.
{ "domain": "robotics.stackexchange", "id": 29841, "lm_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, navigation, dwa-local-planner", "url": null }
c#, .net, asp.net /// <summary> /// Gets the RequestScoped instance for the given HttpContext. /// Creates and returns a new instance if it doesn't exist yet. /// This method is not thread-safe. /// The assumption is that there will only be one thread per request. /// </summary> public static RequestScoped GetOrCreate(System.Web.HttpContext context) { if (!context.Items.Contains(key)) { context.Items[key] = new RequestScoped(); context.AddOnRequestCompleted(Cleanup); } return (RequestScoped)context.Items[key]; } private static void Cleanup(System.Web.HttpContext context) { if (context.Items.Contains(key)) { var scope = (RequestScoped)context.Items[key]; scope.Dispose(); } } private readonly Lazy<IDbConnection> connection; private readonly Lazy<SessionRepository> sessionRepo;
{ "domain": "codereview.stackexchange", "id": 19359, "lm_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#, .net, asp.net", "url": null }
c++, template-meta-programming, enum #elif defined(_MSC_VER) // "auto __cdecl enum_value_name<XXXXXX::XXXXX::XXXXX>(void) noexcept" constexpr std::string_view header = "auto __cdecl enum_stringifyer::enum_value_name<"; constexpr std::string_view footer = ">(void) noexcept"; return std::string_view{ __FUNCSIG__ + header.size(), sizeof(__FUNCSIG__) - 1 - header.size() - footer.size() }; #else static_assert(false, "enum_value_name requires either __PRETTY_FUNCTION__ or __FUNCSIG__ to be available"); #endif }
{ "domain": "codereview.stackexchange", "id": 44759, "lm_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++, template-meta-programming, enum", "url": null }
synthesis, heat The reaction proceeds into a high-energy transition state, and then comes down to the low energy products. To reach the transition state however, you must supply heat. Edit: As @porphyrin mentioned, there are some reactions that have essentially zero activational energy. Combination of radicals may be an example: $$\ce{Cl. + Cl. -> Cl2}$$ This one has no activational energy because there is no unstable transition state involved. Another popular example is the basic neutralization reaction: $$\ce{H+ + OH- <=> H2O}$$ Here again, there isn't any highly unstable transition state.
{ "domain": "chemistry.stackexchange", "id": 8273, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "synthesis, heat", "url": null }
complexity-theory, computer-architecture, quantum-computing For a classical two-bit vector, the permissible values are $00,01,10,11$, whereas for a two-qubit system you can have any $a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle$ for $a,b,c,d\in\mathbb{C}$ provided that $|a|^2+|b|^2+|c|^2+|d|^2=1$. This, together with the postulates of quantum mechanics, permits a completely different range of behaviors of quantum systems (and qubit vectors), behaviors that are unseen in classical systems. This gives the above representation of information a lot more power compared to classical information representation. A number of physical phenomena allow various interesting information theoretic operations (such as teleportation, superdense coding, etc), which are not admissible using classical systems. The emphasis here really is on the fact that in quantum computing you can exploit a range of physical phenomena that is not typical in classical information theory.
{ "domain": "cs.stackexchange", "id": 10410, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, computer-architecture, quantum-computing", "url": null }
${\displaystyle {\frac {a+c}{b+d}},}$ which first appears in the Farey sequence of order b + d. Thus the first term to appear between 1/3 and 2/5 is 3/8, which appears in F8. The Stern–Brocot tree is a data structure showing how the sequence is built up from 0 (= 0/1) and 1 (= 1/1), by taking successive mediants. Fractions that appear as neighbours in a Farey sequence have closely related continued fraction expansions. Every fraction has two continued fraction expansions — in one the final term is 1; in the other the final term is greater than 1. If p/q, which first appears in Farey sequence Fq, has continued fraction expansions [0; a1, a2, ..., an − 1, an, 1] [0; a1, a2, ..., an − 1, an + 1] then the nearest neighbour of p/q in Fq (which will be its neighbour with the larger denominator) has a continued fraction expansion [0; a1, a2, ..., an] and its other neighbour has a continued fraction expansion [0; a1, a2, ..., an − 1]
{ "domain": "wikipedia.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9956005859235121, "lm_q1q2_score": 0.8092911688903465, "lm_q2_score": 0.8128673087708699, "openwebmath_perplexity": 557.5860109233022, "openwebmath_score": 0.9529710412025452, "tags": null, "url": "https://en.wikipedia.org/wiki/Farey_sequence" }
From the Solution 1, it seems that $P(2s|5H) \neq P(2s)P(5H)$ That is the event of picking out the weighted coin affects the probability of getting 5H. Here is part of my question, isn't there also some tiny probability of getting 5H from picking the normal one as well? Doesn't make sense why the events of picking the coin and getting 5H is dependent. Read on the next question Problem 2 A diagnostic test for an eye disease is 88% accurate of the time and 2.4% of the population actually has the disease. Let $ED$ be the event of having the eye disease and $p$ be the event of testing positive. Find the probability that a) the patient tests positive b) the patient has the disease and tests positive Solution 2 Here is a tree diagram a) $0.02122 + 0.011712 = 0.13824$ b) $P(ED | p) = \dfrac{P(\text{ED and p})}{P(p)} =\frac{0.02122}{0.13824 }= 0.1535$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9740426382811477, "lm_q1q2_score": 0.8336355127492092, "lm_q2_score": 0.8558511506439708, "openwebmath_perplexity": 194.58201653780065, "openwebmath_score": 0.8548222780227661, "tags": null, "url": "http://math.stackexchange.com/questions/173716/independent-events-and-dependent-events" }
computer-vision, algorithms, local-features The first important thing is Detection; in this step you want to detect points-of-interest or keypoints, and what that means is that you want to choose local points (basically small patches) that you think are interesting in the image, there are many ways to do that; this paper doesn't contribute in this area. However, it seems that they use SURF feature detector and CenSurE keypoints (you can look them up if you want to know more about them, I won't talk about this step except that they use features such as gradients and so, which means that if you have a photo, it's unlikely that a point in the middle of the sky would be chosen as an interest point, that's because the pixels around that point are all same intensities, things that are 'busy' tend to be chosen as interest points (e.g. table/building edges/corners)).
{ "domain": "dsp.stackexchange", "id": 156, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computer-vision, algorithms, local-features", "url": null }
c++, c++17 I don't use a Singleton, but rather I create a shared_ptr and std::move it across constructors. First, in many cases you don't need singletons. Maybe you can't think of a reason why someone would want to create two brokers in the same program, but on the other hand, there is nothing that would prevent that from working correctly. Second, I don't think you need to use std::shared_ptr at all, just pass non-owning references to objects and make sure their lifetime is correct. For example, I think you should be able to write your main() function like so: int main() { Broker broker; PlanningPipeline planningPipeline(broker); PerceptionPipeline perceptionPipeline(broker); ... } As for the messages, consider having Queue own the messages enqueued on it: template<class T> class Queue: public QueueBase { public: ... template<typename... Args> void EnqueueMessage(Args&&... args); ... private: ... std::queue<T> messages; };
{ "domain": "codereview.stackexchange", "id": 43619, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++17", "url": null }
deep-learning, natural-language-processing, classification, voice-recognition Title: How much the dialects recognition and speech recognition are relevant? In this tutorial, they build a speech recognition model to classify a one-second audio clip as one of ten predefined words. Suppose that we modified this problem as the following: Given an Arabic dataset, we aim to build a dialects recognition model to classify a two-second audio clip as one of $n$ local dialects using ten predefined sentences. I.e. for each of these ten sentences, there are $x$ different phrases and idioms which refer to the same meaning$^*$. Now how can I take advantage of the mentioned tutorial to solve the modified problem? $*$ The $x$ different phrases and idioms for each sentence are not predefined. The tutorials you link are not much relevant, there are already existing implementations of your exact problem. You can use https://github.com/swshon/dialectID_e2e, there are many other similar implementations on github.
{ "domain": "ai.stackexchange", "id": 1071, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "deep-learning, natural-language-processing, classification, voice-recognition", "url": null }
mechanical-engineering, combustion, engines, diesel Title: Why do some diesel engines run on diesel fuel and others on fuel oil? Trucks and smaller vehicles with diesel engines run on diesel fuel which looks more or less like kerosene - less flammable than gasoline, low viscosity liquid. However larger diesel engines like this 120 thousand horsepower marine engine have more or less the same design but use fuel oil which looks very different from diesel fuel - much higher viscosity and I'd guess igniting fuel oil at room temperature is a challenge.
{ "domain": "engineering.stackexchange", "id": 3007, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, combustion, engines, diesel", "url": null }
ros, navigation, move-base, create-robot onnect() in progress to [192.168.1.6:53668] on socket [22] [roscpp_internal] [2011-03-08 19:38:19,516] [thread 0xb601db70]: [DEBUG] Connect ed to publisher of topic [/tf] at [192.168.1.6:53668] [roscpp_internal] [2011-03-08 19:38:19,891] [thread 0xb681f740]: [DEBUG] Publish er update for [/move_base_simple/goal]: http://192.168.1.7:46858/, already have these connections: [roscpp_internal] [2011-03-08 19:38:19,891] [thread 0xb681f740]: [DEBUG] Began a synchronous xmlrpc connection to [192.168.1.7:46858] [roscpp_internal] [2011-03-08 19:38:19,918] [thread 0xb681f740]: [DEBUG] XML-RPC call [searchParam] returned an error (-1): [Cannot find parameter [tf_prefix] i n an upwards search] [roscpp_internal] [2011-03-08 19:38:19,923] [thread 0xb681eb70]: [DEBUG] Accepte d connection on socket [7], new socket [12] [roscpp_internal] [2011-03-08 19:38:19,924] [thread 0xb681eb70]: [DEBUG] TCPROS received a connection from [192.168.1.6:43381]
{ "domain": "robotics.stackexchange", "id": 5002, "lm_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, navigation, move-base, create-robot", "url": null }
beginner, f# This is the library: namespace Dymanix module Mscrm = open System open Microsoft.Xrm.Sdk open Microsoft.Xrm.Sdk.Messages type CrmRecord = | Entity of Entity | Reference of EntityReference type PluginMessage = | Create | Update | Delete | Other of string type PreStage = | PreValidation | PreOperation type Stage = | Pre of PreStage | PostOperation type StepStage = { Message : PluginMessage Stage : Stage } type FullRecordImage = Entity type TargetRecord = Entity let MergeRecords (baseRecord : Entity) (toMerge : Entity) = let mergeTarget = Microsoft.Xrm.Sdk.Entity(baseRecord.LogicalName, Id = baseRecord.Id) toMerge.Attributes |> Seq.iter (fun att -> mergeTarget.[att.Key] <- att.Value) mergeTarget
{ "domain": "codereview.stackexchange", "id": 6599, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, f#", "url": null }
python, python-3.x, trie def __contains__(self, item): word = self._normalize_word(item) return self.__contains(word, self._root) is not None def _normalize_word(self, word): return word.strip().lower() def get_possible_words(self, word): word_node = self.__contains(word, self._root) return [] if word_node is None else \ self.__get_possible_words(word, word_node) def __get_possible_words(self, word, word_node, word_list=None): word_list = [] if word_list is None else word_list if word_node.terminus: word_list.append(word) for letter in word_node.children: if not word_node.children[letter]: word_list.append(word + letter) else: self.__get_possible_words(word + letter, word_node.children[letter], word_list) return word_list
{ "domain": "codereview.stackexchange", "id": 23068, "lm_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, trie", "url": null }
beginner, logging, powershell Get-Service -Name ( "Win$( '*' )" ) Those examples are convoluted, but you get the idea. In array/hashtable definitions @()/@{} I use these a lot. Format as needed within these. Note that in a hashtable definition, if you are used to using semicolons ; to separate items on a single line (like @{ Key1 = 'val1' ; Key2 = 'val2' } the newlines take the place of the semicolon. # Hashtable @{ Key1 = 'val1' Key2 = 'val2' } # Array @( 1,2,3 ) @( 1, 2, 3 ) @( 1 , 2 ,3 ) # why oh why # my preferred (long) array style: @( 1 ,2 ,3 ) Combined: @{ Set1 = @{ Arr1 = @( 'A' ,'B' ,'C' ) Arr2 = @( 1 ,2 ,3 ) } Set2 = @{ Scalar = 10 } }
{ "domain": "codereview.stackexchange", "id": 28174, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, logging, powershell", "url": null }
lagrangian-formalism, conservation-laws, symmetry, coordinate-systems, noethers-theorem The answer is: Yes, the quasi-symmetry $$y^i(q,\dot{q},t)~=~\{q^i(t),Q_L(t)\}, \qquad i~\in~\{1,\ldots,n\},\tag{B} $$ is generated via the Peierls bracket $$\{ F,G \}~:=~\iint\!dt~dt^{\prime}~\sum_{i,k=1}^{n} \frac{\delta F }{\delta q^i(t)}~G^{ik}_{\rm ret}(t,t^{\prime})~\frac{\delta G }{\delta q^k(t^{\prime})} - (F\leftrightarrow G),\tag{C} $$ where $G^{ik}_{\rm ret}(t,t^{\prime})$ is the retarded Green's function, see e.g. various textbooks by Bryce S. DeWitt and this Phys.SE answer by user AccidentalFourierTransform. Unfortunately, within the Lagrangian formalism, we do not know the explicit form of the retarded Green's function $G^{ik}_{\rm ret}(t,t^{\prime})$, except in special cases. This makes OP's purely Lagrangian endeavour challenging & calculations cumbersome. However, we know that there is a bijective correspondence to a corresponding Hamiltonian formulation via a Legendre transformation, cf. e.g.
{ "domain": "physics.stackexchange", "id": 51528, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lagrangian-formalism, conservation-laws, symmetry, coordinate-systems, noethers-theorem", "url": null }
physical-chemistry, spectroscopy Title: What does the negative superscript in the term symbol for ground state Oxygen stand for? I think that I understand most of the parts of the symbol shown for ground state oxygen $\ce{{}^{16}O2}$, which is ${}^{3}\Sigma^{-}_{g}$. However, I was hoping that someone could tell me what exactly the negative superscript sign means? And how do you identify between a positive and negative state? I think it has something to do with a mirror plane. You're right that it has to do with a mirror plane. The negative sign means that the overall electronic wavefunction changes sign when reflected in a mirror plane that includes the internuclear axis.
{ "domain": "chemistry.stackexchange", "id": 862, "lm_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, spectroscopy", "url": null }
c#, dependency-injection, asp.net-core, autofac public Status Get() { return _order != null ? GetStatus() : Status.Idle; } private Status GetStatus() { return TakeUpDateIsNotDecidedAndContainerStaysMoreThanAllowedDays() ? Status.Old : IsTakeAble(); } private bool TakeUpDateIsNotDecidedAndContainerStaysMoreThanAllowedDays() { return _order.TakeUpDate.Equals(null) && (_dateTime.Now - _order.LayDownDate).TotalDays >= NumberOfAllowedDaysToStay; } private Status IsTakeAble() { return _dateTime.Now.Equals(_order.TakeUpDate) ? Status.Takeable : Status.BeingFilled; } } This is a high overview of how the Domain layer interacts to with the Data, and how to retrieve the AggregateRoot for an Entity. Look forward to checking online about different approach of the Entity-Aggregate relation. Here you can start to your DDD journey. Hope this help!
{ "domain": "codereview.stackexchange", "id": 27088, "lm_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#, dependency-injection, asp.net-core, autofac", "url": null }
general-relativity, black-holes, spacetime, stars How close to the "centre" you are: The closer you get to a mass, the more intense the force of gravity from it. One exception is the example above - if being closer also means being inside it, then in effect, there will be less mass to act on you. Your question: star vs. black hole: Imagine the sun, compared to a black hole with the sun's mass. In this case you aren't "inside", so the only things affecting how intense gravity is, are the mass - which is the same - and the distance from the "centre". The sun has a radius of 700,000 km. The black hole has a radius of 3km. They both have the same mass "below" them. The intensity of the gravitational field is proportional to the square of the distance. Because the mass "below" is the same, but the distance is 233,000 x less, gravity is 233,000^2 = 55 billion times stronger at the 3km "boundary" of the black hole. (3km is the closest anything can get to the black hole without being "lost" to us within it)
{ "domain": "physics.stackexchange", "id": 50640, "lm_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, black-holes, spacetime, stars", "url": null }
catkin Title: Catkin and Cython? Has anyone tried cython with catkin? Some example? Originally posted by liborw on ROS Answers with karma: 801 on 2013-12-09 Post score: 2 Hi, there is an example of a guy using cython with catkin, look at his githup. https://github.com/marcoesposito1988/cython_catkin_example Originally posted by pablocesar with karma: 252 on 2015-12-24 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 16404, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "catkin", "url": null }
of a Disk Calculator at CalcTown. A quantity expressing a body's tendency to resist angular acceleration is known as the Moment of Inertia, whereas Polar Moment of Inertia is measure of an object's ability to resist torsion under specified axis when and torque is being applied. Section modulus helps in determining the strength of the section. But instead of limits from to, the limit is set from zero to. 10 Thick walled cylinder rotating about the central axis A general body with moment of inertia I cm through its centre of mass, rotating about a parallel axis, a distance d from the. In the preceding subsection, we defined the moment of inertia but did not show how to calculate it. 371r^2) kg/m^3 about the center. Moment of inertia is defined as:"The sum of the products of the mass of each particle of the body and square of its perpendicular distance from axis. In the preceding section, we defined the moment of inertia but did not show how to calculate it. The second moment of area,
{ "domain": "safoo.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9919380089483865, "lm_q1q2_score": 0.8470285215101608, "lm_q2_score": 0.8539127585282744, "openwebmath_perplexity": 205.88164116530058, "openwebmath_score": 0.7360675930976868, "tags": null, "url": "http://bpfz.safoo.de/moment-of-inertia-cylinder.html" }
diffusion Title: How is the water escaping? I have a number of toy balls filled with a liquid-presumably water or something else non-toxic. Over about a year, the balls have gone from firm to indented as shown. The water level in one is visibly low but four others have become indented as if some water were removed without allowing air to take its place. There are no indications of any leaks, balls have all been maintained at room temperature. I posted this to chemistry because my hypothesis is that there is some sort of diffusion through the ball surface or in to the floating toy contained within. In the case of the ball on the right, the toy inside appears to have a hole so maybe it was originally full of air but the liquid has migrated inside pushing the air out and appearing to lower the water level. Explanation doesn't work for the other balls.
{ "domain": "chemistry.stackexchange", "id": 9505, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "diffusion", "url": null }
The final answer is of a very nice form: (a)$$\frac{7^5-1}{3}$$ (b)$$\frac{7^5-1}{2}$$ (c)$$\frac{7^5-3}{4}$$ So I thought there should be a better approach. Although the number of five digits numbers leaving a particular remainder when divided by $$3$$ or $$2$$ or $$4$$ won't be equal, as the groups which each $$a_i$$ is divided into based on remainder(this isn't needed for the question though), are of unequal sizes(for all three cases). But given the answer form, I wondered if it is true that when the digital sum k is divided by a number, then they are equally distributed among all the possible remainders. For example for case (a), we can divide $$k \in [5,35]$$ into groups of $$3$$ based on remainder when divided by $$3$$, then the groups are of sizes $$10$$ ($$0 \mod 3$$), $$10$$ ($$1 \mod 3$$), $$11$$ ($$2 \mod 3$$). The extra number in the last group ($$2 \mod 3$$) is $$5$$, and only one five number has $$k=5$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717478243565, "lm_q1q2_score": 0.8305214060449206, "lm_q2_score": 0.8418256532040707, "openwebmath_perplexity": 182.5652180577814, "openwebmath_score": 0.7266246676445007, "tags": null, "url": "https://math.stackexchange.com/questions/3577086/counting-problem-based-on-digital-sum-divisibility" }
electromagnetism, maxwell-equations $$\nabla \times \mathbf H = \mathbf J + \frac {\partial \mathbf D}{\partial t}.$$ $$\nabla \cdot \mathbf D = \rho .$$ In the Ampere-Maxwell law, $ \frac {\partial \mathbf P}{\partial t}$ is the polarization current and $\epsilon_0 \nabla \cdot \mathbf E $ is the displacement current. Regarding "magnetization current", are you talking about this modification of Faraday's law? If not then what do you mean by it?
{ "domain": "physics.stackexchange", "id": 84578, "lm_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, maxwell-equations", "url": null }
c#, beginner Title: Soda Crate Program I would love to have some suggestion for my program, I would prefer no more suggestion to use Linq and other advanced concepts as I would like to keep it as simple as possible for now. I love suggestion on the structure of the program and methods and so on. If needed to condense the program into the basics, only the things in the menu are needed. Maybe I should use an constructor in the BeverageData class instead of property? The Menu class is in the bottom of the code block. I've tried to split it up for readability. The code is working and without bugs as far as I know. public enum BeverageType { Soda, Juice, Water, Alcohol } public class BeverageData // Skapar { public string Name { set; get; } public BeverageType Type { set; get; } public decimal Price { set; get; } public int Size { get; set; }
{ "domain": "codereview.stackexchange", "id": 26515, "lm_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", "url": null }
c++ http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=mat%3A%3Aat#template%3Ctypename%20T%3E%20T&%20Mat::at%28int%20i%29%20const http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=matiterator#template%3Ctypename%20_Tp%3E%20MatIterator_%3C_Tp%3E%20Mat::begin%28%29
{ "domain": "robotics.stackexchange", "id": 18305, "lm_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 }
pacbio Title: ipdSummary command stops working if --identify m5C_TET is included in command, and does not give any m5C info either I have installed the latest SMRT Tools (ipdSummary version 3.0). My goal is to extract ipdRatio and modified bases. In the ipdSummary --help command : --identify IDENTIFY Specific modifications to identify (comma-separated list). Current options are m6A, m4C, m5C_TET. Using --control overrides this option. (default: m6A,m4C) Accordingly, I am running this command: ipdSummary sorted_chr21_000.bam --reference $REF_path/$REF_FILE_NAME.fasta --referenceWindow 20:1-200000 --identify m6A,m4C,m5C_TET -j 20 --methylFraction --outfile $save_path/$chrom/$name
{ "domain": "bioinformatics.stackexchange", "id": 2646, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pacbio", "url": null }
if (is.na(n) || (n < 1) || (n != round(n))) { stop("n must be a positive integer.") } fib <- rep(NA, n) # initialize output vector for (i in 1:n){ # Distinguish between 3 cases: if (i==1) { fib[i] <- e1 } # initialize 1st element if (i==2) { fib[i] <- e2 } # initialise 2nd element if (i > 2) { fib[i] <- fib[i-2] + fib[i-1] } } return(fib) } This generalized fibonacci function still allows all previous calls, like: fibonacci(n = 25) #> [1] 0 1 1 2 3 5 8 13 21 34 55 89 #> [13] 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 #> [25] 46368 but now also allows specifying different initial elements: fibonacci(e1 = 1, e2 = 3, n = 25) #> [1] 1 3 4 7 11 18 29 47 76 123 #> [11] 199 322 521 843 1364 2207 3571 5778 9349 15127 #> [21] 24476 39603 64079 103682 167761 A.12.2 Exercise 2 Looping for divisors
{ "domain": "bookdown.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854103128328, "lm_q1q2_score": 0.8038927603030837, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 5442.144008090966, "openwebmath_score": 0.3821958899497986, "tags": null, "url": "https://bookdown.org/hneth/ds4psy/A-12-iter-sol.html" }
algorithms, trees, efficiency, board-games Of course, you don't really need to check all children. You can keep a counter at each node that counts the number of unvisited children. The next question would be – how do I find an unvisited child. It's a nice elementary exercise finding a way to achieve this efficiently.
{ "domain": "cs.stackexchange", "id": 6491, "lm_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, trees, efficiency, board-games", "url": null }
quantum-mechanics, electromagnetism, topology, berry-pancharatnam-phase Title: Aharonov-Bohm phase picked up when a magnetic dipole goes around a charge When a particle with charge $q$ traverses a loop that encloses a magnetic flux $\Phi$, it picks up a phase $e^{iq\Phi}$ (I have set $c$ and $\hbar=1$). This is the usual Aharonov-Bohm phase. Now, let us look at a different scenario - consider a particle with a magnetic dipole moment that gives rise to a flux $\Phi$ through a plane. Move this particle along a loop enclosing a charge $q$ in the same plane. What is the phase picked up in this case? According to Section 2.1.3 of Intro. to Topological Quantum Computation by Pachos, this phase is also $e^{iq\Phi}$. I am not able to see why, though. The geometric phase acquired by a neutral particle with a magnetic dipole moment encircling a point charge is an example of the Aharonov-Casher phase which is a variant of the Aharonov-Bohm phase. This phase can be explained as follows: The interaction energy between the two particles is given by:
{ "domain": "physics.stackexchange", "id": 45331, "lm_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, electromagnetism, topology, berry-pancharatnam-phase", "url": null }
ros, ros-kinetic, third-party Title: Problem adding third party library Hi i am currently trying to make ROS node for sending CAN bus messages. I need to import a python 2.7 library named "can" in the script. I tried to add the path to this library to my CMAKE list, but with no luck. Here is the script and errors i am getting. -- ==> add_subdirectory(motor_controller) CMake Error at motor_controller/CMakeLists.txt:153 (target_link_libraries): Cannot specify link libraries for target "motor_controller_node" which is not built by this project. My node python script ## # In ROS, nodes are uniquely named. If two nodes with the same # name are launched, the previous one is kicked off. The # anonymous=True flag means that rospy will choose a unique # name for our 'listener' node so that multiple listeners can # run simultaneously. import rospy, can from sensor_msgs.msg import RegionOfInterest bus = can.interface.Bus(bustype='socketcan', channel='can0', bitrate=500000)
{ "domain": "robotics.stackexchange", "id": 30318, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, third-party", "url": null }
thermodynamics, statistical-mechanics, phase-transition This seems to resemble the peak of heat capacity of a second order transition, c.f. these plots for the Ising model simulations. But my doubt is that as I increase number of particles, the peak appears to decrease its amplitude and widen. This shouldn't happen for a phase transition, which is normally a many-particle effect. So my question is: is what I described above even a phase transition at all? Or will the peak of heat capacity actually drop to zero once I take the limit of $N\to\infty$? Or am I completely wrong about what I think is heat capacity or temperature for this system? Let's calculate the partition function for $N$ particles: $$\begin{align} Z(\beta)&=\left(\int_{-\infty}^{\infty}\exp\left(-\beta\frac{p^2}{2m}\right)\mathrm dp\int_{-L/2}^{L/2}\exp\left(-\beta \begin{cases} 0&\text{if }|x|<d/2\\ U_{II}&\text{if }d<|x|<L/2 \end{cases} \right)\mathrm dx\right)^N=\\ &=\left(\frac{2\pi m}\beta\right)^{N/2}\left(d+e^{-\beta U_{II}}(L-d)\right)^N. \end{align} $$
{ "domain": "physics.stackexchange", "id": 36538, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, statistical-mechanics, phase-transition", "url": null }
# Equivalence of Definitions of Characteristic of Ring ## Theorem Let $\struct {R, +, \circ}$ be a ring with unity whose zero is $0_R$ and whose unity is $1_R$. The following definitions of the concept of Characteristic of Ring are equivalent: ### Definition 1 Let $n \cdot x$ be defined as in Definition:Power of Element. The characteristic $\Char R$ of $R$ is the smallest $n \in \Z, n > 0$ such that $n \cdot 1_R = 0_R$. If there is no such $n$, then $\Char R = 0$. ### Definition 2 Let $g: \Z \to R$ be the initial homomorphism, with $\map g n = n \cdot 1_R$. Let $\ideal p$ be the principal ideal of $\struct {\Z, +, \times}$ generated by $p$. The characteristic $\Char R$ of $R$ is the positive integer $p \in \Z_{\ge 0}$ such that $\ideal p$ is the kernel of $g$. ### Definition 3 The characteristic of $R$, denoted $\Char R$, is defined as follows. Let $p$ be the order of $1_R$ in the additive group $\struct {R, +}$ of $\struct {R, +, \circ}$.
{ "domain": "proofwiki.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137900379083, "lm_q1q2_score": 0.8225543548043371, "lm_q2_score": 0.8376199633332891, "openwebmath_perplexity": 109.43586484600972, "openwebmath_score": 0.9888812899589539, "tags": null, "url": "https://proofwiki.org/wiki/Equivalence_of_Definitions_of_Characteristic_of_Ring" }
forces, electrostatics, rotational-dynamics, integration If we used an object of charge $3Q$ made of two copies of the electroscope - then when it was placed on the original electroscope, $Q$ would go onto it and $2Q$ would remain on the charged object. In both the above situations $Q$ has gone onto the original electroscope, so the readings would be the same, but the charges of the two objects were different.
{ "domain": "physics.stackexchange", "id": 80617, "lm_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, electrostatics, rotational-dynamics, integration", "url": null }
javascript, jquery, revealing-module-pattern $('pre code').each(function(i, block) { hljs.highlightBlock(block); }); /* preventDefault on buttons */ for (var i = 0, l = btns.length; i < l; i++) { btns[i].addEventListener('click', function(e) { e.preventDefault(); e.stopPropagation(); }); } } }; return publicAPI; })(); $(document).ready(styleGuide.init);
{ "domain": "codereview.stackexchange", "id": 23288, "lm_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, revealing-module-pattern", "url": null }
ros-melodic, rospy, roscpp So this leads me into thinking that there is a way to do so. I'm mostly using Python, but for this purpose only I would also be willing to use a C++ node. EDIT: I've marked what I would like to retrieve from the above piece of output. Originally posted by davidem on ROS Answers with karma: 83 on 2019-12-17 Post score: 1
{ "domain": "robotics.stackexchange", "id": 34161, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic, rospy, roscpp", "url": null }
ros, roscpp, time Consclusion gettimeofday and clock_gettime result in similar durations, but ros::Time::now() durations are different. I noticed that if I insert the example above in a loop at startup (instead of asynchronously inside a function), and tell it to sleep a certain time each iteration, I get 0.0 ms reported duration by ROS, and the correct duration with the other 2 methods. My only explanation is that ros::spinOnce() hasn't been called, and this is interfering with ros::Time::now(). This has very little impact on my profiling. However, I sometimes use the ros time to calculate velocities or other quantities in the form x/dt. In this case, poor temporal resolution like this would make a huge difference. Could anyone comment on this? Am I doing something wrong? EDIT 2 I was running using use_sim_time set to true. Changing Time to WallTime everywhere in the code above fixed the issue.
{ "domain": "robotics.stackexchange", "id": 9685, "lm_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, roscpp, time", "url": null }
python, beginner, python-3.x, rock-paper-scissors # assign string to computer random choice if comp == 1: choice = 'rock' elif comp == 2: choice = 'paper' elif comp == 3: choice = 'scissors' print('Computer picked:', choice) # compare selection to figure out the winner if user == 1 and comp == 3: print('You win against the computer\n') elif user == 3 and comp == 1: print('You lose against the computer\n') elif user > comp: print('You win against the computer\n') elif user < comp: print('You lose against the computer\n') elif user == comp: print('You tie against the computer\n') The way you are trying to solve this problem does not seem pythonic. Since switch statements don't exist in python, you can simulate switch-like behaviour using dictionaries. For example, instead of using if-else to set the value of user, you can so something like user_options = { 'r': 1, 'p': 2, 's': 3 } user = user_options[user]
{ "domain": "codereview.stackexchange", "id": 24346, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, rock-paper-scissors", "url": null }
exoplanet, gas-giants, trappist-1 I think, when it comes to these planets, your primary concern for whether life can exist or not is the central star. It is a low-mass, ultra-cool dwarf star. These stars tend to be very volatile, much more so than our generally quiescent Sun. This means these planets are likely to receive much more radiation and be hit by many more solar storms than we are. Furthermore, these planets are so close to TRAPPIST-1 that they're all tidally locked - one face is always towards the star and one is always away. This could make one side inhospitably hot and the other inhospitably cold. The climate/weather on such a planet would likely be unsuitable for life (but who knows for sure). The tidal locking could potentially be good though as it means only the outward-facing side would generally be hit by comets, thus protecting any life on the Sun facing side (assuming its not too hot on that side).
{ "domain": "astronomy.stackexchange", "id": 2130, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "exoplanet, gas-giants, trappist-1", "url": null }
np-complete, reductions, np-hard, np Title: Finding a suitable NP-complete problem for reduction We are given a set of names and a set of papers with names written on each side of the paper (not necessarily different ones and either side of the paper can be empty). Can we place the sheets on a table such that every name shows up? Show that this problem is NP-complete. I have difficulty in finding out an NP-complete problem from which it can be reduced to this problem. I tried to reduce vertex cover and set cover problems but i was not successful. I am not sure if i am heading in the right direction. This is SAT in disguise. Every name corresponds to a clause. Every paper corresponds to a variable. Each side of the paper corresponds to a possible truth assignment to the variable. If this is unclear, I suggest working out an example.
{ "domain": "cs.stackexchange", "id": 13186, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np-complete, reductions, np-hard, np", "url": null }
urdf, ros-melodic, xml Originally posted by distro on ROS Answers with karma: 167 on 2022-12-28 Post score: 0 <link name="front_camera_link"/> You are closing the link tag. The / character should not be there. Originally posted by Mike Scheutzow with karma: 4903 on 2022-12-28 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 38196, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "urdf, ros-melodic, xml", "url": null }
fluid-mechanics, piping The idea is that an upside down water bottle is screwed into the top hole (on the left) and some sort of piping will lead the larger hole on the right to fill up with water. Naturally due to the pressure the water will overflow in the hole on the right. My question is: Is there a way to prevent the water from overflowing in the lower basin when a water bottle has much more water stored than the basin can hold? I am very unversed in those topics so I unfortuantely even failed to find the right terms to search for in google... The water level in the lower basin will not exceed the level of the bottom of the bottle opening. When the empty device is loaded with a full bottle (by keeping the bottle upright!) and then inverted, the basin will allow air into the bottle, which in turn allows water to enter the basin. When the basin water level reaches the opening of the overturned bottle, air can no longer enter, which prevents more water from leaving.
{ "domain": "engineering.stackexchange", "id": 4236, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-mechanics, piping", "url": null }
8. phi that will be a good start 9. ganeshie8 I would do the same, perhaps there is a smarter way to work this using symmetry... need to think it through.. 10. anonymous so we want $$a\cdot10^3+b\cdot10^2+c\cdot10+d$$ to be congruent to $$0\pmod4$$: $$a\cdot 2^3+b\cdot 2^2+c\cdot 2+d\equiv 0\pmod 4\\2c+d\equiv 0\pmod 4\\2c\equiv -d\pmod 4$$now consider that $$2$$ is not invertible $$\pmod 4$$, so look at $$c=0,1,2,3,4,5$$: $$c=0\implies d=4\\c=1\implies d=2\\c=2\implies d\in\{0,4\}\\c=3\implies d=2\\c=4\implies d=0\\c=5\implies d=2$$ in other words, the two-digit multiples of 4 that use no digits bigger than 5 and have no repeating digits we have here are: $$4,12,20,24,32,40,52$$which you could've found easily via exhaustive search (but the above just confirms it) 11. phi the next wrinkle is I assume 4 digits means no leading 0 so you should break your 7 items into those that have a 0 (which allows the remaining 2 digits to be any of the remaining) and those without a 0
{ "domain": "openstudy.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9736446502128797, "lm_q1q2_score": 0.8134640722533031, "lm_q2_score": 0.8354835330070839, "openwebmath_perplexity": 1235.1136023912784, "openwebmath_score": 0.7139334678649902, "tags": null, "url": "http://openstudy.com/updates/55d498a6e4b0c5fe9806f469" }
c#, interpreter, brainfuck case ']': { if (memory[pointer] != 0) { int s = 0; int ptr = instructionPointer - 1; while (instructions[ptr] != '[' || s > 0) { if (instructions[ptr] == ']') { s += 1; } else if (instructions[ptr] == '[') { s -= 1; } ptr -= 1; instructionPointer = ptr; } } break; } } instructionPointer += 1; } } } } int pointer = 1;
{ "domain": "codereview.stackexchange", "id": 22523, "lm_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#, interpreter, brainfuck", "url": null }
mechanical-engineering, structural-engineering, structural-analysis, automotive-engineering, vibration Surely, this outer shell doesn't need to be as thick as it is. In my mind all it's doing is containing a pressurized coolant which can't amount to more pressure than the combustion of the engine itself. So why is it sometimes as thick as the cylinder wall? If you consider only the static forces then indeed the thickness might seem over-engineered. However, engine blocks are not statically loaded. They operate in the range of a few hundred to a few thousand rpm (Revolution Per Minute), so there are dynamic considerations here. Fatigue When materials are subjected to cyclic loading they exhibit a reduction in the allowable stresses. See below for an example:
{ "domain": "engineering.stackexchange", "id": 3676, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, structural-engineering, structural-analysis, automotive-engineering, vibration", "url": null }