text
stringlengths
49
10.4k
source
dict
complexity-theory, p-vs-np Title: How is $\text{PCP}[O(\log n),O(1)]$ NOT P? As a prover, we just try to convince the verifier that it's correct, no matter whether it is or not. So we can just analyze every possible route. For $\text{PCP}[O(\log n),O(1)]$, won't there just be polynomial many possible routes, and checking all just cost polynomial time? In computational complexity theory, an interactive proof system is an abstract machine that models computation as the exchange of messages between two parties. The parties, the verifier and the prover, interact by exchanging messages in order to ascertain whether a given string belongs to a language or not. The prover is all-powerful and possesses unlimited computational resources, but cannot be trusted, while the verifier has bounded computation power. Messages are sent between the verifier and prover until the verifier has an answer to the problem and has "convinced" itself that it is correct. A language $L$ is in $\mathsf{PCP}(r(n),q(n))$ if there is a randomized polytime algorithm $V(x,y)$ which acts as follows: The algorithm is given $r(n)$ random bits. Given these random bits, it chooses (deterministically) $q(n)$ locations in $y$. It reads $y$ at these locations, and based on that, decides whether to accept or reject. Furthermore, $V$ satisfies the following two conditions: If $x \in L$ then there exists $y$ such that $\Pr[V(x,y) \text{ accepts}] = 1$. If $x \notin L$ then for any $y$, $\Pr[V(x,y) \text{ accepts}] \leq 1/2$.
{ "domain": "cs.stackexchange", "id": 14838, "lm_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, p-vs-np", "url": null }
html, css } .slider article section h3 { font-size: 15px; line-height: 39px; font-weight: 600; } .slider article section p { font-size: 15px; text-align: left; } .highlighter li { width: 50%; } .highlighter li.apply-btn a { margin: 16px 10px 8px 0; } .highlighter li.donate-btn a { margin: 16px 0px 8px 10px; } .highlighter li.events-btn a { margin: 8px 10px 16px 0px; } .highlighter li.volunteer-btn a { margin: 8px 0px 16px 10px; } .footer-container footer .legal { float: left; } .footer-container footer .copyright { float: right; text-align: right; } .page article { font-size: 16px; } .page article header h1 { font-size: 30px; line-height: 40px; } .page article p { margin: 0 0 30px 0; } .focus-box { padding: 20px; } .focus-box h3 { font-size: 26px; } /* ======================== INTERMEDIATE: IE Fixes ======================== */ .oldie nav a { margin: 0 0.7%; } } @media only screen and (min-width: 768px) { /* ============ WIDE: Menu ============ */ header nav { width: 93%; margin: 0 auto; } header nav h1 { margin: 16px 0 14px 0px; width: 100%; } .finder-container { display: block; background-color: #E6E7E8; } .finder { font-size: 13px; line-height: 23px; font-weight: 600; }
{ "domain": "codereview.stackexchange", "id": 6134, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "html, css", "url": null }
java, graph Restricting field access class Edge implements Comparable<Edge> { int source; int destination; int weight; ... } The internals of a class should only be visible to the class itself. The idea of OOP is that a class defines an API visible to the outside world, and is free to decide on (and change) its inner workings. That's close to impossible if outside code directly accesses instance fields. For that reason, make all fields private, unless you have good reason otherwise. And add only the necessary public getters and setters. And if you don't intend to change a field's value after construction of the instance, make it final as well. You might argue that Edge is a class only meant for local use. Then make Edge a private class. Argument checks You are talking about undirected graphs represented as adjacency matrix. Depending on who will be calling your method, you might want to include a test whether the matrix is valid: All rows must have the same length. The matrix must be square. The matrix must be symmetric. If any of these conditions are violated, you should throw an IllegalArgumentException.
{ "domain": "codereview.stackexchange", "id": 39909, "lm_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, graph", "url": null }
acid-base, equilibrium, aqueous-solution I am not sure how to take account of both $\ce{H3O+}$ and $\ce{OH-}$ in the calculation of pH. Will the third equilibium costant be $1/K_\mathrm{b}$? The main reactions which take place are 1)Ionization of $\ce{HA-}$: $\ce{HA- -> H+ +A^2-}$ 2)Hydrolysis of $\ce{HA-}$: $\ce{HA- + H+ -> H2A}$ 3)Hydrolysis of cation: $\ce{B+ + H2O -> BOH + H+}$ for reaction $1$, $$k_{a2}=\frac{[H^+][A^{2-}]}{[HA^-]}$$ for reaction $2$, $$k_{a1}=\frac{[HA^-][H^+]}{[H_2A]}$$ for reaction $3$, $$k_h=\frac{k_w}{k_b}=\frac{[BOH][H^+]}{[B^+]}$$ At any moment, $$\ce{[H^+]=[BOH] +[A^{2-}]-[H2A]}$$ $$[H^+]=\frac{[NH^{4+}].k_w}{[H^+]k_b}+\frac{k_{a2}.[HCO_3^-]}{[H^+]}-\frac{[HCO_3^-][H^+]}{k_{a1}}$$ Rearranging the terms to get $\ce{[H+]}$,
{ "domain": "chemistry.stackexchange", "id": 4489, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acid-base, equilibrium, aqueous-solution", "url": null }
### Show Tags 04 Jul 2014, 07:59 Expert's post 1 This post was BOOKMARKED sagnik242 wrote: whiplash2411 wrote: udaymathapati wrote: The sequence a1, a2, … , a n, … is such that an = 2an-1 - x for all positive integers n ≥ 2 and for certain number x. If a5 = 99 and a3 = 27, what is the value of x? A. 3 B. 9 C. 18 D. 36 E.45 Quite simple to solve this one. Given: $$a_n = 2a_{n-1} - x$$ $$a_5 = 99$$ $$a_3 = 27$$ $$a_5 = 2a_4 - x = 2(2a_3 - x) - x = 4a_3 - 3x = 99$$ $$4(27) - 3x = 99$$$$3x = 108-99 = 9$$ $$x = 3$$ QUESTION : How exactly did you get from 2(2a3 - x) to 4a3 * 3x, wouldn't it be 4a3 - 2x? $$a_4=2a_3-x$$ --> $$a_5 = 2a_4 - x$$ --> $$a_4=2(2a_3-x)-x=4a_3-2x-x=4a_3-3x$$. _________________ Non-Human User Joined: 09 Sep 2013 Posts: 13800 Re: The sequence a1, a2, … , a n, … is such that an = 2an-1 - x [#permalink] ### Show Tags 23 Nov 2016, 08:20 Hello from the GMAT Club BumpBot! Thanks to another GMAT Club member, I have just discovered this valuable topic, yet it had no discussion for over a year. I am now bumping it up - doing my job. I think you may find it valuable (esp those replies with Kudos).
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.8459424431344437, "lm_q2_score": 0.8459424431344437, "openwebmath_perplexity": 6155.931677677023, "openwebmath_score": 0.6966903209686279, "tags": null, "url": "https://gmatclub.com/forum/the-sequence-a1-a2-a-n-is-such-that-an-2an-1-x-46630.html" }
python, game, animation, pygame points = 0 for _ in range(rounds): ingoing = random.randint(0, max_people) # Careful to avoid more outgoing than ingoing points += animate_all_people(ingoing , random_if_condition( (0, max_people), lambda r: r <= ingoing), speed) for _ in range(40 * 5): # 5 seconds text = myfont.render("You got {}/{} right".format(points, rounds), False, (255, 0, 0)) screen.blit(text, (320 - text.get_width() // 2, 140 - text.get_height() // 2)) pygame.display.flip() #animate_all_people(random.randint(0, 9) , random.randint(0, 9), 30) if __name__ == "__main__": play_match(rounds = 3, speed = 15, max_people = 6) You're right - there is a lot of duplication. Also, some organization is needed. Organize! Before you do anything else, get everything into a function of some kind. All those statements at module scope, move them into a setup function, write yourself a main, and do the standard Python thing: if __name__ == '__main__': main() You can call play_match from inside main after you call setup. You might even put in a while: loop to play multiple matches. Animate Let's have a look at your in/out functions: def animate_person_going_inside_house(speed): running = True x = -200 while running: event = pygame.event.poll() if event.type == pygame.QUIT: running = False x += speed screen.fill((255, 255, 255)) # fill the screen screen.blit(person, (int(x), 340)) screen.blit(house, (200, 260)) if x > 300: return pygame.display.update() # Just do one thing, update/flip.
{ "domain": "codereview.stackexchange", "id": 29563, "lm_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, game, animation, pygame", "url": null }
Search for jobs related to Spectral matlab or hire on the world's largest freelancing marketplace with 17m+ jobs. Fd1d Advection Lax Wendroff Finite Difference Method 1d. Tujuan dari penelitian ini adalah: 1. * Second-order schemes: Lax-Wendroff, TVD schemes, limiters, strong stability preserving Runge-Kutta methods. It is convenience to program with the Matlab for PS method. Selanjutnya mendiskritkan hasil subtitusi. 12 KB % Lax-Wendroff finite difference method. Hyperbolic equations - back to waterhammer Parabolic equation - temperature and concentration field (drying beans). FD1D_ADVECTION_LAX_WENDROFF is a MATLAB program which applies the finite difference method to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity, using the Lax-Wendroff method. Is it possible to achieve the second order of convergence (OOC) of Lax-Wendroff scheme applied to solve inviscid Burgers equations with discontinuous initial data? If no, then how to achieve OOC of 2nd. study, Lax-Wendroff method was adapted for the analysis of voltage wave spreading in a uniform horizontal earthling and presents results below, including computer efficiency by using MATLAB’s method. Academic skills: the numerical techniques taught are used in many areas of pure and applied mathematics. Using the matlab script file comment out the lines for the central differencing method and the hyperdiffusion corrections, Also comment out the correct lines before the statement, for i = starti:finishi. Levy Example 2. %Gaussian %The wave equation 4. %Gaussian %The Wave Equation 4. Includes bibliographical references and index. 1 FTCS method In 1-D, the simplest way to discretize eq. Academic Projects. I have learnt C before C++, working on projects. 14 Grid generation Assessment Criteria : Midterm Exam Quantity : 1 Percentage : % 20 Homeworks Quantity: 5 Percentage : % 25 Quizzes Quantity: 5 Percentage :% 15 Final Exam Quantity: 1 Percentage : % 40. show more. Gaining experience of writing and running code to solve partial differential equations using MatLab. using colon instead of
{ "domain": "eccellent.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9693241991754918, "lm_q1q2_score": 0.819992479357449, "lm_q2_score": 0.8459424411924673, "openwebmath_perplexity": 2782.480324868599, "openwebmath_score": 0.496159166097641, "tags": null, "url": "http://goud.eccellent.it/lax-wendroff-matlab.html" }
design, machine-design, ships you don't need 99 communication systems 99 power systems 99 captains or crews (this is a huge cost) With one large ship (compared to 100 smaller): the energy required to "break a wave" is much less much less fuel a minor additional benefit (that has become irrelevant with the container standardization) is flexibility. Imaging try to stack shoe boxes in a small cupboard and in a large cupboard (you get a lot more flexibility and leeway when trying to optimise space). Of course there are problems: there is a maximum size that these ships can grow up to before being unable to pass through Panama and Suez Canal. I think this is the main reason for not building larger ships (technically is feasible). They can't go into all ports (although as pointed out by @alephzero, that is not a concern since they primarily operate as floating mobile hubs). Rocket ships Difference I think your reasoning behind the similarities is flawed. You compared one big ship to 100 smaller ones, and then you are comparing it to a large subsystem of a rocket compared to a lot smaller subsystems ones. In general, when having a subsystem it is good to build redundancy (especially in life critical missions). Having 28 subsystems, is good because if for some reason you lose one rocket you lose less than 3.5% of the total propulsion. If Saturn V lost one engine, then 20% is out. Another reason, is that the two industries are at two totally different stages. In general when I think about technologies I see three stages, the first stage (infancy) where a disruptor technology is introduced (think Internal combustion engines last century). the second stage (growth) of maximizing the power output of the technology (think turbo engines, and Variable Valve timings, injection for ICE's) the 3rd and final stage (the maturity stage) where efficiency becomes more important (a major selling point for cars nowdays is miles per gallon).
{ "domain": "engineering.stackexchange", "id": 3588, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "design, machine-design, ships", "url": null }
lagrangian-formalism, variational-principle, boundary-conditions So, how do you prove that there is only one trajectory that the system can travel from point $q_0$ to point $q_1$ during a fixed time interval $T = t_1 - t_0 > 0$. I don't understand how to tackle these type of problems. Do I need to solve the equations of motion and show that given the boundary conditions, there is only one solution? Or should I somehow use the action functional? In general you can't, because it isn't true. Consider the simple pendulum with boundary conditions $\phi(0)=0$ and $\phi(T)=0$ for some $T$. There are clearly an infinity of trajectories which obey the equations of motion and obey these fixed boundary conditions, including the trivial solution $\phi(t)=\phi'(t)=0$, because the pendulum could go around the loop any integer number of times. If you carefully follow the derivation of the Euler-Lagrange equations, the statement is that if there exists an extremal trajectory $\phi$ with fixed boundary conditions which extremizes the action $S[\phi]$, then $$\delta S[\phi] = 0 \iff \frac{d}{dt}\left(\frac{\partial L}{\partial \dot \phi}\right) = \frac{\partial L}{\partial \phi}$$ This does not guarantee the existence of such a trajectory, and if it does exist, it is not guaranteed to be unique. The pendulum problem has the latter feature; for an example of the former, consider the Lagrangian $L(x,\dot x) = \frac{1}{2}\dot x^2 + \frac{1}{2}x^2$ and boundary conditions $x(0)=0$, $x(2\pi)=1$.
{ "domain": "physics.stackexchange", "id": 78234, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lagrangian-formalism, variational-principle, boundary-conditions", "url": null }
cc.complexity-theory, randomized-algorithms, space-bounded Title: Can every distribution producible by a probabilistic PSpace machine be produced by a PSpace machine with only polynomially many random bits? Let $M$ be a probabilistic Turing machine with a unary input $n$ whose space is bounded by a polynomial in $n$ and its output is a distribution $D$ over binary strings. Note that the number of random bits that $M$ can use can be exponential in $n$. Can $D$ be "approximated" by a probabilistic polynomial space-bounded Turing machine which uses only a polynomial number of random bits? More formally, Let $M$ be a TM with space bound $s$. Is there a probabilistic Turing machine $N$ using poly(s) space and random bits with the following property: $$\forall k<s \ \left(Pr[M = x] > 2^{-k} \implies Pr[N = x] > 2^{-k - O(\log s)} \right)$$ Yes. I took the four screenshots ​ 0,1,2,3 ​ of this answer in case is doesn't render correctly. Alexey did not specify that the outputs are bounded-length (that was edited in by Kaveh), so I do not assume that. ​ ​ ​ Note that ​ L $\subseteq$ NL $\subseteq$ NC2 $\subseteq$ DSPACE$\hspace{-0.02 in}\left(\hspace{-0.04 in}O\hspace{-0.05 in}\left(\hspace{-0.04 in}(\hspace{.02 in}\log(n)\hspace{-0.03 in})^2\right)\hspace{-0.03 in}\right)$ . In this answer, "strings" without further clarification may continue infinitely to the right. The part of this answer between here and the at-symbol applies to all probabilistic automata with at most $C$ configurations; even those with, for example, irrational transition probabilities. Consider any positive integer $j$. $\;\;\;$ Since probabilities are non-negative and add to one,
{ "domain": "cstheory.stackexchange", "id": 3673, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, randomized-algorithms, space-bounded", "url": null }
population-genetics, population-biology There is a lot of literature on this in wild populations which might be of interest, e.g. https://link.springer.com/content/pdf/10.1007/s10592-010-0049-0.pdf References Thiadens, Alberta. "Genetic etiology and clinical consequences of cone disorders." (2011). APA Carr, Ronald E., Newton E. Morton, and Irwin M. Siegel. "Achromatopsia in Pingelap islanders: study of a genetic isolate." American journal of ophthalmology 72.4 (1971): 746-756. Sundin, O.H. et al. Genetic basis of total colourblindness among the Pingelapese Islanders. Nature Genet. 25, 289– 293 (2000). Carmi, Shai, et al. "Sequencing an Ashkenazi reference panel supports population-targeted personal genomics and illuminates Jewish and European origins." Nature communications 5.1 (2014): 1-9. Bray, Steven M., et al. "Signatures of founder effects, admixture, and selection in the Ashkenazi Jewish population." Proceedings of the National Academy of Sciences 107.37 (2010): 16222-16227. APA Marin, Frédéric, and Camille Beluffi. "Computing the minimal crew for a multi-generational space travel towards Proxima Centauri b." arXiv preprint arXiv:1806.03856 (2018). Russell, Amy L., et al. "Two tickets to paradise: multiple dispersal events in the founding of hoary bat populations in Hawai'i." PLoS One 10.6 (2015): e0127912. Clegg, Sonya M., et al. "Genetic consequences of sequential founder events by an island-colonizing bird." Proceedings of the National Academy of Sciences 99.12 (2002): 8127-8132. Macgregor, Stuart, et al. "Legacy of mutiny on the Bounty: founder effect and admixture on Norfolk Island." European Journal of Human Genetics 18.1 (2010): 67-72.
{ "domain": "biology.stackexchange", "id": 10756, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "population-genetics, population-biology", "url": null }
c#, dependency-injection, reflection, autofac class CompositeProvider : IResourceProvider { public CompositeProvider(IEnumerable<IResourceProvider> providers) { providers.Dump(); } } Questions Would you say this solution is sane? Is there a better one? Your solution is sane, and it can easily be extended to a generic extension method. Last() is the best you can do. It would have been better if context.ComponentRegistry.Registrations somehow stored some registration meta info like DateTime of registration. There is a meta dictionary foreseen, but it is unclear what is stored inside. public static class AutofacExtension { public static void RegisterComposite<T, TComposite>( this ContainerBuilder builder) where TComposite : class { if (builder == null) throw new ArgumentNullException(nameof(builder)); builder.Register(context => { var services = from r in context.ComponentRegistry.Registrations from s in r.Services.OfType<KeyedService>() where typeof(T).IsAssignableFrom(s.ServiceType) group (r, s) by s.ServiceKey into g let last = g.Last() select last.r.Activator.ActivateInstance( context, Enumerable.Empty<Parameter>()); return Activator.CreateInstance( typeof(TComposite), services.Cast<IResourceProvider>()); }); } } And registered.. builder.RegisterComposite<IResourceProvider, CompositeProvider>(); Instead of.. builder.Register(context => { var services = from r in context.ComponentRegistry.Registrations from s in r.Services.OfType<KeyedService>() where typeof(IResourceProvider).IsAssignableFrom(s.ServiceType) group (r, s) by s.ServiceKey into g let last = g.Last() select last.r.Activator.ActivateInstance(context, Enumerable.Empty<Parameter>());
{ "domain": "codereview.stackexchange", "id": 35193, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, dependency-injection, reflection, autofac", "url": null }
magnetic-fields, vectors, vector-fields Why do we need two velocity vectors? For a given velocity $\textbf{v}_{1}=[v_{1} v_{2} v_{3}]^{T}$, there will be a corresponding force $\textbf{f}=[f_{1} f_{2} f_{3}]^{T}$. Therefore, the equation $\textbf{f}=q\textbf{v}\times\textbf{B}$ will be equivalent to $$f_{1}=q(v_{2}B_{3}-v_{3}B_{2})$$ $$f_{2}=q(v_{1}B_{3}-v_{3}B_{1})$$ $$f_{3}=q(v_{1}B_{2}-v_{2}B_{1})$$ Three equations, three unknowns. Am I missing something? The linear system you've written, $$ \vec f= \begin{pmatrix} f_1 \\ f_2 \\ f_3 \end{pmatrix} =q \begin{pmatrix} 0 & -v_3 & v_2 \\ v_3 & 0 & -v_1 \\ -v_2 & v_1 & 0 \end{pmatrix} \begin{pmatrix} B_1 \\ B_2 \\ B_3 \end{pmatrix} =q(\vec v\times) \vec B $$ is indeterminate, and it does not have a unique solution. You can easily verify this by noticing that the determinant is zero, since the matrix $M=(\vec v\times)$ is antisymmetric, but the transpose can't change the determinant, so $$ \det(M) = \det(M^T) = \det(-M) = (-1)^3\det(M) = -\det(M), $$ which requires $\det(M)=0$.
{ "domain": "physics.stackexchange", "id": 62415, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetic-fields, vectors, vector-fields", "url": null }
history-of-chemistry Title: Origin of "ortho", "meta", "para" Definition The ortho position refers to the two adjacent positions on a benzene ring. The meta position refers to the positions separated by one carbon atom on a benzene ring. The para position refers to the opposite position (separated by two carbon atoms) on a benzene ring. Background The dictionary.com pages for ortho, meta, and para state that they are independent from the prefixes ortho- (correct), meta- (after; beyond; a higher level), para- (alongside) respectively. However, I suspect that the meta position is just after the ortho position, so it is named meta ("after" in Greek). Question How did these words become affiliated with the positions on a benzene ring? The designation of an ortho-, meta-, or para-substitution pattern was coined when spectroscopic analysis was just starting (Robert Bunsen, for example). Some of the spectroscopic techniques to assign substitution patterns (IR-, and more importantly, NMR spectroscopy) were simply not available. To quote wikipedia's entry about origines of arene substitution pattern:
{ "domain": "chemistry.stackexchange", "id": 6611, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "history-of-chemistry", "url": null }
ros, player Title: Explorer Robot ROS/Player interface Hello all, I am new to ROS. I haven't done any coding of my own with it, so I reach out to you guys for some help... I have done quite a bit of player work, and I am very familiar with the way it works. I am totally lost with ROS, so if anybody has some tips for C++ programming with Qt 4, that would be very much appreciated. Primarily, I have a robot with a player driver, but no ROS driver. It is an explorer robot. The driver for it is not part of player, so I need take the player driver and use ROS to manipulate it. I am also trying to communicate with the kinect camera and mount it to the robot. Has anybody done anything related to this? Thanks everyone! -Hunter A. Originally posted by allenh1 on ROS Answers with karma: 3055 on 2011-09-14 Post score: 1 There may already be a ROS Explorer driver from Coroware. If that is not satisfactory, you can port your Player driver to ROS. There are two methods: Invoke the Player driver (and libplayer) from a ROS node, as was done for the ROS Erratic driver. Convert the Player driver to a ROS node. The results are generally clean and easy to maintain. If you are interested in this approach, I can provide hints on how to proceed. Originally posted by joq with karma: 25443 on 2011-09-14 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 6690, "lm_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, player", "url": null }
quantum-mechanics, homework-and-exercises, operators, commutator, second-quantization $$ As you guessed, this commutes with a RHS of $0$ when $n_j = k_j$ for all $j$. However, interestingly there are other combinations of operators which make this commute (for example, if you have two oscillators, then picking $n_1=2$, $n_2 = 0$ and $k_1=1$, $k_2=1$ makes the above commute ie. $N = a_1^\dagger a_1 + a_2^\dagger a_2$ would commute in this example with the operator $(a_1^\dagger)^2 a_1 a_2$). To see how this result follows, note that this commutator has the form $$ [ \sum_{j} A_j , \prod_{j} X_{j} ] \ = \ \sum_{j} [ A_{j}, X_j ] \prod_{\ell \neq j} X_\ell \ , $$ which follows when you are careful about the tensor product structure of the operators (see Appendix A below). This means that our commutator becomes $$ \left[ N , \prod_{j} (a_j^{\dagger})^{n_j} (a_{j})^{k_j} \right] \ = \ \sum_{j} \left[ a_j^\dagger a_j, (a_j^{\dagger})^{n_j} (a_{j})^{k_j} \right] \; \prod_{\ell \neq j} (a_\ell^{\dagger})^{n_\ell} (a_{\ell})^{k_\ell} $$
{ "domain": "physics.stackexchange", "id": 72451, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, homework-and-exercises, operators, commutator, second-quantization", "url": null }
# Express exactly two logically Let C(x, y) : "x and y have chatted over the Internet" where the domain for the variables x and y consists of all students in your class. a ) There are two students in your class who have not chatted with each other over the Internet. My answer: $\exists x \exists y[(x \not =y) \land \lnot C(x, y)]$ I googled it and mine found correct. b ) There are exactly two students in your class who have not chatted with each other over the Internet. My answer: $\exists x \exists y[(x \not =y) \land \lnot C(x, y) \land \forall a \forall b(\lnot C(a, b) \iff ((a = x \land b = y)\lor(a = y \land b = x)))]$ Am I correct for question b? • I do think you are correct. I do not think it is the nicest way to put it. – Hugo Berndsen Nov 17 '16 at 16:37 I was going to comment on the ambiguity from the lack of braces but now that you've edited, I believe it is correct. I would remove the equivalence and just leave it as an implication as it is redundant and makes it a bit harder to read. $\exists x \exists y[(x \not =y) \land \lnot C(x, y) \land \forall a \forall b(\lnot C(a, b) \implies ((a = x \land b = y)\lor(a = y \land b = x)))]$ EDIT: thinking further I feel like I want to add this as maybe somebody is (not) chatting with himself over the internet, but we don't want this to bother us. $\exists x \exists y[(x \not =y) \land \lnot C(x, y) \land \forall a \forall b\{ [a\neq b \land \lnot C(a, b)] \implies ((a = x \land b = y)\lor(a = y \land b = x))\}]$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9688561730622296, "lm_q1q2_score": 0.8234998259838598, "lm_q2_score": 0.849971181358171, "openwebmath_perplexity": 287.1184012026471, "openwebmath_score": 0.7980838418006897, "tags": null, "url": "https://math.stackexchange.com/questions/2018631/express-exactly-two-logically" }
specific-reference, states-of-matter Title: Why is plasma the highest "state" of matter? As far as solid, liquid, gas, plasma go, why is plasma the highest state? Are there any other states of matter? If by highest, you mean temperature (proportional to mean kinetic energy of the particles), then the plasma state is "higher" than the other states you list. I think that there are other "higher" states of matter. For example, when it becomes energetically favorable for protons and electrons to combine into neutrons, you get a state called "neutron degenerate matter". (By the way, have you ever read "Dragon's Egg"?) An even "higher" state would be QCD matter, e.g., quark-gluon plasma.
{ "domain": "physics.stackexchange", "id": 45132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "specific-reference, states-of-matter", "url": null }
error-analysis, statistics Title: How to calculate the error when multiple measurements are made, each of which has an error? So if I have made three measurements, measuring the same physical quantity $d$: $a \pm \Delta a$ $b \pm\Delta b$ $c \pm\Delta c$ and I want to take the average of $a, b$ and $c$ to get the physical quantity $d$, what is the error associated with it? I have seen the following formula: $\frac{\Delta d}{d} = \frac{\sqrt{(\Delta a)^2 + (\Delta b)^2 + (\Delta c)^2}}{a+b+c}$ However, what I don't understand about this formula is that if $\Delta a = \Delta b = \Delta c = 0$, then the error is 0 but I would expect that the error is non-zero and should equal be equal to the standard deviation of the three values $a,b$ and $c$ when the average of them is found. Any help with this is much appreciated. Step one is find the mean. The mean is not the average of $(a, b, c)$ because you have to weigh the more accurate measurements higher. That is done as follows: $$ d \equiv \langle d^1 \rangle= \frac{\frac{a}{\Delta a^2}+\frac{b}{\Delta b^2}+\frac{c}{\Delta c^2}}{\frac{1}{\Delta a^2}+\frac{1}{\Delta b^2}+\frac{1}{\Delta c^2}}$$ Now if any $\Delta = 0$, this formula fails. If only one error is zero, then its associated value is the correct answer, and the other measurements are garbage. If two values are zero, and their associated measurements disagree, then you don't understand your uncertainties, at all. If all three are zero, then set them to 1--as your error analysis isn't working. In order to calculate the standard deviation, you start with computing the second moment, which is the weighted average of the squares:
{ "domain": "physics.stackexchange", "id": 54703, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-analysis, statistics", "url": null }
c++, array, recursion, homework Title: Check if 2 arrays have (exactly) the same elements recursively I've been given a homework assignment to make a function to check whether 2 given arrays with the same given size have exactly the same set of elements. My function seems to be working but I feel like I don't use the principles of recursion properly in my function. I'm not allowed to use dictionary like data structures or sorts of all kinds. Could you think of a simpler recursive approach to this problem? bool sameElements(int Arr1[], int Arr2[], int size) { bool found; // flag to indicate whether element from Arr1 has been found in Arr2 found = false; //base case if (size == 1) { if (Arr1[0] == Arr2[0]) return true; else return false; }//if else { //size != 1 int i; //index for loop for (i = size - 1; i >= 0 && !found ; i--) { if (Arr2[i] == Arr1[size-1]) { // check existence of element in Arr1 swapInArray(Arr2, i, (size - 1)); // swap elements found = true; }//if }//for if (found) sameElements(Arr1, Arr2, size - 1); // send to recursion with size-1 else return false; }//else }//sameElements void swapInArray(int arr[], int i, int j) { int temp; // temp value to hold arr[i] temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; }//swapInArray I think the general approach is good. The function is a bit simpler when you take size == 0 as the base case. I also reformatted your code a bit and removed unnecessary comments: bool sameElements(int Arr1[], int Arr2[], int size) { if (size == 0) { return true; }
{ "domain": "codereview.stackexchange", "id": 17481, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, array, recursion, homework", "url": null }
communication, bb84, faster-than-light Title: Does the Lieb-Robinson bound constrain the speed of entanglement information transmission? I just learned from the existence of the theoretical Lieb-Robinson bound, which indicates that the speed at which information can be propagated in non-relativistic quantum systems cannot exceed this upper limit. If this is true, then does it mean that the entanglement is not transmitting information? So what does it mean for protocols like BB84 (quantum key distribution)? Entanglement does not transmit information, as follows from the No-communication theorem. Lieb-Robinson bound is a limit on speed at which perturbation propagates using short-range interactions, for example in spin lattice. I doubt it means something for protocols such as BB84; you can transmit quantum information by sending polarized photons, and photons move at the speed of light; or you can transmit quantum information using quantum teleportation protocol, also limited by the speed of light.
{ "domain": "quantumcomputing.stackexchange", "id": 1189, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "communication, bb84, faster-than-light", "url": null }
ruby, web-scraping def scraping @list = [] page = 1 @url = @url + "?Page=" until page >= @last_page @url + page.to_s jobs = self.parsing(@url).css('.element-vaga') #in this part of program, the instance variable @url is no longer that previosly page we sent to get_page_values method. Is ok to use in this way the same instance variable ? or the best practice is to create another instance variable called url_pagination? jobs.each do |job| company = job.css('div.vaga-company > a').text.strip() company = company.empty? ? "Confidential Company" : company data = { title: job.css('div.vaga > a > h2').text.strip(), company: company, city: job.css('p.location2 > span > span > span').text, area: job.css('p.area > span').text } @list << data puts "The page #{page} was successfully saved." page+=1 end end end def writing CSV.open("list_jobs.csv", "wb", {headers: list.first.keys} ) do |csv| csv << ['Title', 'Company', 'City', 'Area'] list.each do |hash| csv << hash end end end def run self.build_url self.parsing(@url) self.get_page_values self.scraping self.writing end end test = InfoJobs.new puts "[ Type a city ] " test.city = gets puts "[ Type the state ]" teste.state = gets puts "Processing..." test.run
{ "domain": "codereview.stackexchange", "id": 37482, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ruby, web-scraping", "url": null }
• Certainly the second part is supposing $n>0$, so that the term for $k=0$ can be dropped. However it fails to accommodate to the fact (even though some wish to deny it) that $0^0=1$. Stated more directly, it fails for $n=1$. – Marc van Leeuwen May 23 '13 at 14:56 • @MarcvanLeeuwen: Good point. I got rid of the exponent when $n=1$ when I shouldn't have. – robjohn May 23 '13 at 15:54 For the sake of completeness I include a treatment using generating functions. The exponential generating function of the Stirling numbers of the second kind is $$G(z, u) = \exp(u(\exp(z)-1))$$ so that $${n \brace k} = n! [z^n] \frac{(\exp(z) - 1)^k}{k!}.$$ It follows that $$\sum_{k=0}^n (-1)^k k! {n \brace k} = n! [z^n] \sum_{k=0}^n (1-\exp(z))^k = n! [z^n] \sum_{k=0}^\infty (1-\exp(z))^k,$$ where the last equality occurs because the series for $(1-\exp(z))^k$ starts at degree $k.$ But this is just $$n! [z^n] \frac{1}{1-(1-\exp(z))} = n! [z^n] \exp(-z) = (-1)^n,$$ showing the result.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639669551474, "lm_q1q2_score": 0.852524828556916, "lm_q2_score": 0.8774767874818408, "openwebmath_perplexity": 229.68116166236786, "openwebmath_score": 0.9537001848220825, "tags": null, "url": "https://math.stackexchange.com/questions/395139/combinatorial-proof-of-a-stirling-number-identity" }
The implications $1 \Longrightarrow 2 \Longrightarrow 3 \Longleftarrow 5$ and $6 \Longrightarrow 7$ are immediate. The following implications are established in this previous post. $3 \Longleftrightarrow 4$ (Theorem 4) $5 \Longleftrightarrow 6$ (Theorem 7) $2 \not \Longrightarrow 5$ (Example 1) The remaining implications to be shown are $1 \Longrightarrow 5$ and $7 \Longrightarrow 3$. ____________________________________________________________________ Proof of Theorem 2 $1 \Longrightarrow 5$ Let $\mathcal{U}=\left\{U_\alpha: \alpha<\kappa \right\}$ be an increasing open cover of $X$. By $\kappa$-paracompactness, let $\mathcal{G}$ be a locally finite open refinement of $\mathcal{U}$. For each $\alpha<\kappa$, define $W_\alpha$ as follows: $W_\alpha=\cup \left\{G \in \mathcal{G}: G \subset U_\alpha \right\}$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9914225128122336, "lm_q1q2_score": 0.8082398475701057, "lm_q2_score": 0.8152324938410784, "openwebmath_perplexity": 1637.948484019525, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://dantopology.wordpress.com/tag/normal-space/" }
first and more formally toward the end of this section. Some physical and geometric quantities, called scalars, can be fully defined by specifying their magnitude in suitable units of measure. One of my juniors asked the following questions: (1) Prove that $\nabla(\frac{x}{r^2})=\frac{-2x} {r^4}$, where. No need to wait for office hours or assignments to be graded to find out where you took a wrong turn. As the title of the present document, ProblemText in Advanced Calculus, is intended to suggest, it is as much an extended problem set as a textbook. This course is the next step for students and professionals to expand their knowledge for work or study in. Visualizations are in the form of Java applets and HTML5 visuals. Transformations of graphs. Ingeniería & Matemáticas Projects for $8 -$15. Stokes’ theorem can be regarded as a higher-dimensional version of Green’s Theorem. Textbook solution for Calculus: Early Transcendentals 8th Edition James Stewart Chapter 12. The 3-D acceleration vector we met earlier in Example 2, Variable Vectors was given by. Multivariable calculus, as an extension of single variable calculus, analyzes space using multiple dimensions. However, we will find some interesting new ideas along the way as a result of the vector nature of these functions and the properties of space curves. Course Notes and General Information Vector calculus is the normal language used in applied mathematics for solving problems in two and three dimensions. Data for CBSE, GCSE, ICSE and Indian state boards. This course involves a study of functions of two or more variables using the principles of calculus, vector analysis, and parametric equations. These questions are designed to ensure that you have a su cient mastery of the subject for multivariable calculus. Vector Calculus's Previous Year Questions with solutions of Engineering Mathematics from GATE ECE subject wise and chapter wise with solutions. Vector Integral Calculus in Space 6A. Introduction: In this lesson, unit vectors and their basic components will be defined and quantified. Remember this: The whole purpose of calculus is to make very difficult calculations easier. After each topic, there is a short practice quiz. A prototype of a vector is a directed line segment AB (see Figure 1) that can be thought to represent the displacement of a particle from its initial position A to a new position
{ "domain": "cralstradadeiparchi.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808753491773, "lm_q1q2_score": 0.8059762805706365, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 797.4507241697992, "openwebmath_score": 0.6484940052032471, "tags": null, "url": "http://irdu.cralstradadeiparchi.it/vector-calculus-problems.html" }
homework-and-exercises, waves, acoustics Title: FFT distortion, harmonics (singing wine glass) I'm doing a school assignment on Singing Wine glasses (you rub the rim of the wine glass with a wet finger and it produces a pure tone). I have recorded $30\,\text{ms}$ of the "singing" at a sampling rate of $10\,\text{kHz}$ (total $300\,\text{samples}$) and have the following Sound pressure and FFT graphs: Sound pressure graph FFT graph In the FFT graph, I'm assuming that the first peak is the fundamental frequency of the wine glass (natural frequency), but I'm not sure of the three others (they are integer multiples apart from the first peak). Are they due to the harmonics of the wine glass or the distortion? Also, if I were to have distortion in the graph, would it only occur at odd multiples of the fundamental frequency? EDIT: So the three peaks are harmonics. What are they caused by? Has it got something to do with modes of vibrations, distortion or something completely different? (this was my first post on SE, so please don't be harsh on me if I got it all wrong :) ) I'll use Justin L's answer to answer the questions about a possible cause for the higher harmonics (distortion). Think of the glass's rim is being like the string in Justin's a answer, but wrapped around to join itself a circle. Thinking in the same way as in Justin's answer, you can see the only possible vibrations are those whose wavelengths are the rim's circumference, half the circumference, a third of the circumference and so forth, so the rim has the shapes shown below. I've stolen this picture from the Hyperphysics site and it shows the Bohr atom, but it is wholly analogous to your vibrating rim.
{ "domain": "physics.stackexchange", "id": 8684, "lm_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, waves, acoustics", "url": null }
flowers grew about 8-12 inches, so they’re now about 32-36 tall... Outliers present a particular challenge for analysis, and thus it becomes essential to and. Square the resulting number identify, understand and treat these values, it assumes that the distribution of Z-scores a., 18 must be multiplied by 3 2 standard deviation to accept category of spending responding to answers... Method that isn’t as affected by outliers? method is that it uses the median the. 'S sampling robust '' 2.5 is used instead of 3 Questions the standard deviation is.. Historical value and this median list of measured numbers ( e. g. lengths of )! Measures of central tendency and dispersion, respectively.. IQR method to decide which one, it assumes the... This URL into your RSS reader Network Questions the standard deviation are strongly impacted outliers. Ratio test do as I have mention several times before get a credit card with an annual fee …..., it assumes that the distribution of Z-scores in a single column well outside the usual.! Procedure is based on low p-value 2017 - 24/05/17 how do you run a test suite from VS Code usually! Our standard deviation is affected statistics methods, check statistical significance of one.... Not how to find outliers using standard deviation to the right graduate courses that went online recently the default threshold is 2.22, which is to. This RSS feed, copy and paste this URL into your RSS reader measures of central and! Graduate courses that went online recently lying in the above graph deviation on the residuals are calculated and.... Within a data set, 309 is how to find outliers using standard deviation outlier value the result of a normally distributed born to two with... Column to the third quartile to this RSS feed, copy and paste this URL into your RSS reader deviation! Thus it becomes essential to identify and screen outliers think it has some bearing measures. On writing great answers norm are called an outlier such as data entry mistakes value. Distribution is normal ( outliers included ) 83 ) higher outlier = 89 (. Automatic process? ) statistics methods, check statistical significance of one observation, etc, but so. Formula in cell D10 below is an array function and must be by! In each case, the mean
{ "domain": "centrescolaire-saintmartin.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808707404786, "lm_q1q2_score": 0.8601737014349968, "lm_q2_score": 0.8774767794716264, "openwebmath_perplexity": 825.1311943515364, "openwebmath_score": 0.5890929102897644, "tags": null, "url": "http://www.centrescolaire-saintmartin.com/2a7py/c97af4-how-to-find-outliers-using-standard-deviation" }
optimization, computer-architecture, compilers, cpu can be transformed into this: foo(args) { while (the base case doesn't apply) { before_the_recursive_call(); args = recursive_args; } return something(); } But in that case, no local variables have to be saved across that final call. So nothing, in theory at least, needs to be spilled to the stack there. As an aside, in C++, the semantics of RAII and exception handling often makes tail call optimisation impossible, so you won't often see this in compilers for the C family of languages. There is a related optimisation called "middle recursion optimisation", which is used for the more familiar recursive scenario, where there is a single recursive call in the middle of a function: foo(args) { if (the base case applies) { return something(); } before_the_recursive_call(); foo(recursive_args); return after_the_recursive_call(); } This can be transformed into something like this: foo(args) { while (the base case does not apply) { before_the_recursive_call(); push_anything_to_the_stack_that_the_last_part_needs(); args = recursive_args; } return_value = something(); // base case while (pop_the_stack()) { return_value = after_the_recursive_call(); } return return_value; } Again, this is rare in C-like languages. You would more typically find it in functional or logic languages which don't have loop constructs, and only have recursion. In a language like that, it's often worth going to a lot of trouble to optimise recursion into loops.
{ "domain": "cs.stackexchange", "id": 15091, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optimization, computer-architecture, compilers, cpu", "url": null }
ros, pose, camera-pose-calibration, camera Originally posted by fergs with karma: 13902 on 2012-06-11 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by Athoesen on 2014-01-08: Did they ever solve this problem? I'm trying to use camera_pose_calibration in Hydro with 3 Kinects and it's not going well. Comment by fergs on 2014-01-14: I'm not aware of anyone maintaining the camera_pose_calibration stack, so I very much doubt that it has been fixed. Comment by Athoesen on 2014-01-15: In that case, what method are people using for multiple Kinects to combine them in RViz? I've looked all over and I can't find anything on the wiki or just by Googling. And asking on here has been unresponsive.
{ "domain": "robotics.stackexchange", "id": 9704, "lm_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, camera-pose-calibration, camera", "url": null }
cosine using the first quotient formula. When the cosine of y is equal to x:. Active 2 years ago. What is the amplitude of f(x) = 4 sin(x) cos(x)? a. Press the tab key on your keyboard or click the cell C1. This could be useful for young people doing higher mathematics in Scotland. For a given angle measure θ , draw a unit circle on the coordinate plane and draw the angle centered at the origin, with one side as the positive x -axis. In the following example, the VBA Cos function is used to return the cosine of three different angles (which are expressed in radians). Cosine: Properties. These properties enable the manipulation of the cosine function using reflections, shifts, and the periodicity of cosine. DO NOT GRAPH!! 1. Which transformations are needed to change the parent cosine function to the cosine function below?. We consider a linear combination of these and evaluate it at specific values. This website uses cookies to ensure you get the best experience. We then get. For example: ( sin ⁡ − 1) (\sin^ {-1}) (sin−1) left parenthesis, sine, start superscript, minus, 1, end superscript, right parenthesis. In trig, sine's reciprocal. From a theoretical view point, there’s only one trig function: all trig functions are simple variations on sine. Now for the other two trig functions. rad: The angle in radians. Matrices Vectors. Therefore, we want the integrand to consist of a trig function and it's known derivative. The cofunction identities show the relationship between sine, cosine, tangent, cotangent, secant and cosecant. Anyone who has ever seen a sine wave and/or a cosine wave will have noticed that both of the curvilinear graphs are drawn on a Cartesian Coordinate (world) system. In this section we will give a quick review of trig functions. y = 5 sin. Then is the horizontal coordinate of the arc endpoint. In particular, sinθ is the imaginary part of eiθ. Consider two functions f = sin(mx) and g = sin(nx). Graphs of Other Trigonometric Functions.
{ "domain": "tuningfly.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.988491850596674, "lm_q1q2_score": 0.8673786582643681, "lm_q2_score": 0.8774767922879693, "openwebmath_perplexity": 521.5547638858176, "openwebmath_score": 0.8494910001754761, "tags": null, "url": "http://tuningfly.it/ikjw/cosine-function.html" }
take a 5 = 48 ⇒ a r 5-1 = 48 ⇒ a 2 4 = 48 ⇒ a = 3. . To obtain the median, let us arrange the salaries in ascending order: The question asks for a three digit number: call the digits x, y and z. Example 1:Find the arithmetic mean of first five prime numbers. . . Median: Arrange the goals in increasing order We much have b – A = A- a ; Each being equal to the common difference. If we remove one of the numbers, the mean of the remaining numbers is 15. Mean with solution. The following table shows the grouped data, in classes, for the heights of 50 people. From equation ( ii ) , ( iii ) & b = -1. a = 2 and c = -4. Solution: Using the formula: Sum = Mean × Number of numbers Sum of original 6 numbers = 20 × 6 = 120 Sum of remaining 5 numbers = 15 × 5 = 75 Question 20. So the sequence is 2, -1, -4. The last two numbers are 10. Solution:First five prime numbers are 2, 3, 5, 7 and 11. Selection of the terms in an Arithmetic Progression, If number of terms is 3 then assume them as ” a-d, a & a+d” and common difference is  “d”, If number of terms is 4 then assume them as  ” a-3d, a-d, a+d & a+3d ”  and common difference is  “2d”, If number of terms is 5 then assume them as  ” a-2d, a-d, a, a+d & a+2d ”  and common difference is  “d”, If number of terms is 6 then assume them as  ” a-5d, a-3d, a-d, a+d ,  a+3d & a+5d ”  and common difference is  “2d”. . Detailed explanations and solutions to these questions … This GMAT averages problem is a vey easy question. The “n” numbers r1, r2, r3, r4, . G n are said to be Geometric means in between ‘a’ and ‘b’. a + c = 2b . Give One Example Each On Designed Experiment, Observational Study And Retrospective Study, T Distribution And Sampling Distribution Between The Difference Of Means And Justify. Solution: From graph, median = 54. Example -11: Four geometric means are
{ "domain": "justinbuschmusic.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9711290963960278, "lm_q1q2_score": 0.8348444777455071, "lm_q2_score": 0.8596637469145053, "openwebmath_perplexity": 928.1472019940666, "openwebmath_score": 0.6901515126228333, "tags": null, "url": "https://justinbuschmusic.com/bu87fll/a7d264-mean-questions-with-solutions" }
special-relativity, momentum, dirac-equation, dirac-matrices Title: 4-momentum commutative with gamma matrix? I was checking the adjoint Dirac equation derivation. Starting from: \begin{equation} (\gamma^\mu p_\mu - m) u = 0. \end{equation} We take the hermitian conjugate on both sides \begin{equation} 0 = u^\dagger ((\gamma^\mu p_\mu - m))^\dagger. \end{equation} Since m is a scalar, $m^\dagger = m$ \begin{equation} 0 = u^\dagger ((p_\mu)^\dagger (\gamma^\mu)^\dagger - m). \end{equation} And all entries of $p_\mu$ are real, so $p_\mu^\dagger = p_\mu$ \begin{equation} 0 = u^\dagger ((p_\mu) (\gamma^\mu)^\dagger - m). \end{equation} We also know that $(\gamma^\mu)^\dagger = \gamma^0\gamma^\mu\gamma^0$ \begin{equation} 0 = u^\dagger ((p_\mu) \gamma^0\gamma^\mu\gamma^0 - m). \end{equation} Now, I'm having a hard time understanding why one can jump to the next step: \begin{equation} 0 = u^\dagger (\gamma^0 \not p \gamma^0 - m). \end{equation} Wouldn't that imply that $p_\mu$ can commute with the gamma's matrices? Does it has something to do with the fact that $p_\mu$ is a number (for every $\mu = \{0,1,2,3\}$)? Hint:
{ "domain": "physics.stackexchange", "id": 97987, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, momentum, dirac-equation, dirac-matrices", "url": null }
c#, design-patterns, entity-framework Title: Database first entity framework, repository, service, UnitOfWork pattern I have seperated my project into two projects. One is the web forms project and the other is the Model project with contains a generic repository implementation, a service class for each of my entities and a UnitOfWork class. All the code below apart from the last section is in my Model class library project. Generic repository interface public interface IRepository<TEntity> : IDisposable where TEntity : class { IQueryable<TEntity> GetAll(); IQueryable<TEntity> GetWhere(Expression<Func<TEntity,bool>> predicate); TEntity GetSingle(Expression<Func<TEntity, bool>> predicate); TEntity GetSingleOrDefault(Expression<Func<TEntity, bool>> predicate); void Add(TEntity entity); void Delete(TEntity entity); } I start of with this Interface which my services will interact with. A few points about this class: As i am having a service for each of my entity object, I see no reason why I shouldn't use a generic repository as creating a repository for each entity object as-well, would bloat the amount of classes i have and make it harder to manage, when i can just pass a predicate from my service into the Get methods to retrieve the data i need. So instead of creating multiple methods such as "GetById", "GetByName" in a repository specific to each entity i use a generic one and include those methods in the service class. However i have heard many people say the generic repository is an anti-pattern so i'm not sure if this is the right way. I do not include a save changes methods in the repositories as i want to make any interactions with these only come from the UnitOfWork class (which will expose the service classes as properties). So this should force validation to be done via the service classes as these are the only objects which will interact with repository. In every example i see the repository has a save changes method so i'n not sure if this is a reasonable approach.
{ "domain": "codereview.stackexchange", "id": 7201, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, design-patterns, entity-framework", "url": null }
electric-circuits, electric-current, electrical-resistance and so $$ { V_{\rm{out}} } = V_{\rm{in}} \times { R_{\rm{bottom}} \over R_{\rm{top}} + R_{\rm{bottom}} }$$ This is the equation for the potential divider. Note that the fraction on the right hand side ${ R_{\rm{bottom}} / (R_{\rm{top}} + R_{\rm{bottom}} })$ is a number between $0$ and $1$ so the output voltage is smaller than the input voltage or we could say the 'voltage is divided' or the 'potential is divided' by the 'potential divider'.
{ "domain": "physics.stackexchange", "id": 21124, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-circuits, electric-current, electrical-resistance", "url": null }
javascript, strings Title: How can I improve performance for my JavaScript table class? I've written a JavaScript table class to make it easy to display tabular data and allow the user to sort the data by clicking on the table headers. However, when there are hundreds of rows, performance on the sorting is a bit sluggish. I would like to know what kind of improvements I can make. I suspect that my string concatenation methods in displayData may not be optimal. var tableUtility = (function () { var fn = {}; // This is a constructor function for an object that represents a table fn.DataTable = function (p_data, p_columnDataFields, p_tableId, p_displayCallback) { // This is expected to be an array of objects. var data = p_data; // This is expected to be an array of strings that represents the names of the fields to use for the column data. var columnDataFields = p_columnDataFields; // This is expected to be the HTML ID of the table in which the data will be displayed. // Note that this JavaScript will only affect the TBODY of the TABLE. It is expected that the HTML already contains the THEAD with the column headers. var tableId = p_tableId; // This is expected to be either null or a function to execute after the table is displayed. var displayCallback = p_displayCallback; // Find the TBODY element of the TABLE and cache it var tbody = document.getElementById(tableId).getElementsByTagName('tbody')[0]; // softData sorts the table's data. fields is expected to be an array of strings with the names of the fields to sort by. sort functions is expected // to be an array of functions describing how to sort each field. // Note that fields must be distinct, or weird things will happen. this.sortData = function (sortFields, sortFunctions) { if (sortFields.length != sortFunctions.length) throw new Error('fields and sortFunctions don\'t have the same length.'); var builtInSorts = this.sortData.sorts;
{ "domain": "codereview.stackexchange", "id": 1281, "lm_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, strings", "url": null }
quantum-mechanics, hamiltonian-formalism You are given the system of PDEs \begin{align} &\frac{\partial S}{\partial t} \, + \, \frac{1}{2m} \,\left(\frac{\partial S}{\partial x} \cdot \frac{\partial S}{\partial x}\right) \, + \, V(x,t) \, + \, \frac{\hbar^2}{2m} \, \frac{1}{\sqrt{\rho}} \, \frac{\partial^2 \sqrt{\rho}}{\partial x^2} = 0\\ &\frac{\partial \rho}{\partial t} \, + \, \frac{1}{m} \, \text{div}\left(\rho \, \frac{\partial S}{\partial x}\right) = 0 \end{align} where $\frac{\partial}{\partial x}$ is the gradient with respect to the variables $x \in \mathbb{R}^n$ (not including the time variable $t\,$) and $\frac{\partial^2}{\partial x^2}$ is the Laplace operator with respect only to $x$ and not including $t$. Furthermore, define the Hamiltonian $$H(x, p, t) = \frac{1}{2m} \,p^2 \, + \, V(x,t) \, + \, \frac{\hbar^2}{2m} \, \frac{1}{\sqrt{\rho(x,t)}} \, \frac{\partial^2 }{\partial x^2}\sqrt{\rho(x,t)}$$ Then this Hamiltonain leads to the system of ODEs \begin{align} \frac{dx}{dt} &= \frac{\partial H}{\partial p} (x,p,t)\\
{ "domain": "physics.stackexchange", "id": 40361, "lm_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, hamiltonian-formalism", "url": null }
inorganic-chemistry, bond I think it's either (2) or (3). (Single correct type). Bot $\ce{F2}$ and $\ce{I2}$ bonds are weak because of inter electronic repulsions and due to large sizes respectively. In case (3), both molecules have bond order 3. The answer here has nothing to do with how the molecules relate to each other, e.g. similar bond order or length. This is actually a question that highlights an unexpected break in a trend. The bond enthalpies for the halogens are: $$ \begin{array}{|c|c|}\hline \text{Halogen}&\text{Bond energy (kJ/mol)}\\\hline \ce{F-F}&\pu{156}\\\hline \ce{Cl-Cl}&\pu{243}\\\hline \ce{Br-Br}&\pu{193}\\\hline \ce{I-I}&\pu{151}\\\hline \end{array} $$ Plotting these data we would expect the bond enthalpy of $\ce{F2}$ to be the strongest of them all, something around $\pu{300 kJ/mol}$, but in fact it much weaker than for chlorine. Indeed it is so weak, it as almost as weak as for iodine. The reason for this is that fluorine is so small that it breaks the trend. The atomic radius is so small that the electrostatic repulsion between the nuclei is significant, and the non-bonding electrons surrounding each atom also repel each other due to the small amount of space available. These forces counteract the strong attraction between the nuclei and the bonding pair of electrons and weakens the bond compared to what might be expected.
{ "domain": "chemistry.stackexchange", "id": 5165, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, bond", "url": null }
quantum-field-theory, charge, leptons In the Standard Model we see a lot of similar flavor symmetries. We don't currently have any good justification for these symmetries, and since we don't know of any reason for their existence, there is a lot of reserach that is done to try to explain them.
{ "domain": "physics.stackexchange", "id": 11828, "lm_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, charge, leptons", "url": null }
quantum-mechanics, operators, time-evolution $$ However, I fail to arrive at this same result, if I try to compute the derivative directly: $$ \frac{d}{dt} \hat{f}(\hat{O}(t)) = \Sigma_{j=1} c_j j \hat{O}^{j-1}(t) \dot{\hat{O}}\\ = \Sigma_{j=1} c_j j \hat{O}^{j-1}(t) \frac{i}{\hbar}[\hat{H}(t), \hat{O}(t)] $$ To arrive at the same result, I would have to permute the Hamiltonian $\hat{H}$ through the whole product $(\hat{O}(t))^{j-1}$. I'm stuck here. Am I making a mistake somewhere? Derivative of product of operator valued functions is : $$\frac{d}{dt}(A(t)B(t))=(\frac{d}{dt}A(t))B(t)+A(t)(\frac{d}{dt}B(t)).$$ You can proove it using standard definition of derivative. You have missed this non commutativity of derivative of an operator with operator itself in writing down the derivative after Taylor expansion. Once you fix it you can see that both expressions for time evolution of function of an operator will agree.
{ "domain": "physics.stackexchange", "id": 43398, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, operators, time-evolution", "url": null }
special-relativity, classical-mechanics, reference-frames, classical-electrodynamics, mathematics \mathbf{e}_\phi &= \frac{1}{r\sin\theta} \boldsymbol{\phi}. \end{align} You'll see and use both of these frames. They are clearly different frames, even though they're based on exactly the same coordinates. More generally, you're free to define your frame at any point in any way you want (as long as you keep the same number of vectors, and keep them linearly independent). So a change of coordinates implies a change in coordinate frame, but it is not equivalent to a change in frame generally.
{ "domain": "physics.stackexchange", "id": 59431, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, classical-mechanics, reference-frames, classical-electrodynamics, mathematics", "url": null }
quantum-mechanics, atomic-physics, atoms, commutator, hydrogen Title: Can non-central hamiltonians commute with $\vec{L}^2$? Central potentials $V(r)$ trivially commute with the operator $\vec{L}^2$ in quantum mechanics because the latter is a function of the angular coordinates $(\theta,\phi)$ only. Non-central potentials, may or may not commute with $\vec{L}^2$. It is not obvious. For example, in atomic physics, the Darwin term $H_{\rm Darwin}=C\delta(\vec{r})$ is a non-central Hamiltonian because it depends on $\vec{r}$ rather than $r$. But it still commutes with $\vec{L}^2$. Can anyone help me understand how $[\vec{L}^2,H_{\rm Darwin}]=C[\vec{L}^2,\delta(\vec{r})]=0$? Isn't the Darwin potential central? We could rewrite it as: $$H_\text{Darwin}=C\delta (\vec{r})=\frac{C}{4\pi r^2}\delta (r)$$ Disclaimer: I tried to add a comment instead of directly answering, but I apparently need a higher reputation to do so.
{ "domain": "physics.stackexchange", "id": 51142, "lm_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, atomic-physics, atoms, commutator, hydrogen", "url": null }
statistical-mechanics, renormalization, phase-transition, ising-model Title: Using renormalization group theory on the Ising model using decimation transformations Consider a 1d Ising model with no external magnetic field $(h=0)$ and adopt a decimation transformation in which every other spin is traced out. So the Hamiltonian $H$ is given by $$H = -J\sum_{(i,j)} s_i s_j$$ where $(i,j)$ corresponds to the nearest neighbors of $i$. I am trying to sketch the RG flow of this system, and I am struggling. How do you start a problem like this? I know you coarse grain a system by some spin-block tranformation $\tau$, but I am unsure of how to use it. The end goal is to derive the RG equation, so the map $K' = R_l[K]$ for this transformation and find the fixed points in the flow. Any advice would be appreciated! Take the partition function $$ Z = \sum_{\{ S_{j} \}} \exp\left( \beta J \sum_{( i,j )} s_i s_j \right) = \sum_{\{ s_{j} \}} \prod_{(i,j)} \exp\left( \beta J s_i s_j \right) \ , $$ and sum over every other spin (so explicitly evaluate $\{s_{2n+1}\} \in \pm 1$ in the sum, but don't sum over $s_{2n}$). This should be equal to a similar partition function over the coarse-grained lattice (with a new coupling $J'$ and new spin variables $s_i'$) $$ Z = \sum_{\{ S_{j} \}} \exp\left( \beta J' \sum_{( i,j )} s'_i s'_j \right) = \sum_{\{ s_{j} \}} \prod_{(i,j)} \exp\left( \beta J' s'_i s'_j \right) \ . $$
{ "domain": "physics.stackexchange", "id": 73351, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, renormalization, phase-transition, ising-model", "url": null }
java if(recipient1.isEmpty()) { System.out.println("FILE_ERROR: Please populate field \"email1\" in configuration.properties"); try { Thread.sleep(3000); } catch(InterruptedException e) { Thread.currentThread().interrupt(); } System.exit(0); } if(recipient2.isEmpty()) { System.out.println("FILE_ERROR: Please populate field \"email2\" in configuration.properties"); try { Thread.sleep(3000); } catch(InterruptedException e) { Thread.currentThread().interrupt(); } System.exit(0); } if(recipient3.isEmpty()) { System.out.println("FILE_ERROR: Please populate field \"email3\" in configuration.properties"); try { Thread.sleep(3000); } catch(InterruptedException e) { Thread.currentThread().interrupt(); } System.exit(0); }
{ "domain": "codereview.stackexchange", "id": 12104, "lm_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 }
php, mysqli, join Bernd: Bee Tom: Bear Dog Is it really necessary to have 2 nested while clauses here? Formatting Your code has some formatting issues, reducing the readability of it: spacing: your spacing around = seems arbitrary and you are missing spaces around .. indentation: 2 spaces aren't really enough, use at least 4. you should also indent the queries after a linebreak a bit more to increase readability. your curly brackets are not consistent. Security Depending on who can add members and ranks, you may be vulnerable to XSS as the name is echoed unencoded. Even if this isn't a problem now because only you can add them, your requirements may change. Encoding input is always a good idea. Also, depending on the type and changability of id you may be vulnerable to SQL injection. Always use prepared statements. Structure You should add functions to increase the maintainability - readability, reusability, changability, etc - of your code. For example, selectMembersByCountry($country) or selectMemberRanksByID($id), which would then return an array of members and/or ranks. Naming zeile isn't a good name. First of all, your variable names shouldn't switch languages, and ideally they should all be in English. But row wouldn't be much better. What is it really? Well, $result contains a list of members, right? So its name could reflect that, and then zeile could be member, which would give you: $member = $membersResult->fetch_assoc(). Simplify SQL You could put all the logic directly into the query, but I don't think that that is necessary, so I'll leave that to someone else (although you may want to change your table structure first, see below). I would say that it's fine the way it is. Especially when you extract the queries to functions, you would have well-defined and reusable functions. Putting all the logic directly in the query is likely to be less readable and harder to maintain, and I doubt that it will give you a noticeable performance benefit (definitely not if you limit by 2). Table Structure
{ "domain": "codereview.stackexchange", "id": 20076, "lm_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, mysqli, join", "url": null }
cc.complexity-theory, complexity-classes Title: Why is the "balanced vs constant function" problem not a proof that P ≠ BPP? Recently, I came across the problem of figuring out whether a given binary function $f(x)$ is constant (0 for all values of $x$ or 1 for all values of $x$) or balanced (0 for half of values and 1 for the other half), for $x \leq N$. Clearly, the complexity of a bounded error probabilistic algorithm is $O(1)$, because the probability of the function being constant if you get k random elements with the same value is less than $\frac{1}{2^k}$. However, the deterministic algorithm is to check $f(x)$ for the possible values of $x$ until you find different values or $\frac{N}{2} + 1$ equal values. The time complexity for the worst case is $O(2^n)$, with $n$ being the number of bits of $N$, which is exponential. To me it seems trivial that there is no better solution than this one, because you cannot be sure that two values inside a black box are different until you find them or get the maximum amount of equal numbers, so this problem is in $BPP$, but not in $P$. What is wrong in my line of thought? Also, is this a "clue" that P is probably different from BPP? It is true that if the function $f$ is given by an oracle, then a randomized algorithm is exponentially faster than any deterministic algorithm. With an oracle function, however, this is not a $BPP$ problem! It becomes a $BPP$ problem only if the function $f$ is given by a polynomial time algorithm, so that the whole task can be defined via a polynomial time Turing machine. In that case, however, it is not clear that you indeed have to check exponentially many values in the deterministic case. You might be able to bypass it via capitalizing on knowing the special algorithm that computes $f$. (Note that knowing the algorithm is essential to make it a $BPP$ problem.)
{ "domain": "cstheory.stackexchange", "id": 5629, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, complexity-classes", "url": null }
quantum-mechanics, homework-and-exercises, potential-energy, computational-physics Solutions to $I$ and $IV$ may be immediatly given as $$\psi_I(x)=Ae^{ikx}+Be^{-ikx}$$ $$\psi_{IV}(x)=Ge^{ikx},$$ the first corresponding to the incoming and reflected wave, and the other to the transmitted wave. Introducing the change of variables $$\xi(x)=q_0(\frac{|x|}{a}+\epsilon^2-1)$$ transforms the other two equations into Airy differential equations: $$\frac{d^2\psi_{II}}{d\xi^2}=-\xi\psi_{II}$$ $$\frac{d^2\psi_{III}}{d\xi^2}=-\xi\psi_{III}$$ with general solutions in the form $$\psi_{II}(x)=C\mathrm{Ai}(-\xi)+D\mathrm{Bi}(-\xi)$$ $$\psi_{III}(x)=E\mathrm{Ai}(-\xi)+F\mathrm{Bi}(-\xi),$$ where $\mathrm{Ai}(z)$ and $\mathrm{Bi}(z)$ are the standard Airy functions of the first and second kind. Using the fact that both $\psi(x)$ and $\psi'(x)$ are continuous, this gives the linear system: $$\left(\begin{matrix} e^{-ika} & e^{ika} & -\mathrm{Ai}(-\xi_a) & -\mathrm{Bi}(-\xi_a) & 0 & 0 \\ -\frac{ika}{q_0}e^{-ika} & \frac{ika}{q_0}e^{ika} & \mathrm{Ai}'(-\xi_a) & \mathrm{Bi}'(-\xi_a) & 0 & 0 \\
{ "domain": "physics.stackexchange", "id": 90518, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, homework-and-exercises, potential-energy, computational-physics", "url": null }
neural-network, supervised-learning, matlab, accuracy, training As already highlighted by Jan van der Vegt, its extremely odd that changing the no of features from 8 to 40 has no impact on test set accuracy.
{ "domain": "datascience.stackexchange", "id": 1073, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neural-network, supervised-learning, matlab, accuracy, training", "url": null }
python, hash-map The nested loop can be transformed to a dictionary comprehension like this: dic2 = {v: k for k, values in dic.items() for v in values} You can remember that the order of for clauses in the comprehension is the same as the order of corresponding nested for loops. Potential pitfalls You should be aware that this transformation from a dictionary of lists to a reverse dictionary only works if all items in the original lists are unique. Counterexample: >>> dic = {0: [1, 2], 1: [2, 3]} >>> {v: k for k, values in dic.items() for v in values} {1: 0, 2: 1, 3: 1} # missing 2: 0 To correct this, the output dictionary should have the same format as the input, namely mapping each of the items in the input lists to a list of corresponding keys. If the input represents a directed graph (mapping nodes to lists of neighbours), this corresponds to computing the transposed or reversed graph. It can be done by using a collections.defaultdict. I don't see an easy way to write it as a comprehension in this case. from collections import defaultdict graph = {0: [1, 2], 1: [2, 3]} transposed_graph = defaultdict(list) for node, neighbours in graph.items(): for neighbour in neighbours: transposed_graph[neighbour].append(node) # {1: [0], 2: [0, 1], 3: [1]}
{ "domain": "codereview.stackexchange", "id": 34056, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, hash-map", "url": null }
java, object-oriented, minecraft /** * Set all towns in this nation * Doesn't effect database * * @param towns HashMap with this nations towns */ public void setAllTowns(@NotNull HashMap<Town, NationRank> towns) { Validate.notNull(name); this.towns = towns; } @Nullable public NationRelationship getRelationship(@NotNull Nation nation) { Validate.notNull(nation); return relationships.get(nation); } /** * Send a message to all members of this nation * * @param message The message to send */ public void broadcastToNation(@NotNull String message) { Validate.notNull(message); getTowns().keySet().forEach(town -> town.broadcastToTown(message)); } /** * Get the owner of the nation * * @return The uuid of the owner of the nations capital town */ public UUID getOwner() { return getCapital().getOwner(); } public enum NationFlag { OPEN, TIER } public enum NationRank { CAPITAL, MEMBER } public enum NationRelationship { ALLY, NEUTRAL, ENEMY } }
{ "domain": "codereview.stackexchange", "id": 21061, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, minecraft", "url": null }
electromagnetism, general-relativity, forces, reference-frames, equivalence-principle Title: Do all forces of nature produce opposite force when they move? I am not sure if I understand it right but as I see it any two moving charge particles must repel each other like they are not moving relative to observer that moving at the same speed as they moving, according to this https://www.youtube.com/watch?v=rKFzV8sVDsA . but accept the magnetic force and gravity there is also the strong force and the week force would they produce force to the opposite direction as well in case they are moving? Force is rate of change of momentum. As total momentum is conserved and constant, as long as you stay in the same inertial reference frame, the total force is zero. This the basis of Newton's third law.
{ "domain": "physics.stackexchange", "id": 76091, "lm_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, general-relativity, forces, reference-frames, equivalence-principle", "url": null }
beginner, ruby, linux, timer Can't comment much on the menu object as it's a little difficult to read. One thing I will say it looks like you're weaving in and out of class and object contexts (use of self in initialize). Be wary of this. fix your attributes The way you are specifying attributes is wrong, and actually shouldn't have an effect at all. If you want to define attributes and a way to access or modify them, you can use either attr_reader :list, :of, :attributes or attr_writer :list, :of, :attributes or, for both attr_accessor :list, :of, :attributes. See here for more info. extract more! Another prime opportunity for extraction is your config file parsing. If you can use a different format that doesn't require so much parsing (yaml, etc), great! If not, you should look into extracting the parser into its own object. You would then have something like (note no empty ()): def config @config ||= Config.parse('CountdownI.config') end Couple of other notes on the above code. I've removed read_ as that is redundant. In Ruby, we forget about read_ this, get_ that, is_ this, set_ that. Be succinct and descriptive. The method name clearly indicates it will return your config. I have also used memoization (@config ||=). This is to prevent the method from parsing the config multiple times. It will parse once and set variable as return of parse, then simply return variable value on subsequent calls. Get used to this and use it for making your code more efficient. extract yet more! Another opportunity for extraction is in your conditionals. You have: if(@enable_notify) First, as noted in the basic style part of this review, you shouldn't use parentheses. It should be if @enable_notify. Better yet, you can extract this into a predicate method: def notify? @enable_notify end if notify? ... end in closing The main issues I would say:
{ "domain": "codereview.stackexchange", "id": 23047, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, ruby, linux, timer", "url": null }
moveit Title: Error while running move_group.launch ( MoveitSimpleControllerManager: Action client not connected: arm_controller/follow_joint_trajectory ) Hi, While I launching move_group.launch I got the following error. i am trying to control my 6DOF arm(hardware) from moveit. Can any one dare to fix my issue [ERROR] [1381292999.635005693]: MoveitSimpleControllerManager: Action client not connected: arm_controller/follow_joint_trajectory [move_group-1] process has died [pid 6684, exit code -11, cmd /opt/ros/groovy/lib/moveit_ros_move_group/move_group __name:=move_group __log:=/home/unais/.ros/log/6883204e-309a-11e3-b71a-0c6076593c99/move_group-1.log]. log file: /home/unais/.ros/log/6883204e-309a-11e3-b71a-0c6076593c99/move_group-1*.log Originally posted by unais on ROS Answers with karma: 313 on 2013-10-08 Post score: 0 The error message is pretty explanatory -- the controller is unable to connect to the action specified. Does your driver actually expose a FollowJointTrajectoryAction interface named arm_controller/follow_joint_trajectory? Originally posted by fergs with karma: 13902 on 2013-10-08 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 15799, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "moveit", "url": null }
B001 LBL B ; here is your program/equation B002 PxV=NxRxT ; with these five variables P, V, N, R and T B003 RTN Please note the additional VIEW N statement in A004 that displays the result obtained by Solve. Within a program it is not displayed automatically. Simply because you may want to continue with that result instead of having it displayed. Within a program, Solve also works like a test command: if there is a result, the program continues with the next statement. If no result can be calculated, the next step is skipped (!). (09-30-2014 11:52 AM)mcjtom Wrote:  Maybe SF 11 has something to do with it, but I wasn't able to successfully use it... Flag 11 does not make a difference here. It just decides whether you are prompted for the variables or not. With flag 11 cleared you can use a sequence of INPUT statements (one for each variable) at the beginning of the program defining your function, and you will be asked for the known variables – cf. chapter 15 of the 35s manual. Dieter An excellent and clear explanation Dieter! This was quite confusing when I first started using it, and took a while to figure it out. Yours is by far the best explanation of this I've seen. Thanks very much for taking the time to explain it so clearly, including useful tips like the test command behavior. --Bob Prosperi 10-01-2014, 05:31 PM Post: #13 Dieter Senior Member Posts: 2,397 Joined: Dec 2013 RE: HP 35s and Solve button (but not in equation catalogue) (10-01-2014 01:09 AM)rprosperi Wrote:  An excellent and clear explanation Dieter! This was quite confusing when I first started using it, and took a while to figure it out.
{ "domain": "hpmuseum.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9511422241476944, "lm_q1q2_score": 0.8121924697664534, "lm_q2_score": 0.8539127473751341, "openwebmath_perplexity": 3334.7188415092896, "openwebmath_score": 0.3730664551258087, "tags": null, "url": "https://hpmuseum.org/forum/showthread.php?mode=linear&tid=2195&pid=20051" }
between a curve described by the equation y = f(x) and the x-axis in a finite interval [a, b]. If f is positive, then the integral represents the area bounded by the curve y = f (x) and the lines x = a; x = b and y = 0:. As shown in the diagram; Trapezoidal Load. Using the measurements from Figure 7. ; noun The duration of such power. Click here for Excel file. The trapezoidal rule is used to approximate the integral of a function. Say the length of y is much larger than the actual number of points calculated for the FPR and TPR. We present a novel methodology for the numerical solution of problems of diffraction by infinitely thin screens in three dimensional space. Bending Moment is mostly used to find bending stress. The Total Area includes the area of the circular top and base, as well as the curved surface area. Step 2 : Volume of the given prism is = base area x height. I'm new to learning c and either my arrays or my loop is not computing properly. 1 4 2 6 A M A D V = + +. The collected data are shown in the table below. In one of my previous articles, I discussed Midpoint Ordinate Rule and Average Ordinate Rule in detail with an example and listed out various important methods used for the calculation of areas in Surveying. Fuzzy logic is a powerful problem-solving technique that's particularly useful in applications involving decision making or with problems not easily definable by practical mathematical models. But how do we know how accurate our approximation is, in comparison to the exact area under the curve? We want to know whether an approximation is very good, and close to actual area, or if it’s. Access the answers to hundreds of Trapezoidal rule questions that are explained in a way that's easy for you to understand. 12r2 + 3r2 = 375. The AUC is the sum of these rectangles. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson’s rule requires an even number of intervals. nodots suppress dots during calculation id(id var) is required. Introduction Calculation for areas and volumes for earthworks, cuttings, embankments etc. • Area = h(a+b)/2 • Perimeter = a + b
{ "domain": "calcolailtuomutuo.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717420994768, "lm_q1q2_score": 0.8405125581701728, "lm_q2_score": 0.8519528000888386, "openwebmath_perplexity": 744.3997072342853, "openwebmath_score": 0.8069357872009277, "tags": null, "url": "http://calcolailtuomutuo.it/mmac/trapezoidal-rule-for-area-calculation.html" }
algorithms, logistic-regression plt.plot(x, log_odds(x)) plt.xlabel("age") plt.ylabel("log odds of gray hair") Now, let's make it a classifier. First, we need to transform the log odds to get out our probability $P(A)$. We can use the sigmoid function: $$P(A) = \frac1{1 + \exp(-\text{log odds}))}$$ Here's the code: plt.plot(x, 1 / (1 + np.exp(-log_odds(x)))) plt.xlabel("age") plt.ylabel("probability of gray hair") The last thing we need to make this a classifier is to add a decision rule. One very common rule is to classify a success whenever $P(A) > 0.5$. We will adopt that rule, which implies that our classifier will predict gray hair whenever a person is older than 40 and will predict non-gray hair whenever a person is under 40. Logistic regression works great as a classifier in more realistic examples too, but before it can be a classifier, it must be a regression technique!
{ "domain": "datascience.stackexchange", "id": 5950, "lm_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, logistic-regression", "url": null }
$|A_1 \cap A_2|$: Observe that sequences in the sets $A_1$ and $A_2$ share a position in which there must be a $1$. Hence, sequences in $A_1 \cap A_2$ have three consecutive ones and two positions that may be filled with $0$, $1$, or $2$. Hence, $$|A_1 \cap A_2| = 3^2$$ The sets $A_1 \cap A_2$, $A_2 \cap A_3$, and $A_3 \cap A_4$ each contain sequences with three consecutive $1$s and two positions that may be filled with a $0$, $1$, or $2$. Hence, $$|A_1 \cap A_2| = |A_2 \cap A_3| = |A_3 \cap A_4|$$ $|A_1 \cap A_3|$: The sets $A_1$ and $A_3$ contain sequences that do not share a position in which there must be a $1$. Hence, four positions of the ternary sequence must be filled with $1$s. The remaining position of the sequence can be filled with a $0$, $1$, or $2$. Hence, $$|A_1 \cap A_3| = 3$$ The sets $A_1 \cap A_3$, $A_1 \cap A_4$, and $A_2 \cap A_4$ each contain sequences in which four positions must be filled with $1$s and the remaining position can be filled with a $0$, $1$, or $2$. Hence, $$|A_1 \cap A_3| = |A_1 \cap A_4| = |A_2 \cap A_4|$$ $|A_1 \cap A_2 \cap A_3|$: Observe that there are four consecutive positions that must be filled with $1$s. The remaining position can be filled with a $0$, $1$, or $2$. Therefore, $$|A_1 \cap A_2 \cap A_3| = 3$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754442973825, "lm_q1q2_score": 0.8026578926193247, "lm_q2_score": 0.8152324915965392, "openwebmath_perplexity": 41.31215778959164, "openwebmath_score": 0.9717938303947449, "tags": null, "url": "https://math.stackexchange.com/questions/2679804/ternary-string-using-the-inclusion-exclusion" }
beginner, object-oriented, ruby def withdraw(amount) # subtract amount from balance or raise error if balance # isn't large enough (or amount is negative) end def deposit(amount) # add amount to balance or raise error if amount is negative end end class Atm def initialize(account) @account = account end # ... end The Atm class handles all the user interaction much like now, but delegates the actual withdrawal/depositing and PIN checking to the account. How you structure it from here is up to you, but the basic point is that the account is "just" an account.
{ "domain": "codereview.stackexchange", "id": 33759, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, object-oriented, ruby", "url": null }
Excellent +1 from me. the exact values can be plotted by substituting x =... -2,-1.0,1,2,3.... which will be useful in merging two graphs and finding the intersection. Manager Joined: 27 May 2008 Posts: 203 Followers: 1 Kudos [?]: 20 [0], given: 0 Re: Quick Way to Graph Inequalities [#permalink]  04 Mar 2009, 05:50 selvae wrote: Nach0 wrote: Here's a couple more examples: 5x-7y<-4 Attachment: 3.gif +5x: No reversing/reversing/"oppositing" -7y: Positive slope <: shade to the left of the line -4: X-intercept is negative (to the left of the origin) -3x-6y<-9 Attachment: 4.gif -3x: Everything will be reversed! -6y: Positive slope, but since there's a -3x, it will be negative <: Supposed to mean shade to the left, but it's right this time because of the -3x -9: Like the others, generally means negative x-intercept. It will be positive because of the -3x Excellent +1 from me. the exact values can be plotted by substituting x =... -2,-1.0,1,2,3.... which will be useful in merging two graphs and finding the intersection. Also kind of fine tuning the logic (still you hold the patent ) for the scenario 2, where you said when X coeff. is negative, can be converted to scenario 1 by multilying -1 both the side. So -4x+5y<6 becomes, 4x -5y >-6 the diagram still look the same. and the user dont have to remember too much of logics. Intern Joined: 03 Mar 2009 Posts: 49 Followers: 3 Kudos [?]: 53 [1] , given: 3 Re: Quick Way to Graph Inequalities [#permalink]  04 Mar 2009, 05:53 1 KUDOS Here's a link where you can test out what you've just learned: In "Type of Region" select Linear I or Linear II.
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9643214460461698, "lm_q1q2_score": 0.8177134894019498, "lm_q2_score": 0.8479677526147223, "openwebmath_perplexity": 4364.311934759316, "openwebmath_score": 0.4746108055114746, "tags": null, "url": "http://gmatclub.com/forum/quick-way-to-graph-inequalities-76255.html?fl=similar" }
quantum-chromodynamics, symmetry-breaking, quarks, isospin-symmetry S^a(x) = -\frac{i}{2}\epsilon^{abc} [I^b,S^c(x)].$$ The vacuum is isospin and translationally invariant (isospin doesn't break dynamically/spontaneously in QCD), so $I^a|0\rangle= 0$, whence $$\langle 0|S^a(x)|0\rangle = \langle 0|S^a(0)|0\rangle =0.$$ Focussing on a=3 directly implies $$ \langle \bar u u\rangle - \langle \bar d d \rangle =0. $$
{ "domain": "physics.stackexchange", "id": 96942, "lm_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-chromodynamics, symmetry-breaking, quarks, isospin-symmetry", "url": null }
Although `sympref` and `subexpr` do not provide a way to choose which subexpressions to replace in a solution, you can define these subexpressions as symbolic variables and manually rewrite the solution. For example, define new symbolic variables `a1` and `a2`. `syms a1 a2` Rewrite the solutions `sols` in terms of `a1` and `a2` before assigning the values of `a1` and `a2` to avoid evaluating `sols`. ```sols = [(1/2*a1 + 1/3 + sqrt(3)/2*a2*1i)^2;... (1/2*a1 + 1/3 - sqrt(3)/2*a2*1i)^2]``` ```sols =  $\left(\begin{array}{c}{\left(\frac{{a}_{1}}{2}+\frac{1}{3}+\frac{\sqrt{3} {a}_{2} \mathrm{i}}{2}\right)}^{2}\\ {\left(\frac{{a}_{1}}{2}+\frac{1}{3}-\frac{\sqrt{3} {a}_{2} \mathrm{i}}{2}\right)}^{2}\end{array}\right)$``` Assign the values $\left(t+\frac{1}{9t}\right)$ and $\left(t-\frac{1}{9t}\right)$ to `a1` and `a2`, respectively.
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676419082931, "lm_q1q2_score": 0.8247093409093923, "lm_q2_score": 0.8418256412990657, "openwebmath_perplexity": 1314.6378446511126, "openwebmath_score": 0.6773620843887329, "tags": null, "url": "https://au.mathworks.com/help/symbolic/abbreviate-common-terms-in-long-expressions.html" }
quantum-mechanics Title: What is the relation between adiabatic elimination and adiabatic theorem? What is the relation between adiabatic elimination and adiabatic theorem? Does adiabatic elimination come from adiabatic theorem? Yes, the adiabatic elimination is a particular application of the adiabatic theorem in a more complicated context. The adiabatic theorem says that if the Hamiltonian is changing as a function of time very slowly and there is a gap in the spectrum around the eigenvalue $E$, the eigenstate with this eigenvalue will continuously evolve into the "same" eigenstate of the gradually changing Hamiltonian, without getting a contribution from other eigenstates. Adiabatic elimination is a "practical" application in systems with at least three states. The first-to-second transition may be driven by an AC field and the second-to-first decay may be eliminated by the effect described in the adiabatic theorem. The time-dependent Hamiltonian in this case involves the gradual increase of the Stark shift.
{ "domain": "physics.stackexchange", "id": 31199, "lm_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", "url": null }
ros, ros-kinetic Is this an error with synchronizer.h I can't fix, was it caused by a minor error in my code? Thanks Originally posted by Old Meme on ROS Answers with karma: 40 on 2018-08-20 Post score: 0 /.../src/roscomm.cpp:222:85: error: ‘IMU’ is not a member of ‘sensor_msgs’ typedef sync_policies::ApproximateTime<sensor_msgs::NavSatFix, std_msgs::Float64, sensor_msgs::IMU> NavSyncPolicy; ^~~~~~~~~~~ /.../src/roscomm.cpp:222:85: error: ‘IMU’ is not a member of ‘sensor_msgs’ Note: the message name is Imu, not IMU. If you've fixed that and still get the same error, it's likely you forgot to include the sensor_msgs/Imu.h header. another note: time synchronisation is only possible with message types that have a header: std_msgs/Float64 doesn't have one, so it cannot be used. Edit: Is this an error with synchronizer.h I can't fix, was it caused by a minor error in my code? seeing as these packages have been around for at least 10 years, I would always assume your code is at fault -- at first. However, no code is faultless, so if you've assured that you're doing the right thing, then suspecting message_filters starts to make sense. Originally posted by gvdhoorn with karma: 86574 on 2018-08-20 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 31583, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic", "url": null }
simulation Title: Running a simulated odometry node Hi all, I'm trying to run an odometry node that is simulated using the ROS navigation stack. I start with values of 0,0,0 for start, and execute a subscriber to listen to /cmd_vel topic, and then use those values as the odometry values. My code is given below: // Simulated odometry publisher // Assumes that the robot follows the given velocity commands // Basically read in the velocity command values and then transmit them as // odometry // #include <ros/ros.h> #include <tf/transform_broadcaster.h> #include <nav_msgs/Odometry.h> #include <geometry_msgs/Twist.h> double vx = 0.0; double vy = 0.0; double vth = 0.00; // Initialize a callback to get velocity values: // void Odocallback( const geometry_msgs::TwistConstPtr& cmd_vel) { ROS_INFO( "Velocity_Recieved_by_OdomNode"); vx = cmd_vel->linear.x; vy = cmd_vel->linear.y; vth = cmd_vel->angular.z; } int main( int argc, char** argv) { ros::init(argc, argv, "odometry_publisher"); ros::NodeHandle n; ros::Publisher odom_pub = n.advertise<nav_msgs::Odometry>("odom", 50); ros::Subscriber sub = n.subscribe("cmd_vel", 1000, Odocallback); tf::TransformBroadcaster odom_broadcaster; double x = 0.0; double y = 0.0; double th = 0.0; //double vx = 0.0; //double vy = 0.0; //double vth = 0.0;
{ "domain": "robotics.stackexchange", "id": 5139, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "simulation", "url": null }
where do I start in a large restaurant an average of every 7 customers ask for water with the their meal. A random sample of 12 customers is selected, find the probability that exactly 6 ask for water with their meal any body with idea Rufai conditional probability Ramesh Rufai iam really sorry. it's been long since I used these things. I just gave you a hint though Ramesh ok Rufai this follows binomial distribution. p(X=6)=12C6*(0.6)^6*0.4^6 use this formula n find. syeda can you explain the cosidered variable in the formula Divya x is variable wich is exactly 6 costumers syeda n is number of customers syeda ncx*p^X*q^X? Divya q^n-x syeda oh right !!! thanks yaar Divya I agree with Seyda too Hoshyar I agree with Syeda too Hoshyar 7/12 =0.58is it? yousaf . yousaf r8 khalid what is descriptive statistic Descriptive statistics are brief descriptive coefficients that summarize a given data set, which can be either a representation of the entire or a sample of a population. Descriptive statistics are broken down into measures of central tendency and measures of variability (spread). Divya are you getting this ? Divya if so let me know Divya yes m getting Ramesh fine Divya what's taking place can l join u Anest yeah !!why not? sure Divya okey thanks Anest where are statistics used hello Giannis Hi Makhosi how u doing Muhid the upper quartile of the population 10,12,14,16,18,20,25,15,11,11,17,is................? Gach The probability range is 0 to 1... but why we take it 0 to 1.... because in probability 1 means success and 0 means failure and it cnnt be more or less than 1 and 0. syeda b/c v hv mazimum probibliy 1 and minimum which is.no.probiblity is 0.so.v hv the range from 0 to 1 khalid the size of a set is greeter than its subset
{ "domain": "jobilize.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429575500228, "lm_q1q2_score": 0.8151311456361054, "lm_q2_score": 0.8289388146603365, "openwebmath_perplexity": 1081.8252220180818, "openwebmath_score": 0.5185075402259827, "tags": null, "url": "https://www.jobilize.com/statistics/course/2-2-histograms-frequency-polygons-and-time-series-graphs-by-openstax?qcr=www.quizover.com&page=1" }
inorganic-chemistry, solubility, analytical-chemistry, identification Title: 3rd analytical group of cations If a mixture of Mn$^{2+}$, Zn$^{2+}$, Co$^{2+}$, Ni$^{2+}$ and Al$^{3+}$ salts is dissolved in water, a white dim solution is obtained. I guess that the aluminium and zinc ions hydrolysed and the respective hydroxides are formed. Am I right, or maybe one of them won't hydrolyze so much that the solution becomes dim or maybe some other cation could have hydrolysed, too? Aluminium and zinc will produce a white precipitate due to formation of hydroxide. Both these hydroxides dissolve in excess acid or alkali due to their amphoteric character. Manganese, nickel, cobalt hydroxides are probably soluble as they are precipitated in the 4th group as sulphides.
{ "domain": "chemistry.stackexchange", "id": 3003, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, solubility, analytical-chemistry, identification", "url": null }
java, json, tic-tac-toe, machine-learning public static void addBeads(int index, int move, int count, int player){ if(player == 1){ if (player1Choices.get(index).length() < maxMovesInChoiceString){ for(int x = 0; x < count; x++)player1Choices.set(index, player1Choices.get(index) + move); }else{ for(int x = 0; x < player1Choices.get(index).length(); x++){ if (Integer.parseInt(player1Choices.get(index).charAt(x) + "") != Integer.toString(move).charAt(0)){ char[] charArray = player1Choices.get(index).toCharArray(); charArray[x] = Integer.toString(move).charAt(0); player1Choices.set(index, new String(charArray)); return; } } } }else{ if (player2Choices.get(index).length() < maxMovesInChoiceString){ for(int x = 0; x < count; x++)player2Choices.set(index, player2Choices.get(index) + move); }else{ for(int x = 0; x < player2Choices.get(index).length(); x++){ if (Integer.parseInt(player2Choices.get(index).charAt(x) + "") != Integer.toString(move).charAt(0)){ char[] charArray = player2Choices.get(index).toCharArray(); charArray[x] = Integer.toString(move).charAt(0); player2Choices.set(index, new String(charArray)); return; } } } } }
{ "domain": "codereview.stackexchange", "id": 18385, "lm_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, json, tic-tac-toe, machine-learning", "url": null }
discrete-signals, fourier-transform, sampling, nyquist, theory Since $ \mathcal{F} \left\{ f \left( x \right) \right\} = F \left( w \right) $. Changing order of integration for converging integrals. Applying $ \mathcal{F} \left\{ \operatorname{sinc} \left( \frac{ x - m T }{T} \right) \right\} \left( - w \right) $. Integration boundaries according to the Rect function. Applying Inverse Fourier Transform at $ x = n T $. Wrapping it yields: $$ f \left( x \right) = \sum_{n = -\infty}^{n} \langle f \left( x \right), {g}_{n} \left( x \right) \rangle {g}_{n} \left( x \right) = \sum_{n = - \infty}^{\infty} f \left( n T \right) \operatorname{sinc} \left( \frac{ x - n T }{T} \right) $$ Which is known as the Whittaker Shannon Interpolation Formula. Conclusion In the process above the analysis and synthesis of Band Limited Functions is shown using Orthonormal Basis. If one set $ T $ to be the Sampling Interval, usually denoted by $ {T}_{s} $ then the Sampling Frequency is given by $ {F}_{s} = \frac{1}{ {T}_{s} } $. Now, since the function in frequency domain stretches in the range $ \left[ -\frac{{F}_{s}}{2}, \frac{{F}_{s}}{2} \right] $ we indeed have the known relation that the sampling frequency has to be twice the one sided support of the function in frequency.
{ "domain": "dsp.stackexchange", "id": 7941, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "discrete-signals, fourier-transform, sampling, nyquist, theory", "url": null }
called vertices, connected by links, called edges.The degree of a vertex is the number of edges that are attached to it. Note that each edge here is bidirectional. The degree sum formula says that if you add up the degree of all the vertices in a (finite) graph, the result is twice the number of the edges in the graph. graphs combinatorics counting. The Handshaking Lemma − In a graph, the sum of all the degrees of all the vertices is equal to twice the number of edges. Pick an arbitrary vertex of the graph root and run depth first searchfrom it.
{ "domain": "danaetobajas.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9615338079816756, "lm_q1q2_score": 0.8371086986403576, "lm_q2_score": 0.8705972600147106, "openwebmath_perplexity": 328.7180906892018, "openwebmath_score": 0.500089704990387, "tags": null, "url": "http://www.danaetobajas.com/uutjb/how-to-find-number-of-edges-in-a-graph-180e55" }
java, object-oriented, mvc, swing, chess private void addPieceImagesToMap() { Image[][] pieceImages = new Image[2][6]; readPieceImages(pieceImages); pieceToImage.put("q", pieceImages[0][0]); pieceToImage.put("k", pieceImages[0][1]); pieceToImage.put("r", pieceImages[0][2]); pieceToImage.put("n", pieceImages[0][3]); pieceToImage.put("b", pieceImages[0][4]); pieceToImage.put("p", pieceImages[0][5]); pieceToImage.put("Q", pieceImages[1][0]); pieceToImage.put("K", pieceImages[1][1]); pieceToImage.put("R", pieceImages[1][2]); pieceToImage.put("N", pieceImages[1][3]); pieceToImage.put("B", pieceImages[1][4]); pieceToImage.put("P", pieceImages[1][5]); } // Get piece images from file private void readPieceImages(Image[][] pieceImages) { int imageSize = 64; try { BufferedImage imageBuffer = ImageIO.read(new File("piece_images.png")); for (int i = 0; i < 2; i++) for (int j = 0; j < 6; j++) pieceImages[i][j] = imageBuffer.getSubimage(j * imageSize, i * imageSize, imageSize, imageSize); } catch (IOException io) { System.out.println("Error with handling images"); io.printStackTrace(); } } } Move.java package chess; import java.io.Serializable; import java.util.ArrayList; import java.util.List;
{ "domain": "codereview.stackexchange", "id": 38934, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, mvc, swing, chess", "url": null }
python, python-3.x, console, linux, installer Code wise: Looks pretty clean, you've obviously spent a lot of time making it look good, I can easily follow it, which is great! tty_supports_ansi, the if isn't necessary, just return (hasattr...). The {k: v for k, v in ... if v} thing happens thrice, just make it a function at that point. The prompt for y[es] happens multiple times, make that a function too (e.g. if prompt("Do you want to start the service?"): ... or so).
{ "domain": "codereview.stackexchange", "id": 32027, "lm_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, console, linux, installer", "url": null }
optics Title: Why Jones matrix of quarter-wave plate of which fast axis is vertical is $e^{i\pi/4}\left[\begin{matrix}1&0\\0&-i\\\end{matrix}\right]$? Jones matrix of quarter-wave plate of which fast axis is horizontal is $e^{i\pi/4}\left[\begin{matrix}1&0\\0&i\\\end{matrix}\right]$ If the plate is rotated by $π/2$, then Jones matrix is followed $e^{i\pi/4}\left[\begin{matrix}\cos{\frac{\pi}{2}}&-\sin{\frac{\pi}{2}}\\\sin{\frac{\pi}{2}}&\cos{\varphi\frac{\pi}{2}}\\\end{matrix}\right]\left[\begin{matrix}1&0\\0&i\\\end{matrix}\right]\left[\begin{matrix}\cos{\frac{\pi}{2}}&\sin{\frac{\pi}{2}}\\-\sin{\varphi\frac{\pi}{2}}&\cos{\frac{\pi}{2}}\\\end{matrix}\right]=e^{i\pi/4}\left[\begin{matrix}i&0\\0&1\\\end{matrix}\right]$ Hence I think quarter-wave plate of which fast axis is vertical is $e^{i\pi/4}\left[\begin{matrix}i&0\\0&1\\\end{matrix}\right]$ But quarter-wave plate of which fast axis is vertical is known as $e^{i\pi/4}\left[\begin{matrix}1&0\\0&-i\\\end{matrix}\right]$
{ "domain": "physics.stackexchange", "id": 78695, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics", "url": null }
newtonian-mechanics, angular-momentum, conservation-laws, symmetry, spacetime-dimensions Title: In 4 spatial dimensions, would motion under a central force law be confined to a plane? In dimension $3$, we have the angular momentum $\omega = q \times v$, and since $$\frac{d}{dt} \omega = v \times v + q \times (F/m)$$ from the fact the force is central (so $F$ is parallel to $q$) we obtain the conservation of $\omega$, so $q$ always lies in the plane perpendicular to $\omega$. With 4 spatial dimensions there's no such thing as a cross product so none of this makes sense. Can motion under a central force law not lie within a $2d$ plane in this case? More specifically: is there some smooth $F : \mathbb{R}^4 - \{0\} \to \mathbb{R}^4$ such that $F(q)$ is always parallel to $q$, and some smooth $q : \mathbb{R} \to \mathbb{R}^4 - \{0\}$ satisfying $F(q(t)) = m q''(t)$ for some $m > 0$ such $q(\mathbb{R})$ does not lie in any affine 2-dimensional subspace of $\mathbb{R}^4$? In general, the angular momentum is defined as $\mathbf{L}=\mathbf{r}\wedge\mathbf{p}$. In our problem, switching to index notation, we have, in the CM frame, $$L_{\mu\nu}=r_\mu p_\nu-r_\nu p_\mu=\mu(r_\mu\dot{r}_\nu-r_\nu\dot{r}_\mu)$$ Now, since there is no external torque, angular momentum is constant.
{ "domain": "physics.stackexchange", "id": 62989, "lm_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, angular-momentum, conservation-laws, symmetry, spacetime-dimensions", "url": null }
rosdep Originally posted by peci1 on ROS Answers with karma: 1366 on 2015-04-24 Post score: 2 Original comments Comment by gvdhoorn on 2015-04-24: Not a real answer, but is there anything preventing you from contributing the rules for acpi to the main repository? Comment by peci1 on 2015-04-24: I can imagine some of our custom dependencies could go in the public list, but I'm not sure it'd be wise to add all of them (since we're not going to release our codes in the upcoming year or two, and a lot of things can change in the end and the dependecies can change or disappear). That page was out of date. Please see the documentation here: http://docs.ros.org/independent/api/rosdep/html/contributing_rules.html It used to be that you could add rosdep.yaml files in your source space, but because rosdep is a system wide setting we don't support source space modifications any more. The above link tells you how to setup a custom source. Originally posted by tfoote with karma: 58457 on 2015-04-24 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 21522, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosdep", "url": null }
immune-system, crispr Title: Does immunity to CRISPR proteins limit their effectiveness? The use of crisper-cas systems is currently applied to cells cultivated in vitro. As control of the ‘off target’ effects of Crispr improves and Crispr is used in vivo, why won’t the immune system neutralize it? Usually not. the Crispr/Cas proteins can be delivered to the cell as DNA/RNA and the proteins will only exist inside the cell in low numbers. Even in systems that deliver the protein from the outside in vivo almost always the proteins would be encapsulated in a delivery system to ensure they and any necessary accompanying nucleic acids get into the cell. Getting Crispr/Cas into a cell is difficult to do and they don't just pop in by themselves. They also require guide RNA, which will not easily stay whole in the blood stream and tissues for long. if you want to just inject a fluid into the blood with unprotected CRISPR/CAS proteins, an immune reaction might stop them. Not all proteins produce an immune reaction. Sometimes just 2-3 proteins of an entire bacterium produce an immune reaction (antibodies). But then again its unlikely the proteins would have edited any genomes in any host cells even so.
{ "domain": "biology.stackexchange", "id": 10763, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "immune-system, crispr", "url": null }
c, file-system, linux struct file_info info; if (read_file_info(path, entry->d_name, &info) != 0) { continue; } files[entry_no] = info; int owner_len = (int) strlen(get_owner(info.st.st_uid)); int size_len = snprintf(NULL, 0, "%ld", info.st.st_size); owner_w = (owner_len > owner_w) ? owner_len : owner_w; size_w = (size_len > size_w) ? size_len : size_w; if (entry_no++ == buf_size - 1) { buf_size *= 2; struct file_info *new_files = xrealloc(files, buf_size * sizeof(struct file_info)); files = new_files; } } closedir(dir); qsort(files, entry_no, sizeof(struct file_info), compare_file_name); if (!first_call) { printf("\n"); } first_call = 0; printf("%s:\n", path); for (int i = 0; i < entry_no; i++) { print_file_info(&files[i], owner_w, size_w); } for (int i = 0; i < entry_no; i++) { if (files[i].type == DIRECTORY) { list_dir(files[i].path); } } free_file_info(files, entry_no); free(files); } static int myrls(const char *path) { init(); struct stat st; if (lstat(path, &st) == -1) { file_error("cannot access", path); return MINOR_ERROR; }
{ "domain": "codereview.stackexchange", "id": 45101, "lm_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, file-system, linux", "url": null }
meteorology, atmosphere, wind $$ $R$ is the gas constant, $n$ is the particle number in moles, and $V$ is the volume. The conversion from moles to number of molecules is performed via the Avogadro constant. We have in the order of $10^{10}$ particles and in the order of $10^{25}$ molecules per $m^3$. Hence, we are are dominantly hit by gaseous molecules (assuming equal speed of particles and moolecules which is not necessarily correct). Answer No, we are not mainly hit by nitrogen particles. However, we are mainly hit by nitrogen molecules.
{ "domain": "earthscience.stackexchange", "id": 827, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "meteorology, atmosphere, wind", "url": null }
newtonian-mechanics, reference-frames, acceleration, weight Title: How much weight do you feel during negative g-forces? My physics teacher told me and some other students that when you experience negative g-forces, your weight equals: $$\frac{mass}{g_{force}}$$ So when the g-forces equal -4 g your mass will be: $$\frac{mass}{-4}$$ Now I don't think this is true, because this doesn't work when the g-forces are positive. And also to follow the pattern (example pattern):) $45 \, \mathrm{kg} \times 3g = 1350\, \mathrm N$ $45 \, \mathrm{kg} \times 2g = 900\, \mathrm N$ $45 \, \mathrm{kg} \times 1g = 450 \, \mathrm N$ $45 \, \mathrm{kg} \times 0g = 0\, \mathrm N$ $45 \, \mathrm{kg} \times (-1g) = -450\, \mathrm N$ $45 \, \mathrm{kg}\ /\;(-1g) = -450 \, \mathrm N$ $45 \, \mathrm{kg} \times (-2g) = -900\, \mathrm N$ $45 \, \mathrm{kg}\ / \;(-2g) = -225\, \mathrm N$
{ "domain": "physics.stackexchange", "id": 61170, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, reference-frames, acceleration, weight", "url": null }
However, the statement that the derivatives need to converge uniformly on $$[0,1]$$ is what's making my head spin. The original functions are defined on $$[0,1]$$ so shouldn't the derivatives be defined on $$(0,1)$$ ?. If not, what does it mean for the derivatives to converge uniformly on $$[0,1]$$ ? • Do you know measure theory and the dominated convergence theorem? Dec 8 '20 at 5:38 • If you want to establish uniform convergence, you can use this. Dec 8 '20 at 5:41 • You only need the derivatives to converge uniformly on $x \in [0,a]$ for each $0<a<1$, not $a=1$ (which would be false)... Dec 8 '20 at 5:44 • I know it would be false, but the text (reading this from Tao's analysis) says that the derivatives converge uniformly on the closed interval, which is kinda weird Dec 8 '20 at 6:00 • Sorry I havn't answered. I've been too focused on studying. I'll check your answer out when I can and tell you if I could follow it Dec 12 '20 at 0:04 Let $$f(x)= \sum\limits_{n=1}^{\infty} {(-1)^{n-1} x^{n-1}}$$. This is geomertic seris and the sum is $$\frac 1 {1+x}$$. Now $$\int_0^{x} f(t) dt=\sum\limits_{n=1}^{\infty} \frac {(-1)^{n-1} x^{n}} n$$. Since $$(-1)^{n-1}=(-1)^{n+1}$$ the given sum is $$\int_0^{x} f(t) dt=\ln (1+t)|_0^{x}=\ln (1+x)$$. As $$x \to 1$$ this tends to $$\ln 2$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812345563902, "lm_q1q2_score": 0.8090665791117658, "lm_q2_score": 0.8354835371034368, "openwebmath_perplexity": 312.339209519376, "openwebmath_score": 0.9795765280723572, "tags": null, "url": "https://math.stackexchange.com/questions/3939490/finding-the-limit-as-x-approaches-1-of-sum-frac-1n1n-xn" }
gene-ontology This is the graph representing the parents of my GO. In the same page I find the Child Terms that represent the children of my term. Now, I can download the goa file (related to the organism I'm interested into) containing the GO associations and grep my term to extract a list of associated genes but, as far as I can understand, this list does not represent the whole graph that actually describe my GO term. Should I also get the genes in the childred terms of my term? Or in the parents terms? If yes, then again I have to go back in the graph and find the parents/children of the found parents/children and so on, till the whole graph is visited. Is this the correct approach? Or should I only focus on those genes related to my GO:0030098, and that's it? I found this: Retrieving a list of human genes having GO associations and this but I think they don't address my question since they do not describe the parent-children association. Also I found this, on the GO FAQ, but what I need to do is quite the opposite. Summarising: I need to find the genes associated to a specific GO term. Should I also look for its parents or children or not? Any clues? You can use BioMart to filter by your GO term and get the genes as attributes. BioMart is ontology-aware so will pull out all genes associated with your term and with any of its child terms. There is no need to look up the GO child terms as BioMart already deals with this. A term may have more than one parent term, but if it's associated with a gene then everything about that term is associated with the gene. The term is not associated with the gene via parent X or parent Y, it means that both are relevant. So if the child term is associated with the gene, then the parent term is by proxy. If you're not already familiar with BioMart, there's a help video. Here's a BioMart query that gets you exactly what you need in human using the web interface If you want to work with the R interface to biomaRt, here's some documentation and this is the identical query to above: library(biomaRt)
{ "domain": "bioinformatics.stackexchange", "id": 769, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gene-ontology", "url": null }
error-correction, stabilizer-code "As mentioned before, the set of self-dual linear codes over GF(4) is a subset of the self-dual additive codes of Type II. Note that conjugation of single coordinates does not preserve the linearity of a code. It was shown by Van den Nest $^{[25]}$ that the code $\mathcal C$ generated by a matrix of the form Γ + $ωI$ can not be linear. However, if there is a linear code equivalent to $\mathcal C$, it can be found by conjugating some coordinates. Conjugating coordinates of $\mathcal C$ is equivalent to setting some diagonal elements of Γ to 1. Let $A$ be a binary diagonal matrix such that Γ + $A$ + $ωI$ generates a linear code. Van den Nest $^{[25]}$ proved that $\mathcal C$ is equivalent to a linear code if and only if there exists such a matrix $A$ that satisfies Γ$^2$ + $A$Γ + Γ$A$ + Γ + $I$ = $0$. A similar result was found by Glynn et al. $^{[12]}$. Using this method, it is easy to check whether the LC orbit of a given graph corresponds to a linear code. However, self-dual linear codes over GF(4) have already been classified up to length 16, and we have not found a way to extend this result using the graph approach.". References: [12] D. G. Glynn, T. A. Gulliver, J. G. Maks, M. K. Gupta, The geometry of additive quantum codes, submitted to Springer-Verlag, 2004. Book [25] M. Van den Nest, Local Equivalence of Stabilizer States and Codes, Ph.D. thesis, K. U. Leuven, Leuven, Belgium, May 2005. .PDF (English starts on page 22)
{ "domain": "quantumcomputing.stackexchange", "id": 203, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-correction, stabilizer-code", "url": null }
python, beginner, object-oriented, tic-tac-toe # Try to take the center, if it is free. if self.board[4] == " ": self.board[4] = computer_letter return def _player_move(self, letter): while True: try: move = int(input(f"It's your turn {letter}. Enter a number between 1-9: ")) - 1 if not 0 <= move <= 8: print("The number entered is invalid. Enter a number between 1 and 9.") elif self.board[move] != " ": print("This place is already occupied.") print(f"\n{self.spacer}\n") else: self.board[move] = letter break except ValueError: print(f"Enter a number!\n\n{self.spacer}\n") def play(self): print("Welcome to Tic Tac Toe!") human, computer = self._select_letter first_player = self._human_goes_first print(f"\n{self.spacer}") while not self._board_full: if first_player: print(f"\nNow playing: Human ({human})") self._player_move(human) else: print(f"\nNow playing: Computer ({computer})") self._computer_move(human, computer) first_player = False if first_player else True print(f"\n{self._print_board}") print(f"\n{self.spacer}") if self._check_win(human): print("\nYou won!") print("Thanks for playing!") break elif self._check_win(computer): print("\nComputer won!") print("Thanks for playing!") break else: print("\nNobody won, it's a tie.")
{ "domain": "codereview.stackexchange", "id": 42932, "lm_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, object-oriented, tic-tac-toe", "url": null }
python, python-3.x, email, web-scraping def sendmail(subject,message): try: server = smtplib.SMTP("smtp.server.com",587) server.set_debuglevel(0) server.ehlo() server.starttls() server.login("email@server.de","password") except: print("Can't connect to the SMTP server!") date = datetime.datetime.now().strftime( "%d.%m.%Y %H:%M:%S" ) msg = "From: email@server.de\nSubject: %s\nDate: %s\n\n%s""" % (subject, date, message) server.sendmail("email@server.de","email2@server.de",msg) server.quit() print(date+": email was sent") parser = argparse.ArgumentParser(description="Monitor if a website has changed.") parser.add_argument("url",help="url that should be monitored") parser.add_argument("-t","--time",help="seconds between checks (default: 600)",default=600,type=int) parser.add_argument("-nd","--nodiff",help="show no difference",action="store_true") parser.add_argument("-n","--nomail",help="no email is sent",action="store_true") args = parser.parse_args() url1 = urlchange(args.url) time.sleep(args.time) while(True): if(url1.comparehash()): break time.sleep(args.time)
{ "domain": "codereview.stackexchange", "id": 18492, "lm_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, email, web-scraping", "url": null }
c#, .net, sql private void someOtherButton_Click(object sender, EventArgs e) { List abbreviation = string.Empty; if (dbHelper.Open()) { abbreviation = dbConn.GetTeamLeaders(textboxTeam.Text); dbHelper.Close(); } else { return; } // all the code to use results } Now I'm sure there are some very serious issues with how this is setup, but for me my biggest complaints are always having to open and close the connection. My first move was to just move the open and close inside the DatabaseHelper methods, so each method (i.e. GetTeamLeaders) would call open and close in itself. But the problem was if it did actually fail to open it was really hard to feed it back up to the main program, which would try to run with whatever value the variable contained when it was made. I was thinking I would almost need an "out" bool that would tag along to see if the query completed, and could check make and check that anytime I used I needed to get something from the database, but I'm sure that has issues to. Another big problem with this approach is anytime I want to make a call from another form, I have to either make another instance of the helper on that form, or pass a reference to the main one. (Currently my way around this is to retrieve all the information I would need beforehand in the MainApp and then just pass that to the new form). I'm not sure if when I rewrite this there's a good static way to set it up so that I can call it from anywhere. So is there anything here worth keeping or does it all need to be stripped down and built back from scratch? I'm going to try to attack from a perspective of refactoring. In my mind "re-write" means starting over. In MainApp.cs you want to say this: teamLeaders = dbConn.GetTeamLeaders(textboxTeam.Text);
{ "domain": "codereview.stackexchange", "id": 3310, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, sql", "url": null }
neutrinos Title: Experiments to find right handed neutrinos I have read this in the wiki article about neutrino oscillation. The question of how neutrino masses arise has not been answered conclusively. In the Standard Model of particle physics, fermions only have mass because of interactions with the Higgs field (see Higgs boson). These interactions involve both left- and right-handed versions of the fermion (see chirality). However, only left-handed neutrinos have been observed so far. An then I have found a link therein (on Wikipedia) which lead to this book: https://books.google.com/books?id=tYFMoFi50hsC&printsec=frontcover&dq=Seventy+Years+of+Double+Beta+Decay:+From+Nuclear+Physics+to+Beyond-standard&hl=en&sa=X&ved=0ahUKEwjGydPEhsLbAhWzMn0KHVuxCSoQ6AEIKTAA#v=onepage&q=Seventy%20Years%20of%20Double%20Beta%20Decay%3A%20From%20Nuclear%20Physics%20to%20Beyond-standard&f=false But so far I have found nothing searhing for right-handed neutrinos, or any experiments to look for them. I have read these too: Why are right hand neutrinos unaffected by all forces except gravity If the mass of neutrino is not zero, why we cannot find right-handed neutrinos and left-handed anti-neutrinos? Question:
{ "domain": "physics.stackexchange", "id": 51967, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neutrinos", "url": null }
control-engineering, control-theory Title: Control theory: Closed loop zeros, Root locus and its dynamic response Why the closed loop dominant poles of the root locus can show the response of the system? Wont it neglect the effect of the closed loop zeros? As I read on the books, root locus method deal with the closed loop poles. It sketch the locus of the close-loop poles under an increase of one open loop gain(K) and if the root of that characteristic equation falls on the RHP. It means the close loop pole fall into RHP and make system unstable. But the exercises and examples also treat Root locus as a method of designing compensation or gain to fulfill the system requirement like damping factor and setting time. Isn't the root locus method for stability only? I thought the system response should include the closeloop zero. Did I miss something? Also, can Nyquist plot also used to show the system response and to design the system? As I thought its some how same as Root locus, with frequency being the varying K(gain). But the exercises and examples also treat Root locus as a method of designing compensation or gain to fulfill the system requirement like damping factor and setting time. Isn't the root locus method for stability only? What determines stability? zeros or poles? Poles on RHP always cause instability. That is what we would like to avoid. In many cases, as long as the system is stable, engineers do not care. They just like a system work either good or bad. But the system requirements is also important. But it is meaningless if the system is not stable. Therefore, stability is the first requirement. The system quality is a bonus. Why the closed loop dominant poles of the root locus can show the response of the system?
{ "domain": "engineering.stackexchange", "id": 4062, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "control-engineering, control-theory", "url": null }
performance, linked-list, swift, complexity, collections Title: LinkedList Swift Implementation Linked List Implementation in Swift Swift 5.0, Xcode 10.3 I have written an implementation for a doubly linked list in Swift. As well, I decided to make the node class private and thus hidden to the user so they don't ever need to interact with it. I have written all of the algorithms that I needed to give it MutableCollection, BidirectionalCollection, and RandomAccessCollection conformance. What I Could Use Help With I am pretty sure that my LinkedList type properly satisfies all of the time complexity requirements of certain algorithms and operations that come hand in hand with linked lists but am not sure. I was also wondering if there are any ways I can make my Linked List implementation more efficient. In addition, I am not sure if there are and linked list specific methods or computed properties that I have not included that I should implement. I have some testing but if you do find any errors/mistakes in my code that would help a lot. Any other input is also appreciated! Here is my code: public struct LinkedList<Element> { private var headNode: LinkedListNode<Element>? private var tailNode: LinkedListNode<Element>? public private(set) var count: Int = 0 public init() { } } //MARK: - LinkedList Node extension LinkedList { fileprivate typealias Node<T> = LinkedListNode<T> fileprivate class LinkedListNode<T> { public var value: T public var next: LinkedListNode<T>? public weak var previous: LinkedListNode<T>? public init(value: T) { self.value = value } } } //MARK: - Initializers public extension LinkedList { private init(_ nodeChain: NodeChain<Element>?) { guard let chain = nodeChain else { return } headNode = chain.head tailNode = chain.tail count = chain.count } init<S>(_ sequence: S) where S: Sequence, S.Element == Element { if let linkedList = sequence as? LinkedList<Element> { self = linkedList } else { self = LinkedList(NodeChain(of: sequence)) } } }
{ "domain": "codereview.stackexchange", "id": 35602, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, linked-list, swift, complexity, collections", "url": null }
ros, callback Title: Multiple subscribed topics in one callback Hi, I'm new to ROS and PCL as well so please excuse my trivial question. I need to process a PointCloud topic and CameraInfo topic (project the cloud using the camera info). What is the best way to do that? I can see that I cannot have multiple topics as arguments in one callback, I found I can use the function "bind" but I am not sure if it is the right way for me... Thanks in advance, jp Originally posted by jpo on ROS Answers with karma: 57 on 2014-03-04 Post score: 4 In general, if you want to synchronize the input from two topics and process them in the same callback, you can use the message_filters time synchronizer API. If you're looking specifically to receive a camera_info message and use the data in it for processing a camera image, it may be better to subscribe to the two topics separately and just save the most recent CameraInfo for use when processing images. This relaxes the timing requirements pretty significantly and means you don't have to run a complex synchronization filter. You may also find the documentation on the CameraInfo message useful. For typical uses you should be able to extract XYZ from a structured RGB Point cloud without resorting to CameraInfo. Originally posted by ahendrix with karma: 47576 on 2014-03-04 This answer was ACCEPTED on the original site Post score: 4 Original comments Comment by shrini96 on 2023-05-23: Somehow the rospy version of this API does not seem does not seem to be working. The execution never really reaches the callback function (based on the example they have shown there). I wanted it for synchronizing odometry and laser scan messages. But well, I am going to look for a different solution than trying to make this work, or else this could have been a separate question on its own. Comment by shrini96 on 2023-06-04: So just for anyone else having the same problem, the solution is to use message_filters.ApproximateTimeSynchronizer instead of the tutorial suggested message_filters.TimeSynchronizer. I got this idea from this SE post.
{ "domain": "robotics.stackexchange", "id": 17169, "lm_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, callback", "url": null }
lstm Title: Possible to correct an actual cell state in LSTM via gradient? Why in LSTM we calculate gradient w.r.t weights, but not w.r.t the cell state? Is it theoretically possible to correct the contents of the cell state, and what would it result in? I understand that weights are like a "set of skills", so that network can respond correctly to the input, even gazillions of iterations later. The cell-state is an understanding of what's going on in the past, up to the start of the current minibatch. So why not to correct the value stored in the cell state? It would be very useful if we carry the cell state forward, between minibatches. https://stackoverflow.com/a/44183738/9007125] Generally it is recommended to reset state after each epoch, as the state may grow for too long and become unstable. However in my experience with small size datasets (20,000- 40,000 samples) resetting or not resetting the state after an epoch does not make much of a difference to the end result. For bigger datasets it may make a difference. Is it theoretically possible to correct the contents of the cell state, and what would it result in? Yes it is. Using back propagation, it is possible to get the gradient of any value that affects a well-defined output. For training data, that includes all current cell outputs - in fact these are necessary to calculate as an interim step in order to get the gradients of the weights. Once you have the gradients of a cost or error function, then you can perform a step of gradient descent in order to discover a value that would result in a lower error for given training data. In usual training scenarios you do not alter neuron outputs after they have been calculated using feed-forward, because these are not parameters of the model. Typical reasons to alter neuron values (or even the input) are in order to view what the ideal state might be in a given scenario. If your state can be visualised through some decoder - maybe even another neural network - then this could allow you to see the difference between actual internal state, and a potentially better one. That could be useful in error analysis for example. So why not to correct the value stored in the cell state?
{ "domain": "datascience.stackexchange", "id": 2565, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lstm", "url": null }
energy, definition Centuries ago, before people appreciated the fundamental role of maths in physics, they believed e.g. that the heat - a form of energy - was a material called the phlogiston. But, a long long time ago experiments were done to prove that such a picture was invalid. Einstein's $E=mc^2$ partly revived the idea - energy is equivalent to mass - but even the mass in this formula has to be viewed as a number rather than something that is made out of pieces that can be "touched". Energy has many forms - terms contributing to the total energy - that are more "concrete" than the concept of energy itself. But the very strength of the concept of energy is that it is universal and not concrete: one may convert energy from one form to another. This multiplicity of forms doesn't make the concept of energy ill-defined in any sense. Because of energy's relationship with time above, the abstract definition of energy - the Hamiltonian - is a concept that knows all about the evolution of the physical system in time (any physical system). This fact is particularly obvious in the case of quantum mechanics where the Hamiltonian enters the Schrödinger or Heisenberg equations of motion, being put equal to a time-derivative of the state (or operators). The total energy is conserved but it is useful because despite the conservation of the total number, the energy can have many forms, depending on the context. Energy is useful and allows us to say something about the final state from the initial state even without solving the exact problem how the system looks at any moment in between. Work is just a process in which energy is transformed from one form (e.g. energy stored in sugars and fats in muscles) to another form (furniture's potential energy when it's being brought to the 8th floor on the staircase). That's when "work" is meant as a qualitative concept. When it's a quantitative concept, it's the amount of energy that was transformed from one form to another; in practical applications, we usually mean that it was transformed from muscles or the electrical grid or a battery or another "storage" to a form of energy that is "useful" - but of course, these labels of being "useful" are not a part of physics, they are a part of the engineering or applications (our subjective appraisals).
{ "domain": "physics.stackexchange", "id": 97614, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy, definition", "url": null }
quantum-field-theory, symmetry-breaking Title: Confusion over spontaneous symmetry breaking Consider a complex scalar field with Lagrangian $$\mathcal{L} = (\partial_{\mu} \bar{\phi})(\partial^{\mu} \phi) - V(\phi)$$ with potential $$V(\phi) = \frac{1}{4}\lambda(\bar{\phi}\phi - \eta^2)^2$$ The model is invariant under global $U(1)$ phase transformations. The minima of the potential lie on the circle $|\phi| = \eta$, and so the vacuum is characterized by a non-zero expectation value: $$\langle 0|\phi|0\rangle = \eta e^{i\theta}.$$ Now, here is where my confusion lies. The $U(1)$ phase transformation would change the phase of the ground state into $\theta + \alpha$ for some constant $\alpha$. If the symmetry were still manifest, then we would not have found this and instead returned to $\theta$ alone; therefore, the symmetry is broken. However, the broken symmetry vacua with different values of $\theta$ are all equivalent. So, what would it matter if considered $\theta + \alpha$ as opposed to $\theta$ as surely the two represent equivalent vacua? If this is the case, then why is the phase transformation not a symmetry of the vacuum, if it works only to move me to an equivalent configuration? What am I missing? In general, spontaneous symmetry breaking is the phenomenon in which a stable state of a system (for example the ground state or a thermal equilibrium state) is not symmetric under a symmetry of its Hamiltonian, Lagrangian, or action. Note the "stable" word, it is important: it means that if such a state is perturbed, then it oscillates around its non-perturbed configuration. The vacua configurations are equivalent from the energetic point of view, but are not the same configuration. Since these configurations are required to be stable, they do not "mix", i.e. it is not easy to pass from one to another, they can just oscillate (this is related to the "Goldstone modes").
{ "domain": "physics.stackexchange", "id": 69698, "lm_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, symmetry-breaking", "url": null }
r, ggplot2 I want to plot based on condition. Not sure how I would do that. I tried the fill command but doesn't seem to work as the object is not found, I can't seem to add it back to the data set. How do I include the condition in the bar chart? When I'm calculating sd, I think it's combining the cell type value into one, rather than taking it individually. How do I change that? dput(head(all@meta.data)) structure(list(orig.ident = c("PDAC", "PDAC", "PDAC", "PDAC", "PDAC", "PDAC"), nCount_RNA = c(7945, 7616, 7849, 5499, 853, 1039), nFeature_RNA = c(2497L, 2272L, 2303L, 2229L, 509L, 588L ), percent.mt = c(2.63058527375708, 3.7421218487395, 4.9433048796025, 0.490998363338789, 0.234466588511137, 0.192492781520693), RNA_snn_res.0.5 = structure(c(5L, 5L, 5L, 5L, 1L, 6L), .Label = c("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"), class = "factor"), seurat_clusters = structure(c(5L, 5L, 5L, 5L, 1L, 6L), .Label = c("0", "1", "2", "3", "4", "5",
{ "domain": "bioinformatics.stackexchange", "id": 1249, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "r, ggplot2", "url": null }
general-relativity, metric-tensor, coordinate-systems, singularities but after a change in coordinates such that the radial velocity of light is constant In the first map the singularity is shown as a point, in the second it appears as a surface. However, these representations are properties of the maps, not the properties of a geometrical manifold. If spacetime were a topological manifold (without metric) either might be valid, and I think that is what Hawking and Ellis are suggesting. But that depends on the philosophical assumption that there exists a prior manifold independent of measurement. I would disagree fundamentally with such an assumption. The manifold in general relativity is not a substantive physical prior, it is constructed out of physical measurements, and consequently it has no meaning at points where measurement is not possible. The same thing is seen in quantum mechanics, the property of position does not always exist for a particle.
{ "domain": "physics.stackexchange", "id": 65221, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, metric-tensor, coordinate-systems, singularities", "url": null }
python, algorithm, python-3.x #Move 4: move from B into C (if room) AND (if not state doesn't exist) if jugB_state !=0: if jugC_state < jugC_max: #Empty B into C if room if jugC_state + jugB_state <= jugC_max: new_jugB_state, new_jugC_state = 0, jugC_state + jugB_state else: #Empty as much of B into C new_jugB_state, new_jugC_state = (jugB_state - jugC_max), jugC_max new_jugA_state = jugA_state if [new_jugA_state,new_jugB_state,new_jugC_state] not in listPrevSolutions: listPrevSolutions.append([new_jugA_state,new_jugB_state,new_jugC_state]) listTotalSteps.append(runningTotal+1) list_index_steps.append(previousSteps + [listPosition]) listPosition +=1 noNewSolutionAdded = 0 if new_jugA_state == targetVol or new_jugB_state == targetVol or new_jugC_state == targetVol: print (targetVol,"ml reached in", runningTotal+1,"steps") print_Steps_Taken(previousSteps + [listPosition-1]) return True #Move 5: move from C into B (if room) AND (if not state doesn't exist) if jugC_state !=0: if jugB_state < jugB_max: #Empty C into B if room if jugC_state + jugB_state <= jugB_max: new_jugC_state, new_jugB_state = 0, jugB_state + jugC_state else: #Empty as much of C into B totalToMove = jugB_max - jugB_state new_jugB_state, new_jugC_state = jugB_max, jugC_state - totalToMove
{ "domain": "codereview.stackexchange", "id": 34282, "lm_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 }
So lets find it: You figured if $$x = 7k + 6 \equiv 4 \pmod 5$$. So that means $$7k +6 \equiv 2k + 1 \equiv 4 \pmod 5$$ so $$2k \equiv 3\pmod 5$$. Now note that $$3*2 \equiv 6 \equiv 1 \pmod 5$$ so that means $$2k \equiv 3\pmod 5$$ so $$3*2k\equiv 3*3\pmod 5$$ so $$6k\equiv 9\pmod 5$$ and $$k \equiv 4 \pmod 5$$. So have $$k = 5m + 4$$ for some $$m$$ and $$x = 7(5m + 4) + 6 = 35m +34$$ so $$x\equiv 34 \pmod {35}$$. In hindsight this makes a lot of sense! $$x \equiv 4\equiv -1 \pmod 5$$ and $$x \equiv 6\equiv -1 \pmod 5$$. So $$x \equiv -1$$ both $$\pmod 5$$ and $$\pmod 7$$ and so $$x \equiv -1 \equiv 34 \pmod {35}$$ is a solution $$\pmod {35}$$ (and by CRT it is the only solution. It would have been much easier to do it that way). Okay.... so we have $$x \equiv 34 \equiv -1\pmod {35}$$. Let's not make the same mistake twice. Let's use $$x = 35m -1$$ for some $$m$$. SO $$35m -1 \equiv 1 \pmod 3$$ so $$35m \equiv 2\pmod 3$$. But $$35m\equiv 2m\equiv 2\pmod 3$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806518175515, "lm_q1q2_score": 0.8128413590526191, "lm_q2_score": 0.8289388104343892, "openwebmath_perplexity": 236.47306618868794, "openwebmath_score": 0.9398370981216431, "tags": null, "url": "https://math.stackexchange.com/questions/3696009/solving-system-of-congurences-with-the-chinese-remainder-theorem" }
dna, gene Title: Are genes on the 5' to 3' strand only? I confused myself during studying, and wanted to confirm something. Since transcription via RNA polymerases only takes place in the 5'to 3' direction, that would mean that that 5' to 3' strand is the only one that contains the information to be translated later into a protein or mRNA or w/e. So then the 3' to 5' strand would NOT contain any genes, but just the base pair complement to them? Or am I thinking of the concept of a gene wrong? There is nothing called the 3' to 5' strand. Both strands are have the same polarity but the DNA helix is anti-parallel. Both the strands contain approximately equal number of genes. Sometimes the transcription from both the strands can overlap, leading to production of antisense-transcripts. So RNA polymerase will read the other strand from its 3' to 5'.
{ "domain": "biology.stackexchange", "id": 4414, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dna, gene", "url": null }
coordinate with $\delta$ declination, $\phi$ your latitude and $\text{HA}$ the hour angle at the time of the observation, which is the local sidereal time minus right ascension. You can then solve these two equations for declination and hour angle, and convert the hour angle to right ascension by $\alpha=\text{LST}-\text{HA}$, with $\text{LST}$ being the local sidereal time at the second observation. In your case, the elevation and azimuth aren't changing, so the declination and hour angle are the same. What has changed is the local sidereal time, which - for two observations spaced an hour apart - has changed by approximately one hour, meaning that in turn the right ascension will have changed by approximately one hour.
{ "domain": "astronomy.stackexchange", "id": 5628, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "coordinate", "url": null }
astrophysics, newtonian-gravity, planets Title: What is the maximum mass of planet HD 40307 g Recently discovered planet HD 40307g around HD40307 Star system is claiming that its inside a habitual zone of a solar system. Besides It has water where life could be evolved. I tried to calculate g of that planet. But failed! This is because the true mass of the planet could not be found. What we have is Minimum Mass which is 7.1 times Earth mass. My question is how do I know the Maximum Mass? It isn't possible to determine upper limits for the planet masses. The problem is that we don't know the orientation of the system relative to us. The system has been analysed by measuring the motion of the star in the direction towards and away from us. For some planetary mass $M$ we'll see the biggest star motion if we're looking at the system edge on, because in that orientation the planet pulls the star directly towards us and directly away from us as it revolves around the star. If the plane of the system is tilted with respect to us we'll see a smaller stellar motion, and if the system is at 90 degrees to us we wouldn't see any stellar motion at all no matter how big the planet's mass was. So it's easy to calculate the minimum masses of the planets, because to do that we assume the system is edge on with respect to us. However there is no upper limit to the mass without an upper limit to the inclination of the system.
{ "domain": "physics.stackexchange", "id": 5419, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics, newtonian-gravity, planets", "url": null }
forces, quantum-chromodynamics, quarks, color-charge Title: What IS Color Charge? This question has been asked twice already, with very detailed answers. After reading those answers, I am left with one more question: what is color charge? It has nothing to do with colored light, it's a property possessed by quarks and gluons in analogy to electric charge, relates to mediation of strong force through gluon exchange, has to be confined, is necessary for quarks to satisfy Heisenberg principle, and one of the answers provided a great colored Feynman diagram of its interaction, clearly detailing how gluon-exchane leads to the inter-nucleon force. But what is it? To see where I'm coming from, in Newton's equation for gravity, the "charge" is mass, and is always positive, hence the interaction between masses is always attractive. In electric fields the "charge" is electric charge, and is positive or negative. (++)=+, (--)=+, so like charges repel (+-)=(-+)=-, so opposite charges attract. In dipole fields, the "charge" is the dipole moment, which is a vector. It interacts with other dipole moments through dot and cross products, resulting in attraction, repulsion, and torque. In General Relativity, the "charge" is the stress-energy tensor that induces a curved metric field, in turn felt by objects with stress-energy through a more complicated process. So what is color charge? The closest that I've gotten is describing it through quaternions ($\mbox{red}\to i$, $\mbox{blue}\to j$, $\mbox{green}\to-k$, $\mbox{white}\to1$ , "anti"s negative), but that leads to weird results that don't entirely make sense (to me), being non-abelian.
{ "domain": "physics.stackexchange", "id": 6120, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "forces, quantum-chromodynamics, quarks, color-charge", "url": null }
robotic-arm, ros, moveit Originally posted by Mike Scheutzow with karma: 4903 on 2021-10-17 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by definitelynotabot on 2021-10-17: In 2), by "use two different movement plans", do you mean to first set_pose_target() to target object's initial location and plan, and then, after the initial location has been reached, set_pose_target() to the destination location and plan? Comment by Mike Scheutzow on 2021-10-18: Yes. For me, the planner's decisions were surprisingly random. For many situations, the arm's movement is much more predictable if you give the planner a series of waypoints rather than just the final goal. But for getting started, one pose should be enough.
{ "domain": "robotics.stackexchange", "id": 37024, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "robotic-arm, ros, moveit", "url": null }
php, authentication, session self::relogUser($result['login_userId']); } public static function isLoggedIn(){ Session::openSession(); return isset($_SESSION['userId']); } public static function handleAuthentication() { try { self::authenticate(); } catch (\Exception $e) { self::notLogged(); } }
{ "domain": "codereview.stackexchange", "id": 27430, "lm_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, authentication, session", "url": null }