text
stringlengths
1
1.11k
source
dict
particle-physics, nuclear-physics, conservation-laws, elementary-particles No. Flavor is a good quantum number. In charged current weak interactions, flavor is violated, whence the ditty that strangeness is produced strongly (in S=-1+1=0 associated pairs), but decays weakly: strangeness weak-decays to upness. Can there be a weak interaction in which transformation of quark flavors doesn't take place? Yes, of course. Weak neutral currents, coupling to the Z boson, do not violate flavor. If both the answers are "No", then while checking a nuclear reaction/decay can't we just match quarks on both sides(by cancelling extra quark and anti quark pairs) and if same number of different quarks are present than it will be a strong interaction and it not than a weak interaction(provided other conservation laws are followed)? No, you saw why you can't just do that, as your premise fails. In NC neutrino scattering, flavors are conserved. If leptons are present in a nuclear reaction/decay does that necessarily mean that the reaction is a weak interaction?
{ "domain": "physics.stackexchange", "id": 72983, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, nuclear-physics, conservation-laws, elementary-particles", "url": null }
- +1: More questions though: Is integrability of $f''$ enough to prove that all the solutions of the differential equation are given by Christian's answer? Are you sure there are no extra assumptions being made there? –  Aryabhata Feb 10 '12 at 18:30 For instance the theorem on this wiki: en.wikipedia.org/wiki/Green%27s_function seems to assume continuity of $y''-y$. (Of course, a wiki might not be reliable). –  Aryabhata Feb 10 '12 at 18:37
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.970687766704745, "lm_q1q2_score": 0.8211459827719816, "lm_q2_score": 0.84594244507642, "openwebmath_perplexity": 155.13298726897384, "openwebmath_score": 0.9750116467475891, "tags": null, "url": "http://math.stackexchange.com/questions/107001/proving-the-positivity-of-a-twice-differentiable-real-valued-function" }
ros, ros-melodic, tf2, dynamic-reconfigure, transform ## Retrieve parameters ## self.parent_frame = parent_frame self.child_id = child_id ## Create static broadcster ## self.static_br = tf2_ros.StaticTransformBroadcaster() ## Initialize transform broardcaster ## self.br = tf2_ros.TransformBroadcaster() self.tf_msg = geometry_msgs.msg.TransformStamped() ## Initialize dynamic reconfigure server ## self.srv = Server(PandaAutoGraspConfig, self.dync_reconf_callback) def dync_reconf_callback(self, config, level): """Dynamic reconfigure callback function.
{ "domain": "robotics.stackexchange", "id": 33816, "lm_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-melodic, tf2, dynamic-reconfigure, transform", "url": null }
plasma-physics, fusion \begin{equation} n T \tau'_E\geq \frac{12 T^2}{\langle \sigma v\rangle \epsilon_{\alpha}-4 c_{br}\sqrt{T}}\,. \end{equation} I suspect that the plots in the links above use a different definition of the Lawson criterion, \begin{equation} P_f \geq \frac{W}{\tau_E}\,, \end{equation} where $\tau_E$ is the total energy confinement time (including radiative losses). Re-arranging again gives a different lower limit on the triple product, \begin{equation} n T \tau_E\geq \frac{12 T^2}{\langle \sigma v\rangle \epsilon_{\alpha}}\,. \end{equation} Now, by our definition we also require that the power density loss due to Bremsstrahlung is less than the total energy loss rate per unit volume, \begin{equation} P_{rad} \leq \frac{W}{\tau_E}\,, \end{equation} Re-arranging gives the following upper limit on the triple product \begin{equation} n T \tau_E \leq \frac{3 T^{3/2}}{c_{br}}\,. \end{equation}
{ "domain": "physics.stackexchange", "id": 52535, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "plasma-physics, fusion", "url": null }
cc.complexity-theory, time-hierarchy * A weak form of additive time hierarchy is discussed in "Computational Models with No Linear Speedup" by Amir Ben-Amram, Niels Christensen, Jakob Grue Simonsen (2012). The three ingredients of a diagonalization based proof of the time hierarchy theorem are universal simulation, timing, and reversal. By choosing (or defining) a computational model where these operations are efficient, we get a sharp hierarchy theorem. In particular, by using a model with a timed virtualization primitive satisfying certain conditions, we get a time hierarchy in the requested form. However, unlike the sharp space hierarchy, the precise time usage and hierarchy is on a per-model basis (and thus somewhat arbitrary). If we set up things appropriately, the following algorithm can be implemented in time $f(n)+O(g(n))$ but not in time i.o.-$(f(n)+O(1))$ where $g(n)≥\log(n+f(n))$ and $f$ is $g$-time computable (i.o. means infinitely often): * Determine the input length $n$, and compute $f(n)$.
{ "domain": "cstheory.stackexchange", "id": 4190, "lm_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, time-hierarchy", "url": null }
python, python-3.x, random, graph In your comments you talked about not needing to build an explicit graph; you claimed to do it virtually. But notice that you do need to keep track of all the edges so that you can count them. Because performance is an issue, and we want to be able to handle large numbers of items, I made some optimizations that may make the code harder to read. For example, for the task at hand a List[int] (array) can serve the purpose of a Dict[int, int] with a lot less machine overhead. But it ties you representing your nodes as ints. As for further research steps, it depends on your goals. My intuition is that this kind of sampling may be an easy way of checking if your hypothesis is viable, and you've done that. If you want to prove it, then you need to actually prove it. Maybe a programmatic proof system like agda or coq can help, maybe not; I haven't learned them yet! import matplotlib matplotlib.use('TkAgg')
{ "domain": "codereview.stackexchange", "id": 38565, "lm_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, random, graph", "url": null }
programming-challenge, time-limit-exceeded, swift // Similar for best window ... With a struct StringWindow { var startIndex: String.Index var endIndex: String.Index var length: Int // ... } these related properties are nicely combined, and it makes the code more self-documenting: var currentWindow = StringWindow(...) var bestWindow: StringWindow? Comparing the length against the optional bestWindow can be put into a method of that type, assigning a new best window is simply done with bestWindow = currentWindow and the final result can be determined with optional binding: if let best = bestWindow { return String(s[best.startIndex..<best.endIndex]) } else { return "" } Putting it together Putting all the above suggestions together the code could look like this: func minWindow(_ s: String, _ t: String) -> String { struct StringWindow { var startIndex: String.Index var endIndex: String.Index var length: Int
{ "domain": "codereview.stackexchange", "id": 36796, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming-challenge, time-limit-exceeded, swift", "url": null }
general-relativity, spacetime, coordinate-systems, time, observers Title: The synchronized clocks on earth's surface: at which observer's rate are they beating? From what I understand, the time rates (I'm not speaking about absolute times) of all clocks on earth's surface are synchronized. This means that, say, a mobile phone's clock is generally not beating the mobile phone's proper time – any synchronization would be out as soon as we swing the phone around – although the difference is probably undetectable with today's technology. I assume this synchronized time rate is the proper-time rate of some observer. My question is: which one? For instance: An observer standing still on Earth at zero sea level and zero latitude? Or an observer at zero sea level and zero latitude that's standing still with respect to the distant stars? Or an observer at infinity (the $t$ coordinate in Schwarzschild's metric)? (My question is different from this question, which is about how synchronization is achieved in practice).
{ "domain": "physics.stackexchange", "id": 98503, "lm_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, spacetime, coordinate-systems, time, observers", "url": null }
nlp Title: Checking if english sentences have impact catpured in them using NLP I am looking for high level approach to identify if a given sentence has impact captured in it. For example in below two examples, sentence 2 has impact captured. Example 1 Sentence 1: I learnt speaking spanish this year. Sentence 2: I learnt speaking spanish this year which helped expand my business to Mexico. Example 2 Sentence 1 : I taught machine learning to my students this year. Sentence 2 : I taught machine learning to my students earlier this year which resulted in increasing base salary of students by 20,000 Dollars. My initial thought is below approach. think of all the english words like helped, resulted etc., Apply these words as filters on a public domain data set to get sentences Curate the sentences to see if they fall in the "Sentence 2" category. Apply classification/modelling to categorize into sentences with impact and without impact Question:
{ "domain": "datascience.stackexchange", "id": 6995, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nlp", "url": null }
c++, object-oriented, strings I tried doing this with return type as void and cout within the function, but apparently there's going to be an error for this with iostream. So is returning const string& a good way to do this? I passed by const reference because I do not change the object within the function. Function 3: stringOps stringOps::reverseStr(stringOps &a) { reverse(a.arr.begin(), a.arr.end()); return a; } This again takes the argument of type stringOps object by reference and directly manipulates the string. However, if I were to pass this argument as a const, how do I go about this? Motivation for me to do so is that I want to return a manipulated string that is new, and not manipulate the object that is coming in directly. The header would look something like this: string stringOps::reverseStr(const stringOps &a)
{ "domain": "codereview.stackexchange", "id": 21031, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, object-oriented, strings", "url": null }
botany, color Again about photodamage. We have to remember that the capture of photons by chlorophyll is only the beginning of a very long chain of chemical transformations needed for photosynthesis to take place. If the plant is under unfavorable conditions (low or high temperature, lack of moisture, etc), the biochemical cycles can be disrupted. In this case, chlorophyll will continue to absorb photons and enter the excited state, but it will not be able to release this energy further into the cycle. This can be due to many reasons, like the depletion of the plastoquinone pool for example. Under such conditions, the threat of heat shock (if the captured energy is released as heat) or oxidative shock through the formation of reactive oxygen species (ROS) increases. Some plants have developed interesting mechanisms to prevent such adverse effects. In particular, mottled leaf coloration, where green areas alternate with meteolated (chlorophyll-free) areas. Such meteolated areas act as a kind of
{ "domain": "biology.stackexchange", "id": 11840, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "botany, color", "url": null }
c++, algorithm, interview-questions, clustering, natural-language-processing // Required for dennominator count[tok]++; std::set<std::string> known; // Checking the last K history for (auto &i : hist) { if (!known.count(i)) { coo[std::pair<std::string, std::string>(tok, i)]++; //coo[std::pair<std::string, std::string>(i, tok)]++; } known.insert(i); } if (hist.size() != K) { hist.push_back(tok); } else { /* * Reconstruct the history of recent words */ for (auto i = 0; i < hist.size()-1; i++) { hist[i] = hist[i+1]; } hist[hist.size()-1] = tok; } } } std::vector<std::string> toks; boost::split(toks, line, boost::is_any_of(" "));
{ "domain": "codereview.stackexchange", "id": 21880, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, algorithm, interview-questions, clustering, natural-language-processing", "url": null }
order-of-magnitude Look at the table "Some Physical Constants" at the start of the book for examples. This is just the number "$0.0086$". Separating last digit with a space is fairly pointless in this case, IMO, but I suppose the "style sheet" for the book was set up to format all numbers the same way.
{ "domain": "physics.stackexchange", "id": 42505, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "order-of-magnitude", "url": null }
quantum-state, measurement, locc-operation Title: Universal resource for measurement based quantum computation Consider universal resources for measurement based quantum computation, as defined here: We are now ready to formulate the following definition. A family $\Psi$ is called a universal resource for MQC if for each state $|\phi\rangle$ on $n$ qubits there exists a state $|\psi\rangle \in \Psi$ on m qubits, with $m \geq n$, such that the transformation $$|\psi\rangle \rightarrow |\phi\rangle|+\rangle ^{m−n}$$ is possible deterministically (with probability 1) by LOCC.
{ "domain": "quantumcomputing.stackexchange", "id": 3299, "lm_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-state, measurement, locc-operation", "url": null }
ros, ros-kinetic, universal-robot, ur5 please note that for multi-homed hosts this may not return the correct IP. Could you show the output of ip addr show? And UniversalRobots/Universal_Robots_ROS_Driver#74 is a recent thread with a similar issue. See some of the later comments with steps to diagnose connection issues. Comment by gvdhoorn on 2020-01-09: Given this: 192.168.69.4/19 I'm curious how you can access 192.168.1.200. Is there a (NAT) router between you and the robot? Can you show the output of: tracepath 192.168.1.200? Comment by krablander on 2020-01-09: There is a router between the ROS PC and the robot. tracepath 192.168.1.200 outputs this: 1?: [LOCALHOST] pmtu 1500 1: 192.168.1.200 3.091ms reached 1: 192.168.1.200 1.933ms reached Resume: pmtu 1500 hops 1 back 1
{ "domain": "robotics.stackexchange", "id": 34245, "lm_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, universal-robot, ur5", "url": null }
reinforcement-learning, deep-rl, hyperparameter-optimization, hyper-parameters, a3c Having more child processes (up to a point, discussed above), will increase hardware utilization, and make your training run faster. With a Core i7 CPU for instance, you might be able to run 8 or 16 child processes at a time, so you'd train 8-16x times faster. Having more child processes than processing units (CPU cores, CUDA cores), will begin to cause frequent context switching, where the processing units have to pause to change between different jobs. Changing jobs is extremely expensive, and ultimately, your program cannot train faster than it would by using all the available hardware. If you have more processes than processing units, reducing the number should make your program train faster.
{ "domain": "ai.stackexchange", "id": 669, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reinforcement-learning, deep-rl, hyperparameter-optimization, hyper-parameters, a3c", "url": null }
ruby, ruby-on-rails, html5 I'm still at an experimental stage at the moment so I'm looking at all the feedback I can get! Github link for the whole project. Controller class GridController < ApplicationController
{ "domain": "codereview.stackexchange", "id": 17080, "lm_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, ruby-on-rails, html5", "url": null }
solubility, solutions, recrystallization Edit 2: Changed the description of entropy After thinking for sometime, I realized that I neglected to mention three things:
{ "domain": "chemistry.stackexchange", "id": 14503, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "solubility, solutions, recrystallization", "url": null }
java, algorithm, collections, guava Step 8 is quite an odd step, partly because I feel you have deconstructed a Map semantic as a sorted List of Entry instances. This definitely can be implemented in the form of a TreeMap, which allows you to sort on the keys while giving you additional flexibility of retrieving using Map-friendly methods. After sorting the keys, you can simply use the largest key to get() from your Multimap as your result, instead of having to deal with a List<Entry> data structure. Putting together, steps 4 to 8 can probably be done as such: private static <K, V extends Comparable<V>> Collection<K> getMaximumByValue( Map<K, V> map) { Multimap<V, K> inverseMap = Multimaps.invertFrom(Multimaps.forMap(map), ArrayListMultimap.create()); return inverseMap.get(Ordering.natural().immutableSortedCopy(inverseMap.keys()) .reverse().get(0)); }
{ "domain": "codereview.stackexchange", "id": 15331, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, collections, guava", "url": null }
• As far as I understand, the ball does not move along the cavity, therefore, there's no centripetal acceleration of the ball. – ole Feb 2 at 15:17 • The fact that the cavity is a circular arc just means that you can use the labeled angle on the figure to determine the direction of the normal force at the point where the sphere rests on the surface of the cavity. The problem could equally well have told you there was a glass of water in a cup holder in the car and could have described the angle of the surface the the water in the glass. – David K Feb 2 at 15:22
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717452580315, "lm_q1q2_score": 0.8553929878335765, "lm_q2_score": 0.8670357649558006, "openwebmath_perplexity": 309.4383571958716, "openwebmath_score": 0.7747662663459778, "tags": null, "url": "https://math.stackexchange.com/questions/3531519/how-to-find-the-acceleration-of-a-car-ascending-in-an-incline-when-a-sphere-make" }
pressure, gas Title: Why do we consider pressure for perfect gas? In Equation of state formula for perfect gas we have : PV=nRT So we know perfect gas is a gas in which particles don't have any contact with each other. So logically there shouldn't be any pressure in this situation . Sorry for poor English Pressure is due to the gas molecules contacting the container not each other
{ "domain": "physics.stackexchange", "id": 33911, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pressure, gas", "url": null }
c#, design-patterns, entity-framework or void ChangeDiscountRate(Guid CampaignId, decimal newDiscountRate) whose implementation would be something like: var campaignDetailsToUpdate = _campaignDetailsRepository.GetById(CampaignId); campaignDetailsToUpdate.DiscountRate = newDiscountRate; _campaignDetailsRepository.Update(campaignDetailsToUpdate); _campaignDetailsRepository.Save(); You need not stop there. Ideally after a next round of refactorings (Including defining One-to-One and one-to-many relations where necessary) your service methods will read like below: var campaignToUpdate = _campaignRepository.GetById(CampaignId); campaignToUpdate.ChangeDiscountRate(newDiscountRate); _campaignRepository.Update(campaignToUpdate ); or more generally: var aggregateRoot = repository.GetById(id); aggregateRoot.ModifyThisEntityAndItsDetails(...); repository.Update(aggregateRoot);
{ "domain": "codereview.stackexchange", "id": 6665, "lm_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 }
What represents $\exists xP(x)\wedge\neg\exists yQ(y)\wedge\forall z(P(z)\Rightarrow Q(z))$ in $\mathbb R$? I did it in two different ways (I looked at this post but I can not get anything useful because I do not understand if it represents a $T, C$ or contingency). I have to say if the following complex propositional function (in $\mathbb R$) represents a tautology, contradiction or contingency: $$\exists xP(x)\wedge\neg\exists yQ(y)\wedge\forall z(P(z)\Rightarrow Q(z)).$$ I tried to do it in two different ways, and both give me that it represents a contradiction: • I singled out everything in one variable: $a$. In this way you can remove the quantifiers: $$P(a)\wedge\neg Q(a)\wedge(P(a)\Rightarrow Q(a))\quad\underbrace{\Leftrightarrow}_{\textrm{Modus Tollens}}\\P(a)\wedge\neg P(a)\Leftrightarrow \textrm{Contradiction}.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126438601956, "lm_q1q2_score": 0.8001704814983858, "lm_q2_score": 0.8175744806385543, "openwebmath_perplexity": 291.44457425815824, "openwebmath_score": 0.7688612341880798, "tags": null, "url": "https://math.stackexchange.com/questions/2726760/what-represents-exists-xpx-wedge-neg-exists-yqy-wedge-forall-zpz-righta" }
c#, winforms, chess private void DrawLines() { DrawLineNumbers(); DrawLineAlphabet(); } private void DrawLineNumbers() { const int horizontal = 5; int vertical = tileHeight; for (int i = 0; i < size; i++) { Label nextLabel = new Label { AutoSize = true, Location = new Point(horizontal, vertical), Text = (i + 1).ToString(), Font = new Font("Microsoft Sans Serif", 16), }; vertical += tileHeight; Controls.Add(nextLabel); } } private void DrawLineAlphabet() { const int vertical = tileHeight*9 - 10; int horizontal = tileWidth - 15; for (int i = 0; i < size; i++) { Label nextLabel = new Label { AutoSize = true, Location = new Point(horizontal, vertical), Text = letters[i].ToString(),
{ "domain": "codereview.stackexchange", "id": 19923, "lm_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#, winforms, chess", "url": null }
c#, error-handling, wpf Bad exception handling as all exceptions are swallowed. Logging an exception is not handling an exception. What is happening here, is that all exceptions are swallowed. Especially those that are critical to the application. By catching Exception you basically handle every exception. Catching Exception at application level makes it even worse: a NullReferenceException will never see the light. A IndexOutOfRangeException will never get attention too, as you didn't even re-throw anything (re-throwing an exception is also generally considered as bad practice). A NullReferenceException must crash your application and requires the developer's full attention. If Reference.AppPath throws a NullReferenceException because Reference or AppPath is null we will never notice it without consulting any log file.
{ "domain": "codereview.stackexchange", "id": 37235, "lm_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#, error-handling, wpf", "url": null }
c++, c++11, language-design, lexical-analysis if (*value == 0.0 && i == after_number) { delete value; delete new_number; return nullptr; } new_number->value = (void*) value; i = after_number; return new_number; }; //builds a new Token of type name, assumes the first character is printable but not a digit or symbol auto buildname = [&line, &i, &next, &end] () -> Token* { Token* new_name = new Token(nullptr, name, line); std::string* value = new std::string(""); while (*i != end) { if (isspace(*i) || is_symbol(*i)) { break; } *value += *i; next(); } new_name->value = (void*) value; return new_name; };
{ "domain": "codereview.stackexchange", "id": 22014, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, language-design, lexical-analysis", "url": null }
Therefore, ar (ADE) = ar (BCF) (Congruent figures have equal areas).........(5) Now, ar (ABCD) = ar (ADE) + ar (EDCB) = ar (BCF) + ar (EDCB) ......... [From(5)] = ar (EFCD) So, parallelograms ABCD and EFCD are equal in area. Let us now take some examples to illustrate the use of the above theorem. Q 3260178015 In Fig. 9.13, ABCD is a parallelogram and EFCD is a rectangle. Also, AL ⊥ DC. Prove that (i) ar (ABCD) = ar (EFCD) (ii) ar (ABCD) = DC × AL Class 9 Chapter 9 Example 1 Solution: (i) As a rectangle is also a parallelogram, therefore, ar (ABCD) = ar (EFCD) (Theorem 9.1)
{ "domain": "exxamm.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.981453437115321, "lm_q1q2_score": 0.8199881951740032, "lm_q2_score": 0.8354835432479661, "openwebmath_perplexity": 1361.0033052027138, "openwebmath_score": 0.8043944239616394, "tags": null, "url": "http://exxamm.com/blog/Blog/14155/zxcfghfgvbnm4?Class%209" }
discrete-signals, signal-analysis, filter-design, continuous-signals, digital-filters However the following books (or subjects) will enhance your understanding, or broaden your appreciation of the subject. First of all, the very first graduate level course on DSP, Communications, and Control is called Linear System Theory which brings together all the undergraduate mathematical stuff from a new, advanced, deeper, and foundational point of view of the Hilbert (linear vector) Spaces, Linear Mappings, and Matrix theory. It does not have a definite book but a bunch of books on Linear Algebra & Matrices, Measure Theory, and Diferential Equations were used. Note that there's a control theory oriented bunch of Linear System Theory books (Desoer's crew) that I do not recommend for DSP, unless you will be designing control systems on the field. Signal processing does not make much use of state-space approach, unless it's absolutely necessary.
{ "domain": "dsp.stackexchange", "id": 9466, "lm_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, signal-analysis, filter-design, continuous-signals, digital-filters", "url": null }
water, solutions, extraction Title: Extract ammonium sulfate from water What is the best method to extract ammoniumsulfate from water? The assignment is as follows: Manure is being processed and the product left is a mixture between water and ammonium sulfate, transporting the mixture costs a lot of money. So we only want the ammonium sulfate. What is the best method to do this on a big scale? Evaporation isn't a good option since it costs too much energy to heat the big amounts of water. Evaporation isn't a good option since it costs too much energy to heat the big amounts of water.
{ "domain": "chemistry.stackexchange", "id": 7353, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "water, solutions, extraction", "url": null }
neuroscience, neurophysiology, hearing, human-ear However, there are other theories, notably one from Hermann von Helmholtz, a brilliant scientist of the 1800's that has revolutionized sensory sciences. It is called the 'sympathetic resonance' theory. I am not at all familiar with this theory, as it has been largely abandoned, at least as far as I know. The theory from Von Békésy assumes that the basilar membrane is a place-to-frequency converter that acts like a Fourier transformer, known as the place coding theory. Basically, the traveling wave dissects complex acoustic stimuli into different acoustic frequencies by menas of frequency tuning of the BM (Fig. 2). By contrast, Helmholtz assumed there are tiny tuned elements positioned in the cochlea that basically perform the Fourier transform (not shown here). If you wish to read more of the latter theory, I happily refer you to Bell, 2004).
{ "domain": "biology.stackexchange", "id": 11131, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience, neurophysiology, hearing, human-ear", "url": null }
ai-design, game-ai For a more complex approach, you might want to consider how prevalent some pokemon are (you might not need to optimize against a super rare mythical type, but rather the very common types available in the game), how likely is it that certain pokemon can have better / faster attacks, what is the probability of battle IVs, how frequent can a trainer switch pokemon in battle, etc. Again, I know this is not what you asked for, but for the sake of the example, this will become so complex that instead of a search algorithm, a simulation (Monte Carlo?) approach might be simpler to build teams out of statistical testing.
{ "domain": "ai.stackexchange", "id": 2351, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ai-design, game-ai", "url": null }
c#, design-patterns Desgin Pattern: using Creational.Prototype.Model; namespace Creational.Prototype.DesignPatters; public abstract class PierogiPrototype { public Guid Guid { get; } public int Count { set; get; } public string Type { get; set; } public PierogiPrototype(int count) { Guid = Guid.NewGuid(); Count = count; } public abstract PierogiPrototype Clone(); public override string ToString() { return $"Guid: {Guid}, Count: {Count}, Type: {Type}"; } } public class PierogiWithPotatoesAndCheese : PierogiPrototype { public PierogiWithPotatoesAndCheese(int count) : base(count) { Type = PierogiTypes.WithPotatoesAndCheese; } public override PierogiPrototype Clone() { return (PierogiPrototype)MemberwiseClone(); } } . . . . .
{ "domain": "codereview.stackexchange", "id": 44199, "lm_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", "url": null }
python, rostest, rosbuild my_suite = suite() import rostest rostest.rosrun('my_package', 'test_my_first_test_suite', my_suite) Note that the call to rostest.rosrun uses a unittest.TestSuite as argument rather than a unittest.TestCase. But it seems that rostest.rosrun is not compatible with unittest.TestSuite, since after runing this code you would get a TypeError like the following: rostest.rosrun('my_package','test_my_first_test_case', my_suite) File "/opt/ros/groovy/lib/python2.7/dist-packages/rostest/init.py", line 136, in rosrun suite = unittest.TestLoader().loadTestsFromTestCase(test) File "/usr/lib/python2.7/unittest/loader.py", line 50, in loadTestsFromTestCase if issubclass(testCaseClass, suite.TestSuite): TypeError: issubclass() arg 1 must be a class
{ "domain": "robotics.stackexchange", "id": 16779, "lm_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, rostest, rosbuild", "url": null }
general-relativity, special-relativity On the other hand, there's a nice explanation here on SE that I find intuitively appealing but it concludes the opposite: $L' = L/\gamma$. So which shall it be? Due to obvious reasons I put more weight on the first possibility, although I don't actually understand the reasoning, so if someone could describe it in more detail it'd be great. There's also this paper I've been looking at, which arrives at Einstein's result in a general relativistic framework, but I'd rather just stay at measuring rods and the like if it's possible... You can get the result you want by looking at the "circumference" in different ways. In the circle's rest system, there is no ambiguity of circumference. It is the sum of length's of the rods laid out along the circle. This is the total length of black rods in the following picture:
{ "domain": "physics.stackexchange", "id": 93860, "lm_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, special-relativity", "url": null }
javascript, programming-challenge, functional-programming, ecmascript-6 const CumulativeDiffs = (totalSoFar, val) => { const row = val.split(/\s+/); const max = Math.max(...row); const min = Math.min(...row); return totalSoFar + max - min; //add diff to cumulative total };
{ "domain": "codereview.stackexchange", "id": 28912, "lm_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, programming-challenge, functional-programming, ecmascript-6", "url": null }
python, python-3.x, mysql, authentication, tkinter Apart from that fundamental issue looks mostly okay, no SQL injection since the execute will handle that. __ as prefix for the variable names is unnecessary and confusing. I can't see why it's there at all. Actually, SELECT password ... ... the password's stored in plaintext? Big no-no in anything used by other people. Do not store passwords in plaintext. The properties at the end of DatabaseManip seem not very useful, in Python there's no need for them unless you want to control what/how values are stored in the object / how they're computed if they're not stored at all. The __str__ method is there for what reason? That's very much confusing the responsibility of the class. It would somewhat make sense if it's being used interactively in a REPL, otherwise I can't see the reason for having it. Oh. Oh now I see it. Yeah, don't do that, that's bad style. How I'd expect things to go is something like this: def submit(self):
{ "domain": "codereview.stackexchange", "id": 35675, "lm_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, mysql, authentication, tkinter", "url": null }
ABSTRACT: In this document we try to illustrate the possibilities offered by the CAS (Computer Algebra System) Maxima, along the lines of the chapters "A Tour of Mathematica" that appeared in the printed versions of The Mathematica Book by Wolfram Research up to its 5th edition (2003). Although it is free software (as in 'freedom' and as in 'free beer'), the quality of Maxima is comparable to that of commercial programs such as Mathematica (TM) or Maple (TM). Its development began at the MIT (Massachusetts Institute of Technology) in the 60s, and it is nowadays active thanks to the dedicated work of a wide group of people around the world. Maxima admits many graphical interfaces (originally, it is invoked from the shell). The one we will use in this document is wxMaxima, although almost all of the results are independent of the interface (the only exception being the animations). This document has been created on a Linux platform running Slackware 14.2, with Maxima version 5.38.0
{ "domain": "uaslp.mx", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.972830769252026, "lm_q1q2_score": 0.8085615346754277, "lm_q2_score": 0.8311430520409023, "openwebmath_perplexity": 8210.193559783387, "openwebmath_score": 0.9115439653396606, "tags": null, "url": "http://galia.fc.uaslp.mx/~jvallejo/Maxima%20Mini-Tour%2019-May-2019.html" }
shors-algorithm, quantum-fourier-transform, quantum-phase-estimation, hidden-subgroup-problem Title: $QFT^{-1}$ at the end of Shor's algorithm and $QFT$ at the end of Hidden Subgroup algorithm In the usual presentations (e.g. Nielsen and Chuang) Shor's algorithm (in its quantum part) is presented as a special case of phase estimation, meaning it uses a circuit of the form "generate superposition, apply function, apply $QFT^{-1}$, measure": But when I try to look at Shor's algorithm as a (variation on a) special case of the Hidden Subgroup Problem, e.g. in de Wolf's lecture notes or this thesis, the circuit used is similar to the one for the general solution of the abelian HSP, which has $QFT$ and not $QFT^{-1}$ at the end:
{ "domain": "quantumcomputing.stackexchange", "id": 4382, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "shors-algorithm, quantum-fourier-transform, quantum-phase-estimation, hidden-subgroup-problem", "url": null }
beginner, recursion, go In your GetTotalEmailCount function: Normally in Go instead of: var foo []int foo = something[bar].foo you'll just see: foo := something[bar].foo not only is it shorter but it can make future code changes easier. In the latter if the field foo changes type you don't need to edit the type of the variable foo to match. (By the way, shorter isn't always better. Clarity is more important than conciseness). Idiomatic Go code tends avoid indenting code by using early returns (see https://github.com/golang/go/wiki/CodeReviewComments#indent-error-flow). You return if len(…) == 0 so you should just drop the else clause and remove the indent (golint will suggest this). E.g, instead of: if someCondition { return something } else { // other code // possibly with more conditional/loop indenting } it would be: if someCondition { return something } // other code // possibly with more conditional/loop indenting
{ "domain": "codereview.stackexchange", "id": 35462, "lm_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, recursion, go", "url": null }
java, regex, template, rags-to-riches, compiler public class TemplateCompiler { private static final Pattern SUBST_PAT = Pattern.compile( "(?<LITERAL>.*?)(?:\\{\\{(?<SUBST>[^}]*)\\}\\})" );
{ "domain": "codereview.stackexchange", "id": 15452, "lm_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, regex, template, rags-to-riches, compiler", "url": null }
random-forest, accuracy, overfitting, hyperparameter-tuning But I see that it gets stabalize much after and i'm afrid that it might lead to overfitting. Is it true? should I choose bigger number from the stable zone or is ok to take low number as long as the training and test data are having the same accuracy and same error? In general, the max depth parameter should be kept at a low value in order to avoid overfitting: if the tree is deep it means that the model creates more rules at a more detailed level using fewer instances. Very often some of these rules are due to chance, i.e. they don't correspond to a real pattern in the data. Overfitting is visible in your graphs from the quite high difference between training and test set performance. One can observe that the performance on the test set increases with the first few values of depth (I'm guessing until around 5 or so), and it starts decreasing after that. So the optimal point (performance and no overfitting) is the point that you mention, it's after this point that the model is overfit.
{ "domain": "datascience.stackexchange", "id": 8806, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "random-forest, accuracy, overfitting, hyperparameter-tuning", "url": null }
1 mile/6 minutes = 2 miles/ 20 minutes cross multiply add and then divide by 2 (16 miles /2) / 60 minutes (16 miles/2)/ 1 minute 8 miles/ 1 minute 1 minute/ 8 miles Intern Joined: 09 Oct 2016 Posts: 34 Re: Triathlete Dan runs along a 2-mile stretch of river and then swims bac [#permalink] ### Show Tags 01 Aug 2017, 02:38 Dienekes wrote: If distance traveled is same but at varying rates, the average rate can be found through the shortcut $$\frac{2ab}{a+b}$$ where a and b are individual rates. In this problem $$a=10$$ and $$b=6$$ therefore average speed = $$\frac{15}{2}$$ miles per hour, i.e. $$\frac{1}{8}$$ miles per minute. P.S. Added tags as saw this question in an MGMAT CAT. Thank you for the explanation. I picked answer choice "B" because I did not pay attention to the unit (minutes) in the question. SVP Joined: 12 Sep 2015 Posts: 2298 Re: Triathlete Dan runs along a 2-mile stretch of river and then swims bac [#permalink] ### Show Tags
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9339146139750798, "lm_q1q2_score": 0.8271041759950936, "lm_q2_score": 0.8856314738181875, "openwebmath_perplexity": 4971.2395867193645, "openwebmath_score": 0.6162729263305664, "tags": null, "url": "https://gmatclub.com/forum/triathlete-dan-runs-along-a-2-mile-stretch-of-river-and-then-swims-bac-57499.html" }
ros, gazebo, topic, joint-state-publisher Title: Controll of urdf on gazebo with ros topics I've managed to create an urdf file and can simulate it in gazebo. It consists of a 3 finger gripper so the joints are all revolute. Now I want to be able to rotate them on gazebo or rviz, this is, open and close the gripper, with a ROS topic. How am I able to do that? I cant publish the topic but can't make the model move since I can't make it subscribe the message. I think that I have to use the topic "hand_command" and the msg "trajectory_msgs/JointTrajectory". Is there any tutorial on this or can anyone give me some help? The gripper is based on the model found on the link of shadow hand smart grasping sandbox. Originally posted by JuanTelo on ROS Answers with karma: 9 on 2018-01-22 Post score: 0 Here's a place you can start: http://wiki.ros.org/urdf/Tutorials/Using%20a%20URDF%20in%20Gazebo Originally posted by David Lu with karma: 10932 on 2018-01-22 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 29816, "lm_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, gazebo, topic, joint-state-publisher", "url": null }
python, file, xml I have found a bug in it when copying over bands or songs with UTF-8 names in it e.g. Fantômas. Because the UTF-8 elements are encoded in the Playlist XML the names do not match the directory so I need to fix that. Have kept a copy on Gist, so if you want a copy go grab/comment/whatever. I'm new to Python so any feedback is welcome on better ways to do things. overwrite would be better as True or False. Since each file is treated independently, you should define a function to make the independence obvious. To split and join path components, use os.path.split() and os.path.join() instead of doing your own string analysis. The interface is slightly nicer, and it also ensures that there won't be missing or extra / separators. If you reorder the conditionals, you could reduce the number of os.path.exists() tests in the don't-overwrite case, where the destination file already exists.
{ "domain": "codereview.stackexchange", "id": 14253, "lm_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, file, xml", "url": null }
reference-frames, coordinate-systems Title: Is this webcomic accurate? I was considering this xkcd comic from 5/10/14, with the alt-text "Trains rotate the Earth around various axes while elevators shift its position in space." I'm wondering about its accuracy.
{ "domain": "physics.stackexchange", "id": 13667, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reference-frames, coordinate-systems", "url": null }
#### Attached Files: • ###### Capture.PNG File size: 76 KB Views: 121 4. Nov 27, 2015 ### Samy_A But, as @fresh_42 rightly supposed, you have one more piece of information, namely $\frac {\overline {PA}}{\overline{PB}}=\frac {4.77}{8}$. Then, as the text suggests, you can calculate A and B using trigonometry. Last edited: Nov 27, 2015 5. Nov 27, 2015 ### shayaan_musta But how? This is the actual question of mine. For A and B, I posted this thread. If you are saying to solve it myself then what is the cause of posting this thread. Kindly enlighten the way for me to find A and B. 6. Nov 27, 2015 ### SteamKing Staff Emeritus You've been posting information in dribs and drabs, and you are expecting a full solution to what is obviously a much larger problem than just figuring out this triangle. How about some full disclosure of the complete problem or section from this text you are referencing? 7. Nov 27, 2015 ### Samy_A
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9609517095103498, "lm_q1q2_score": 0.8743766999907592, "lm_q2_score": 0.9099070133672954, "openwebmath_perplexity": 1126.2293299906453, "openwebmath_score": 0.767493486404419, "tags": null, "url": "https://www.physicsforums.com/threads/find-the-value-of-point-a-and-b.845250/" }
-1 to 1 which is what makes the trick work. yes -n^2/n < sin(n^2)/ n < n^2 But one limit is neg inf and the other pos inf Which means we can only conclude the limit is somewhere between - inf and pos inf which means we know nothing about the limit. 5. can we use Cauchy's method At first we check whether |sin(n^2) / n| converges or diverges , int {from 1 to oo} sin(x^2)/x dx Sub u = x^2 => du = 2x dx the integral becomes 1/2 int { from 1 to oo } sin(u) / u du We know that int { from 0 to oo } sin(u) / u du converges to pi/2 so this integral 1/2 int { from 1 to oo } sin(u) / u du converges Since the summation of |sin(n^2) / n| converge , sin(n^2) / n also converges too 6. Remember if the corresponding series converges it must converge to 0.
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969684454967, "lm_q1q2_score": 0.8175097822179909, "lm_q2_score": 0.8311430478583168, "openwebmath_perplexity": 2134.7246341170367, "openwebmath_score": 0.9816304445266724, "tags": null, "url": "http://mathhelpforum.com/calculus/84241-sine-sequence.html" }
form of the complex numbers is presented as r * exp(c * %i), where r is radius and c is the angle in radians. (On the TI … You’re used to seeing points in the xy -plane displayed in the (x, y) rectangular form. Convert the polar equation to rectangular form. An easy to use calculator that converts a complex number to polar and exponential forms. Solution x 3 and y 1 so that r 3 2 12 2 and tan 1 3 3 3 Here the reference angle and for is 30°. Use Pythagoras Theorem to find the long side (the hypotenuse): See also the polar to rectangular and rectangular to polar calculator, on which the above is based: Polar to Rectangular Online Calculator. Polar Complex Numbers Calculator. U: P: Polar Calculator Home. We have converted a complex number from polar form (using degrees) into rectangular form. Convert 12 - 42j to polar form (r ∠ theta). Show Instructions In general, you can skip the multiplication sign, so 5x is equivalent to 5*x. Rectangle coordinates: Converts from Cartesian to Polar
{ "domain": "gridserver.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.957912274487423, "lm_q1q2_score": 0.8063951261825719, "lm_q2_score": 0.8418256532040707, "openwebmath_perplexity": 987.9640415293046, "openwebmath_score": 0.8588264584541321, "tags": null, "url": "http://s130894.gridserver.com/hxniv2h/ccbd6e-rectangular-to-polar-form-calculator" }
classical-mechanics, orbital-motion, celestial-mechanics $$\frac{\partial J (u_0(L),L)}{\partial u}=1-\beta^2=-2+\frac{u_0(L)}{f\left(\frac{1}{u_0(L)}\right)}\left[\frac{d}{du}f\left(\frac{1}{u}\right)\right]_{u=u_0(L)} \tag{7}$$ In (7), we find that all the dependence on $L$ is through the function $u_0(L)$. Since $u_0(L)$ is assumed to be a smooth function of $L$, we can really just drop the $L$ and solve for $u_0$. This is equivalent to having derived $$\frac{\partial J (u,L_0(u))}{\partial u}=1-\beta^2=-2+\frac{u}{f\left(\frac{1}{u}\right)}\frac{d}{du}f\left(\frac{1}{u}\right)\tag{8}$$ This gives a differential equation for $f(r)$ which we can solve, and work back to get $J(u,L)$.
{ "domain": "physics.stackexchange", "id": 83555, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, orbital-motion, celestial-mechanics", "url": null }
ros, message, publisher The problem is equivalent from ROS to Prométhé : to subscribe to a topic, I have to know which type it is to define the callback function. So is there a way to be transparent from the type of topic (and compatible with C, meaning that I can't use templates) like a function that dynamically determines type or a "generic" type that gathers every other types (a "common_message" type) ? Or must I define a look-up table / switch case to use the right message depending on the input/output data (considering that I can get a user specified option giving the wanted type) ?
{ "domain": "robotics.stackexchange", "id": 10231, "lm_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, message, publisher", "url": null }
machine-learning, classification, logistic-regression, svm, one-hot-encoding So you should use a text vectorizer for processing only the text column first. This will give you one data-frame (say A). This data-frame will have columns corresponding to tokens/words in the dataset. So if text vectorizer picks up 100 unique words then you will have a 1000x100 size data-frame. Note that these 100 columns have been generated only by text vectorizer. For symbols and notes, you can use one-hot encoding, which will get you another data-frame (say B). Then you should join A & B on common key to get your final data-frame if input. The common key here will be row ID (though read the following comment on aggregating data at user level). It is not clear if the user name (Account) column unique in the data? If there are 1000 rows but only 400 users, that means there can be more than 1 row per user. In that case, you can consider aggregating the data at the user level (for text column, you can simply concat all strings for same user).
{ "domain": "datascience.stackexchange", "id": 8176, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, classification, logistic-regression, svm, one-hot-encoding", "url": null }
mph for at least one moment during your drive. First, let’s start with a special case of the Mean Value Theorem, called Rolle’s theorem. And that will allow us in just a day or so to launch into the ideas of integration, which is the whole second half of the course. Indian. The requirements in the theorem that the function be continuous and differentiable just guarantee that the function is a regular, smooth function without gaps or sharp corners or cusps. The Mean Value Theorem tells us that the function must take on every value between f (a) and f (b). The median value of a series may be determinded through the graphic presentation of data in the form of Ogives.This can be done in 2 ways. 4.2 Mean Value Theorem. Rolle's Theorem (from the previous lesson) is a special case of the Mean Value Theorem. Australian. Rolle's theorem states that for a function $f:[a,b]\to\R$ that is continuous on $[a,b]$ and differentiable on $(a,b)$: If $f(a)=f(b)$ then $\exists c\in(a,b):f'(c)=0$
{ "domain": "hiitfit.is", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877667047451, "lm_q1q2_score": 0.834465091334529, "lm_q2_score": 0.8596637559030338, "openwebmath_perplexity": 823.5710277581143, "openwebmath_score": 0.7786087989807129, "tags": null, "url": "https://hiitfit.is/ffa-full-sqgsicl/c9d368-language-mean-value-theorem" }
Method. The choice of the equation to be integrated will depend on how easy the calculations are. If in a given differential. 2Named after one member of that famous 17th-century mathematical family. It is much simpler for a human being to do that than the above integral, because the integral involves evaluating limits and so on, but for a computer algebra system, the above integral is a one-liner. Solving a Separable Differential Equation, #5, Initial Condition - Differential Equations Solving a Separable Differential Equation, Another Example #5, Initial Condition. Zarebnia Department of Mathematics, University of Mohaghegh Ardabili, 56199-11367, Ardabil, Iran. However, another method can be used is by examining exactness. Differential Equations is an online course equivalent to the final course in a typical college-level calculus sequence. we just wrote down is an example of a differential equation. Determining that a solution exists may be half the work of finding it. The
{ "domain": "iwno.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.990440601781584, "lm_q1q2_score": 0.8165805643704677, "lm_q2_score": 0.8244619242200082, "openwebmath_perplexity": 551.0452697520972, "openwebmath_score": 0.8149483799934387, "tags": null, "url": "http://wcgm.iwno.pw/exact-differential-equation-solver.html" }
signal-analysis, fourier-transform, fourier, sensor The plotted values are the results of a FFT. My question now is: How to understand the spectrum? The 60 Hz plot is clear. A FFT was operated and all the values were extracted which correspond to the 60 Hz signal. This is (or should be) the upper plot. The spectrum is allegedly the value across the whole frequency range - this I do not quite understand. How can I make use of this or how can it physically be interpreted? Is it finally kind of a total amplitude? Is it the origin signal (I don't think so..)? Is it even possible without an inverse transformation? Or is it just what it is: The sum of all (fourier) frequencies without any higher meaning? I'm not sure how to name the signals/peaks in the frequency domain. Let me put a practical answer with the following Matlab / Octave Code : L = 2*1000; % signal sample count n = 0:L-1; % discrete-time index
{ "domain": "dsp.stackexchange", "id": 8449, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "signal-analysis, fourier-transform, fourier, sensor", "url": null }
slam, navigation Every time I need an updated map, I call the send_all service, but this also gives the tf for each of the pointcloud, resulting in multiple map->odom transform being broadcast. For the headless.launch file, I have added the following: <param name="config/fixed_frame_name" value="/map"/> <param name="config/ground_truth_frame_name" value=""/><!--empty string if no ground truth--> <param name="config/base_frame_name" value="/odom"/> <!-- /openni_camera for hand-held kinect. For robot, e.g., /base_link --> <param name="config/fixed_camera" value="true"/> <!--is the kinect fixed with respect to base, or can it be moved (false makes sense only if transform betw. base_frame and openni_camera is sent via tf)-->
{ "domain": "robotics.stackexchange", "id": 9226, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation", "url": null }
electric-circuits, electric-current, electrical-resistance, superposition, linear-systems Title: Does one current affect other current? While studying Wheatson bridge I got a minor confusion. Two loops are present in [the bridge section of ] this circuit. My question is when two currents are flowing in opposite direction and net current is obtained in specific direction then what is happening? Can someone please explain this interaction of two currents to give one net current?
{ "domain": "physics.stackexchange", "id": 32924, "lm_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, superposition, linear-systems", "url": null }
c#, .net, mysql, database, wpf protected void SetParameterValue(string ParameterName, int value) { int tableIndex = getParameterIndex(ParameterName); if (tableIndex >= 0) { _sqlCmdParameters[tableIndex].Value = value.ToString(); } } protected void SetParameterValue(string ParameterName, bool value) { int tableIndex = getParameterIndex(ParameterName); if (tableIndex >= 0) { _sqlCmdParameters[tableIndex].BValue = value; } } protected bool GetParameterBValue(string ParameterName) { bool ParameterValue = false; int tableIndex = getParameterIndex(ParameterName); if (tableIndex >= 0) { ParameterValue = _sqlCmdParameters[tableIndex].BValue; } return ParameterValue; }
{ "domain": "codereview.stackexchange", "id": 35353, "lm_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, mysql, database, wpf", "url": null }
general-relativity, cosmology, big-bang, causality, time-travel The holographic principle of black holes tells us the field theoretic information of strings on the event horizon is completely equivalent to field theoretic information in the spacetime one dimension larger outside. This physics is observed on a frame stationary with respect to the black hole. The question naturally arises; what physics is accessed by the observer falling through the event horizon on an inertial frame? This question is important for the black hole small enough to exhibit fluctuations comparable to its scale. A sufficiently small quantum black hole will be composed of strings in a superposition of interior and exterior configurations or states.
{ "domain": "physics.stackexchange", "id": 390, "lm_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, cosmology, big-bang, causality, time-travel", "url": null }
quantum-information, open-quantum-systems (mathematical) stability under perturbation (i.e. changing $\tau$ to $\tau+\varepsilon \eta$ for some small $\varepsilon$). channel stability under perturbation.
{ "domain": "physics.stackexchange", "id": 19833, "lm_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-information, open-quantum-systems", "url": null }
dipole-moment Title: Centre of charge of the distribution If one has a charge distribution whose monopole moment differs from zero, how can I show that one can always find an origin such that the dipole moment will be zero? Taking this proof from Griffiths Electrodynamics 3rd ed. Section 3.4.3: The dipole moment is defined as: $\vec{p} = \int \vec{r'} \rho (r') d \tau'$. You can define a new dipole moment, $\vec{\bar{p}}$, where you have moved the origin to the position given by the vector $\vec{a}$. $\vec{\bar{p}} = \int (\vec{r'} - \vec{a}) \rho (r') d \tau' = \vec{p} - \vec{a} \int \rho (r') d \tau' = \vec{p} - \vec{a} Q $ Q, the total charge, is the nonzero monopole term, and is independent of coordinate system. So choose $\vec{a}$ so that $\vec{p} = \vec{a} Q $, and your dipole moment is 0 in the new coordinate system.
{ "domain": "physics.stackexchange", "id": 81433, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dipole-moment", "url": null }
zoology, dna, genomes, feline GEB has reference notes and bibliography and there is no reference cited to back this claim. However, GEB does not attempt to be a rigorous academic thesis and the references is only called upon more when Hofstadter quotes other works directly while the bibliography is a list of readings which the reader may want to check out, regarding the main thesis of the book.
{ "domain": "biology.stackexchange", "id": 7056, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "zoology, dna, genomes, feline", "url": null }
electromagnetism, special-relativity, dipole-moment $\vec{p}$ and the magnetic dipole moment $\vec{m}$ together into a covariant $4$-tensor. Thanks to all the comments below I realized it is actually more complicated than I thought before. The electric dipole moment $\vec{p}$ and the magnetic dipole moment $\vec{m}$ cannot directly be put together to form something covariant. But you can do it with the corresponding densities (polarization $\vec{P}$ and magnetization $\vec{M}$) which are defined by the volume integrals $$\vec{p}=\int \vec{P}\ d^3r$$ $$\vec{m}=\int \vec{M}\ d^3r$$ Polarization $\vec{P}$ and magnetization $\vec{M}$ can be put together to form a covariant $4$-tensor. See Covariant formulation of classical electromagnetism - Magnetization-polarization tensor or Griffiths' article Manuripur's Paradox (eq. 20). Its contravariant components are $$M^{\mu\nu}=\begin{pmatrix} 0 & cP_x & cP_y & cP_z \\ -cP_x & 0 & -M_z & M_y \\ -cP_y & M_z & 0 & -M_x \\ -cP_z & -M_y & M_x & 0 \end{pmatrix}$$
{ "domain": "physics.stackexchange", "id": 93953, "lm_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, special-relativity, dipole-moment", "url": null }
redox Title: Why ZnS can be seen as the solution is made alkaline? Explain with reactions There is an extract in my book which i am not able to get. It says: Place strip of metallic zinc in aqueous solution of copper nitrate for about one hour. You may notice that the strip becomes coated with reddish metallic copper and the blue colour of the solution disappears. Formation of Zn2+ ions among the products can easily be judged when the blue colour of the solution due to Cu2+ has disappeared. If H2S gas is passed through the colorless solution containing Zn2+ ions, appearance of white zinc sulphide, ZnS can be seen on making solution alkaline with ammonia. The final solution contains $\ce{Zn^{2+}}$ ions, which reacts with $\ce{H_2S}$ to produce white $\ce{ZnS}$. But you may not avoid that maybe some of the initial $\ce{Cu^{2+}}$ ions still remains in the solution. And these rare $\ce{Cu^{2+}}$ ions do react with $\ce{H_2S}$ to produce Copper sulphide $\ce{CuS}$ which is dark black.
{ "domain": "chemistry.stackexchange", "id": 13361, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "redox", "url": null }
plot showing the centroid (red circle), regression line, and y-residuals. Simply create an instance of the LinearRegression class, put the data and weights into suitable. Locally weight it. The linear predictor could allow the mean to depend on higher order functions of covariates. What is the effect of specifying aweights with regress? Title. Linear regression is a procedure for fitting a straight line of the form [latex] Linear: In the population, there is a linear relationship that models the average value of y for different values. Just google for it and I'm sure you will find it. When I run linear regression, I get R values of the order of. Linear Regression is an approach to modeling the relationship between two variables by fitting a linear equation to observed data. In the hidden layers, the lines are colored by the weights of the connections between neurons. Slides by Zia Khan. Linear Regression works accurately only on data has a linear relationship between them. Power
{ "domain": "data-wizard.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682471364099, "lm_q1q2_score": 0.8083099198872961, "lm_q2_score": 0.817574471748733, "openwebmath_perplexity": 833.588459763039, "openwebmath_score": 0.6430838108062744, "tags": null, "url": "http://data-wizard.de/weighted-linear-regression.html" }
`combine` does not rewrite powers of sine or cosine functions with negative integer exponents. ```syms a b combine(sin(b)^(-2)*cos(b)^(-2),'sincos')``` ```ans = 1/(cos(b)^2*sin(b)^2)``` ### Exponential Terms Combine terms with exponents by specifying the target argument as `exp`. `combine(exp(sym(3))*exp(sym(2)),'exp')` ```ans = exp(5)``` ```syms a combine(exp(a)^3, 'exp')``` ```ans = exp(3*a)``` ### Terms with Integrals Combine terms with integrals by specifying the target argument as `int`. ```syms a f(x) g(x) combine(int(f(x),x)+int(g(x),x),'int') combine(a*int(f(x),x),'int')``` ```ans = int(f(x) + g(x), x) ans = int(a*f(x), x)``` Combine integrals with the same limits. ```syms a b h(z) combine(int(f(x),x,a,b)+int(h(z),z,a,b),'int') ``` ```ans = int(f(x) + h(x), x, a, b)``` ### Terms with Inverse Tangent Function Calls Combine two calls to the inverse tangent function by specifying the target argument as `atan`.
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471632833944, "lm_q1q2_score": 0.8020641698571417, "lm_q2_score": 0.8152324871074608, "openwebmath_perplexity": 1505.7918499296266, "openwebmath_score": 0.9012227654457092, "tags": null, "url": "https://nl.mathworks.com/help/symbolic/combine.html" }
complexity-theory, quantum-computing The current belief is that, despite the exponentiality of the wavefunction, quantum mechanics will not let us solve NP-complete problems in polynomial time (though it famously does let us solve certain "special" NP problems, like factoring and discrete logarithms). The basic difficulty is that, even if a solution to an NP problem is "somewhere" in the wavefunction, that isn't useful if a measurement will only reveal that solution with exponentially-small probability. To get a useful quantum algorithm, you need to use quantum interference to make the correct answer observed with high probability, and it's only known how to get an exponential speedup that way (compared to the best-known classical algorithm) for a few special problems like factoring.
{ "domain": "cs.stackexchange", "id": 1238, "lm_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, quantum-computing", "url": null }
developments of code writing from ancient times to our modern era, and learn some of the classical ciphers, a modern cryptosystem, and certain aspects. , 16 or 32 bits) For crypto, need to work with integers that are much longer (e. Certainly before the advent of modern cryptography modular arithmetic could lay claim to being one of the purest (that is, most application-free) areas of mathematics. Maps between curves and arithmetic obstructions, with Felipe Voloch, in Arithmetic, Geometry, Cryptography and Coding Theory, Contemporary Mathematics 722, AMS, 2019, 167--175. The Knapsack Problem and Public Key Cryptography Age 16 to 18. Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Java BigInteger was made for RSA cryptography Introduction. I am adding in hardware acceleration to a preexisting RSA library (mbedTLS) by replacing the modular
{ "domain": "remmantova.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9942697522964353, "lm_q1q2_score": 0.8174777853108608, "lm_q2_score": 0.8221891327004132, "openwebmath_perplexity": 958.0978312245458, "openwebmath_score": 0.45587220788002014, "tags": null, "url": "http://dxnp.remmantova.it/uses-of-modular-arithmetic-in-cryptography.html" }
matlab, fast-convolution, cwt % Get powers powers = abs(convres).^2; I have attached a picture of the signal (1 second chirp embedded in 5.5 seconds of noise) and a plot of the spectrogram using the power extracted from the first S points of the result of convolution between the signal and wavelets.
{ "domain": "dsp.stackexchange", "id": 10669, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, fast-convolution, cwt", "url": null }
rviz, gazebo-11, sdformat </friction> </surface> </visual> </link> <link name="rear_right_wheel"> <pose>-0.1 -0.088 0.05 0 1.5707 1.5707</pose> <mass>0.75</mass> <collision name="collision"> <geometry> <cylinder> <radius>0.0325</radius> <length>.02</length> </cylinder> </geometry> <surface> <friction> <ode> <mu>10</mu> <mu2>10</mu2> <slip1>0.000000</slip1> <slip2>0.000000</slip2> </ode> </friction> </surface> </collision> <visual name="visual"> <geometry> <cylinder> <radius>0.0325</radius> <length>.02</length> </cylinder> </geometry> </visual> </link> <link name="rear_left_wheel"> <pose>-0.1 0.088 0.05 0 1.5707 1.5707</pose> <mass>0.75</mass> <collision name="collision"> <geometry> <cylinder>
{ "domain": "robotics.stackexchange", "id": 4612, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, gazebo-11, sdformat", "url": null }
skin, perception, temperature, senses With regard to your question on metal and whether heat-flux can be sensed: a metal surface will feel cool only when it is lower in temperature than your body. Suppose now you touch a metal object at room temperature, i.e. lower than your body temperature. In that case, as you already indicate, it will draw away heat quickly from your skin by conduction, creating a 'heat-flux' if you like. The extraction of heat thereby elicits a powerful stimulus, because a large temperature difference creeps into your skin as heat is drawn away from your skin and underlying tissues. As such, and contrary to other answers given elsewhere, I explicitly say yes, 'heat-flux' can be sensed as it per definition generates a temperature difference. This in contrast to touching insulators like wood or plastic, which will quickly adopt the temperature of the skin very locally where you touch it. However, as has been pointed out by others - this does not mean that temperature is measured by heat-flux sensors per
{ "domain": "biology.stackexchange", "id": 3462, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "skin, perception, temperature, senses", "url": null }
fluid-dynamics, differentiation, vector-fields, flow, navier-stokes It is simpler to write these things in the compact "index notation" which reads: $$ \vec{u}\cdot \nabla \vec{u} = u_i\partial_i u_j = u_x\partial_x\vec{u}+u_y\partial_y\vec{u}+u_z\partial_z\vec{u}$$ Each term on the RHS of this equation is a vector obtained by doing the appropriate differentiation on each entry of $\vec{u}$ and then multiplying by the relevant component.
{ "domain": "physics.stackexchange", "id": 55054, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, differentiation, vector-fields, flow, navier-stokes", "url": null }
formal-languages, regular-languages, automata, finite-automata Now we'll add some more states to get from the start state to the $s$'s. All it takes is to construct a complete tree (binary in this example) having the $s$ states as leaves, like this: All of the states in the FA above will be accepting states, except for the darkened ones. The $p_i$ states are all accepting, since we haven't yet seen a length-3 string, so we haven't violated the condition that defines the language $L$ and only the patterns $\mathtt{011}, \mathtt{101}$, $\mathtt{110}$, and $\mathtt{111}$ violate the condition of the language. These correspond to states $s_3, s_5, s_6, s_7$. Once we've entered one of these states, we reject the input word, so we might as well merge these into a single "dead" state, $d$, from which there will be no exit.
{ "domain": "cs.stackexchange", "id": 4833, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "formal-languages, regular-languages, automata, finite-automata", "url": null }
quantum-mechanics, operators, wavefunction, eigenvalue, observables Title: How to get the weight of an eigenstate inside the state of the system without knowing the state? Let us suppose we have a system in a state $\Psi$, with: $\Psi = \sum_m c_m \psi_m$ Let us further suppose that we don't know what $\Psi$ or the $c_m$ are, but that we know what the $\psi_m$ are since we managed to retrieve them from a time-independent SE. How does one then obtain the coefficients $c_m$? (i.e. how does one come to know "how much" of any state of the basis is inside the state of the specific system they are considering?). From your comments, I understand your question as follows: by solving the time-independent Schrödinger equation, we only find the eigenstates $|\psi_m\rangle$ of the Hamiltonian. How do we know what the state of the system is?
{ "domain": "physics.stackexchange", "id": 87765, "lm_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, wavefunction, eigenvalue, observables", "url": null }
crystal-structure, solid-state-chemistry, crystallography, lattices Title: Does a unit cell have to contain a whole number of atoms? I was given this problem recently to compute the number of ions in a unit cell of ferrous oxide $\ce{FeO}$. The data given was: Side length $a = \pu{5 Å}$ Density $d = \pu{4 g/cc}$
{ "domain": "chemistry.stackexchange", "id": 13330, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "crystal-structure, solid-state-chemistry, crystallography, lattices", "url": null }
inorganic-chemistry, enthalpy Title: Enthalpy of reaction Please someone help me with this question How is d possible? Ea = (delta)H + RT i guess that ends the confusion. Now you can adjust the last term and have all 3 cases as possible https://lavelle.chem.ucla.edu/forum/viewtopic.php?t=13676
{ "domain": "chemistry.stackexchange", "id": 7680, "lm_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, enthalpy", "url": null }
performance, vba, excel If wsDEM.Range("AO3") <> "Vin" Then Wrong = Wrong & "Vin: DEM AO" & vbCrLf If wsDEM.Range("BE3") <> "Co- buyer First Name" Then Wrong = Wrong & "Co- buyer First Name: DEM BC" & vbCrLf If wsDEM.Range("BF3") <> "Co Buyer Last Name" Then Wrong = Wrong & "Co Buyer Last Name: DEM BD" & vbCrLf If wsDEM.Range("BG3") <> "CoBuyer Address" Then Wrong = Wrong & "CoBuyer Address: DEM BE" & vbCrLf If wsDEM.Range("BH3") <> "Co Buyer City" Then Wrong = Wrong & "Co Buyer City" & vbCrLf If wsDEM.Range("BI3") <> "Co Buyer State" Then Wrong = Wrong & "Co Buyer State: DEM BG" & vbCrLf If wsDEM.Range("BJ3") <> "Co Buyer Zip" Then Wrong = Wrong & "Co Buyer Zip: DEM BH" & vbCrLf If wsDEM.Range("BK3") <> "Co Buyer Social" Then Wrong = Wrong & "Co Buyer Social: DEM BI" & vbCrLf If wsDEM.Range("BL3") <> "Co Buyer DOB" Then Wrong = Wrong & "Co Buyer DOB: DEM BJ" & vbCrLf
{ "domain": "codereview.stackexchange", "id": 30352, "lm_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, vba, excel", "url": null }
python, c++, ffi string* paramptr = &t_param; // Create pointer to param. PyObject* returnValue = PyObject_CallMethod(m_pyObject, methodName, "(s)", paramptr); // Python class and method name with string param to be converted and used. delete[] methodName; return _PyLong_AsInt(returnValue); } #ifndef Py_Interface_H #define Py_Interface_H #include <Python.h> #include <string> using namespace std; /** * C++ class to easily interface with Python classes and methods. * * Stores member variable/pointer m_pyObject of type PyObject. * m_pyObject is a pointer to the specified Python class and is * used in subsequent method calls handled by callPyMethod and * callPyMethodInt. * * Designed to reduce redundant calls to Python and increase * modularity. */ class PyInterface { public: PyInterface(string t_objName); void callPyMethod(string t_method); int callPyMethodInt(string method, string t_param);
{ "domain": "codereview.stackexchange", "id": 43657, "lm_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, c++, ffi", "url": null }
ros, ikfast, ros-kinetic Original comments Comment by gvdhoorn on 2018-06-30: Which commands did you use (exactly) to generate the plugin? an SIA5 is a 7dof robot, so you would've to change some of the commands of the tutorial you link. Without knowing what you did, it'll be hard to help you. Comment by gvdhoorn on 2018-07-02: re: edit: you have freeindex set to 8, which is the joint between links b and t. That is legal, but seems strange to me. For a 7dof SIA5 I would expect the e joint to be the free one. Do you have a specific reason for choosing the t joint? Comment by gvdhoorn on 2018-07-02: Note also: you appear to have a split in the urdf tree (two links with base_link as their parent). I seem to remember IKFast having a problem with that. This section in the tutorial you .. Comment by gvdhoorn on 2018-07-02: .. link also mentions that. Perhaps the wrong link is used as the end of your chain because of that, resulting in only 6 dofs to be encoded into the plugin? Comment by cpetlowany on 2018-07-02:
{ "domain": "robotics.stackexchange", "id": 31133, "lm_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, ikfast, ros-kinetic", "url": null }
The following is a bit of what I found. All of these sources prove the property by contradiction: Basic Real Analysis - Howland Mathematical Analysis - Browder A First Course in Analysis - Donald Yau Principles of Mathematical Analysis - Rudin A Course in Calculus and Real Analysis - Ghorpade & Limaye Elementary Real Analysis - Thomson, J. Bruckner & A. Bruckner So, my question is: How to proof this theorem directly, without using proof by contradiction?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104962847373, "lm_q1q2_score": 0.8032253653643652, "lm_q2_score": 0.8311430478583168, "openwebmath_perplexity": 137.2774314230657, "openwebmath_score": 0.9476463794708252, "tags": null, "url": "https://math.stackexchange.com/questions/3115231/direct-proof-of-archimedean-property-not-by-contradiction" }
javascript storage.observers[observerTarget][action].push(task); } return { observe : function() { switch( arguments.length ) { case 2: return registerObserver( arguments[0], ['update','insert','destroy'], arguments[1] ); break; case 3: return registerObserver( arguments[0], arguments[1], arguments[2] ); break; default: throw "Invalid arguments length"; break; } },
{ "domain": "codereview.stackexchange", "id": 8789, "lm_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", "url": null }
hamiltonian-formalism, chaos-theory, phase-space, complex-systems, integrable-systems since the toruses cannot cover the whole phase space when indexed by energy... But I'd say this is a property associated to dimension, not to chaos. The definition of "stochastic web" does not change: it is a chaotic filament of phase space where dynamics is chaotic, but outside of it it is regular. I think the teacher only used the term "stochastic web" as an analogy for a region there chaos "spreads as a web", not referring to the technical jargon that was started by Zaslavsky.
{ "domain": "physics.stackexchange", "id": 31987, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "hamiltonian-formalism, chaos-theory, phase-space, complex-systems, integrable-systems", "url": null }
Estimation. then this is the book for you. and his book on Linear Algebra is a very good introduction. Linear Algebra for Data Scientists. A lot of linear algebra over the complex field This free book Linear Algebra - As an Introduction to Abstract Mathematics from UC Davis has plenty of exercises; Terence Tao has a set of notes if you google, they go with the book Linear Algebra by Friedberg, Insel and Spence. Programming and data science articles by hadrienj. Linear Algebra: Foundations to frontiers – edx. This works in the latest snapshot of Breeze. Linear Algebra Examines basic properties of systems of linear equations, vector spaces, inner products, linear independence, dimension, linear transformations, matrices, determinants, eigenvalues, eigenvectors and diagonalization. GitHub; LinkedIn; Twitter; Donald Miner (@donaldpminer) specializes in large-scale data analysis enterprise architecture and applying machine learning to real-world problems. Windows-64 (64-bit linear algebra
{ "domain": "cfalivorno.it", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936073551713, "lm_q1q2_score": 0.9126122943990052, "lm_q2_score": 0.9273632991598454, "openwebmath_perplexity": 1063.9791517497667, "openwebmath_score": 0.2879904508590698, "tags": null, "url": "http://oanx.cfalivorno.it/linear-algebra-and-learning-from-data-github.html" }
ros, pid r_arm_controller: type: my_controller_pkg/RightArmControllerPlugin right_shoulder_link: base_to_right_shoulder right_tricep_link: right_rotator_to_tricep right_lower_bicep_link: right_upper_to_lower_bicep right_upper_forearm_link: right_lower_bicep_to_upper_forearm right_wrist_link: right_lower_forearm_to_wrist right_hand_link: right_wrist_to_hand pid_parameters: p: 150.0 i: 0.0 d: 0.0 i_clamp: 0.0 The pid values are just the test values from the tutorial to see if I can launch the controllers but unfortunately they don't launch. Does any one know where this error comes from? Kind Regards, Martin
{ "domain": "robotics.stackexchange", "id": 12815, "lm_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, pid", "url": null }
python, performance, beginner, python-3.x, game-of-life Title: A beginners implementation of Game of Life I'm totally new to python and coding in general and I tried for my first project to recreate Conway's game of life. After days of trial and error, I came up with this code: import numpy as np import copy import png import PIL as PIL def a(a) : if a == "gen" : size=int(input("size ? ")) ratio=float(input("ratio ? ")) name=input("file name: ") matrix=np.random.choice(2,(size,size),p=[1-ratio,ratio]) i = png.from_array(matrix, mode='L;1') i.save(str(name)+'.JPEG')
{ "domain": "codereview.stackexchange", "id": 31340, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, beginner, python-3.x, game-of-life", "url": null }
algorithms, computational-geometry Let's work out the implications of this insight. In our universe the ball starts at some initial coordinate $(x_0,y_0)$, moving NE, and we want to know if will ever reach coordinate $(x',y')$. What does this mean in the infinite universe? Well, imagine placing mines at coordinates $(x',y')$, $(x',2n-y')$, $(x',y'+2n)$, $(x',4n-y')$, ..., $(2m-x',y')$, $(2m-x',2n-y')$, ... -- in particular, at coordinates $(2im \pm x',2jn \pm y')$ where $i,j$ range over all integers. Then I claim that the ball will eventually reach coordinate $(x',y')$ in our universe if and only if the ball will eventually hit a mine in the parallel universe. So our problem reduces to asking: in the parallel universe, will the ball ever hit a mine?
{ "domain": "cs.stackexchange", "id": 5492, "lm_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, computational-geometry", "url": null }
python, python-3.x In your function write_score, you should use str.join. In read_scores you can directly iterate over the lines of the file, which is a lot more memory-efficient. You can also use tuple assignment to make it clearer what is what. In sort_scores, you can use sorted directly on zip, there is no need to cast it to a list first. You can also return the result right away. In has_better_score you can just return the result of the comparisons. In print_scores you can use str.join again. #!/usr/bin/env python3
{ "domain": "codereview.stackexchange", "id": 23172, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x", "url": null }
angular-momentum, nuclear-physics, conservation-laws, quantum-spin, parity The matrix element for a particular transition is generally proportional to the overlap between the initial wavefunction and the final wavefunction. In nuclear decays the initial state is the nucleus, which is tiny and more-or-less spherical with uniform density, while the final state includes the daughter nucleus and the wavefunctions for the decay products. If the decay products carry orbital angular momentum $\ell$, the radial part of the wavefunction goes like $r^\ell$ near the origin. Dimensional analysis then says that the overlap between the nucleus and the decay wavefunction is proportional to $(kR)^\ell$, where $R$ is the nuclear radius and $k = p/\hbar = 2\pi/\lambda$ is the wavenumber of the decay product. (Note that nuclear decay products typically have $\lambda \gg R$, so you can treat the decay product wavefunction as roughly uniform averaged over the nucleus.) If the probability of a decay is proportional to $(kR)^\ell$, that means that
{ "domain": "physics.stackexchange", "id": 35866, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "angular-momentum, nuclear-physics, conservation-laws, quantum-spin, parity", "url": null }
Yes, such sequences are closely related, and the relationship does involve the golden ratio. Let $\varphi=\frac12(1+\sqrt5)$ and $\widehat\varphi=\frac12(1-\sqrt5)$; $\varphi$ is of course the golden ratio, and $\widehat\varphi$ is its negative reciprocal. Let $a_0$ and $a_1$ be arbitrary, and define a Fibonacci-like sequence by the recurrence $a_n=a_{n-1}+a_{n-2}$ for $n\ge 2$. Then there are constants $\alpha$ and $\beta$ such that $$a_n=\alpha\varphi^n+\beta\widehat\varphi^n\tag{1}$$ for each $n\ge 0$. Indeed, you can find them by substituting $n=0$ and $n=1$ into $(1)$ and solving the system \left\{\begin{align*} a_0&=\alpha+\beta\\ a_1&=\alpha\varphi+\beta\widehat\varphi \end{align*}\right. for $\alpha$ and $\beta$. In the case of the Fibonacci numbers themselves, $\alpha=\frac1{\sqrt5}$ and $\beta=-\frac1{\sqrt5}$; in the case of the Lucas numbers $L_n$, for which the initial values are $L_0=2$ and $L_1=1$, $\alpha=\beta=1$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471675459396, "lm_q1q2_score": 0.8582564822654299, "lm_q2_score": 0.8723473630627235, "openwebmath_perplexity": 155.8255702074925, "openwebmath_score": 0.9097886085510254, "tags": null, "url": "http://math.stackexchange.com/questions/546030/significance-of-starting-the-fibonacci-sequence-with-0-1" }
python, python-3.x, regex, reflection, namespaces Shallow review self.call_re seems to be variable that does not change, is the same for all instance and is used only in __mul__. You could define it as a "constant" or as a local variable in __mul__. The same thing applies to sep_re. def __init__(self, *_): self.t = T() def __mul__(self, code): CALL_RE = f'{self.__class__.__name__}\((.+)\).*' return CALL_RE * code.count(self.__class__.__name__) def setattrs(self, t, varnames, f_back): SEP_RE = '\s*,\s*' for name in split(SEP_RE, varnames.strip(', ')): I think that normalise_pos would be easier to understand if it was written like this: def normalize_pos(self, no): self.__class__.no += 1 if self.__class__.no == no: self.__class__.no = 0
{ "domain": "codereview.stackexchange", "id": 28772, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, regex, reflection, namespaces", "url": null }
Readers might enjoy constructing counterexamples to the proposition when any of the conditions on $$f$$ are relaxed. To answer the question: This applies to Normally distributed variables because they are a location-scale family of absolutely continuous variables with distributions supported on the entire real line.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.979667648438234, "lm_q1q2_score": 0.8163811507302945, "lm_q2_score": 0.8333245994514084, "openwebmath_perplexity": 344.8452102843219, "openwebmath_score": 0.9153262376785278, "tags": null, "url": "https://stats.stackexchange.com/questions/392601/gaussian-to-gaussian-transformations" }
homework-and-exercises, general-relativity, optics, gravity, gravitational-lensing What does "we may regard this bending equivalently as due to a medium of refractive index" mean? If we can treat it as a medium, them what do we take the angle of incidence, refraction, the medium interface etc to be? By optical path length of path QP, should we find $\int n(s)ds$ over the line segment QP or should we do it over the actual path taken by light to move from Q to P? And how do we show the last part? ANSWER TO : DOUBT 1: They Are basically modelling the curving light ray to be the same scenario as when a light beam passes through a medium having continuously varying R.I for each infinitesimal layer(like the atmosphere suppose). The function of R.I here is given as a function of the potential, which is a function of the distance from the object M. DOUBT 2: You have to find the optical path length $\Delta$, which by definition is: $\Delta = \int_{C} n(s).ds$ where C denotes the curve signifying its actual path traversed.
{ "domain": "physics.stackexchange", "id": 34613, "lm_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, general-relativity, optics, gravity, gravitational-lensing", "url": null }
complement of A in U:[4], The absolute complement of A is usually denoted by It follows that some programming languages may have a function called set_difference, even if they do not have any data structure for sets. Here four basic operations are introduced and their properties are discussed. R Without a definition of the universal set, you can't really give a standard-library definition of the complement of a set.. Hence, A' = { x | x ∉ A }. Sometimes the complement is denoted as A' or AC. Each of union, intersect, setdiff and setequal will discard any duplicated values in the arguments, and they apply as.vector to their arguments (and so in particular coerce factors to character vectors).. is.element(x, y) is identical to x %in% y. View Set Operations _ Union _ Intersection _ Complement _ Difference _ Mutually Exclusive _ Partitions _ from DEVELOPMEN 14740 at St. John's University. The complementary relation If X ⊆ U, where U is a universal set, then U \ X is called the compliment
{ "domain": "france-metallurgie.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9674102542943773, "lm_q1q2_score": 0.8040563012142039, "lm_q2_score": 0.8311430415844385, "openwebmath_perplexity": 610.5719462253402, "openwebmath_score": 0.7532367706298828, "tags": null, "url": "http://france-metallurgie.com/site/gujarat-assembly-mqmzq/ut0f30z.php?tag=b1580a-set-operations-complement" }
newtonian-mechanics, waves, continuum-mechanics, string Title: Why is KE equal to PE for waves on a string? Clarification needed For waves on a string why is Kinetic Energy said to be equal to Potential Energy? The linked answer gives no reason for it. I knew that KE for each elementary part of wave is $(1/2)(dm)v^2$ ($v$ i.e. $\frac{dy}{dt}$ being instantaneous velocity) while PE is $T\Delta \ell$ (as in the linked answer). Kinetic Energy Of Plane Progressive Wave In A String: Consider a small element of the string at a distance $x$ from origin $dx$. K.E of that small part of the string is: $$\frac{1}{2}(\mu dx)(\frac{\partial y}{\partial t})^2$$ Potential Energy Of Plane Progressive Wave In A String: Again consider a small element of the string at a distance $x$ from origin $dx$. Since there is no motion in the x-direction, points on the string only move in the y-direction. If the slope of a segment changes, the length must also
{ "domain": "physics.stackexchange", "id": 39910, "lm_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, waves, continuum-mechanics, string", "url": null }
react.js, jsx, to-do-list Form.js It's been a common practice among the popular Javascript frameworks (angular, react, or vue) to have one component per file. This has been a useful practice that really helps with code organization. It's akin to having one class per file in java. But with the recent addition of react hooks, which empower functional components, there's some additional power to harness that's unique to React. There's some great potential that we miss out on if we keep trying to structure projects with a single medium-sized component per file. If we instead changed this rule to "one well-defined exported component per file", we are then free to make all sorts of smaller helper components that can aid us in defining the component we wish to export - akin to having multiple helper functions in a single file. Here's a version of Form.js that I've broken up into lots of little components /* eslint-disable jsx-a11y/label-has-associated-control */ import PropTypes from "prop-types";
{ "domain": "codereview.stackexchange", "id": 40215, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "react.js, jsx, to-do-list", "url": null }
newtonian-mechanics, newtonian-gravity, energy-conservation, orbital-motion, conservation-laws The planet-centered orbital energy of the object to be captured is constant in the two body problem. It is not constant in the three body problem. The osculating planet-centered orbital energy of the object to be captured is time varying in the three body problem. Under the right circumstances, the orbital energy can temporarily switch from slightly positive, meaning an escape trajectory, to slightly negative, meaning a temporarily bound orbit. Since gravity gradient from the sun is greatest when the planet is at perihelion, this is where capture is most likely to occur.
{ "domain": "physics.stackexchange", "id": 76930, "lm_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, newtonian-gravity, energy-conservation, orbital-motion, conservation-laws", "url": null }
• "If ${a_n}$ does not converge to a, the there is an $ϵ>0$ and a subsequence $a_{n_k}$ such that for each $k>0$, $|a_{n_k}|>ϵ$." Do you not mean $|a_{n_k}-a| \geq \epsilon$? – Kurome Jun 16 '15 at 0:14 • I am also not sure why we have to explicitly state that $a_{n_{k_l}}$ does not converge to $a$, isn't it already enough that we know $a_{n_k}$ does not converge to $a$ to show that $a_n$ must converge to $a$?. – Kurome Jun 16 '15 at 0:21 • if so, then take $\epsilon /2$ the inequality is now strict. so you may as weel assume it's strict to begin with. – Matematleta Jun 16 '15 at 0:24 • but all you know about $a_{n_{k}}$ is that it is bounded. You are given that know every convergent subsequence has $a$ as its limit.but $a_{n_{k}}$ might not converge. Bolzano saves you though because you can extract a convergent sub-subsequence. – Matematleta Jun 16 '15 at 0:30
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9702399043329856, "lm_q1q2_score": 0.8285002313396519, "lm_q2_score": 0.8539127566694178, "openwebmath_perplexity": 117.03018504177386, "openwebmath_score": 0.9761823415756226, "tags": null, "url": "https://math.stackexchange.com/questions/1326470/bounded-sequence-with-subsequences-all-converging-to-the-same-limit-means-that-t" }
homework-and-exercises, newtonian-mechanics, classical-mechanics, energy, potential-energy Title: When a balloon pops and lets a brick fall, where does the energy come from? Let's say a scientist attaches a 1 kg brick to a large helium inflated balloon, lets the balloon go, and then it reaches an altitude of 10 000 meters before it pops, dropping the brick. The brick falls and hits the ground with with a kinetic energy of approximately 100 000 joules. (Actually a bit less, it gives some of that energy as air resistance, but it still stored that much energy.) For reference, a rifle shot is about 2 000 joules.
{ "domain": "physics.stackexchange", "id": 50981, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, classical-mechanics, energy, potential-energy", "url": null }
time-complexity, finite-automata Title: Why does lexer has O(n) time complexity? According to my CS knowledge so far, a lexer uses DFA(which takes linear time) for 'each' token type to find the next token, so in the worst case, it should try 'all possible' token types of a language. (there are some other reasons, e.g. to find the 'longest matching pattern' to distinguish between if a(keyword) and ifa(identifier)) Then, the lexer repeats this process until the input string ends, producing N tokens as a result. So I ended up with the conclusion that lexer has $\mathcal O(n^2)$ time complexity. But every resource and book says lexer takes linear time because the DFA has linear time complexity. What I am missing? *Edit:
{ "domain": "cs.stackexchange", "id": 21560, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "time-complexity, finite-automata", "url": null }
# 1.4.2: Subtracting Integers In Section 1.2, we stated that “Subtraction is the opposite of addition.” Thus, to subtract 4 from 7, we walked seven units to the right on the number line, but then walked 4 units in the opposite direction (to the left), as shown in Figure $$\PageIndex{1}$$. Thus, 7 − 4 = 3. The key phrase is “add the opposite.” Thus, the subtraction 7 − 4 becomes the addition 7 + (−4), which we would picture on the number line as shown in Figure $$\PageIndex{2}$$. Figure $$\PageIndex{1}$$ and Figure $$\PageIndex{2}$$ provide ample evidence that the subtraction 7−4 is identical to the addition 7+(−4). Again, subtraction means “add the opposite.” That is, 7 − 4=7+(−4). Defining Subtraction Subtraction means “add the opposite.” That is, if a and b are any integers, then $a − b = a + (−b).\nonumber$
{ "domain": "libretexts.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9912886152849367, "lm_q1q2_score": 0.8445311170774867, "lm_q2_score": 0.8519528057272544, "openwebmath_perplexity": 3179.0888159169285, "openwebmath_score": 0.9624632000923157, "tags": null, "url": "https://math.libretexts.org/Courses/Honolulu_Community_College/Math_75X%3A_Introduction_to_Mathematical_Reasoning_(Kearns)/01%3A_Whole_Numbers_and_Integers/1.04%3A_Combining_Integers-_Addition_and_Subtraction_with_Integers/1.4.02%3A_Subtracting_Integers" }
python, game, python-3.x, pyqt # Start new game elif key in (Qt.Key_Enter, Qt.Key_Return): self.start() elif key == Qt.Key_Escape: self.close() # Reset current field and draw new one. # Starting the game is still needed. elif key == Qt.Key_R: self.reset() def print_text(self, source): self.QText_status.setHtml(source) def reset(self): self.timer.stop() self.key = None self.players = create_players() self.squares = create_squares(9, 9) self.scene.clear() self.draw_field(self.squares, self.players) self.print_text(print_main())
{ "domain": "codereview.stackexchange", "id": 22242, "lm_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, python-3.x, pyqt", "url": null }