text
stringlengths
1
1.11k
source
dict
python, python-3.x, regex, formatting, hash-map Title: Can it be shorter?: DNA Sequence Analyzer from CS50 written in Python This is my first time requesting a code review. This is code I wrote in Python to create a DNA sequence analyzer. This is for the Harvard CS50 course. I was really hoping to get some constructive criticism on this code I finished for the DNA problem in Problem Set 6. This code passed all tests and is fully functional as far as I am aware. I was mainly wondering if there were any more succinct ways to rewrite parts of it. I spent several hours writing this and my brain is pretty exhausted, so near the end I just went for whatever worked. Any input is appreciated! (Also, sorry if this is an excessive amount of comments, but they help me keep everything clear in my head.) import re import csv from sys import argv # Checks for correct number of command-line arguments if not len(argv) == 3: print("Incorrect number of command-line arguments.") exit(1)
{ "domain": "codereview.stackexchange", "id": 39040, "lm_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, regex, formatting, hash-map", "url": null }
c++, c++17, coordinate-system /*! * Scalar multiply *= operator * * This function will only be defined if typename _S is a * scalar type. Multiplies this Vector<S, N> by s, element-wise. */ template <typename _S=S, enable_if_t<is_scalar<decay_t<_S>>::value, int> = 0 > void operator*= (const _S& s) { auto val = this->begin(); for (size_t i = 0; i < N; ++i) { *(val+i) *= static_cast<S>(s); } } /*! * Scalar division * operator */ template <typename _S=S, enable_if_t<is_scalar<decay_t<_S>>::value, int> = 0 > Vector<S, N> operator/ (const _S& s) const { Vector<S, N> rtn; auto val = this->begin(); auto rval = rtn.begin(); for (size_t i = 0; i < N; ++i) { *(rval+i) = *(val+i) / static_cast<S>(s); } return rtn; }
{ "domain": "codereview.stackexchange", "id": 38013, "lm_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, coordinate-system", "url": null }
c++, beginner, c++11, random, clustering unsigned int subset = n + (rem ? 1 : 0); this->file_rpt << "\n" << " Generating " << subset << " points around centroid " << ++centroid_ct << " ..."; while (subset) { std::vector<double> temp_point; for (auto dimension_iter = centroid_iter->begin(); dimension_iter != centroid_iter->end(); ++dimension_iter) { // Would love to put something here to allow users to specify their own distribution... std::normal_distribution<double> distr(*dimension_iter, 10); temp_point.push_back(distr(gen)); } for (auto temp_point_iter = temp_point.begin(); temp_point_iter != temp_point.end(); ++temp_point_iter) { if (temp_point_iter != temp_point.begin()) { this->file_out << this->delim_out; } this->file_out << (*temp_point_iter); }
{ "domain": "codereview.stackexchange", "id": 27001, "lm_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, c++11, random, clustering", "url": null }
In the brackets $\,\rm\displaystyle\left[\, mod\ \ 65\!:\ \ \frac{-3}{77} \equiv \frac{-3}{12} \equiv \frac{-1}4 \equiv \frac{64}4 \equiv \color{#d0f}{16}\,\right]\quad$ (see Beware below) This yields $\rm\ \ x\ \equiv\ \color{#0a0}{2 + 77}\,[\,\color{#d0f}{16}\,] \equiv 1234\,\ \ (mod\ 77\cdot 65)\quad$ QED Theorem $\:$ (Easy CRT) $\rm\ \$ If $\rm\ m,\:n\:$ are coprime integers then $\rm\ m^{-1}\$ exists $\rm\ (mod\ n)\ \$ and $\rm\displaystyle\qquad\quad\quad\quad \begin{eqnarray}\rm x&\equiv&\!\rm\ a\ \ (mod\ m) \\ \rm x&\equiv&\!\rm\ b\ \ (mod\ n)\end{eqnarray} \ \iff\ \ x \equiv\, a + m\ \bigg[\frac{b-a}{m}\ mod\ n\,\bigg]\,\ \ (mod\ m\:n)$ Proof $\rm\ (\Leftarrow)\ \ \ mod\ m:\,\ x \equiv a + m\ [\,\cdots\,] \equiv a,\$ and $\rm\ mod\ n\!\!:\,\ x \equiv a + (b\!-\!a)\ m/m \equiv b$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969708496456, "lm_q1q2_score": 0.8510317918563698, "lm_q2_score": 0.8652240877899776, "openwebmath_perplexity": 697.5250583298947, "openwebmath_score": 0.8776496648788452, "tags": null, "url": "https://math.stackexchange.com/questions/20223/getting-an-x-for-chinese-remainder-theorem-crt/20259" }
of the problem is shown below for the simplest case of 3 corresponding points (the minimum required points to solve). DotNumerics. lished results that solve SVD with missing values as well as the effect of the parameters on convergence speed and over-fitting. The solve() method in the BDCSVD class can be directly used to solve linear squares systems. Eigenvalue Calculator. NET initiative and is the result of merging dnAnalytics with Math. If you're behind a web filter, please make sure that the domains *. The input to the B port is the right side M -by- L matrix, B. resolution row and column resolution of a matrix. A two-sided rotation Jacobi SVD algorithm is used to compute the SVD and is implemented on a two million gate FPGA. A good alternative method is Gaussian elimination with full or partial pivoting. 1 Singular Value Decomposition (SVD) The singular value decomposition of a matrix Ais the factorization of Ainto the product of three matrices A= UDVT where the columns of Uand Vare
{ "domain": "cesenaticoopen.it", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109485172559, "lm_q1q2_score": 0.8227933346453876, "lm_q2_score": 0.8354835371034368, "openwebmath_perplexity": 1043.0111490718846, "openwebmath_score": 0.6158665418624878, "tags": null, "url": "http://yjcg.cesenaticoopen.it/svd-solver.html" }
quantum-mechanics, fourier-transform, textbook-erratum Yes, it should be $dx$ not $dk$ (it's a typo) No, you can still take the position operator inside the integral. This is probably a bit clearer if we re-write the steps as follows \begin{align} \hat x \tilde f(k) &= \hat x \int dx' e^{-ik x'} f(x')\\ &= \int dx' \hat x e^{-ik x'} f(x')\\ &= \int dx' x' e^{-ik x'} f(x') \end{align} The missing minus sign in the exponential is a typo. The solutions are using the following: $$i \frac{\partial}{\partial k}e^{-ikx} = i (-ix) e^{-ikx} = x e^{-ikx} = \hat x e^{-ikx} $$ Looks like the solutions just have a couple of typos. Otherwise you seem fine. Throughout this answer I have just accepted the definition \begin{equation} \hat{x} f(x) = x f(x), \end{equation} This definition is a little loose, see my answer to another question here for more details.
{ "domain": "physics.stackexchange", "id": 88520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, fourier-transform, textbook-erratum", "url": null }
python, python-3.x biggest_poopy = str(max(John, Elaine, Austin, Bridgette, Rocky)) print("\nThe biggest poopy is " + biggest_poopy + "!") Yes, it can be easily done. Just pass some indication of parity into the function. The most straightforward way is to check player_count in the function like this: def both_across(): global pass_counter global player_count if pass_counter == 1: print("WE ARE PASSING LEFT") pass_counter = pass_counter + 1 elif pass_counter == 2: print("WE ARE PASSING RIGHT") pass_counter = pass_counter + 1 elif pass_counter == 3 and player_count%2==0: print("WE ARE PASSING ACROSS") pass_counter = pass_counter + 1 elif pass_counter == 3 and player_count%2==1: print("WE ARE HOLDING") pass_counter = pass_counter - 2 elif pass_counter == 4: print("WE ARE HOLDING") pass_counter = pass_counter - 3
{ "domain": "codereview.stackexchange", "id": 42802, "lm_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 }
primes, windows, assembly, nasm Pretty much never use mov rcx, symbol to get a static address into a register. With nasm -fwin64, it assembles to the 10-byte mov r64, imm64 encoding, which is larger and typically slower to decode and/or fetch from uop cache than a 7-byte RIP-relative LEA. Also, it needs a load-time fixup for ASLR. If static addresses fit in 32-bit signed immediates (true in some systems), they usually also fit in 32-bit unsigned, so mov ecx, symbol is shorter (only 5 bytes).
{ "domain": "codereview.stackexchange", "id": 32159, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "primes, windows, assembly, nasm", "url": null }
c#, logging, asp.net-web-api private void SqlLog(string message, HttpRequestMessage request, DateTime timestamp) { var requestedURi = (string)request.RequestUri.AbsoluteUri; var requestMethod = request.Method.ToString(); SqlErrorLogging sqlErrorLogging = new SqlErrorLogging(); ApiError apiError = new ApiError() { Message = message, RequestUri = requestedURi, RequestMethod = requestMethod, TimeUtc = timestamp }; //sqlErrorLogging.InsertErrorLog(apiError); } private string FormatException(Exception ex, int depth = 0) { //... omitted for brevity } }
{ "domain": "codereview.stackexchange", "id": 35631, "lm_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#, logging, asp.net-web-api", "url": null }
everyday-chemistry, alcohols, toxicity Title: Why is Denaturated alcohol made poisonous? I understand the need to denaturate alcohol, as to have a material that can be used for non-food products without the heavy alcohol beverage tax. So, adding a foul tasting bitter substance like Denatonium seems like a great idea. It will also prevent children from accidentally chugging a bottle of the stuff. But what I can't comprehend is: sometimes the alcohol is purposefully made poisonous. By adding methanol or other toxic substances. Can anyone tell me the logic behind this decision? Is preventing tax avoidance so extremely important that they're willing to kill or blind anyone that might drink the illegal drink? Maybe they bought it without even knowing it was illegally made! Do they deserve to die? It just seems insane to me. Perhaps chemists in this site might have an explanation. It seems there is not spread enough fact that ethanol is poisonous even before denaturation. "The dose makes the poison." - the old medieval wisdom.
{ "domain": "chemistry.stackexchange", "id": 16043, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "everyday-chemistry, alcohols, toxicity", "url": null }
python, performance dirs = os.listdir("/home/Set/") poseList = [] #Store poses for all files featuresList = [] # Store features def data(): for dir_name in dirs: fp = '/home/Set/left' fp_2 = '/home/Set/fc/fc2_0.npy' if os.path.exists(fp) and os.path.exists(fp_2): files = glob.glob(fp+"/*.txt") curr_pose = [] #Store curr pose for f in files: with open(f) as pose: pl = pose.readlines() pl = [p.strip() for p in pl] pl = map(float, pl) # str ->float curr_pose.append((pl)) poseList.append(curr_pose) #append to main list featuresList.append(np.load(fp_2)) print "Not available", dir_name
{ "domain": "codereview.stackexchange", "id": 28114, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance", "url": null }
finite-automata Title: Construct DFA’s Accept all strings containing “ 011 ” or “ 001 ” as a substring and should not contain “ 010 ” as substring My question is Accept all strings containing “ 011 ” or “ 001 ” as a substring and should not contain “ 010 ” as substring for the following languages over the alphabet {0,1} i have solve it but , i have doubt if i can make the string contain 010 as substring goes to dead state ?!!! To construct the DFA for a cross-section of the languages (string must be accepted by both DFAs) You can work as follows: Make sure the transition function for the input DFAs is complete. The new set of states for the DFA is the cartesian product of the states of the 2 DFAs $Q' = Q_1 \times Q_2$. The transition function looks at the 2 states independently: $\delta'((Q_1, Q_2), s) = (\delta_1(Q_1, s), \delta_2(Q_2, s))$. The accepting states are those where both the original states are accepting $F' = F_1 \times F_2$.
{ "domain": "cs.stackexchange", "id": 9115, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "finite-automata", "url": null }
- cool answer, thanks a lot. The only thing I wonder about now - is that no one of us used the fact that $a = \mathsf E(\xi-\eta)>0$ and maybe bounds would be better in that case. –  Ilya Nov 26 '11 at 19:32 It is $a=\mathsf{E}|\xi-\eta|>0$ (absolute values) which is simply a way of saying that $a=\mathsf{E}|\xi-\eta|\not=0$, and it was used with Markov's Inequality. –  robjohn Nov 26 '11 at 19:58 nice point, but it can hold as well if $a<0$. Nevertheless, it seems to me now that it's not so important what is greater, $\xi$ or $\eta$ because we mostly use $k\xi$ to obtain bounds –  Ilya Nov 26 '11 at 20:02 Inspired by the answer by Ashok, I also derived bounds for the convergence which I need as well. Just for the case I put it here as an answer.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924810166349, "lm_q1q2_score": 0.8099852368660656, "lm_q2_score": 0.8333245911726382, "openwebmath_perplexity": 242.8963969156459, "openwebmath_score": 0.967746376991272, "tags": null, "url": "http://math.stackexchange.com/questions/85193/probabilistic-inequality-with-two-random-variables" }
java A good first step can be to create a method that processes parameters given in the canonical order. It doesn't matter what is the canonical order, but once you define it, it will help you, for example: void parseArgs(String playerParam, String rParam, String lParam) { Player p = player.getServer().getPlayer(playerParam.split(":")[1]); String r = rParam.split(":")[1]; String l = lParam.split(":")[1]; Config.addPlayer(p, r, l, player); }
{ "domain": "codereview.stackexchange", "id": 10596, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java", "url": null }
quantum-field-theory, kinematics, s-matrix-theory &=(k_1^0-k_2^0)^2-|\mathbf{k_1}|^2(1+\alpha)^2\\ &=k_2^2+|\mathbf{k_2}|^2-2k_1^0k_2^0+k_1^2-|\mathbf{k_1}|^2\alpha(2+\alpha)\\ &=2m^2-2k_1^0k_2^0-2\alpha|\mathbf{k_1}|^2\\ &< 0 \end{align}$$ So indeed $t$ is off shell. We can then proceed along the same route the book took to calculate the imaginary part of the amplitude. For our purpose we don't need to full analysis, just showing the analytic structure would be enough. Note that one can use Feynman parameters to solve this integral but it might not give a satisfactory answer to this question so we proceed as the book did. Let us shift our analysis to the center of mass system. Here $k'=(0,\mathbf{k'})$ with $\mathbf{k'}=\mathbf{k}_1+\mathbf{k}_2$. The poles will look like, $$q^0=\pm\left[\sqrt{E_{\mathbf{q}}^2+\mathbf{k'}\cdot\left(\frac{\mathbf{k'}}{4}-\mathbf{q}\right)}-i\epsilon\right],\quad q^0=\pm\left[\sqrt{E_{\mathbf{q}}^2+\mathbf{k'}\cdot\left(\frac{\mathbf{k'}}{4}+\mathbf{q}\right)}-i\epsilon\right]\tag{5}$$
{ "domain": "physics.stackexchange", "id": 90170, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, kinematics, s-matrix-theory", "url": null }
signal-energy, signal-power Title: Product of power signal and energy signal I tend to believe that if we multiply an energy signal with a power signal the product is an energy signal. My reasoning is that the energy signal will have finite bandwidth and consequenty the product will have finite bandwith and will be an energy signal. Can anybody confirm that I am right? Or am I missing something? Thanks in advance. If you are not looking for a rigorous proof, then the following would suffice for a particular class of power signals which has the property that their magnitude is bounded; i.e, $ |x_p(t)| \leq K$ for all $t$. Numerous examples exist for such power signals like sinusoidal waves, complex exponentials, all kinds of periodic continuous-time signals which are defined via convergent Fourier series sums... Then for such a power signal $x_p(t)$ and a given energy signal $x_e(t)$ you can show that their product $y(t) = x_p(t) x_e(t)$ will be an energy signal as follows; given
{ "domain": "dsp.stackexchange", "id": 5575, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "signal-energy, signal-power", "url": null }
formal-languages, turing-machines, computability $$ $$ = \{w: \text{ $w \neq \sigma\cdot u$, $\sigma\in\{0, 1\}$ and $u\in \Sigma^*$} \} \cup \left( \{ 0\}\cdot \overline{A_{TM}} \cup \{ 1\}\cdot A_{TM} \right) $$ So, we have that $w \in \overline{J}$ iff $w$ does not encode a bit followed by a word of the form $\langle M, w \rangle$, or $w = 1x$ for some $x \in A_{TM}$ or $w = 0y$ for some $y \in \overline{A_{TM}}$. Finally, note that they're implicitly assuming w.l.o.g that every nonempty word in $\{0, 1\}\cup \Sigma^*$ is of the form "$\text{bit} \cdot \langle M, w\rangle$". This assumption is okay, as checking whether a word respects some encoding can be easily done by a TM.
{ "domain": "cs.stackexchange", "id": 17466, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "formal-languages, turing-machines, computability", "url": null }
python, homework, turtle-graphics, checkers-draughts Proposed improvements: import turtle def draw_box(canvas, x, y, size, fill_color): canvas.penup() canvas.goto(x, y) canvas.pendown() canvas.fillcolor(fill_color) canvas.begin_fill() for i in range(4): canvas.forward(size) canvas.right(90) canvas.end_fill() def draw_circle(canvas, x, y, radius, color): canvas.penup() canvas.goto(x, y) canvas.pendown() canvas.fillcolor(color) canvas.begin_fill() canvas.circle(radius) canvas.end_fill()
{ "domain": "codereview.stackexchange", "id": 33134, "lm_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, homework, turtle-graphics, checkers-draughts", "url": null }
• Nov 2, 2021 at 17:04 Stolen from @J.M.'s answer, https://mathematica.stackexchange.com/a/239797/4999, with one correction (is that enough to make it not a duplicate?): Nodes = ps; ellipsoidBR = BoundingRegion[Nodes, "FastEllipse"]; (* not "FastEllipsoid" *) center = ellipsoidBR[[1]]; {vals, vecs} = Eigensystem[ellipsoidBR[[2]]]; {a, b} = Sqrt[vals]; major = N@{center - a vecs[[1]], center + a vecs[[1]]} minor = N@{center - b vecs[[2]], center + b vecs[[2]]} Graphics[{ellipsoidBR, Red, Point@ps, Green, Point@center, Line@{major, minor}}, Frame -> True] Here's the alternate way using SingularValueDecomposition: pt = rec[[1]]; mat = rec[[2]]; {u, s, v} = SingularValueDecomposition[(mat + Transpose[mat])/2]; func = Composition[AffineTransform[{u, pt}], ScalingTransform[Sqrt[Diagonal[s]]]]; and the length: EuclideanDistance @@@ {func@{{0, -1}, {0, 1}}, func@{{-1, 0}, {1, 0}}} {2.06559, 3.57771} Graphics[{rec, Blue, Line[func@{{-1, 0}, {1, 0}}], Line[ func@{{0, -1}, {0, 1}}]}]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305297023093, "lm_q1q2_score": 0.8515336153340314, "lm_q2_score": 0.8840392710530071, "openwebmath_perplexity": 4270.224787556017, "openwebmath_score": 0.3861517608165741, "tags": null, "url": "https://mathematica.stackexchange.com/questions/257623/finding-ellipse-axes" }
evolution, homework, natural-selection Finally, inheritance ensures that the beneficial alleles generated by mutation and filtered by selection get passed on to successive generations, allowing them to spread in the population and to be further modified by successive mutations. In a sense, inheritance and mutation can be seen as opposite sides of the same coin: the more faithfully genes are inherited, the less mutations there are. Yet both are necessary for evolution; an organism that never mutates obviously could not evolve, but neither could one that mutated so much that all of its genes were totally scrambled in each generation.
{ "domain": "biology.stackexchange", "id": 1923, "lm_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, homework, natural-selection", "url": null }
c#, compression, pdf private void PutLength( int code ) { if ( LengthPass == 1 ) Len.Used[ code ] += 1; else Output.WriteBits( Len.Bits[ code ], Len.Codes[ code ] ); } private void EncodeLengths( int n, byte [] lengths, bool isLit ) { if ( isLit ) { PreviousLength = 0; ZeroRun = 0; Repeat = 0; } for ( int i = 0; i < n; i += 1 ) { int length = lengths[ i ]; if ( length == 0 ) { EncodeRepeat(); ZeroRun += 1; PreviousLength = 0; } else if ( length == PreviousLength ) { Repeat += 1; } else { EncodeZeroRun(); EncodeRepeat(); PutLength( length ); PreviousLength = length; } } if ( !isLit ) { EncodeZeroRun(); EncodeRepeat(); } }
{ "domain": "codereview.stackexchange", "id": 33345, "lm_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#, compression, pdf", "url": null }
newtonian-mechanics, conservation-laws, acceleration, collision, elasticity PS: I am talking about elastic collisions. If you model the colliding objects as rigid bodies, then the collision will take zero time. Since the collision has zero duration, there is no issue with the objects having different accelerations. While this is often a reasonable approximation to make to simplify calculations, it doesn't exactly explain really going on here, so we look at what happens if we take away this assumption. If you do not model the colliding objects as rigid bodies, then you must account for how the objects deform during the collision. Since the objects are deforming, their centres of mass can have different accelerations without the objects losing contact, because the sizes of the objects will not be constant, i.e. the distance between the centres of mass can change while the surfaces of the objects stay touching, like compressing a pair of springs.
{ "domain": "physics.stackexchange", "id": 76890, "lm_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, conservation-laws, acceleration, collision, elasticity", "url": null }
ros, pose, velocity, turtlesim if (distance_error > error_tol) { command.linear = l_scale*distance_error; command.angular = 0; } else if (distance_error < error_tol && fabs(theta_error)> error_tol) { command.angular = a_scale*theta_error; command.linear = 0; } else if (distance_error < error_tol && fabs(theta_error)< error_tol) { command.angular = 0; command.linear = 0; } else { command.angular = a_scale*theta_error; command.linear = l_scale*distance_error; } // publish the velocity command pub.publish(command);
{ "domain": "robotics.stackexchange", "id": 7797, "lm_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, pose, velocity, turtlesim", "url": null }
c++, algorithm if (subsequenceLength[dir][i] > maxSubsequenceLength[dir]) { maxSubsequenceLength[dir] = subsequenceLength[dir][i]; } if (subsequenceLength[dir][i] == 1 + maxSubsequenceLength[!dir]) { break; } } } } } } std::vector<T> result; // Which direction to start? size_t dir = (subsequenceLength[DESCENDING][0] > subsequenceLength[ASCENDING][0]) ? DESCENDING : (subsequenceLength[ASCENDING][0] > subsequenceLength[DESCENDING][0]) ? ASCENDING : (nextElement[DESCENDING][0] < nextElement[ASCENDING][0]) ? DESCENDING : ASCENDING; size_t i = 0; do { result.push_back(input[i]); i = nextElement[dir][i]; dir = !dir; } while (i != 0); return result; }
{ "domain": "codereview.stackexchange", "id": 4639, "lm_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", "url": null }
electromagnetism, energy, waves, electromagnetic-radiation Specially considering the particle itself didn't even have EM energy, since there is no other charge that could be affected by the light. An acceleration is the reason for a charge to radiate energy. An acceleration could happens only in two cases. Or under the influence of other particles, like electrons, protons or even neutrons. Or under the influence of a magnetic field, called the Lorentz force.
{ "domain": "physics.stackexchange", "id": 44652, "lm_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, energy, waves, electromagnetic-radiation", "url": null }
peak <- function(x, y, alpha=0.05) { # # Estimate the peak of a quadratic logistic fit of y to x # and a 1-alpha confidence interval for that peak. # logL <- function(b) { # Log likelihood. p <- sapply(cbind(rep(1, length(x)), x, x*x) %*% b, logistic) sum(log(p[y==1])) + sum(log(1-p[y==0])) } f <- function(gamma) { # Deviance as a function of offset from the peak. b0 <- c(b[1] - b[2]^2/(4*b[3]) + b[3]*gamma^2, -2*b[3]*gamma, b[3]) -2.0 * logL(b0) } # Estimation. fit <- glm(y ~ x + I(x*x), family=binomial(link = "logit")) if (!fit$converged) return(rep(NA,3)) b <- coef(fit) tp <- -b[2] / (2 * b[3]) # Two-sided confidence interval: # Search for where the deviance is at a threshold determined by alpha. delta <- qchisq(1-alpha, df=1) u <- sd(x) while(fit$deviance - f(tp+u) + delta > 0) u <- 2*u # Find an upper bound l <- sd(x) while(fit$deviance - f(tp-l) + delta > 0) l <- 2*l # Find a lower bound upper <- uniroot(function(gamma) fit$deviance - f(gamma) + delta, interval=c(tp, tp+u))
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407168145568, "lm_q1q2_score": 0.8172632944861039, "lm_q2_score": 0.8397339736884712, "openwebmath_perplexity": 1893.9101154811324, "openwebmath_score": 0.6975759267807007, "tags": null, "url": "http://stats.stackexchange.com/questions/40602/can-i-interpret-the-inclusion-of-a-quadratic-term-in-logistic-regression-as-indi" }
c# return sb.ToString(); } This method uses the StringBuilder class. The AppendLine() method is returning the StringBuilder itself hence we can use the method calls fluently. It uses $-string interpolation as well. The former ConfirmInformation() method could then look like so private static bool ConfirmInformation(string information) { Console.Write(output); while (true) { string input = Console.ReadLine().ToLowerInvariant(); if (input == "y" || input == "yes") { return true; } if (input == "n" || input == "no") { return false; } Console.WriteLine("ERROR: Input must be either YES or NO."); Console.WriteLine(); Console.Write(output); } }
{ "domain": "codereview.stackexchange", "id": 36285, "lm_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 }
algorithms, trees, randomized-algorithms EDIT: More specifically, I would like the trees at $p=1$ to be drawn from the same distribution as if we draw a tree uniformly at random from the set of possible trees over the node set (I know this is problematic due to this number generally being bigger than the period of most random number generators, but let's leave that for now). My intuition here (which is likely overly simplistic, but might be useful) is that I'd like to create a kind of linear interpolation between the input tree and a tree drawn uniformly at random from the set of all possible trees over the node set. Of course, linear interpolation doesn't make an awful lot of sense between trees (as far as I can figure it out
{ "domain": "cs.stackexchange", "id": 6689, "lm_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, randomized-algorithms", "url": null }
quantum-field-theory, gauge-theory, group-theory, group-representations, lie-algebra as a $4$-dimensional Dirac spinor representation under Lorentz transformations. as a $2$-dimensional fundamental representation of the gauge group $SU(2)$ under gauge transformations. Similarly, the $4\times 4$ Dirac matrices $\gamma^{\mu}$ and the $2\times 2$ $SU(2)$ gauge group generator $T^a$ act on different representations. The product of $\gamma^{\mu}$ and $T^a$ is a tensor product. In particular, the term $\gamma^{\mu}T^a\psi$ in OP's formula again carries two types of indices, and is evaluated as $$ (\gamma^{\mu}T^a\psi)^{\alpha i}~=~(\gamma^{\mu})^{\alpha}{}_{\beta}~ (T^a)^{i}{}_{j}~\psi^{\beta j}. $$
{ "domain": "physics.stackexchange", "id": 17211, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, gauge-theory, group-theory, group-representations, lie-algebra", "url": null }
quantum-field-theory, hilbert-space, representation-theory, second-quantization Title: Basic understanding of the Fock space of a quantized real scalar field The states in quantum mechanics belong to some Hilbert space while the states in quantum field theory belong to a Fock space. For simplicity, let me stick to the Fock space emerging after the quantization of a real scalar field. A Fock space is defined as a direct sum, $$\mathcal{F}=\oplus_n\mathcal{H}_n$$ of Hilbert spaces $\mathcal{H}_n$, of physical $n$-particle states. For a real scalar field, which after quantization (which lead to only one type of particle) the states in $\mathcal{H}_n$, are in general, linear combination of $n$-particle states $\{|p_1,p_2,...,p_n\rangle\}$ of all possible momenta satisfying $p^i_{\mu }p^{\mu i}=m^2$, and $p^0_i>0$.
{ "domain": "physics.stackexchange", "id": 45555, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, hilbert-space, representation-theory, second-quantization", "url": null }
particle-physics, notation, protons Title: Does an antiproton have a proton number of 1 or -1 I have a disagreement with someone; they have written this equation: $$ \,^{0}_{0}\gamma\to\,^1_1p+\,^1_1\bar p $$ I disagree, and say that the anti-proton should have a proton number of -1, not 1. Who is correct? It is called baryon number, and the proton has baryon number 1, and all anti baryons have a baryon number of -1. Quarks have a baryon number of 1/3 and antiquarks -1/3. Baryon number is conserved in the present standard model of particle physics. There are extensions that predict decays of the proton, and thus non conservation of baryon number but experiments up to now do not validated the proposals. So you are correct but not using the correct terminology.
{ "domain": "physics.stackexchange", "id": 37127, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, notation, protons", "url": null }
vba, excel ActiveCell.Value = RESPONSABLE ActiveCell.Offset(0, 1).Select ActiveCell.Value = OBSERVACIONES Sheets("Remito").Select Range(DIREC1).Select
{ "domain": "codereview.stackexchange", "id": 31899, "lm_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 }
spinors $$ \frac{\partial}{\partial \lambda^b} \lambda^a = \delta_b^a $$ If you lower the index on $\lambda^b$ you get $$ \lambda_a = \epsilon_{ac} \lambda^c $$ Putting this together gives $$ \frac{\partial}{\partial \lambda^b} \lambda_a = \epsilon_{ac} \frac{\partial}{\partial \lambda^b} \lambda^c = \epsilon_{ab} = -\epsilon_{ba} $$ which has a different sign from what you have. Furthermore, the spinor bracket you write is Lorentz invariant if you transform both spinors at the same time. The actions of $J^A$ and $J^B$ on $\langle AB \rangle = \epsilon_{cd} A^c B^d$ is given by \begin{align} J_{ab}^A\, \epsilon_{cd} A^c B^d &= \left(A_a \frac{\partial}{\partial A^b} + A_b \frac{\partial}{\partial A^a} \right) \, \epsilon_{cd} A^c B^d \\ &= \epsilon_{cd} \left( A_a \delta_b^c + A_b \delta_a^c \right) B^d = +(A_a B_b + B_b A_a) \\ % J_{ab}^B\, \epsilon_{cd} A^c B^d &= \left(B_a \frac{\partial}{\partial B^b} + B_b \frac{\partial}{\partial B^a} \right) \, \epsilon_{cd} A^c B^d \\
{ "domain": "physics.stackexchange", "id": 8122, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "spinors", "url": null }
ros, cv-bridge, tutorials Originally posted by Allen Ayala on ROS Answers with karma: 22 on 2017-07-08 Post score: 0 Just for the record and people having the same issue I'm adding this comment. I was also having problems following that tutorial so I've changed the topic name to /usb_cam/image_raw so it works now! Originally posted by rosberrypi with karma: 75 on 2017-07-24 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 28309, "lm_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, cv-bridge, tutorials", "url": null }
python, python-2.x, numpy, coordinate-system The code below works but it is slow when I have, say, 2000 points and each has a constraint with each other. I am looking for input on how to speed up the code below. The procedure outlined above must be followed, but any algorithm that implements it is allowed. I have a few ideas for improving it, including: Don't take the square roots: compare square distances instead. Have a list of pairs that need to be 'checked' rather than checking the distances of all pairs. Be clever with NumPy arrays. But I would appreciate input on which of these is fastest, works best in Python etc. Does anyone have a feel for how good the 'best' performance of Python will be compared to, for example, C++? import numpy as np import random # inters is a list of lists of lists: the first index is point_1_no, the second index is point_2_no and # the third index is either 0 for the lower bound or 1 for the upper bound. # See below for sample data and code for reading it into the inters list.
{ "domain": "codereview.stackexchange", "id": 11718, "lm_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-2.x, numpy, coordinate-system", "url": null }
quantum-mechanics, electrons, quantum-spin, group-theory When the spin operator is written as $\hat s_i=\hbar \sigma_i$, where $\sigma_i$ are the standard two-dimensional Pauli matrices, one is implicitly assuming that we are acting on two-dimensional vectors. The notes appear to be addressing the following question: if our state space is two-dimensional, which vectors $|s,s_z\rangle$ span it? What linear combinations of $|s,s_z\rangle$ form an orthonormal basis? It's a bit of a reverse-logic question, since the relation $\hat s_i=\hbar \sigma_i$ is originally derived for the spin-$1/2$ representation of $su(2)$, which tells you that $|\frac{1}{2},\pm\frac{1}{2}\rangle$ is by definition the basis, but I suppose someone could ask this question.
{ "domain": "physics.stackexchange", "id": 89925, "lm_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, electrons, quantum-spin, group-theory", "url": null }
quantum-mechanics, forces And virtual exchange is a correct description, because during the interaction the exchanged particle is not on mass shell. Keep in mind that in the microcosm of particles nature is quantum mechanical. The particle scattering on another particle and the momentum and energy and quantum number exchanges between them are all described by one wave function, one mathematical formula that gives the probability for the interaction to take place in the way it has been ( will be ) observed.. Thus it is not a matter for "knowing" but a matter of "being". The Feynman diagrams that give rise to the "particle exchange" framework are just a mathematical algorithm for the calculations and help in understanding how to proceed with them. To see how classical fields are built up by the substructure of quantum mechanics see the essay here.
{ "domain": "physics.stackexchange", "id": 12401, "lm_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, forces", "url": null }
homework-and-exercises, diffusion **EDIT:**I played around with the stepsizes of the length and the standard deviation and got the correct result. A value of $\sigma = 0.01$ and $\Delta x=0.01$ did return the 0.285 I expected. I think the earlier step-size of 0.1 was too big to take into account the normal distribution. Would love some more insight on this. I think is more of a computational error here, because your distribution is so narrow in comparison with your tank, probably the discretization is not as dense to consider the distribution before it decays to zero, leaving you with a single point of mass $\rho(0,0)$ that when distributed evenly, gives you the result you mention. Maybe try with a smaller grid, try to have a grid of $\sigma / 2$ at most if not smaller and see if that fix the issue
{ "domain": "physics.stackexchange", "id": 69556, "lm_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, diffusion", "url": null }
ros, opencv, ros-kinetic, astra, depth Title: How to calculate the distance to object with orbbec astra camera Hello, I am using orbbec Astra camera in order to get the distance to the already detected object. I have detected the object by using OpenCV and /brg/image_raw topic from Astra camera. Now I want to estimate the distance to the object by using depth in order to send command (move forward or stay) to the robot. I am tracking that object. Could someone help me with that, or where I can find the material about distance estimation with orbbec camera. Originally posted by Yehor on ROS Answers with karma: 166 on 2019-03-24 Post score: 0 There's probably 3 major steps you should consider.
{ "domain": "robotics.stackexchange", "id": 32730, "lm_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, opencv, ros-kinetic, astra, depth", "url": null }
c++, c++17, singleton Proxy::Impl::Impl() { // constructor for Impl here } void Proxy::Impl::method1() { // the real method1 for the implementation } General comments welcome. Specific questions include: is there a way to eliminate the pointer dereference that will occur with each call intended for the underlying implementation? (For example, When Proxy::method1 is called, that redirects to the underlying singleton class.) Instead of using a static weak_ptr, is there a better way of tracking whether the Implementation exists? Have others done anything like this? I'm concerned that I haven't seen this pattern (with smart pointers) documented anywhere. It makes me feel like I've gone "off the rails" with this code and have overlooked some problems with this approach. Without locking, this works for me: class proxy { public: proxy() : m_impl(make_impl()) {}
{ "domain": "codereview.stackexchange", "id": 33395, "lm_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, singleton", "url": null }
galaxies The apparent motion of galaxies has two components: One which is due to the cosmological expansion of Space, and one which is due to local gravitational interactions with other galaxies. Neither, however, are correlated with the galaxies' proper rotation or alignment.
{ "domain": "physics.stackexchange", "id": 14520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "galaxies", "url": null }
star, galaxy, night-sky, stellar-density Still trying to find some good plots of stellar numbers, preferably as a function of galactic latitude, but at high galactic latitudes, the slope of the relationship is shallower and it crosses the galaxy curve at around $B=20$. i.e. Fainter than this, galaxies dominate and by orders of magnitude by the time you get to the limits of the Hubble Ultradeep field.
{ "domain": "astronomy.stackexchange", "id": 6679, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "star, galaxy, night-sky, stellar-density", "url": null }
php, sql, mysqli But I believe this is not the best way to do this. How can I make my code cleaner? Let the database do the hard work for you. Instead of selecting the values individually and summing them yourself, you can union your queries and sum the results in sql: SELECT SUM(x) / 9 * 10 AS globalavg FROM ( SELECT AVG(voto) AS x FROM values WHERE type ='a' UNION ALL SELECT AVG(voto) AS x FROM values WHERE type ='b' UNION ALL SELECT AVG(voto) AS x FROM values WHERE type ='c' UNION ALL -- follow the pattern for d, e, f, ... ) t Assuming you put this query in a $query variable in PHP, your code can be simplified as: $result = mysqli_fetch_assoc(mysqli_query($connessione, $query)); $globalavg = $result['globalavg']; echo 'Global average: '; echo $globalavg; Not only the PHP is simpler, it's more efficient to run one query than 9.
{ "domain": "codereview.stackexchange", "id": 9529, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, sql, mysqli", "url": null }
c#, strings, formatting, extension-methods, exception var properties = exception.GetType() .GetProperties(propertyFlags) .Except(typeof(TExceptException).GetProperties(propertyFlags), x => x.Name) .Select(p => new { p.Name, Value = p.GetValue(exception) }) .Where(p => p.Value != null && !string.IsNullOrEmpty(p.Value as string)); return properties; } private static IEnumerable<dynamic> GetData(this Exception exception) { foreach (var key in exception.Data.Keys) { yield return new { Key = key, Value = exception.Data[key] }; } }
{ "domain": "codereview.stackexchange", "id": 24061, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, strings, formatting, extension-methods, exception", "url": null }
-
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534316905262, "lm_q1q2_score": 0.8399780470115501, "lm_q2_score": 0.8558511488056151, "openwebmath_perplexity": 298.05780074192336, "openwebmath_score": 0.8994263410568237, "tags": null, "url": "http://math.stackexchange.com/questions/174828/a-probably-trivial-induction-problem-sum-2nk-2-lt1/174857" }
quantum-mechanics, quantum-entanglement Depends on how you view it. There is an explanation of quantum measurement (called decoherence) in which this is true. I will not be using that explanation in this post because it's unnecessarily complicated. This will have some immediate non-local effect on Particle B won't it?
{ "domain": "physics.stackexchange", "id": 624, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-entanglement", "url": null }
homework-and-exercises, optics, visible-light You can't represent incoherent light with Jones vectors (2 components), but you can do it with density matrices (this approach has a huge importance in quantum mechanics, where incoherent mixtures are most important). So, 2×2 matrices, formed as time averages of tensor product of the Jones vector with itself. The meaning of the matrix is the correlation of components: diagonal terms are the energy fluxes (remember - it's amplitude squared), and the off-diagonal terms are cross-correlations between polarizations. There are no cross-correlations if they are incoherently mixed (unpolarized) so incoherent light has diagonal matrices. Anything between totally polarized and totally unpolarized light is likewise describable by this. Trace of the matrix is the total energy flux. Coherent mixtures add as vectors. Incoherent mixtures add as matrices. Consider this $x$ and $y$ polarizations: $E_x=(1,0)$ and $E_y=(0,1)$. Associated matrix:
{ "domain": "physics.stackexchange", "id": 30601, "lm_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, optics, visible-light", "url": null }
python, python-3.x, interview-questions I have many if statements that are used to exit out of loops to avoid array index errors Any feedback or criticism is appreciated - nitpick on anything that seems off glaring issue is that this doesn't handle edge cases well. For example: "A 2" https://leetcode.com/problems/zigzag-conversion/ class Solution: def convert(self, s: str, numRows: int) -> str: if numRows == 1: return s row = [''] * (len(s) // 2) self.s = s self.numRows = numRows self.final_grid = [] for i in range(numRows): self.final_grid.append(list(row)) self.addElements(0, 0) return "".join(map("".join, self.final_grid)) def addElements(self, count, column): print(column, "beg") for i in range(self.numRows): if count > len(self.s) - 1: break self.final_grid[i][column] = self.s[count] count += 1
{ "domain": "codereview.stackexchange", "id": 35536, "lm_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, interview-questions", "url": null }
c++ Title: best practice to divide uint16_t to get double I have two integer values and would like to obtain their quotient which should be a fractional number, in this example 37/2=18.5. I usually do this: uint16_t dividend=37; uint16_t divisor=2; auto quotient=dividend/double(divisor); In python3 there are division / and truncation division // which result in respective quotients of 18.5 and 18. As far as I know there is only / in C++ which on integers works like truncation division. Is there a standard way of getting a quotient==18.5 in C++? Don't use the C cast in C++. We have a specific cast for this in C++ auto quotient = dividend / static_cast<double>(divisor); Alternatively you can simply multiply one value by 1.0 auto quotient = 1.0 * dividend / divisor;
{ "domain": "codereview.stackexchange", "id": 40005, "lm_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 }
bin.mid <- (bin.upper + bin.lower)/2 n <- sum(counts) mu <- sum(bin.mid * counts) / n sigma2 <- (sum(bin.mid^2 * counts) - n * mu^2) / (n-1) The mean (mu) is $1195/22 \approx 54.32$ (needing no correction) and the variance (sigma2) is $675/11 \approx 61.36$. (Its square root is $7.83$ as stated in the question.) Because the common bin width is $h=5$, we subtract $h^2/12 = 25/12 \approx 2.08$ from the variance and take its square root, obtaining $\sqrt{675/11 - 5^2/12} \approx 7.70$ for the standard deviation. ### Maximum Likelihood Estimates An alternative method is to apply a maximum likelihood estimate. When the assumed underlying distribution has a distribution function $F_\theta$ (depending on parameters $\theta$ to be estimated) and the bin $(x_0, x_1]$ contains $k$ values out of a set of independent, identically distributed values from $F_\theta$, then the (additive) contribution to the log likelihood of this bin is
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.969785409439575, "lm_q1q2_score": 0.8459897462705355, "lm_q2_score": 0.8723473647220787, "openwebmath_perplexity": 700.5224289268373, "openwebmath_score": 0.844092845916748, "tags": null, "url": "https://stats.stackexchange.com/questions/60256/standard-deviation-of-binned-observations" }
ios, swift let isReachable = flags.contains(.Reachable) let needsConnection = flags.contains(.ConnectionRequired) return isReachable && !needsConnection } Your notification mechanism is far too complicated in my opinion. Instead of scheduling an NSOperation which reschedules itself with dispatch_after, you could simply create a repeating NSTimer. Also you should check if the startNotifier/stopNotifier calls are properly balanced. Even better, you can register a notification callback which is automatically called when the reachability status changes. I'll come back to that later. The SwiftReachability class should not do any UI-related stuff like displaying alerts. Use NSNotification or callback methods to make the class reusable. A different design Let's have a look at the "Supporting IPv6 DNS64/NAT64 Networks" document from Apple:
{ "domain": "codereview.stackexchange", "id": 20049, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ios, swift", "url": null }
quantum-field-theory, particle-physics, hamiltonian, interactions, mean-field-theory the "default" particle states of QFT are only defined in the context of free theories/Hamiltonians. This is why the particle states in the scattering formalism live in the infinite (or "asymptotic") past and future, where the fields are supposed to be effectively free.
{ "domain": "physics.stackexchange", "id": 97468, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, particle-physics, hamiltonian, interactions, mean-field-theory", "url": null }
python, algorithm, python-3.x Or, using list comprehension: jug_state = [ volume if ch == '1' else 0 for ch, volume in zip(jug_binary_state, list_volumes) ] make_moves for from_jug in range (number_jugs): for to_jug in range (number_jugs): if to_jug == from_jug: continue #Empty from_jug, ignore to_jug #Fill from_jug, ignore to_jug #Move as much from from_jug to to_jug For each from_jug, you loop over each possible to_jug, and then ignore the to_jug for the "Empty" and "Fill" possible moves. But you are still evaluating the new state for these moves for every to_jug, only to discarding the duplicate states. Why? That is a lot of extra work. How about moving the "Empty" and "Fill" steps out of the inner loop? for from_jug in range (number_jugs): #Empty from_jug #Fill from_jug for to_jug in range (number_jugs): if to_jug == from_jug: continue #Move as much from from_jug to to_jug
{ "domain": "codereview.stackexchange", "id": 34338, "lm_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, python-3.x", "url": null }
quantum-gate, quantum-fourier-transform, universal-gates Title: Is the quantum Fourier transform efficient if only one control-phase is allowed in the gate set I have seen Why can the Discrete Fourier Transform be implemented efficiently as a quantum circuit?. This is not a duplicate. I am familiar with the decomposition of the QFT from Nielsen&Chuang and Preskill's notes, and it requires to be able to perform n-different control phase gates. If we only allow the smallest control-phase, we can still implement all the other ones as powers but we now need to use it exponentially many times. It seems that the speedup of the quantum fourier transform is based on allowing a particularly nice (albeit reasonable) gate set.
{ "domain": "quantumcomputing.stackexchange", "id": 820, "lm_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-gate, quantum-fourier-transform, universal-gates", "url": null }
python Title: Dream holiday poll Now ALL of the below works as intended - a poll asks users questions and I store them in a dictionary, finally I print how many times a country was mentioned - boring I know. However, I really want to know if there is better, cleaner even high level way to do this (reading comments here people usually mention speed, efficiency always gets me excited and motivated to carry on learning) and if I am falling into any potholes or bad practices. I am not new to programming but new to Python, I would genuinely appreciate the help. Stay safe :) dream_vacation_poll = {} question = 'What is your dream holiday? ' while True: name = input('Name: ').lower() message = input(question).lower() dream_vacation_poll[name] = message message = input('Does anyone else want to answer? (y/n)').lower() if message == 'n': break else: continue
{ "domain": "codereview.stackexchange", "id": 38554, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
telescope, astrobiology As for non-permanent positions in astronomy, there are plenty of those. The funding situation for postdoctoral positions is such that, while there is still a great deal of competition for open positions (stemming partially from the fact that almost everyone applies to almost every open job --- I exaggerate, but only slightly), there are enough open positions, that almost all astronomy Ph.Ds who want a postdoc will be able to get one. But those positions only last for an average of three years. However the job prospects for astronomy Ph.Ds who decide to leave the field of astronomy (like myself) are quite good. Those holding an astronomy degree have one of the lowest unemployment rates of anyone (around 0.3%). Here are a few links to some papers on the state of the job market in astronomy:
{ "domain": "astronomy.stackexchange", "id": 1536, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "telescope, astrobiology", "url": null }
python, beginner, parsing, csv accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains
{ "domain": "codereview.stackexchange", "id": 15859, "lm_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, parsing, csv", "url": null }
one of them: A = 35 o, B = 49 o, and a = 7. unit_5_quiz_a_key. 4 Linear and Angular Speed Linear Speed Angular Speed Test Prep 252 Review Exercises 254 Test 257 4 Graphs of the Circular Functions 259 4. The Ambiguous Case. A sampling of exercises from the chapter reviews and chapter tests is included for practice. 3 - Right Triangle Trigonometry - Assign 5. State whether the Law of Sines or Law of Cosines is the best choice to solve for x for the given figure. SAT EXAM SYLLABUS. the answer key follows the sample questions. Skills Solve a right triangle given the measures of one angle and one side or the measure of two sides. 1 The Law of Sines 772 Congruency and Oblique Triangles Derivation of the Law of Sines Using the Law of Sines Description of the Ambiguous Case Area of a Triangle. Chapter 7: Applications of Trigonometry and Vectors Topics to be covered include: Law of Sines, Law of Cosines, and vectors. 7 Study Guide and Practice WS Tues. One of the most important differences
{ "domain": "otticamuti.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9867771774699747, "lm_q1q2_score": 0.8044528059651472, "lm_q2_score": 0.8152324803738429, "openwebmath_perplexity": 909.6973263622766, "openwebmath_score": 0.5671159029006958, "tags": null, "url": "http://nxyy.otticamuti.it/law-of-sines-and-cosines-multiple-choice-test-pdf.html" }
cell-biology, microbiology, terminology The fact is, that as a general rule, bacteria are unicellular, but at times, like you said, they can undergo filamentation. When they do, they end up with several connected cells which are generally considered functionally independent. In certain circumstances, however, the cells can be dependent on each other for survival, and because they didn't separate completely, it's hard to define whether we're looking at multicellularity or symbiosis. It is generally accepted that cyaonbacteria are truly multicellular. In order to be multicellular, an organism generally has to fulfill 5 basic requirements:
{ "domain": "biology.stackexchange", "id": 8412, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cell-biology, microbiology, terminology", "url": null }
ros, kinect, primesense, openni-camera Originally posted by fergs on ROS Answers with karma: 13902 on 2011-04-30 Post score: 1 Original comments Comment by Mac on 2011-06-17: Has this sorted itself out? Comment by fergs on 2011-05-01: I haven't gone and tried the OpenNI directly -- that's next on my list. With the old NI stack, I had similar results (actually, it seemed less reliable than the current results). Comment by Eric Perko on 2011-05-01: Have you tried the old NI stack or just standard OpenNI drivers? Perhaps the openni_kinect stack doesn't really support the PSDK5.0 so well or has a regression of some sort? This seems to have been fixed in more recent versions of the driver. Originally posted by fergs with karma: 13902 on 2011-09-02 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 5478, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, kinect, primesense, openni-camera", "url": null }
ros, catkin, github, bloom-release, release In particular, davetcoleman/rosdistro is not a fork, searching... But it is in fact a fork and I've done this many times before...? Thanks! UPDATE 1: Bloom Log: https://gist.github.com/davetcoleman/25eaabafc3f155658376 UPDATE 2: I applied your github patch. Note I got a somewhat weird message while doing so, but on visual inspection it looks like it worked: bloom$ sudo patch < github.py.patch patching file github.py patch unexpectedly ends in middle of line Hunk #1 succeeded at 121 with fuzz 1.
{ "domain": "robotics.stackexchange", "id": 19457, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, catkin, github, bloom-release, release", "url": null }
In [24]: data = np.array([5, 7, 8, 9]) In [25]: avg_squared_loss(4, data) Out[25]: 12.75 In [26]: avg_squared_loss(7, data) Out[26]: 2.25 A somewhat better approach is to use brute force to try out a bunch of thetas and return the one that yields the lowest loss. In [27]: def simple_minimize(loss_fn, observations, thetas): losses = [loss_fn(theta, observations) for theta in thetas] return thetas[np.argmin(losses)] In [28]: simple_minimize(avg_squared_loss, data, np.linspace(0, 10, 20)) Out[28]: 7.368421052631579 Visually, what we're doing is computing all the starred values below and then returning the $\theta$ that goes with the minimum value. In [29]: thetas = np.linspace(0, 10, 200) sparse_thetas = np.linspace(0, 10, 20) loss = avg_squared_loss(thetas, data) sparse_loss = avg_squared_loss(sparse_thetas, data)
{ "domain": "ds100.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9653811641488383, "lm_q1q2_score": 0.800241911785479, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 12992.987593992833, "openwebmath_score": 0.3793398439884186, "tags": null, "url": "http://www.ds100.org/fa18/assets/lectures/lec09/09-Models-and-Estimation-II.html" }
In other words, $W$ is $16$ with probability $q$, and $0$ with probability $1-q$. So the expected amount of money you walk away with is therefore $E[W] = q(16) + (1-q)0 = (1-(1-p)^4)16 \approx 14.77$. [Aside: Note that this is less than the $15$ you came in with. This shows that you can't win in expectation even with your clever betting strategy; a consequence of the optional stopping theorem.] -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.989013056721729, "lm_q1q2_score": 0.8575096989820084, "lm_q2_score": 0.8670357718273068, "openwebmath_perplexity": 335.1219784788124, "openwebmath_score": 0.8544569611549377, "tags": null, "url": "http://math.stackexchange.com/questions/237073/playing-roulette" }
javascript, html, css </div> <div id="wars">Knights & Dragons - Wars <table id="warslist"> <tr> <td>1.</td> <td>4.</td> <td>7.</td> </tr> <tr> <td>2.</td> <td>5.</td> <td>8.</td> </tr> <tr> <td>3.</td> <td>6.</td> <td>9.</td> </tr> </table> <span class="info">Guild info >></span> <span id="previous"><a href="previouswars.html">Click here to see all previous wars</a> </span> </div> <div id="content"> </div>
{ "domain": "codereview.stackexchange", "id": 7519, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, html, css", "url": null }
quantum-mechanics, wavefunction, heisenberg-uncertainty-principle Title: The connection between the Heisenberg Uncertainty Principle and wavefunctions I have recently read Something Deeply Hidden by Sean Carroll, and in the book, he tries to sum up how the Heisenberg Uncertainty Principle can be found from just the way wavefunctions work, but I couldn't understand it. How are the Heisenberg Uncertainty Principle and Wavefunctions connected? It's because: $$ p = -i\hbar\frac{d}{dx} $$ You can't have a constant derivative and a fixed $x$ (e.g. $\delta(x)$). As $\psi(x)$ becomes more localized, the standard deviation of $d\psi(x)/dx $ grows, and vice versa.
{ "domain": "physics.stackexchange", "id": 90115, "lm_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, wavefunction, heisenberg-uncertainty-principle", "url": null }
ros, moveit, collision-object planning_scene_interface.addCollisionObjects(collision_objects); //add objects to planning interface bin.meshes.clear(); //Clear mesh required for MOVE operation (Only to avoid a warning) bin.operation = bin.MOVE; //change operation to MOVE while (node.ok()){ //Listen to tfs try{ listener.lookupTransform("torso_base_link", "bin1", ros::Time(0), t_bin1); } catch (tf::TransformException ex){ ROS_WARN("%s",ex.what()); }
{ "domain": "robotics.stackexchange", "id": 29390, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, moveit, collision-object", "url": null }
ros, camera, rosjava, baxter, ros-indigo Originally posted by fc23 on ROS Answers with karma: 1 on 2018-01-30 Post score: 0 Hi @fc23! You will need ROS Android stuff. You can go to https://wiki.ros.org/android to get started and create a new package/ project from scratch. Another option (perhaps a bit faster) would be to take a look at https://github.com/rosjava/android_apps. You can use teleop app as a template, remove what you don't need and build your app on top of that. You will see that this app has a place where an image stream can be visualized; you can probably grab that and tweak it to meet your needs. If you won't use any custom service or message, you should be able to build your app using Gradle as a regular Android app without installing anything else just with Android Studio. You can also do it the catkin-way; in that case you will need to install rosjava and it's build tools. Check https://wiki.ros.org/rosjava for installation tutorials (personal recommendation: go to source installation).
{ "domain": "robotics.stackexchange", "id": 29915, "lm_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, camera, rosjava, baxter, ros-indigo", "url": null }
subtends 4(pi) steradians. Everyday low prices and free delivery on eligible orders. 4pi steradians covers a complete sphere, just as 2 pi radians covers a circle. This means that the celestial sphere covers 41253 square degrees (3602/T) of the sky. Science Advisor. You Can Do Math: Radians and Steradians: Tanna, Sunil: Amazon.sg: Books. Maybe I should ll him by his forst number, 3), solid angles subtended on a sphere are measured in terms of steradians.You can look at the anguloar measure as the area on a sphere of radius R, divided by R squared. The HUDF image is a square of side length 2.4 arc-minutes, and 10,000 galaxies are estimated within the image. Interestingly enough, 4pi is also the surface area of a unit sphere with radius of 1. Account & Lists Account Returns & Orders. Calculating Candelas and Lumens. The question is, how many counts do you expect in this detector when it's a certain distance ... has the unit of what's called steradians-- steradians-- with a full sphere
{ "domain": "shukunegi.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540656452214, "lm_q1q2_score": 0.8182341908183411, "lm_q2_score": 0.8354835289107309, "openwebmath_perplexity": 1875.7777519416447, "openwebmath_score": 0.7406566739082336, "tags": null, "url": "http://shukunegi.com/georgia-hall-jwyd/page.php?341f42=st-paul-school-agra-admission-2020-21" }
the code, but it gives a fair bit of idea. Is it possible to produce unique number (an integer) from two integers? They are used to quickly compare dictionary keys during a dictionary lookup. How to effectively defeat an alien "infection"? Scramble the bits of the key so that the resulting values are uniformly distributed over the key space. Map the integer to a bucket. Castro, et.al., 2005, "The strict avalanche criterion randomness test", Mathematics and Computers in Simulation 68 (2005) 1–7,Elsevier, Malte Sharupke, 2018, "Fibonacci Hashing: The Optimization that the World Forgot (or: a Better Alternative to Integer Modulo)", Plain ASCII is a 7-bit character encoding, although it is often stored in 8-bit bytes with the highest-order bit always clear (zero). We will also be … The mid-square method squares the key value, and then takes out the middle r bits of the result, giving a value in the range 0 to 2 r − 1. Examples of back of envelope calculations leading to good intuition?
{ "domain": "afd-hamburg-nord.de", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9626731147976794, "lm_q1q2_score": 0.8239048929936093, "lm_q2_score": 0.8558511506439708, "openwebmath_perplexity": 1102.311196464562, "openwebmath_score": 0.20374804735183716, "tags": null, "url": "https://afd-hamburg-nord.de/forum/archive.php?53e5c2=hash-function-for-two-integers" }
to compute the cross product of the standard unit vectors. When θ is a right angle, the versor is a right versor: its scalar part is zero and its vector part v is a unit vector in ℝ . The unit normal vector is defined to be, →N(t) = →T ′ (t) ‖→T ′ (t)‖ The unit normal is orthogonal (or normal, or perpendicular) to the unit tangent vector and hence to the curve as well. Advanced Math Solutions – Vector Calculator, Simple Vector Arithmetic. or inversely by: [] = [⁡ ⁡].Any vector field can be written in terms of the unit vectors as: = ^ + ^ + ^ = ^ + ^ + ^ The cylindrical unit vectors are related to the cartesian unit vectors by: [^ ^ ^] = [⁡ ⁡ − ⁡ ⁡] [^ ^ ^]Note: the matrix is an orthogonal matrix, that is, its inverse is simply its transpose.. Time derivative of a vector field. Vectors with Initial Points at The Origin. If you walk straight along the path, your direction can be considered a unit vector and its magnitude is 1. The basic idea behind vector components is any vector can be
{ "domain": "botan.es", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9518632247867715, "lm_q1q2_score": 0.812808152019291, "lm_q2_score": 0.8539127585282744, "openwebmath_perplexity": 524.0888829780756, "openwebmath_score": 0.8113547563552856, "tags": null, "url": "http://botan.es/5bacvvfu/unit-vector-formula-580664" }
= d, the focal distance. The crease will be half-way between the focus and the directrix. Problem 1: Find the vertex, focus, axis, and directrix of the followingpara The focus of a parabola tangent to four lines is the Miquel point of the lines: the common point of the circumcircles of the four triangles formed by the four lines. Directions: The focus and directrix of a parabola are given. Question 10 A parabolic dish with a diameter of 200 cm and a maximum depth of 50 cm is the coordinates of the focus in x,y format are: (29/16, 1) The directrix of the parabola is x = 35/16 Since p = -3/16, the directrix is 3/16 units to the right of the vertex. Example Of Directrix Of A Conic I think that it is a clever way to solve such a problem, but is there any quicker method or formula that when given the focus and directrix (which is tilted), I can easily find the equation of the parabola? I have also seen and read this previously asked question if anyone was wondering. Choose: The focus is a
{ "domain": "true-fish.ru", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850906978876, "lm_q1q2_score": 0.8336244549881283, "lm_q2_score": 0.8479677526147223, "openwebmath_perplexity": 373.28047375649123, "openwebmath_score": 0.507796049118042, "tags": null, "url": "http://true-fish.ru/d1yul/directrix-and-focus-problems.html" }
particle-physics, neutrinos, feynman-diagrams I've found that differentiating charged-current and neutral-current interactions is most relevant in the context of so-called "scintillator" detectors, which use hydrocarbons (with approximate chemical formula C$_n$H$_{2n}$) as the primary interaction medium. I would like some to explain to me, in the context of neutrino-matter interactions, what qualifies as a charged-current interaction and what qualifies as a neutral-current interaction. You can use the scintillator-relevant interactions in Table 1 of this paper for specific examples. Feel free to use Feynman diagrams in your explanation if it helps, I am familiar with them. At the tree level (i.e. the simplest Feynman diagram) the both types of weak interaction result from the exchange of a weak boson. The weak bosons are the $Z^0$ (neutral) and the $W^\pm$ (charged).
{ "domain": "physics.stackexchange", "id": 18703, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, neutrinos, feynman-diagrams", "url": null }
Probably this is a dumb question, but I'm self studying this to prepare for university mathematics to have at least a bit experience with some more abstract mathematics. I got this analysis book from my brother who studies physics. Last edited: Jul 28, 2016 9. Jul 28, 2016 ### Staff: Mentor It will get better with time. Wait until you will finish your proofs as soon as some $\epsilon$ show up and all the work now, like $\epsilon' = 2 \epsilon$, $\epsilon' = \frac{1}{3} \epsilon$ or $\epsilon = \min\{\epsilon_1, \epsilon_2\}$ will be classified under the label: "boring technical issues". Unfortunately until then, the boring stuff has to be learned, too. (see post #7) 10. Jul 28, 2016 ### Math_QED Well I do not think it's boring at all ;) 11. Jul 28, 2016 ### PeroK
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9728307724028541, "lm_q1q2_score": 0.8064171791184583, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 1481.8272625084667, "openwebmath_score": 0.7614350318908691, "tags": null, "url": "https://www.physicsforums.com/threads/definition-of-the-limit-of-a-sequence.880213/" }
com's Surface Area of a Pyramid Calculator – Features a detailed pyramid diagram, step-by-step instructions, and example problems. You can find the lateral area and total surface area of a prism by using a net. These are just two simple types of calculations that involve these formulas. Total Surface Area and Volume of a Box with a Cylindrical Hole. Surface area is measured in square units. Cylinder A cylinder is a space figure having two congruent circular bases that are parallel. 2 square inches. If they are the same, then the box will become a perfectly square box. area of equilateral triangle = 43. 33 Of all the circular cone of slant height 8 cm, find the dimensions of the cone of largest volume. With the integration of edge-lit technology, driverless AC LED technology, and full dimmability, E. Find the dimensions of the box with the largest volume. cu 36 square inches. Surface area of cubes: 6 (l ∙ w) Surface area of cylinders: A=2πr^2∙2πrh; After students have computed the
{ "domain": "auralicht.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575193498701, "lm_q1q2_score": 0.8166458533833736, "lm_q2_score": 0.8311430499496096, "openwebmath_perplexity": 333.35130182291016, "openwebmath_score": 0.7742525935173035, "tags": null, "url": "http://kgll.auralicht.de/surface-area-of-a-box-with-a-square-base.html" }
For $n\equiv 2\pmod{5}$, $2n+2$ is the smallest value that can be formed which is 1 mod 5, so $2n+2=96$ and $n=47$. We see that $92=45+47$, $93=48+45$, and $94=47+47$, so $n=47$ does work. If $n\equiv 3\pmod{5}$, then the smallest value that can be formed which is 1 mod 5 is $2n$, so $2n=96$ and $n=48$. We see that $94=49+45$ and $93=48+45$, but 92 cannot be formed, so there are no solutions for this case. If $n\equiv 4\pmod{5}$, then we can just ignore $n+1$ since it is a multiple of 5, meaning that the Chicken McNuggest theorem is a both necessary and sufficient condition, and it states that $5n-n-5=91$ meaning $4n=96$ and $n=24$. Hence, the only two $n$ that work are $n=24$ and $n=47$, so our answer is $24+47=\boxed{071}$. -Stormersyle
{ "domain": "artofproblemsolving.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9914225161069058, "lm_q1q2_score": 0.8011360392090414, "lm_q2_score": 0.8080672227971211, "openwebmath_perplexity": 101.3253183452252, "openwebmath_score": 0.841289758682251, "tags": null, "url": "https://artofproblemsolving.com/wiki/index.php?title=2019_AIME_II_Problems/Problem_14&diff=prev&oldid=123938" }
mobile-robot, ros, navigation, hokuyo-laser @Humpelstilzchen, Do you know how to merge Ultrasound Sensor on local_costmap of TurtleBot3? Here is local_costmap_params.yaml local_costmap: global_frame: odom robot_base_frame: base_footprint update_frequency: 10.0 publish_frequency: 10.0 transform_tolerance: 0.5 static_map: false rolling_window: true width: 3 height: 3 resolution: 0.05 And here is costmap_common_params_burger.yaml obstacle_range: 3.0 raytrace_range: 3.5 footprint: [[-0.105, -0.105], [-0.105, 0.105], [0.041, 0.105], [0.041, -0.105]] #robot_radius: 0.105 inflation_radius: 1.0 cost_scaling_factor: 3.0 map_type: costmap observation_sources: scan scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true} Would you Please Assist? Comment by Humpelstilzchen on 2022-03-06: You should create a new question for this
{ "domain": "robotics.stackexchange", "id": 21324, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mobile-robot, ros, navigation, hokuyo-laser", "url": null }
created by Eric ) SYMMETRIC POSITIVE DEFINITE DIAGONALLY DOMINANT MATRICES QIANG YE Abstract. Show that the matrix A is invertible. Ask Question Asked 10 months ago. are diagonally dominant in the above sense.). Join the initiative for modernizing math education. Many matrices that arise in finite element methods are diagonally dominant. 0 A strictly diagonally dominant matrix is nonsingular. No (partial) pivoting is necessary for a strictly column diagonally dominant matrix when performing Gaussian elimination (LU factorization). Due to Ger sgorin’s Theorem [41, Theorem 6.1.1], row diagonally dominant matrices with positive diagonal entries are positive stable, namely, their eigenvalues lie in the open right half of the complex plane. The thing about positive definite matrices is xTAx is always positive, for any non-zerovector x, not just for an eigenvector.2 In fact, this is an equivalent definition of a matrix being positive definite. {\displaystyle A} (Justify your answers.) ( ,
{ "domain": "primus.marketing", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138170582865, "lm_q1q2_score": 0.8016210494908431, "lm_q2_score": 0.8198933425148214, "openwebmath_perplexity": 444.59087134651685, "openwebmath_score": 0.9217110872268677, "tags": null, "url": "https://primus.marketing/journal/archive.php?1eef13=i-know-what-you-did-last-summer-ben-willis" }
homework-and-exercises, electric-circuits, electric-current, electrical-resistance, voltage what if the emfs aren't same? Then you have a mathematically contradictory model. Say source BC has 10 V, and source FE has value 7 V. Then your schematic is equivalent to writing the equation $$10\ {\rm V}=7\ {\rm V}$$ which is simply a mathematical false statement. In the real world, the contradiction would be resolved by the sources having non-zero equivalent internal resistance. In comments you asked, How am I supposed to interpret the mathematical invalidity[?] The mathematical impossibility tells you your model is non-physical. It can't represent any real physical system. Something is supposed to happen when I connect the circuit even if the set up is ideal , or not ?
{ "domain": "physics.stackexchange", "id": 58624, "lm_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, electric-circuits, electric-current, electrical-resistance, voltage", "url": null }
botany, species-identification, trees Title: Can someone identify this tree from the Pacific Northwest? A tree at my house in Seattle, Washington, USA has these leaves. Can someone tell me what it is? It looks similar to a Cotinus coggygria, which is a shrub that we call a Smokebush in the UK. But given your location, it could be Cotinus obovatus, known as American smoketree. See http://dendro.cnre.vt.edu/dendrology/syllabus/factsheet.cfm?ID=415 The leaves will start green and progressively change colour to deep reds in the autumn with sprays of pink-purple flowers in the summer that from a distance look like smoke, hence the name. Here are some images I have found on the web. http://www.cirrusimage.com/tree_American_smoke.htm http://allthedirtongardening.blogspot.co.uk/2012/08/smoke-tree-smoke-bush-coninus.html
{ "domain": "biology.stackexchange", "id": 7190, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "botany, species-identification, trees", "url": null }
javascript, optimization, jquery, animation } } /** * Calculates the content height of an element by it's children's height * @param elem * @returns {number} */ function calculateContentHeight(elem) { var total = 0; elem.children().not('.clone').each(function() { if(parseInt($(this).css('margin-top')) >= 0) total += $(this).height() + parseInt($(this).css('margin-top')); else total += $(this).height(); }); total -= 10; return total; } /** * Generates a spacer. * @param marginTop * @param height * @returns {*|jQuery|HTMLElement} */ function generateSpacer(marginTop, height) { var spacer = $('<div class="marquee-spacer clone" style="margin-top: '+marginTop+'px;"></div>'); height = height || 60; spacer.css({ height: height }); return spacer; }
{ "domain": "codereview.stackexchange", "id": 10207, "lm_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, optimization, jquery, animation", "url": null }
interstellar-medium Title: Why is the interstellar medium so hot? On this link, it states the following: "large assemblies of galaxies that are permeated by even larger amounts of diffuse gas. With temperatures of 10 million degrees or more". How are these diffused (ionized) gas able to become so hot when they are in large distances from one another and have very little density? What that ESA (European Space Agency) page titled Hot gas sloshing in a galactic cauldron that you link to describes are called WHIM (Warm–Hot Intergalactic Medium). They are not interstellar medium, but intergalactic medium gas. The difference in density is huge, with interstellar medium density at an average of $\rho ∼ 1\ ppcm$ (one proton per cubic centimeter), but the density of these WHIM being even a few orders of magnitude lower at $\rho ∼ 10^{−6}−10^{−5}\ ppcm$, or roughly 1 to 10 protons per cubic meter (NASA's Chandra X-ray Observatory quotes average density of 6 protons per cubic meter).
{ "domain": "astronomy.stackexchange", "id": 135, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "interstellar-medium", "url": null }
homework-and-exercises, newtonian-mechanics, acceleration, string $$2mg - mg = ma$$ In other words, $a = g$ However, the expected answer is $a = \frac{g}{2}$. So in both cases, I have a factor of two error, so I'm clearly missing something. But I can't quite figure out what. Any help would be greatly appreciated! As long as mass B is partially supported by the surface, then the acceleration of mass A is twice that of M. If the surface is not a factor, then the acceleration of M puts A and B into an accelerated frame, in which has a relative acceleration of a'.
{ "domain": "physics.stackexchange", "id": 85682, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, acceleration, string", "url": null }
modulation, fourier, highpass-filter Now the defintion of the (ideal) BPF is such that its frequency response is: $$ H(\omega) = \begin{cases} 1 &, |\omega-\omega_0| < W \\ 0 &, o.w. \\ \end{cases} $$ Then the multiplication of $H(\omega)$ with $0.5 X(\omega-\omega_0) + 0.5 X(\omega+\omega_0)$ would yield: $$ H(\omega) \left[ 0.5 X(\omega-\omega_0) + 0.5 X(\omega+\omega_0) \right] = 0.5 X(\omega-\omega_0) + 0.5 X(\omega+\omega_0) $$ Which means: $$ \mathcal{F} \{ \text{BPF} \{ x(t) \cos(\omega_0 t) \} \}= 0.5 X(\omega-\omega_0) + 0.5 X(\omega+\omega_0)$$ In this example the whole spectrum is the modulated spectrum so you don't actually filter out anything, but in other situations the BPF would indeed perform some useful operations.
{ "domain": "dsp.stackexchange", "id": 5610, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "modulation, fourier, highpass-filter", "url": null }
observational-astronomy, nebula You can see the exposed white dwarf. And it looks like a thin shell envelopes that star, while the space between the star and the shell is scarce, like see-through. But wouldn't that image imply that the planetary nebula is disk-shaped? If the nebulae is spherical, then shouldn't there be "more nebulae" between the star and the shell? Or shouldn't the inner space be tinted in the color of the nebulae, because we look at a white dwarf that's behind a shell? I've drawn my problem with Paint too, sry for my artistic skills: Pattern A is what I thought it should be; Pattern B is what I think it looks like. Short Answer Thin gas in a nebula only absorbs some portion of star light corresponding to a small subset of the overall visible spectrum, according to the corresponding molecular composition of the nebula. For even these limited spectral ranges, the star is still often visible in a nebula since the gas can be too thin to absorb all the energy emitted by the star. Long Answer
{ "domain": "astronomy.stackexchange", "id": 5499, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "observational-astronomy, nebula", "url": null }
big-bang-theory, matter, antimatter The clear inference from that is hydrogen is also a combination of matter and antimatter. We say the electron is matter, and the proton too. But why? Surely since the proton is more like the positron than the electron, we ought to say the proton is the antimatter. Like this:
{ "domain": "astronomy.stackexchange", "id": 3323, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "big-bang-theory, matter, antimatter", "url": null }
cnn, image-classification, image-recognition, convolutional-neural-network Another approach is to learn this scaling. It means that the learning algorithm needs scale-invariant features but NNs are supposed to actually create features in their hidden layers through learning. So if you have sufficiently big dataset in which all variants are presented enough, your NN will learn it (most probably with poor results). The process is intuitive ML-wise:
{ "domain": "datascience.stackexchange", "id": 5833, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cnn, image-classification, image-recognition, convolutional-neural-network", "url": null }
telescope, observatory (Sometimes there is a hole in the primary, and the tertiary sits on top of a small "tower" that protrudes up through the hole from behind the primary; this would help disguise the existence of the hole. That's how the tertiary mirrors in the 8 m unit telescopes of the VLT work, though I don't think they have support vanes the way this one does. The existence of the support vanes and the nature of the B' reflection suggests there really isn't a hole in the primary here.) The "dome" is an example of a "clamshell" design, in which two halves fold down out of the way; you can see one of the two hinges in the front, near the bottom right of your images. If you google for images of these telescopes, you can see them in the daytime, folded-up configuration. Here's an image of one of the telescopes when it was still in the factory (before the mirrors were installed), which may help you understand the design better:
{ "domain": "astronomy.stackexchange", "id": 3328, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "telescope, observatory", "url": null }
electricity, electric-fields, potential, voltage Title: Voltage as the work to move from infinity to a point in field I understand that electric potential is defined as the work needed to move a charge from infinity to a specific point in the field. However, how does this apply for a field which is limited between two plates (a positive and negative plate) ? How can the concept of electric potential as work to move a charge from infinity make sense in this scenario, as infinity is defined as zero electric potential, but then in the plates, the negative plate is defined as 0V? I understand that electric potential is defined as the work needed to move a charge from infinity to a specific point in the field
{ "domain": "physics.stackexchange", "id": 63922, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, electric-fields, potential, voltage", "url": null }
complexity-theory, time-complexity, computational-geometry not in the convex hull iff there exists $\vec v$ such that If $P$ is convex and "open" (whatever it means), then you only need its "frontier" and the corresponding orientation. You apply the same algorithm as above on the frontier (plus the orientation vector) reducing the complexity. For a polygon it becomes in $O(1)$ if you already know the two segments on the frontier. Hope this helps.
{ "domain": "cs.stackexchange", "id": 410, "lm_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, time-complexity, computational-geometry", "url": null }
swift Please note that I'm not concerned about sort order. How does my extension look? Since I'm fairly new at this, I'd like to know if I'm over-complicating it. Is there a way to write the extension more concisely? What about speed issues? That looks like a clean implementation to me. One minor thing: I find it more natural to assign the new index before the group array is extended, so that you don't have to subtract one: indexKeys[key] = grouped.count grouped.append([element]) The Swift standard library defines many methods for the Sequence protocol and not for concrete sequences like Array, examples are map, filter, min/max, contains ... You can do the same with your method to make it more universally applicable: extension Sequence { // ... no other changes necessary ... }
{ "domain": "codereview.stackexchange", "id": 28132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "swift", "url": null }
If instead of $$n=100$$ possibilities we have a large $$n$$, the expectation converges to $$n/6$$. In fact, if we select numbers without replacement rather than with (which makes a negligible difference when $$n$$ is large), the expectation is exactly $$\frac16(n+1)$$. Here's a way to see that: First, change the game to be: We have $$n+1$$ chairs arranged in a circle. Select one chair at random, remove it from the circle. That leaves a chain of $$n$$ chairs. Select 5 of those chairs at random, and count the gap between the second and third selected chair. It should be clear that this gives the same answer -- the business with making a circle and cutting it into a line is completely irrelevant. However, now we can modify the rules further to We have $$n+1$$ chairs arranged in a circle. Select six chairs at random. Now pick (still at random) one of the six chairs, remove it, unfold the rest to a line, and count the gap between the second and third selected chair.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9799765622193214, "lm_q1q2_score": 0.8442872561827529, "lm_q2_score": 0.8615382129861583, "openwebmath_perplexity": 340.9650205202172, "openwebmath_score": 0.728655219078064, "tags": null, "url": "https://math.stackexchange.com/questions/4079714/we-choose-5-numbers-from-1-to-100-we-order-them-by-value-what-is-the-exp" }
algorithms, complexity-theory, terminology, complexity-classes, approximation A fully polynomial time approximation scheme (FPTAS) for problem $X$ is an approximation scheme whose time complexity is polynomial in the input size and also polynomial in 1/$\epsilon$. Then the writer says: Hence, for a PTAS it would be acceptable to have a time complexity proportional to $|I|^{1/\epsilon}$ where $|I|$ is the input size;although this time complexity is exponential in $1/\epsilon$. An FPTAS cannot have a time complexity that grows exponentially in $1/\epsilon$ but a time complexity proportional to $|I|^8/\epsilon^3$ would be fine. With respect to worst case approximation, an FPTAS is the strongest possible result that we can derive for an NP-hard problem. Then he suggested the following figure to illustrates the relationships between the classes of problems: Here is my questions:
{ "domain": "cs.stackexchange", "id": 9872, "lm_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, terminology, complexity-classes, approximation", "url": null }
newtonian-mechanics, classical-mechanics, lagrangian-formalism, variational-principle, action Title: Does Newtonian $F=ma$ imply the least action principle in mechanics? I've learned that Newtonian mechanics and Lagrangian mechanics are equivalent, and Newtonian mechanics can be deduced from the least action principle. Could the least action principle $\min\int L(t,q,q')dt$ in mechanics be deduced from Newtonian $F=ma$? Sorry if the question sounds beginnerish You also need an expression for the Lagrangian, which in classical mechanics is $$ L = T - U$$ Where $T$ is the kinetic energy and $U$ is the potential energy. Provided that you can associate a potential $U$ to the force $\vec{F}$ such that $\vec{F} = - \vec{\nabla} U$ (such a force is said to be conservative), the principle of least action and Newton second's law are equivalent. The demonstration for a single particle in 1D ($T = m v_x^2 /2$, $F = -dU(x)/dx$) is actually a good exercise.
{ "domain": "physics.stackexchange", "id": 41623, "lm_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, classical-mechanics, lagrangian-formalism, variational-principle, action", "url": null }
electromagnetism, magnetic-fields, topology Title: Magnetic field loops do not knot or link The magnetic field is composed of closed loops (assuming there is no magnetic monopole). How does one prove any two magnetic loops do not knot to form a link? You don't. Take a set of short permanent magnets. Chain them together. Make a knot out of the chain, and connect the ends. Or form two chains. Make them into linked closed loops.
{ "domain": "physics.stackexchange", "id": 74348, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, magnetic-fields, topology", "url": null }
advertising. Let’s start with computer graphics, then touch on science, and return to mathematics. application of matrices in chemistry ppt, a program to find sum of two arrays in java, circulant and composite circulant matrices, application of electrical engeering in matrices ppt, applications of matrices in computer science engineering ppt, rf mems for satellites switches matrices pdf, variance covariance matrices ppt, import java.io. such as Economics, Engineering, Statistics and various other sciences. In video gaming industry, matrices … Google's extraordinary success as a search engine was due to their clever use of eigenvalues and eigenvectors. See our User Agreement and Privacy Policy. Matrices are used much more in daily life than people would have thought. Linear algebra and matrices. In addition to science, engineering and mathematics, linear algebra has extensive applications in the natural as well as the social sciences. Applications of Matrix Mathematics. They can also be
{ "domain": "bringingeuropecloser.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575188391107, "lm_q1q2_score": 0.8078481206639933, "lm_q2_score": 0.8221891392358015, "openwebmath_perplexity": 1605.0470169039208, "openwebmath_score": 0.2001257985830307, "tags": null, "url": "https://bringingeuropecloser.com/two-graves-jers/3a774d-applications-of-matrices-in-computer-science-engineering-ppt" }
python, beginner, calculator, finance 12: "Lucro parcelado 12x: {0}", 15: "Lucro parcelado 15x: {0}", 18: "Lucro parcelado 18x: {0}", 24: "Lucro parcelado 24x: {0}"}, "SectionSeparation": "\n", "Disclaimer": "AVISO: Lucro calculado usando as taxas atuais do MercadoPago (23/07/2018)" }
{ "domain": "codereview.stackexchange", "id": 31394, "lm_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, calculator, finance", "url": null }
homework-and-exercises, newtonian-mechanics, forces, kinematics, acceleration Title: Free fall into circular motion If I'm on a roller coaster free falling from height $h$ and then suddenly start going into horizontal motion with a radius $r$ of turn what is the $g$-force I experience? I worked out the equation like this but am not sure if it is correct: (1) instant velocity of free-fall $v=\sqrt{2 g h}$ (2) uniform circular motion acceleration $a = \frac{v^2}{r}$ (3) $g$-force $ gf = \frac{a}{g} = \frac{v^2}{g r}$ My doubts are:
{ "domain": "physics.stackexchange", "id": 23368, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, forces, kinematics, acceleration", "url": null }
gazebo, urdf, nxt, xacro and (try to) drive it around with: roslaunch nxt_teleop teleop_keyboard.launch If you need me to explain anything else on my code just ask! Thanks in advance, Miguel. Edit: I uploaded a video showing the problem, as you can see, the caster wheel sticks to the ground whenever it touches it. Edit: I tried changing the mu1 and mu2 parameters, the transmission, the continuous joint parameters... Nothing seems to change the problem of the wheel sticking to the ground as if it was glued down. Edit: I used my caster macro in another .urdf file (video, as you can see it spins correctly when I move around the robot, despite the bouncing.) with more satisfactory results, so it seems that the problem is not in the caster definition itself, but anywhere else. That leaves me even more confused and still without any clue about how to fix it.
{ "domain": "robotics.stackexchange", "id": 9906, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, urdf, nxt, xacro", "url": null }
c++, floating-point, numerical-methods /*----------------TRILINEAR------------------------ * y p6____________p7 ^ / | /| | / | / | | / | / | | p2___|_________p3 | | | | | | | | p4_________|__p5 | | / | / | | / | / | | / |/ | p0_____________p1 | |-------------------------> x / / / / / z/ p point that lie in the cuboid defined by the 8 values array v -------------------------------------------------*/
{ "domain": "codereview.stackexchange", "id": 35012, "lm_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++, floating-point, numerical-methods", "url": null }
java, algorithm, strings, interview-questions, hash-map Title: Detecting if two given strings are isomorphic using Java data structures So I have written the following code and it works for various same length isomorphic strings I have tried. However I am not sure what are some time complexity improvements and coding tweaks that could be applied to the code: /** * Created by mona on 5/26/16. */ import java.util.List; import java.util.Map; import java.util.ArrayList; import java.util.HashMap; import java.util.Collections; public class IsomorphicStrings { //the words "abca" and "zbxz" are isomorphic //aabc a(2) b(1) c(1) //zzbx z(2) b(1) x(1) //my algorithm //create a sorted hashmap on value //check to see if two hashmap are equal based on their value set //assuming two isomorphic strings are of the same length public static boolean areIsomorphic(String s1, String s2) { Map<Character, Integer> freqMap1 = new HashMap<>(); Map<Character, Integer> freqMap2 = new HashMap<>();
{ "domain": "codereview.stackexchange", "id": 20150, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, strings, interview-questions, hash-map", "url": null }