text
stringlengths
49
10.4k
source
dict
c#, beginner, file-system score[i]++; hasAScore = true; // Console.WriteLine("Found match with title '{0}' with string '{1}' from file '{2}'", titles[j], subStrings[i], file.Name); } } // if the percentage of word matches and total words in the title is > 80% (arbitrary) // To avoid false matches with longer titles // boost the score int titleWordCount = titles[i].Split(removables, StringSplitOptions.RemoveEmptyEntries).Length; if ((100 * (score[i]) / (2 * titleWordCount)) > 80) { score[i] += 2; } } if (hasAScore) { // Find the highest score in the list and use it's title value as the title of the Category string titleName = titles[Array.IndexOf(score, score.Max())]; bool exists = false; // Check through all the categories if it already exists, otherwise add a new one // TODO perhaps check this in the class's constructor foreach (Category c in categories) { if (c.Name == titleName) { c.AddChildren(new Children(file), titleName); exists = true; break; } } if (!exists) { categories.Add(new Category(new Children(file), titleName)); } } else { // Files without a score were not matched with any existing category notSortedFiles.Add(new Children(file)); } // Console.WriteLine("File: '{0}' has a max score of {1}", file.Name, score.Max()); // Update Progress // Send percentComplete to the backgroundWorker and the current file number int progressPercentage = 100 * fileCount / allFiles.Count; // Only the ReportProgress method can update the UI (backgroundWorker as BackgroundWorker).ReportProgress(progressPercentage, fileCount); } return categories; }
{ "domain": "codereview.stackexchange", "id": 17960, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, file-system", "url": null }
homework-and-exercises, newtonian-mechanics, kinematics $$ Rearranging again leaves us with $$ \frac{d}{dt}\left[ \frac{1}{2}m \left(R^2\dot\theta^2 + \dot R^2\right) - mgR\sin\theta + \frac{1}{2}k(L_0 - R)^2 \right] = 0 $$ Recognize that $R^2\dot\theta^2 + \dot R^2 = \dot{\bf r}^2 \equiv v^2$ is the instantaneous velocity squared and the above reduces to $$ \frac{d}{dt}\left[ \frac{1}{2}mv^2 - mgR\sin\theta + \frac{1}{2}k(L_0 - R)^2\right] = 0 $$ as expected. Moreover, given that the initial energy is null, we actually have $$ \frac{1}{2}m \left(R^2\dot\theta^2 + \dot R^2\right) - mgR\sin\theta + \frac{1}{2}k(L_0 - R)^2 = 0 $$
{ "domain": "physics.stackexchange", "id": 26864, "lm_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, kinematics", "url": null }
python, beginner, python-3.x, tkinter, gui # Tells the program to return to the create sticky function on click myCreateButton = Button( frame, text='Create', command=lambda: create_sticky(self), font = small_font, ) myCreateButton.pack(padx=5, pady=5) settingsbutton = Button( frame, text= 'Settings', font = small_font, command= lambda: openSettings(self), ) settingsbutton.pack(padx=5, pady=10, side=BOTTOM) help(MyApp) if __name__ == '__main__': w = MyApp() w.mainloop() Overall this is a great start, basically functional, and looks cool. Your doing this: import tkinter as tk is a good idea - so you should then avoid the next line: from tkinter import * as it pollutes your namespace. Using tk.LabelFrame etc. uniformly will help. tk.Tk.__init__(self, *args, **kwargs) should use super() rather than tk.Tk. The indentation issue is a case of Python being characterized as friendly to beginners, but actually shooting beginners right in both feet. makecolor, openSettings, and so on should actually be de-indented by one level so that rather than being locally-defined functions, they become actual class methods. Note that the lines starting with: myscreenwidth = (getscreensize(self))[1]
{ "domain": "codereview.stackexchange", "id": 41832, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, tkinter, gui", "url": null }
Math Expert Joined: 02 Sep 2009 Posts: 47200 A is a prime number (A>2). If B = A^3, by how many different integers  [#permalink] ### Show Tags 27 Sep 2017, 21:07 2 Huey002 wrote: A is a prime number (A>2). If B = A^3, by how many different integers can B be equally divided? (a) 3. (b) 4. (c) 5. (d) 6. (e) 7. Finding the Number of Factors of an Integer First make prime factorization of an integer $$n=a^p*b^q*c^r$$, where $$a$$, $$b$$, and $$c$$ are prime factors of $$n$$ and $$p$$, $$q$$, and $$r$$ are their powers. The number of factors of $$n$$ will be expressed by the formula $$(p+1)(q+1)(r+1)$$. NOTE: this will include 1 and n itself. Example: Finding the number of all factors of 450: $$450=2^1*3^2*5^2$$ Total number of factors of 450 including 1 and 450 itself is $$(1+1)*(2+1)*(2+1)=2*3*3=18$$ factors. According to above as $$b=a^3$$ and $$a$$ is a prime, then the number of factors of $$b$$ is $$3+1=4$$: $$1$$, $$a$$, $$a^2$$, $$a^3=b$$. P.S. PLEASE NAME TOPICS PROPERLY. CHECK RULE 3 HERE: RULES OF POSTING. Thank you. _________________ A is a prime number (A>2). If B = A^3, by how many different integers &nbs [#permalink] 27 Sep 2017, 21:07 Display posts from previous: Sort by # Events & Promotions
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104924150547, "lm_q1q2_score": 0.8214210568967238, "lm_q2_score": 0.8499711699569786, "openwebmath_perplexity": 4244.327590684636, "openwebmath_score": 0.6315532326698303, "tags": null, "url": "https://gmatclub.com/forum/a-is-a-prime-number-a-2-if-b-a-3-by-how-many-different-integers-250270.html" }
quantum-mechanics, quantum-information, quantum-computer Title: Why are rotation operators and Pauli rotations defined so that $R_x(\pi)\neq X$? When applying a Hadamard Gate Wikipedia defines it as $XR_y(\frac{\pi}{2}) = H$. The effect of a Pauli Gate $X$ is defined as a Rotation of $\pi$ radians about the x-Axis on the Bloch sphere. The effect of the Rotation Operator Gate $R_x(\theta)$ is defined as a rotation about the x-Axis by an angle $\theta$ on the Bloch sphere. Why is it, that it's $R_x(\pi) \neq X$? If I apply $R_x(\pi)R_y(\frac{\pi}{2})$ to the state $|0\rangle{}$ I end up with a superposition state that differs by $-i$ from what it is supposed to be according to the definitions of the Hadamard Gate. I get that it's $R_x(\pi) = -iX$ according to the definition $R_x(\theta)=e^{-i\theta X/2}$. My question is what the physical background of it is. Why can't I use the rotation operator with $\theta = \pi$ in the Hadamard Gate, but have to use $X$ instead? Recall the matrix exponential of a vector of Pauli matrices $$\exp(-i \theta\mathbf{n}\cdot\boldsymbol{\sigma}/2)=\mathbb{I}\cos\frac{\theta}{2}+i \mathbf{n}\cdot\boldsymbol{\sigma}\sin\frac{\theta}{2}.$$ By this token, we find $$R_x(\pi)=\exp(-i \sigma_x \pi/2)=-i \sigma_x.$$ Physically, there is no difference between this operator $-i\sigma_x$ and $\sigma_x$, because one can never distinguish between two states that differ by a global phase:
{ "domain": "physics.stackexchange", "id": 84147, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-information, quantum-computer", "url": null }
python -1.48373348870346, -1.76484058374354)), class = "data.frame", row.names = c("ModelM", "ModelO", "ModelS", "ModelA", "ModelI", "ModelC", "ModelT", "ModelH", "ModelE", "ModelR", "ModelA2", "ModelP", "ModelE2", "ModelU", "ModelT2", "ModelC2", "ModelS2", "ModelX"))
{ "domain": "bioinformatics.stackexchange", "id": 2572, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python", "url": null }
python, hash-map print vowels I don't claim to be very good at Python. I enjoy mucking around with it, but I think I'm missing something here. The script works, but I'm clearly repeating myself in the for loop. What's the better "Pythonic" was for me to have done this? Change to lower once: text.lower() instead of t.lower() inside loop. Use t in vowels to check if the character is vowels. vowels = {...} can be replaced with dict.fromkeys('aeiou', 0) (See dict.fromkeys) Caution: Use this only if the value is immutable. >>> dict.fromkeys('aeiou', 0) {'a': 0, 'i': 0, 'e': 0, 'u': 0, 'o': 0} vowels = dict.fromkeys('aeiou', 0) for t in text.lower(): # Change to lower once. if t in vowels: vowels[t] += 1 print vowels Alternatively, you can use try ... except KeyError ...: for t in text.lower(): # Change to lower once. try: vowels[t] += 1 except KeyError: # Ignore consonants. pass Or using battery included, collections.Counter: from collections import Counter vowels = Counter(c for c in text.lower() if c in 'aeiou') # => Counter({'e': 54, 'a': 41, 'o': 40, 'i': 37, 'u': 14})
{ "domain": "codereview.stackexchange", "id": 19298, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, hash-map", "url": null }
jupiter, newtonian-telescope, telescope-lens Collimation - look this up, it just means adjusting the two mirrors so your eye is looking right down the tube in a straight line. For a long focal length scope like yours, it's not likely to be a problem unless one of them is wildly out of line. Tube currents/thermal behaviour - on almost any cold night, when the tube and main mirror are still warm from being indoors, rising air currents in the tube will mess up your image and make it shimmery, at high power. Low power will look OK. It might take an hour or so for the image to improve (a guess) Anyway, in summary my guess is changing the eyepieces straight away won't make a dramatic difference. Eyepiece makers will say otherwise of course :)
{ "domain": "astronomy.stackexchange", "id": 1407, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "jupiter, newtonian-telescope, telescope-lens", "url": null }
optics, models, vision The radius of the eye is $ER$ and the radius of the hole is $AR$, and with the length $DA$ these form a right angled triangle. Pythagoras' theorem tells us: $$ DA^2 + AR^2 = ER^2 $$ so: $$ DA = \sqrt{ER^2 - AR^2} $$ which is what your first line of code calculates. So $DA$ is the distance from the centre of the eye to the centre of the hole. The angle $AC$ is then given by: $$ \tan AC = \frac{AR}{DA} $$ so: $$ AC = \arctan \left( \frac{AR}{DA} \right) $$ which is what the second line of code calculates. If you now put a cornea over the hole to make the eye spherical again: Then the length of the arc $AD$ is simply: $$ AD = EC \frac{AC}{2\pi} $$ which is what your third line calculates, although there's something a bit odd here as if $AD$ stands for Aperture Diameter then there is a factor of two missing.
{ "domain": "physics.stackexchange", "id": 12000, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, models, vision", "url": null }
c, bitwise Before mushing the parts together this is what I get in output: x = 1111 0000 0001 0111 1011 1101 1110 1101 =================================================================== mask0 = 1111 0000 0001 0110 0000 1101 1110 1101 mask1 = 1111 1111 1111 1110 0100 1111 1111 1111 mask2 = 0000 0000 0000 0001 1111 0000 0000 0000 =================================================================== output = 1111 0000 0001 0110 0100 1101 1110 1101 Maybe: void invert2(unsigned x, unsigned p, unsigned n) { printbits((~(~0 << n) << p) ^ x); }
{ "domain": "codereview.stackexchange", "id": 876, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, bitwise", "url": null }
ros Originally posted by aldo85ita with karma: 252 on 2012-10-02 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by ThomasK on 2012-10-02: Yes, when you're using the mono vo you have to set the mono vo specific parameters (i.e. height and pitch) as well obviously. Your question was just about the stereo vo though. I'm glad you were able to resolve your issue. Comment by aldo85ita on 2012-10-02: Yes, @ThomasK, you're right: I tried stereo vo because I didn't be satisfied of mono ov, but for both of them I set wrong parameters: in stereo I missed camera pitch and in mono vo I set camera pitch and height only one time each one instead of twice. Thank you very much for your help. Comment by xgdong on 2015-04-04: why do you need camera pitch for stereo visual odometry? Can you tell me how you solved this problem? I also met with the problem of an inaccurate y estimation.
{ "domain": "robotics.stackexchange", "id": 11087, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
plotRectangle(v1,v2,v3,v4); hold on; plot(p(:,1),p(:,2),'o'); plot(q(:,1),q(:,2),'*'); hold off;
{ "domain": "upc.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9908743636887528, "lm_q1q2_score": 0.8361940285991107, "lm_q2_score": 0.8438951084436076, "openwebmath_perplexity": 6775.393367442512, "openwebmath_score": 0.8619092106819153, "tags": null, "url": "https://numfactory.upc.edu/web/FiniteElements/Pract/P4-QuadInterpolation/html/QuadInterpolation.html" }
measure is the Chebyshev measure. I decided to mostly use (squared) euclidean distance, and multiple different color-spaces. Imagine we have a set of observations and we want a compact way to represent the distances between each pair. But if you want to strictly speak about Euclidean distance even in low dimensional space if the data have a correlation structure Euclidean distance is not the appropriate metric. kings and queens use Chebyshev distance bishops use the Manhattan distance (between squares of the same color) on the chessboard rotated 45 degrees, i.e., with its diagonals as coordinate axes. Distance: we use hamming distance if we need to deal with categorical.! Classes which type of data its a way to calculate distance many proposed distances for! Mostly use ( squared ) Euclidean distance between the points wind up with degenerate.... Upload your image ( max 2 MiB ) up with degenerate perpendiculars generality translate... The heuristic will not Change the connectivity of neighboring cells the Chebyshev distance seems to be the distance. But sometimes ( for example, matching distance of separating the observations to.... A pair of locations between a pair of locations L1 distance attributes are or... distances are not compatible. Google account wave functions of the points ( 3, )! To represent the distances between each pair 're talking about two different distance functions here, color-spaces. Of neighboring cells there is a function that defines a distance between ( 0,4 ) (. 45° angle to the axes from the answers the normal methods of comparing two colors are in distance!, 31 January 2011 ( UTC ) no b ) the Euclidean.! Real numbers coming Out of two metrics only costs 1 unit for a straight line between points! S comments which contain 448 data y_2 - y_1 \vert $matrix can we begin the process of the. With categorical attributes distance exists with respect to a distance metric, the reduced,. Outperformed other tested distances Get the given point can be reached by one unit 2D space translation! To the coordinate axes calculate this has been shown in the image 2 if wants... Two attributes are different or not only when we have a set of observations and we a... Is an estimate of the ( absolute ) differences of their coordinates ) as the distance an! Of the real numbers coming Out of two metrics used in
{ "domain": "com.br", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9572778000158576, "lm_q1q2_score": 0.8579615414081564, "lm_q2_score": 0.896251371748038, "openwebmath_perplexity": 833.5634533418914, "openwebmath_score": 0.5468424558639526, "tags": null, "url": "http://www.comfer.com.br/023nhg/chebyshev-distance-vs-euclidean-226c34" }
algorithms, formal-languages, automata, compilers Title: What is the usage of CYK algorithm in the real world considering we have algorithms with a much better Time complexity? So considering CYK is O(n^3) and since we can just use LR(k) algorithms for DCFG's which they can check if a string is in the language in O(n) then whats the usage of CYK? is it being used anywhere? If I'm not mistaken(correct me If I'm wrong) the benefit of CYK is that since we can convert any CFG to CNF form therefore i guess we can apply this to non deterministic CFG's and also Inherently ambiguous grammars which are CFG but are these really benefits? i mean whats the usage of using membership algorithm for Inherently ambiguous CFG's or non deterministic CFG's? where would we use a Inherently ambiguous CFG or non deterministic CFG ?! Isn't the main usage of membership for compilers? which they already use LR algorithms? Here is one benefit: Some grammars aren't LR(k). Then it's useful to have CYK or some other form of GLR parsing. GLR parsing is used in some compilers, where the most natural way to express the grammar leads to a grammar that isn't LR(k), or where ambiguities are resolved in a later pass (not part of the parser).
{ "domain": "cs.stackexchange", "id": 11204, "lm_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, formal-languages, automata, compilers", "url": null }
gravity, big-bang, multiverse Title: Gravity in the multiverse Consider Tegmark's multiverse theory, and single out a level. My question is: is each of the sub-universes endowed with gravity ? What about gravity between the sub-universes: does the multiverse come with a "global gravity" ? If it would, what are the implications for the gravity in each of the sub-universes ? The answer depends on the level, but generally members of a multiverse ensemble have little or no gravitational effects on each other. Level I spatially infinite multiverses have normal gravity: each local copy of some material configuration has the same gravity, and would affect each other were they close enough - but practically they only interact with nearby spacetime. Level II inflationary multiverses have inflation domain bubbles affecting each other along the spacetime manifold, but most of their contents are very far from a domain boundary and hence never feel anything. Level III many-worlds interpretation of quantum mechanics: normal gravity inside each branch, but two parallel branches do not interact gravitationally. Level IV ultimate ensembles: not every mathematically possible universe has gravity, and hence they cannot interact with each other gravitationally.
{ "domain": "physics.stackexchange", "id": 61276, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity, big-bang, multiverse", "url": null }
quantum-mechanics, mathematical-physics, perturbation-theory Title: How to carry out the perturbation expansion of an anharmonic oscillator to high orders? I think this is a standard problem in quantum mechanics. Consider the anharmonic oscillator $E \psi = \left(- \frac{1}{2} \frac{\partial^2}{\partial^2 x } + \frac{1}{2}x^2 + \epsilon x^4 \right) \psi$. Formally, the ground state energy has the asymptotic expansion $E(\epsilon) \sim \sum_{n=0}^\infty a_n \epsilon^n$. How to calculate the coefficients $a_n$ to high orders, say, for $n= 20$? As mentioned in the comments by Bubble, this is answered in Ground State Energy Calculations for the Quartic Anharmonic Oscillator, Robert Smith. Notes for Math 4901, University of Minnesota, Morris (2013).
{ "domain": "physics.stackexchange", "id": 24820, "lm_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, mathematical-physics, perturbation-theory", "url": null }
$\iff x \in A \land x \notin (B\cup C)\tag{(7) def. Set union}$ $$\iff x \in A - (B\cup C)\tag{(8), def. set difference}$$ Hence $$(A-C)- (B-C) = A-(B\cup C)$$ @amWhy has an excellent answer to this, but as an alternative you can also work directly with the set operators: $$(A - C) - (B - C) =$$ $$(A \cap C^C) \cap (B \cap C^C)^C=$$ $$A \cap C^C \cap (B^C \cup C)=$$ $$A \cap C^C \cap B^C=$$ $$A \cap (C \cup B)^C=$$ $$A - (C \cup B)$$ • Thank you! Just starting out with this so this one looks slightly more complicated but definitely something I should strive to learn – mdrjjn Feb 10 '18 at 20:26 • @mdrjjn Yeah, it's good to know how to do these ... the good news is that all the operations are exactly isomorph to what you do with the logical operations. :) Also, if amWhy's answer is satisfactory to you, you can accept it by checking on the check mark next to it. – Bram28 Feb 10 '18 at 20:52 • Nice work. It's nice to have two approaches to suggest, and you're right, re: the correlation/isomorphism between dealing via logic/set operations! +1 – amWhy Feb 10 '18 at 23:48
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357579585026, "lm_q1q2_score": 0.8301907514055228, "lm_q2_score": 0.8479677526147223, "openwebmath_perplexity": 577.792512559472, "openwebmath_score": 0.5174116492271423, "tags": null, "url": "https://math.stackexchange.com/questions/2644956/the-difference-of-two-set-differences-a-c-b-c/2644990" }
ruby, plugin, jekyll 1 file inspected, 10 offenses detected It is a good idea to set up your tools such that the linter is automatically run when you paste code, edit code, save code, commit code, or build your project, and that passing the linter is a criterium for your CI pipeline. In my editor, I actually have multiple linters and static analyzers integrated so that they automatically always analyze my code, and also as much as possible automatically fix it while I am typing. This can sometimes be annoying (e.g. I get 76 notices for your original code, lots of which are duplicates because several different tools report the same problem), but it is in general tremendously helpful. It can be overwhelming when you open a large piece of code for the first time and you get dozens or hundreds of notices, but if you start a new project, then you can write your code in a way that you never get a notice, and your code will usually be better for it. However, even by simply hitting "Save", my editor applies a series of automatic fixes which brings the number of notices down to 48. Running Rubocop as described above, further reduces this to 38, and as mentioned, lots of these are duplicates because I have multiple different linters and analyzers configured. I would say about 16 are unique. Use snake_case for local variables Methods, local variables, instance variables, class variables, global variables, and parameters should use snake_case naming convention. You are jumping back and fort between camelCase and snake_case, for example here: cacheFolder = '.jekyll-cache/zip_bundler/' zipfile_path = cacheFolder + files[0] This should be cache_folder = '.jekyll-cache/zip_bundler/' zipfile_path = cache_folder + files[0]
{ "domain": "codereview.stackexchange", "id": 42188, "lm_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, plugin, jekyll", "url": null }
c#, game, playing-cards // else if (input == "N" || input == "n") // { // return false; // } } // Alternative one-liner public static bool DrawChoice2(string input) => input.ToLower() == "y"; Going back to the idea of a game loop, you now have a condition that dictates whether the game loop continues or not. One possible implementation would be this: string choice = Console.ReadLine(); while (DrawChoice(choice)) // No need to write "== true" or "== false" { // Stuff that happens if a player or the dealer draws another card choice = Console.ReadLine() // Ask again once the game logic has executed } // Stuff that happens when the loop ends 2.3. Drawing cards Blackjack is a card game, therefore you'll be drawing cards a lot, be it for a player or for the dealer. If something happens often in the game, it's generally a good idea to make it into a method so you don't have to write the same logic in different places. Your current implementation draws a random value between the minimum and the maximum of your array of cards. From the documentation, we learn the following: Next(Int32 minValue, Int32 maxValue) A 32-bit signed integer greater than or equal to minValue and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValueequals maxValue, minValueis returned.
{ "domain": "codereview.stackexchange", "id": 39122, "lm_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#, game, playing-cards", "url": null }
quantum-mechanics, hilbert-space, operators, coherent-states But this has suddenly be somewhat confusing, the former stated that coherent states is a superposition of infinite states of probability amplitude distribution of Gaussian wave pack. The later sates that coherent states is a spacial translation of $|0\rangle$ eigenstates. Further, the first definition involve only $\hat{a}^\dagger$ while the latter involved $\hat{p}$, a linear combination of $\hat{a}$ and $\hat{a}^\dagger$. Could you explain to me what's going on? Especially, what's the inituition between define coherent states from $T_{x_0}$? How to prove they are same or not the same? Let's recall a simple but very powerful trick: $e^{k\hat{a}}|0\rangle=\big(1+k\hat{a}+...\big)|0\rangle=|0\rangle$ where $k$ is a scalar, $\hat{a}$ is the annihilation operator, and $|0\rangle$ is the ground state. You see, when we open the bracket, only the first term survives because the rest of them just act on the ground state and annihilate it. So, we have the identity $e^{k\hat{a}}|0\rangle=|0\rangle$
{ "domain": "physics.stackexchange", "id": 61890, "lm_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, hilbert-space, operators, coherent-states", "url": null }
concentration Title: Why would sodium ions want to go down just because of one side is more positive than the other? From Khan Academy starting from 1:25, the narrator, while talking about the Electrochemical gradients, said that sodium ions would naturally want to diffuse down when having a high concentration up here and a low concentration down there. My question is Why would sodium ions want to go down just because of one side is more positive than the other, I mean, isn't the same charges repelling each other? I don't think the degree of positivity will enable them to be attracted to each other. Could anyone help me explain this? This has more to do with the diffusion gradient. Sodium ions move from the region of their higher concentration to a region of their lower concentration. In the example given by you, I believe, there are additional negatively charged molecules present in the inner side of the membrane, resulting in an influx of sodium ions to balance the same. However, like charges do repel, so this influx is not indefinite, but only up to a certain extent- until the electrical potential difference across the membrane exactly balances the concentration gradient. This point is known as the equilibrium potential. (This question and answer might be more appropriate in the Biology SE, I think).
{ "domain": "chemistry.stackexchange", "id": 15173, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "concentration", "url": null }
error-correction, stabilizer-code Title: For a stabilizer code, does existence of transversal Hadamard depend on the choice of logical Paulis? Consider the Steane code $C(S)$, which has the set of consistent transversal logical operators, $$ \bar{X} = X^{\otimes 7}, \\ \bar{Z} = Z^{\otimes 7}, \\ \bar{H} = H^{\otimes 7}. $$ However, we can choose any other pair of anti-commuting operators in the normalizer of $S$ to act as our logical $X$ and $Z$. Gottesman presented in his thesis a way of constructing such operators for any stabilizer code, by manipulating the stabilizer generator matrix of the code (see here for a review). For the Steane code, this method yields for example $$ \bar{X} = IIIIXXX, \\ \bar{Z} = ZZIIIIZ. $$ However, my attempts at creating a logical Hadamard for these operators has failed. The reason is quite simple. We need $\bar{H}\bar{X}\bar{H}^\dagger = \bar{Z}$. If $\bar{H}_0$ is some operator $A$, then the condition for the first qubit is $AA^\dagger = Z$. If we do the algebra, it's quite clear that no such $A$ exists. This answer gives conditions for when a given set of logical Paulis do have a corresponding transversal logical Hadamard. But, does someone know of a set of conditions for when a transversal logical Hadamard does not exist?
{ "domain": "quantumcomputing.stackexchange", "id": 4430, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-correction, stabilizer-code", "url": null }
gazebo, navigation, ros2, robot-localization imu0: imu/data imu0_config: [false, false, false, true, true, true, false, false, false, true, true, true, true, true, true] imu0_nodelay: false imu0_differential: false imu0_relative: false imu0_queue_size: 10 imu0_remove_gravitational_acceleration: true use_control: false Edit: Following @osilva's comments I have checked the sim time parameter of all the nodes: morten@agrirobot:~$ ros2 param list /ackermann_drive: use_sim_time /camera_controller_front: use_sim_time /camera_controller_middle: use_sim_time /controller_manager: use_sim_time /ekf_localization_odom: use_sim_time /gazebo: use_sim_time /gazebo_ros2_control: use_sim_time /velodyne_front/gazebo_ros_laser_controller: use_sim_time /gps: use_sim_time /imu: use_sim_time /joint_state_publisher: use_sim_time /robot_state_publisher: use_sim_time
{ "domain": "robotics.stackexchange", "id": 37182, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, navigation, ros2, robot-localization", "url": null }
organic-chemistry, c-c-addition, c-x-addition Title: Order of reactivity of carbonyl compounds to Nucleophilic addition reaction One of the questions in my textbook was to arrange the following in order of their reactivity for nucleophilic addition reaction. $\ce{(p-NO2Ph)_2CO}$ $\ce{(CH3)_2CO}$ $\ce{(p-NO2Ph)COH}$ $\ce{CH3COH}$
{ "domain": "chemistry.stackexchange", "id": 773, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, c-c-addition, c-x-addition", "url": null }
waves, harmonic-oscillator Title: Can we represent Simple Harmonic function as triangular waves? Having studied the topic recently I found out that simple harmonic motion can represented well with sine and cosine functions.Take for example a pendulum swing which could look like : and the equations governing the motion would be So I've been wondering why can't simple harmonic motion be represented in form of triangular waves.Although the equations above involve angular momentum so I may be contradicting myself but fundamentally the velocity time is sine function : $$-\sin(x)$$ and the gradient represents the acceleration is non-uniformly increasing and decreasing. What if instead of that you use $$-(\arcsin(\sin(x))$$ Which would represent a triangular wave whose gradient would depict that the acceleration is uniformly accelerating and decelerating.So would this represent harmonic motion or is it fundamentally incorrect. Harmonic motion in physics isn't so much defined by a periodic solution as it is defined by a certain differential equation. The equation for the harmonic oscillator is $$ \ddot{x} + kx = 0, $$ where $k$ is some constant. The general solution to this equation can be written $$ x(t) = A \sin(\sqrt{k}t) + B \cos(\sqrt{k}t), $$ where $A$ and $B$ depend on the initial conditions. Sines and cosines simply fall out naturally from the basic equation. Triangle waveforms, on the other hand, are not even differentiable at kinks, so they are not so naturally governed by a differential equation.
{ "domain": "physics.stackexchange", "id": 15885, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, harmonic-oscillator", "url": null }
we need to know definitions... They survived choices in the wrong spot: you still haven ’ t answered the question... Out how to restore/save my reputation the process of trying to answer this I... © 2021 Stack Exchange is a typical Bayes Theorem problem, it ’ s the probability of a student the! Kountz, Ashwini Miryala, Kyle Scarlett, Zachary Zell conditional probability for multiple random variables 4 0! Will finish the test to measure what the student both knows the answer being correct and knowing the answer 0.5. 3 or 4 choices for each question without the table helps me see more clearly we! Because if you know the answer but are not correct Stuck in wrong. Fida uses K ’ to mean “ not K ” of choices in the of! ) / ( 1/4 ) = P ( K∩C ) = 0 — you work., M = multiple choice examination has 5 questions and move 1/12 to right! Level and filesystem for a large storage server knew the answer, you will guess one of subject! That where you put 1/12, and conditional probability is a bit more confusing for.. The subject obtain a particular one are free and with help function teaching... Properties of conditional probabilities and solve problems pen if it is entirely forgivable not conditional probability multiple choice questions seen. A question and answer site for people studying math at any level and filesystem for a large server. Is the probability they knew the answer terms of service, privacy policy and policy... Has 5 questions on some of the subject options randomly authors use “ ~K or. Way I thought about P ( C ’ ∩ K ), which know. Saw when I read this problem was a reversal of information how many choices there are options... Into your RSS reader will get the question in order to work any! A recent question about probability has ties to Venn diagrams, tables, and Miriam symbol some! Completed a multiple-choice test with four options for each question has only one true answer multiple-choice questions are ;! Result of your quiz after you finish the novel that I am reading no! Design / logo © 2021 Stack Exchange Inc ; user contributions licensed under cc by-sa codes and datasets: them... Can ’ t be true professionals in related fields to buy them of choices! ( bleeding '', he who fears will
{ "domain": "nazwa.pl", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226300899745, "lm_q1q2_score": 0.8055179618244943, "lm_q2_score": 0.8244619285331332, "openwebmath_perplexity": 1204.1833417542236, "openwebmath_score": 0.39735767245292664, "tags": null, "url": "https://kampro.nazwa.pl/overnight-spot-xjquz/conditional-probability-multiple-choice-questions-b6b824" }
comparative-review, clojure, simulation (defn- oneth-range "Returns a range without 0. Max is inclusive." ([] (rest (range))) ([max] (rest (range (inc max))))) (defn- toggle-doors "Toggles the state of every nth door." [doors every-n] (mapv #(if (multiple-of? % every-n) (not %2) %2) (oneth-range), doors)) (defn- toggle-doors-for [doors max-n] (reduce toggle-doors doors (oneth-range max-n))) (defn find-open-doors-for "Simulates the opening and closing of n-doors many doors, up to a maximum skip distance of n." [n-doors n] (let [doors (new-doors n-doors) toggled (toggle-doors-for doors n)] (->> toggled (map vector (oneth-range)) (filter second) (map first)))) (ns irrelevant.hundred-doors-set) (defrecord Doors [open n-doors]) (defn- new-doors [n-doors] (->Doors #{} n-doors)) (defn- multiple-of? [n multiple] (zero? (rem n multiple))) (defn- oneth-range "Returns a range without 0. Max is inclusive." ([] (rest (range))) ([max] (rest (range (inc max))))) (defn- toggle-doors "Toggles the state of every nth door." [doors every-n] (update doors :open (fn [open] (reduce (fn [acc-set n] (cond (not (multiple-of? n every-n)) acc-set (open n) (disj acc-set n) :else (conj acc-set n))) open (oneth-range (:n-doors doors)))))) (defn- toggle-doors-for [doors max-n] (reduce toggle-doors doors (oneth-range max-n)))
{ "domain": "codereview.stackexchange", "id": 31989, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "comparative-review, clojure, simulation", "url": null }
computational-chemistry Title: What is GMEC (Global Minimum Energy Conformation)? In a paper I have read the term GMEC, which was not further explained. GMEC stands for Global Minimum Energy Conformation. But what is it? Is it just the conformation with the lowest energy? Yes. It is the conformer with the lowest energy out of all possible conformers. There are also local minima which have a lower energy than conformations either side of the them on the energy diagram but do not have the lowest possible energy. In this diagram showing the conformers of butane we can see that all three stable conformers; the two gauche conformers and the anti conformer are at local energy minima but the anti conformer is the global minimum.
{ "domain": "chemistry.stackexchange", "id": 8626, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computational-chemistry", "url": null }
javascript, node.js, sql-server, mongodb, express.js var toDtoFull = function (item) { if (!item) { return null; } var dto = { id: ((typeof item._id !== 'undefined') ? item._id : null), uid: ((typeof item.uid !== 'undefined') ? item.uid : null), userName: ((typeof item.userName !== 'undefined') ? item.userName : null), passHash: ((typeof item.passHash !== 'undefined') ? item.passHash : null), passSalt: ((typeof item.passSalt !== 'undefined') ? item.passSalt : null), auditVersionDate: ((typeof item._v !== 'undefined') ? item._v : null), auditDeletedDate: ((typeof item._k !== 'undefined') ? item._k : null) }; return dto; }; memberSchema.methods.toDtoFull = toDtoFull; var toDtosFull = function (items) { if (!items || items.length < 1) { return null; } var i, dtos = []; for (i = 0; i < items.length; i += 1) { dtos.push(toDtoFull(items[i])); } return dtos; }; memberSchema.methods.toDtosFull = toDtosFull;
{ "domain": "codereview.stackexchange", "id": 12965, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, sql-server, mongodb, express.js", "url": null }
c#, performance, strings, socket Title: String Isolation Class As a lone developer I don't really have anyone to peer review my work in-house so I was hoping someone could take a look at this class and tell me in what ways I could improve it. Essentially what this class does is receive a string from a socket that could possibly have multiple messages in it and isolates these messages based on the message terminator. In the isolate message method, it acquires the number of terminators with split and then loops through and adds the substring to the list of messages. Afterwards it removes that substring from the data string. Off the top of my head the first opts I spot are using an array based off the terminator count instead of a list and making the terminator string array global so it's not making a new array each time. internal class MessageHandler { const string m_MessageTerminator = "<|>"; int m_TerminatorLength = m_MessageTerminator.ToArray().Length; internal void ProcessStream(SocketState state) { ///Extract individual messages from socket message queue. ProcessMessages(IsolateMessages(state.MessageQueue.ToString())); //Find the last index of the message terminator and remove the substring from the string builder. //We do not want to clear the string builder because it could have partial messages inside. int lastTerminatorIndex = state.MessageQueue.ToString().LastIndexOf(m_MessageTerminator); state.MessageQueue.Remove (0, lastTerminatorIndex + m_TerminatorLength); } internal string[] IsolateMessages(string data) { List<string> messages = new List<string>(); string[] terminators = new string[] { m_MessageTerminator }; int terminatorCount = data.Split(terminators, StringSplitOptions.None).Length -1; for(int i = 0; i < terminatorCount; i++) { //Find The First Instance Of Message Termination int terminatorIndex = data.IndexOf(m_MessageTerminator);
{ "domain": "codereview.stackexchange", "id": 28700, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, strings, socket", "url": null }
ros-groovy And try updating again sudo apt-get update After that, follow the instructions under the installation guide again (Configuring repositories, set up the keys updating apt-get and installing) Originally posted by Gabrielcarioca with karma: 28 on 2013-03-12 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by bobliao on 2013-03-12: it doesn't work ,but still thanks .
{ "domain": "robotics.stackexchange", "id": 13312, "lm_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-groovy", "url": null }
orbital-motion, sun, earth, relative-motion Title: Revolution of Earth If all motion is relative, how do we know that the Earth revolves around the sun? Or we are just making the above statement from the frame of reference in which Sun is at the origin? Motion may be relative, but only in certain reference frames will Newton's Second Law, $$ \vec{F} = m \vec{a}, $$ hold without having to invoke ad hoc forces $\vec{F}$. In this case, suppose we did look at everything in the reference frame where the Earth is not moving. Then the Sun would be moving in a giant circle, $1\ \mathrm{AU}$ in radius, every year. But since even before Newton we've known that objects should just move at the same speed and in the same direction unless acted upon by an external force. Uniform circular motion requires something to be accelerating you ($\vec{a}$) all the time. What, then, is acting on the Sun to accelerate it? Since $m$ is so large for the Sun, you need quite a large $\vec{F}$ to make the necessary $\vec{a}$. The Earth's gravity won't suffice. In fact, the "force" here is known as centrifugal force, and it is "fictitious" in the sense that a better choice of reference frame would eliminate it. So yes, you can say that the Sun moves around the Earth, but only subject to the caveat that you are not talking about an inertial frame. Instead, that statement only holds in a reference frame where objects experience some centrifugal "force," which does not come from any fundamental interaction like gravity or electromagnetism.
{ "domain": "physics.stackexchange", "id": 8503, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "orbital-motion, sun, earth, relative-motion", "url": null }
c#, performance, coordinate-system } public static VectorX NewUnit(int size) { return new VectorX(size, 1); } public static VectorX NewUnitIndex(int size, int index) { VectorX vec = new VectorX(size); vec.SetAt(index, 1); return vec; } public static float Length(VectorX vector) { return vector.Length(); } public static VectorX Normalize(VectorX vector) { return vector.Normalize(); } public static VectorX Abs(VectorX vector) { return vector.Abs(); } public static float Dist(VectorX vector1, VectorX vector2) { return vector1.Dist(vector2); } public static VectorX Min(VectorX vector, VectorX min) { return vector.Min(min); } public static VectorX Max(VectorX vector, VectorX min) { return vector.Max(min); } public static VectorX Clamp(VectorX vector, VectorX min, VectorX max) { return vector.Clamp(min, max); } public static VectorX Lerp(VectorX vector, VectorX to, float amount) { return vector.Lerp(to, amount); } public static float Dot(VectorX vector1, VectorX vector2) { return vector1.Dot(vector2); } public static VectorX operator +(VectorX left, float value) { for (int i = 0; i < left.VectorCount; i++) { left.SetAt(i, left.GetAt(i) + value); } return left; } public static VectorX operator +(VectorX left, VectorX right) { if(left.VectorCount != right.VectorCount) throw new Exception("Vectors not same length"); else{ for (int i = 0; i < left.VectorCount; i++) { left.SetAt(i, left.GetAt(i) + right.GetAt(i)); } return left; } }
{ "domain": "codereview.stackexchange", "id": 35995, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, coordinate-system", "url": null }
python, object-oriented Title: A Python class for handling mortality (and lapse) probabilities I'm developing a model in Python which produces IFRS and SII balance sheets for a hypothetical life insurance company. To value the hypothetical company's insurance liabilities, I need to project the probability of a policy being redeemed in a given year. Policies may be redeemed in two possible ways: The policy holder dies The policy lapses (the policy-holder voluntarily chooses to redeem it) The function relied upon most heavily in this module is prob_death() which gives the probability that a policy holder dies in a given year. Since they must die eventually, the sum of these probabilities will be 1.0. The csv file 'mortality_data.csv' contains probabilities that a person who is currently alive and aged x will survive to age x+1. This is the code: # Import external libraries import pandas as pd import numpy as np class Mortality: def __init__(self, lapse_rate=0.0, mortality_stress=None): if type(lapse_rate) == list: self.lapse_rate = np.array(lapse_rate) else: self.lapse_rate = lapse_rate self.mortality_stress = mortality_stress # Read in mortality data and set age as index self.mort_data = pd.read_csv('inputs/mortality_data.csv', index_col='Age') # Apply mortality stress if applicable self.mort_data = apply_stress(self.mort_data, mortality_stress) def q(self, x): return self.mort_data.loc[x, 'Death Prob'] def prob_in_force(self): qx_curve = model.mort_data['Death Prob'].to_list() df_qx = pd.DataFrame([[0] + qx_curve[i:] + [0] * i for i in range(0, len(qx_curve))], index=[x for x in range(17, 121)])
{ "domain": "codereview.stackexchange", "id": 44783, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, object-oriented", "url": null }
homework-and-exercises, radioactivity Title: Using $A = {\lambda}N$ to find when a the amount of a radioactive source becomes constant The question and mark scheme I will write in bold and my own thoughts in normal sized text. I'm told that: When a $\bf{_{92}^{235}U} $ nucleus is exposed to free neutrons it can absorb a neutron. The resulting nucleus decays, first to $\bf{_{93}^{239}Np}$ and then to $\bf{_{94}^{239}Pu}$. I'm then asked a few questions this, one of which I don't understand the answer to. They say that: The number of $\bf{_{93}^{239}Np}$ nuclei present eventually becomes constant, calculate this constant number of $\bf{_{93}^{239}Np}$ nuclei, given that the half life of $\bf{_{93}^{239}Np} = 2.04 \times 10^{5} s$ and that the number of $\bf{_{93}^{239}Np}$ nuclei produced is at a constant rate of $ \bf{1.80 \times 10^{7} s^{-1}} $ The mark scheme uses the equation: $ \bf{A = \lambda N}$ and rearranges this to say that: $\bf{N=\dfrac{A}{\lambda}}$ and we also know that $\bf{\lambda = \dfrac{0.693}{t_\frac{1}{2}}}$ $\bf{\therefore \lambda \approx 3.397 \times 10^{-6}}$ I understand all of this and I understand the maths of the next step, I just don't understand why it gives you they value of the number of nuclei of $_{93}^{239}Np$ when the rate of decay of $_{93}^{239}Np$ equals the rate of formation of $_{93}^{239}Np$. Substituting this value of lambda into our equation for $\bf{N}$ gives us:
{ "domain": "physics.stackexchange", "id": 11699, "lm_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, radioactivity", "url": null }
geography, cartography Title: Is there a name for the process of producing positional data for cartography? Map-making requires two distinct processes, first to produce the data -- latitude, longitude and elevation -- of the points to be mapped; and second to represent this data on a flat surface as a map. Cartography nicely covers the science of creating the map from the data -- plotting points to give an accurate representation of desired properties, realising that at least one of shape, area, direction or distance, has to be sacrificed. Is there an overall name for the initial gathering of data? Terms like "surveying" seem to me to be too specialised or limited to cover all the processes involved, and "topography" seems too broad. Thank you @Fred. Surveying and Topography do cover it but they both have wider meanings than the restricted use I am after. Topometry is the closest official word I have found. Here is the definition from the Wiktionary: Noun topometry ‎(uncountable) (chiefly medicine) Any of various imaging or surveying techniques in which the three-dimensional positions of an array of points is recorded. The combinatiom of "topo" for shape and "metry" for measurement seems to cover it nicely. So, adding "geo" for the earth, I would like to coin the word Geotopometry to express the exact meaning I am after, although my spell checker doesn't like it, and probably not many people will know what I mean when I use it.
{ "domain": "earthscience.stackexchange", "id": 822, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geography, cartography", "url": null }
conventions, elasticity, continuum-mechanics, stress-strain, textbook-erratum $$\sigma^{\overline{x}}=\left\langle \sigma\right\rangle +\mathfrak{b}\cdot\hat{\mathfrak{r}}\left[2\alpha\right].$$ Setting the derivative with respect to $\alpha$ equal to $0$ produces $$0=\hat{\mathfrak{r}}\left[\beta\right]\cdot\hat{\mathfrak{r}}\left[2\alpha+\frac{\pi}{2}\right].$$ Which implies $$\hat{\mathfrak{r}}\left[2\alpha\right]=\pm\hat{\mathfrak{r}}\left[\beta\right].$$ So that $$b\hat{\mathfrak{r}}\left[2\alpha\right]=\pm\frac{1}{2}\begin{bmatrix}\sigma^{x}-\sigma^{y}\\ 2\tau^{x}{}_{y} \end{bmatrix}=\pm\begin{bmatrix}\cos\left[2\alpha\right]\\ \sin\left[2\alpha\right] \end{bmatrix},\text{and}$$ $$\tan\left[2\alpha\right]=\frac{\pm2\tau^{x}{}_{y}}{\pm\left(\sigma^{x}-\sigma^{y}\right)}.$$
{ "domain": "physics.stackexchange", "id": 52329, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "conventions, elasticity, continuum-mechanics, stress-strain, textbook-erratum", "url": null }
c++, strings, c++11, circular-list, arduino Title: Searching for a substring in a ring queue I am implementing a function which searches through a ring queue for a given substring. The function returns true if the substring is found, otherwise false. There is a cell containing null between the tail and head to signify the end of string. Please give feedback on this implementation. bool SoftwareSerial::contains(const char *substr){ char *pBuffer =_receive_buffer + _receive_buffer_head; char *pSubstr = substr; for(; *pBuffer != 0 && *pSubstr != 0; ++pBuffer ){ if(pBuffer == (_receive_buffer + _SS_MAX_RX_BUFF)){ pBuffer = _receive_buffer + _receive_buffer_head; } if(*pBuffer != *pSubstr){ pSubstr = substr; continue; } ++pSubstr; } return (*pSubstr == 0); } There were few bugs in the function. 1. pStr should point to the start of the buffer once it reaches the end of the buffer. 2. A flag should be set when a character matches and unset the flag when next coming character doesn't match. Here the modified version that I believe is correct: bool Buffer::contains(const char *pcSubstr){ const char *pcCurrentSubstr = pcSubstr; const char *pStr = buffer + head; bool seen = false; for (; *pStr != 0 && *pcCurrentSubstr != 0; ++pStr){ if(pStr == (buffer + MAX_BUFFER_SIZE)){ pStr = buffer; } if(*pStr != *pcCurrentSubstr){ pcCurrentSubstr = pcSubstr; if(seen){ --pStr; } seen = false; continue; } seen = true; ++pcCurrentSubstr; } return (*pcCurrentSubstr == 0); }
{ "domain": "codereview.stackexchange", "id": 12692, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, strings, c++11, circular-list, arduino", "url": null }
performance, python-3.x, sorting My questions: Does this sorting algorithm make any sense from the perspective of sorting algorithms in general? Could the algorithm possibly be optimized for better performance? I'm really interested if the optimization would lead to a better solution, although I mostly bet on it becoming one of the standard algorithm. naming convention self.numL = numL self.numR = numR self.valL = ... PEP-8 asks that you spell these num_l, val_l, new_array, and so on. (Also, somehow your defs wound up exdented and in the left margin, but that must be a stackexchange copy-n-paste issue.) duck defaulting ... = numL.value if isinstance(numL, ValueNode) else numL This reads vaguely like java code, rather than duck-typed python code. Consider using getattr() to simplify it: ... = getattr(numL, 'value', numL) Also, if you're going to mess around with same variable having different types, it would be a kindness to the Gentle Reader to throw in some type annotations, including | Union types, so we know what to expect. The machine doesn't care, but we do. ctor defines all attributes A class invariant is a pretty important aspect of a defined class, and "the set of object attributes" typically will be a stable invariant of constant size, always the same attributes. Your constructor always defines self.value: float = ... self.isPair: bool = ... In the False case we also define self.num. OTOH in the True case we instead define self.numL = ... self.numR = ... self.valL = ... self.valR = ...
{ "domain": "codereview.stackexchange", "id": 45316, "lm_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, python-3.x, sorting", "url": null }
quantum-gate, programming, grovers-algorithm, quantum-circuit In general, the tensor factor may not exist because the extra qubit could be entangled with the part you're trying to extract. But if it's not entangled, which in this case it's not, then you just look at the subset of the state vector where the extra qubit is 0 and that's your answer (after normalizing) (or, if the part of the state vector where the extra qubit is 0 is all amplitudes zero, look at the subset where the extra qubit is 1). To be more specific, what you do is group the state vector into parts keyed by the state of qubits you're not including. You then pick the part with the largest 2 norm as your reference part. This is the result you will return, normalized to have 2-norm of 1, if the state is not entangled. The state is not entangled if all the parts are parallel to each other. To verify lack of entanglement in a numerically stable way, you sum up the dot products of the reference part with all the parts (including itself). If the sum of dot products has a magnitude of 1, the state is not entangled. The sum's magnitude will get smaller as entanglement increases, though it won't necessarily get to zero.
{ "domain": "quantumcomputing.stackexchange", "id": 2175, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-gate, programming, grovers-algorithm, quantum-circuit", "url": null }
electromagnetism, inductance Title: Negative mutual inductance? I'm trying to find the mutual inductance of a straight wire and a square conductor. I used the integral $\int B \cdot da=Φ=ΜI$ However,M comes out negative. Does this have a physical meaning or did I just miscalculate? The current in the square flows as shown and the wire is supposed to be on the z axis with the current going up. There is no reason for a mutual inductance to be positive, all depends on relative orientations of the conductors and on prescribed directions of currents. For example, on the top picture a current in the left coil will create a positive magnetic flux in the right coil, thus the mutual inductance is positive. "Positive magnetic flux" means the magnetic field direction is related to a prescribed direction of a current in the right coil by the right hand screw rule. On the bottom picture the right coil is flipped, hence the mutual inductance is negative because a current in one coil will create a negative magnetic flux in the second coil.
{ "domain": "physics.stackexchange", "id": 40763, "lm_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, inductance", "url": null }
wavefunction, density-operator $$ This is just the continuous variable version of entanglement. As an example with qubits, consider the Bell state $$ |\Psi \rangle = \frac{|01\rangle + |10\rangle}{\sqrt{2}} $$ and trace out one of the qubits. This yields $$ \rho_1 = \rho_2 = \frac{|0\rangle\langle 0|+|1\rangle\langle 1|}{2}, $$ But even a state with only classical correlations, $$ \rho = \frac{|00\rangle \langle00| +|11\rangle\langle11|}{2} $$ would give the same reduced density operators, this state being much different from the entangled one considered. This shows that there is more information in the full state $\rho$ than in the partial knowledge of each of the subsystems $\rho_i$.
{ "domain": "physics.stackexchange", "id": 35674, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "wavefunction, density-operator", "url": null }
Claim: $I_2$ and $I_4$ go to zero for $r$ going to infinite. If so, passing to the limit i get $$\sqrt\pi-e^{\frac{k^2}{4}}I=0$$ from which $I=\frac{\sqrt\pi}{2}e^{-\frac{k^2}{4}}$ So we are left to prove: 1)$I_2$ and $I_4$ tends to zero as $R\rightarrow\infty$ 2)$\int_{-\infty}^{\infty}e^{-t^2}dt=\sqrt{\pi}$ Last edited: #### ZaidAlyafey ##### Well-known member MHB Math Helper $$\int_0^\infty e^{-x^2}cos(kx)dx$$ with $k>0$ First: why k > 0 ? second : I will try to solve it and confirm your result , which is surely correct . $$\int_0^\infty e^{-x^2}cos(kx)dx$$ I will use the substitution $$x^2 = t$$ $$\int_0^\infty e^{-t}\frac{cos(k\sqrt{t})}{2\sqrt{t}}dt$$ $$\int_0^\infty e^{-t}\, \frac{\sum^{\infty}_{n=0}\, \frac{(-1)^n(k\sqrt{t})^{2n}}{(2n)!}}{2\sqrt{t}}dt$$
{ "domain": "mathhelpboards.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517475646369, "lm_q1q2_score": 0.8426289530662795, "lm_q2_score": 0.861538211208597, "openwebmath_perplexity": 514.1999903734612, "openwebmath_score": 0.9993708729743958, "tags": null, "url": "https://mathhelpboards.com/threads/evaluation-of-definite-integral.2683/" }
python, performance, python-3.x def merge(segments: Iterator) -> Generator: start, end, data = next(segments) for start2, end2, data2 in segments: if data == data2 and end + 1 == start2: end = end2 else: yield start, end, data start, end, data = start2, end2, data2 yield start, end, data def discretize(ranges: List[Tuple[int, int, Any]]) -> List[Tuple[int, int, Any]]: if not ranges: return [] result = list(merge(discrete_segments(ranges))) ranges.pop() return result def binary_decompose(n: int, power: int) -> List[int]: return [ power - i for i, d in enumerate(bin(n).removeprefix("0b")[::-1]) if d == "1" ][::-1] def to_network(item: Sequence, version: IPv4 | IPv6 = IPv4) -> Generator[tuple, None, None]: start, end, data = item power = version.power.value formatter = version.formatter powers = binary_decompose(end - start + 1, power) while powers: min_slash = f"{start:0{power}b}".rindex("1") + 1 index = bisect_left(powers, min_slash) if index == (l := len(powers)): for i, n in enumerate( range(powers.pop(-1) + 1, min_slash + 1), start=l - 1 ): powers.insert(i, n) continue yield (f"{formatter(start)}/{(slash := powers.pop(index))}", data) start += 1 << power - slash
{ "domain": "codereview.stackexchange", "id": 44887, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, python-3.x", "url": null }
beginner, brainfuck Title: Hello, Brainfuck It has been bugging me for a while that while I understand how the basics of Brainfuck works, I can't get a firm grasp on the advanced features of the language. So I started to re-evaluate what I know about the language from the ground up. Brainfuck's memory consists of a tape of cells. Every cell can be modified by pointing the pointer at it and incrementing or decrementing it's value. The most basic operators are +, - and .. These operators will respectively increment, decrement and print the data at the current cell. The print operator will take the current value and put the corresponding ASCII character on screen. To print a basic sentence: Hello, World!
{ "domain": "codereview.stackexchange", "id": 15562, "lm_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, brainfuck", "url": null }
graphs, np-hard, minimum-spanning-tree Claim: There exists a hamiltonian path in $G$ if and only if the bipartite graph has a subtree of weight $2|B|$ in which every vertex in $B$ has degree exactly $2$. Proof: (->) Suppose $h: (v_1,\dotsc,v_n)$ be the hamiltonian path in graph $G$. Let $e_{i}$ denote the edge $(v_{i},v_{i+1})$ in $h$. Then, $(x_{v_{1}},v_{1},x_{e_{1}},v_{2},\dotsc,v_{n-1},x_{e_{n-1}},v_{n},x_{n})$ forms a subtree of weight $2|B|$ in the bipartite graph such that each vertex in $B$ has degree exactly $2$. (<-) Suppose that there exists a subtree $T$ in the bipartite graph of weight $2|B|$ in which every vertex in $B$ has degree exactly $2$. Then, this subtree contains all vertices of $B$; otherwise, the weight of the subtree would have been less than $2|B|$. Also, note that the degree of every vertex in $N$ is either $2$ or $1$. Therefore, the degree of each vertex in $T$ is either $1$ or $2$. Therefore, $T$ must be a simple path with its vertices alternating between $V$ and $B$. Suppose this path is $(x_{1},v_{1},x_{2},v_{2},\dotsc,v_{n-1},x_{n},v_{n},x_{n+1})$. Then, this path corresponds to a hamiltonian path $(v_1,\dotsc,v_n)$ in the original graph $G$.
{ "domain": "cs.stackexchange", "id": 18976, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graphs, np-hard, minimum-spanning-tree", "url": null }
ros, ros-canopen auto-starting new master process[master]: started with pid [30712] ROS_MASTER_URI=http://localhost:11311
{ "domain": "robotics.stackexchange", "id": 27482, "lm_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-canopen", "url": null }
c++, ros-melodic, include, nodes, header maybe ROS is not made for that? ROS is a collection of tools, libraries, and conventions (from ROS.org) so you can do whatever you want with ROS using C++ or Python. It looks like you need to use classes, I would advise you to learn the basics of Object-Oriented Programming and C++ before getting into ROS, wihtout this background using ROS would be very challenging. Comment by martinandrovich on 2020-03-03: I'm basically trying to call node_1's methods from node_2 that will alter some internal data structure of node_1, e.g. node1::add_something(). I am not sure that ROS is designed for that without using messages or services. Also, OOP is not really relevant here; if anything, node_1 is a utility class. Comment by Delb on 2020-03-04:\ I am not sure that ROS is designed for that without using messages or services ROS is designed to do this with messages or services. Now with your additionnal inputs I feel we are diverging from your original question ("include methdods from another header"), if one of the two answers has answered this specific question you can mark it as correct. For your other question(s) I still don't see what is your blocking point, with our suggestions you still can't call methods of node_1 from node_2 ? I would advise you to open a new question describing your whole problematic in details, telling us what you have tried so far and what your errors/issues are.
{ "domain": "robotics.stackexchange", "id": 34513, "lm_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++, ros-melodic, include, nodes, header", "url": null }
filters, audio, biquad Each of the five biquads must be tunable across 20 Hz to 20 kHz, -18 to +18dB gain (where applicable) and a Q from 0.5 to 10 for the Peaks. The type of filter stays the same though (i.e. a highpass will always stay a bypass, a peak filter will always be a peak filter...). So my question is: what is the most efficient way to avoid clicks while not risking instability of the filter? Another possibility is to send the coefficients as poles and zeros and interpolate/smooth in the z-plane instead of the coefficient domain. This is always guaranteed to be stable. You can either interpolate in real/imaginary presentation or, if you want to get fancy, in magnitude and phase. The first one is a lot easier, since the phase interpolation has to handle wrap around. Coefficient calculation from real and imaginary part is straight forward and suitable for real time. Only exception may be if you have a dual real pole/zero instead of a complex conjugated pair.
{ "domain": "dsp.stackexchange", "id": 9970, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, audio, biquad", "url": null }
ros, ros-melodic, timesynchronizer, rostime And is there a guarantee that the data transmitted was indeed captured at the specified instant, or does the timestamp only say when the message was published on the ROS topic? The timestamp is set by the driver / algorithm / node / process, not by ROS (which is an ambiguous thing to say in any case). So if the driver sets the timestamp equal to when the data was captured, it will represent the time at which the data was captured. If it sets it to something else, it'll be something else. But how can the computer running the turtlebot software be able to give the exact same timestamp to different sensor data? Won't it be running one line of code at a time? Technically (and pedantically): no, as it will execute a single instruction at a time, and a line may translate into many instructions. As to your question: this will be difficult to answer, as in multi-processor or multi-core systems, it's certainly possible for multiple nodes to be active at the same time. The chances of having two independent nodes, active in parallel, to publish with the exact same timestamp are very low however. And that is why there is an ApproximateTimeSynchronizer, which allows you to configure a maximum delta-t between messages for them to still be considered published "at the same time" (or in that specific case: near enough). Originally posted by gvdhoorn with karma: 86574 on 2019-05-18 This answer was ACCEPTED on the original site Post score: 3 Original comments Comment by gvdhoorn on 2019-05-21: One could wonder: if a single node publishes multiple messages on different topics with the same timestamp, why not just publish a single message that is the union of all those messages? There are (at least) two reasons for this:
{ "domain": "robotics.stackexchange", "id": 33028, "lm_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, timesynchronizer, rostime", "url": null }
transform Title: Is there a standard way to transform a pose between coordinate frames? I have a pose message that I want to transform between two (non-static) coordinate frames. Currently I am doing the following in python: def rotate_orientation(ori, q): rot_mat = tf.transformations.quaternion_matrix(q) pose_rot = rot_mat.dot([ori.x, ori.y, ori.z, ori.w]) ori.x = pose_rot[0] ori.y = pose_rot[1] ori.z = pose_rot[2] ori.w = pose_rot[3] def translate_position(pos, t): pos.x += t[0] pos.y += t[1] pos.z += t[2] def odom_to_utm(odom): global utm_pub trans,rot = listener.lookupTransform('utm', 'odom', rospy.Time(0)) translate_position(odom.pose.pose.position, trans) rotate_orientation(odom.pose.pose.orientation, rot) utm_pub.publish(utm) But it feels a bit clunky. Is there a more standard way to switch between coordinates frames? Something like a tf.transformPose(pose, frame1, frame2) that returns pose in frame 2. Originally posted by linusnie on ROS Answers with karma: 98 on 2017-07-26 Post score: 3 There is something like that, and you almost guessed it! listener.transformPose(target_frame, pose_msg) -> pose_msg You don't need to enter the frame1 because it is listed inside the pose_msg. You can find more information here. And here is the function in the API. Originally posted by Airuno2L with karma: 3460 on 2017-07-26 This answer was ACCEPTED on the original site Post score: 4
{ "domain": "robotics.stackexchange", "id": 28443, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "transform", "url": null }
white noise This example shows how to compute the sample autocorrelation function (ACF) and partial autocorrelation function (PACF) to qualitatively assess autocorrelation. Usage ARMAacf(ar = numeric(), ma = numeric(), lag. Partial Autocorrelation Plot Lag Plot Spectral Plot Seasonal Subseries Plot: Case Study: The autocorrelation plot is demonstrated in the beam deflection data case study. Terminologies in ARIMA Produces a ggplot object of their equivalent Acf, Pacf, Ccf, taperedacf and taperedpacf functions. A Durbin-Watson test. The partial autocorrelation function (PACF) is analogous to concept of partial regression coefficient In the k -variable multiple regression model, the k - th regression coefficient B k measures the rate of change in the mean value of the regressand for a unit change in the k th regressor xk , holding the influence of all other regressor constant . Most of the CLRM assumptions that Partial autocorrelation function of an ARMA process. See autocorrelation. Autocorrelation Functions One important property of a time series is the autocorrelation function. The partial autocorrelations can be calculated as in the following alternative definition. 2 Partial autocorrelation coefficients for DJI time series Sinusoidal behaviour on the partial autocorrelation function and spikes up to lag 3 suggests a moving average model of order 3 or MA(3). Partial Autocorrelation Function (PACF): II for h= 1, have ˚1;1 = (1)= (0) = ˆ(1) for h= 2;3;:::, can get ˚h;h from rst step of hth stage of Levinson{Durbin (L{D) recursions: ˚h;h= (h) P h 1 j=1 ˚h 1;j (h j) vh 1 Q: ˚1;1 is a correlation coe cient since ˚1;1 = ˆ(1), but how can we interpret ˚h;hfor h= 2;3;:::? For a timeseries with an unknown data generating model, the autocorrelation function (ACF) and partial autocorrelation function (PACF) help in identifying the order of
{ "domain": "chaosventures.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.981735721648143, "lm_q1q2_score": 0.8071724351068768, "lm_q2_score": 0.8221891261650248, "openwebmath_perplexity": 1254.9740245179125, "openwebmath_score": 0.8607275485992432, "tags": null, "url": "http://chaosventures.com/j2hi/partial-autocorrelation.html" }
in a an ordered pair is the difference between do you interest '' . Writing a particular case in here, maybe i should n't have written a case. Number, we get, which consist of elements, the preimage of \ ( f\ ) is surjection... do you interest '' and ... interested in '' something g\ ) is onto, need. Cc BY-NC-SA 3.0 surjective ) if maps every element in the domain injective.: Z Z by the rule h ( n ) = Ax is a function not. This should not be an automatic assumption in general elements and y is unused in F2. 4, 9, 16, 25 } ≠ n = B and injective ( one-to-one functions... { 0,2,4,9\ } \ ) \to B\ ) be any element a in a exists least... Still a valid relationship, so f 1 is well-de ned function more than once, then 5x -2 y... Other words, if every element of is mapped to by at least one value the!, not pences '' is equal to its codomain get, which is to! Also called a one-to-one correspondence Define h: R R by the rule f a. Must show the two coordinates of the co-domain of f. e.g, a counter example function was by. pences '' on one-to-one onto function proof onto functions we start with a formal proof of is! Abstract algebra preliminaries article for a refresher on one-to-one and onto x. x = ( y 2... =\ { 0,2,4,9\ } \ ) 2 m-2 D ) =\emptyset\ ) for some \! More than once, then fog is also onto = ( y 2! ( T ( x ) = 2n - 1 for all xR 1. f ( a, ∀ ∈... Of C ( a ) = B 2 also acknowledge previous National Science Foundation support under numbers. A ∈ a, there exists at onto function proof one a ∈ a, y ∈ then! By giving a counter example onto but not one-to-one by giving a counter example has to be a of. C ) onto ( D ) not onto if each element of the domain
{ "domain": "asiel-dier.nl", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9702399060540358, "lm_q1q2_score": 0.8021087692704901, "lm_q2_score": 0.8267117898012104, "openwebmath_perplexity": 366.96877971480524, "openwebmath_score": 0.8402517437934875, "tags": null, "url": "http://asiel-dier.nl/elsuh0/8ab49b-onto-function-proof" }
c++, roman-numerals Integer Roman_int::roman_to_integer(const Roman& roman); Roman integer_to_roman(const Integer& integer); bool is_valid_roman(const Roman& roman); }; std::ostream& operator<<(std::ostream& os, const Roman_int& roman); std::istream& operator>>(std::istream& is, Roman_int& roman); Roman_int operator*(const Roman_int& a, const Roman_int& b); Roman_int operator/(const Roman_int& a, const Roman_int& b); Roman_int operator+(const Roman_int& a, const Roman_int& b); Roman_int operator-(const Roman_int& a, const Roman_int& b); bool operator==(const Roman_int& a, const Roman_int& b); bool operator!=(const Roman_int& a, const Roman_int& b); Roman_int operator%(const Roman_int& a, const Roman_int& b); } Roman_int.cpp #include <algorithm> #include "Roman_int.h" namespace roman_int { const Roman_int::Lockup_table Roman_int::lookup_table = { { "M",1000 }, { "CM",900 }, { "D",500 }, { "CD",400 }, { "C",100 }, { "XC",90 }, { "L",50 }, { "X",10 }, { "IX",9 }, { "V",5 }, { "IV",4 }, { "I",1 }, }; Roman Roman_int::integer_to_roman(const Integer& integer) { if (integer <1) { throw std::runtime_error( "Roman Roman_int::integer_to_roman(const Integer& integer)\n" "Invalid Integer value it must be >= 1 \n" ); }
{ "domain": "codereview.stackexchange", "id": 31485, "lm_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++, roman-numerals", "url": null }
= a : Hm ... = a + 0 : by rw add_zero, have H₄ : of_nat (n + m) = of_nat 0, from add_left_cancel H₃, have H₅ : n + m = 0, from of_nat.inj H₄, have h₆ : n = 0, from nat.eq_zero_of_add_eq_zero_right H₅, show a = b, from calc a = a + 0 : by simp_rw [add_zero] ... = a + n : by simp_rw [h₆, int.coe_nat_zero] ... = b : Hn end #### Kenny Lau (Aug 08 2020 at 07:36): Patrick Thomas said: Is there an example somewhere? look at my proof #### Kenny Lau (Aug 08 2020 at 07:36): the let I used is the existential elimination #### Ruben Van de Velde (Aug 08 2020 at 08:42): Bit higher level than Kenny's: intros z a1, rw [H] at a1, obtain ⟨x, hx, y, hy, h⟩ := a1, linarith [h0.left x hx, h1.left y hy], #### Patrick Thomas (Aug 08 2020 at 17:36): Kenny Lau said: Kevin Buzzard deja vu? ? #### Patrick Thomas (Aug 08 2020 at 18:01): Is there a way to make it more verbose? Something like obtain (x : ℝ, hx : x ∈ X, y : ℝ, hy : y ∈ Y, h : z = x + y) from a1,? #### Ruben Van de Velde (Aug 08 2020 at 20:02): Something like obtain ⟨x, hx, y, hy, h⟩ : ∃ x ∈ X, ∃ y ∈ Y, z = x + y} := a1, (untested) #### Patrick Thomas (Aug 08 2020 at 20:07): Sorry, I was thinking more along the lines of showing explicitly what hx, hy, and h get assigned to in the obtain statement. #### Ruben Van de Velde (Aug 08 2020
{ "domain": "github.io", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812345563902, "lm_q1q2_score": 0.8306465399943904, "lm_q2_score": 0.8577681086260461, "openwebmath_perplexity": 3348.954673009072, "openwebmath_score": 0.3846169710159302, "tags": null, "url": "https://leanprover-community.github.io/archive/stream/113489-new-members/topic/formalizing.20definitions.20for.20real.20analysis.html" }
Ray Vickson Homework Helper Dearly Missed ## Homework Statement I have two kids. Given that at least one of them is a girl, what is the probability that they are both girls? ## The Attempt at a Solution I think it's 1/3, because the possibilities are: Boy Boy, Boy Girl, Girl Boy, Girl Girl. There are three possibilities with at least one girl. Out of these three, only one has two girls. But my friend says order doesn't matter, so BG is the same as GB. So the probability is 1/2. Which is right? This is the same problem as: we toss a (fair) coin twice and get at least one head; what is the probability we get another head as well? The results LOOK a bit paradoxical when written out as follows: events are C = {two heads}, A = {first toss is heads}, B = {second toss is heads}. We have P{C|A} = P{C|B} = 1/2, but P{C|A or B} = 1/3. That is your problem in a nutshell. This looks paradoxical because the statement that we get at least one head is the same as saying that A or B occur, and each of these separately implies a 1/2 probability of C; however, when taken together they imply a 1/3 probability of C! RGV I like Serena Homework Helper Hi everyone! Here's my view on the matter. There is a difference between saying: "given the first (or youngest) kid is a girl" (chance 2/4) and "given that at least one kid is a girl" (chance 3/4). In the first case the chance would be 1/2 as Arcana claims. We can also write this as: $$P(\text{2 girls | the youngest kid is a girl}) = {\text{number of favorable outcomes} \over \text{number of possible outcomes}} = {1 \over 2}$$ In the second case it is: $$P(\text{2 girls | at least 1 girl}) = {\text{number of favorable outcomes} \over \text{number of possible outcomes}} = {1 \over 3}$$
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9773707986486797, "lm_q1q2_score": 0.8542975557957161, "lm_q2_score": 0.8740772253241803, "openwebmath_perplexity": 444.7995798421818, "openwebmath_score": 0.6306095719337463, "tags": null, "url": "https://www.physicsforums.com/threads/conditional-probability-probability-of-having-a-girl.544052/" }
java, performance, strings, json Services: public long getTime(int difference) { // Current time long time = System.currentTimeMillis(); time = (time / 1000 / 60 / 60 / 24); time += difference; return time; } public String encrypt(String searchString) throws GeneralSecurityException, UnsupportedEncodingException { String hexKey = "GD6GTT56HKY4HGF6FH3JG9J5"; //TripleDes3 encryptor = new TripleDes3(new String(Hex.decodeHex(hexKey.toCharArray()))); try { TripleDes3(hexKey); } catch (Exception e) { System.out.println("Error: " + e.toString()); } bytes = searchString.getBytes("ISO8859_15"); bytes = Arrays.copyOf(bytes, ((bytes.length + 7) / 8) * 8); return new String(Hex.encodeHex(encryptB(bytes))); } public void TripleDes3(String encryptionKey) throws GeneralSecurityException, DecoderException { cipher = Cipher.getInstance("DESede/CBC/NoPadding"); try { key = new SecretKeySpec(encryptionKey.getBytes("ISO8859_15"), "DESede"); iv = new IvParameterSpec(Hex.decodeHex("0123456789abcdef".toCharArray())); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
{ "domain": "codereview.stackexchange", "id": 21050, "lm_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, performance, strings, json", "url": null }
class PcaSvm(object): def __init__(self, seed): self.seed = seed self.rng = np.random.default_rng(seed) def __call__(self, a, k, sample_size=1000): # x1 is uninformative & has standard deviation = 1 x1 = self.rng.standard_normal(sample_size).reshape((-1, 1)) # x1 is very informative & has standard deviation = a x2 = a * self.rng.standard_normal(sample_size).reshape((-1, 1)) # y strongly depends on x2; some samples will be perfectly separable or nearly so y = self.rng.binomial(n=1, p=expit(1e6 * np.sign(x2))).reshape(-1) svc_params = { "svc__C": stats.loguniform(1e0, 1e3), "svc__gamma": stats.loguniform(1e-4, 1e-2), } clf = sklearn.pipeline.make_pipeline( PCA(n_components=k), StandardScaler(), SVC() ) random_search = RandomizedSearchCV( clf, param_distributions=svc_params, n_iter=60, scoring="roc_auc", random_state=self.seed, ) random_search.fit(np.hstack([x1, x2]), y) best_test_auc = random_search.cv_results_["mean_test_score"].max() print( f"Using a={a}, the best model with k={k} PCA components has an average AUC (on the test set) of {best_test_auc:.4f}" ) When PCA only retains 1 feature, the model is somewhere between worthless and mediocre. When retaining 2 features, the model is literally perfect.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9465966717067253, "lm_q1q2_score": 0.8119604315589316, "lm_q2_score": 0.8577681031721325, "openwebmath_perplexity": 837.9846828951693, "openwebmath_score": 0.5916396379470825, "tags": null, "url": "https://stats.stackexchange.com/questions/448200/is-pca-always-recommended" }
• Where did $4$ come from? I'm not sure I get it – Yuriy S Feb 16 '16 at 11:49 • @YuriyS All the terms in the numerator will simplify except for the first one, and the coefficient $2$. So you get $2\cdot 2 = 4$ – Kitegi Feb 16 '16 at 15:16
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429164804706, "lm_q1q2_score": 0.8098915790278843, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 513.5850317988353, "openwebmath_score": 0.8517919778823853, "tags": null, "url": "https://math.stackexchange.com/questions/1658073/convergence-of-sequence-sqrt2-sqrt2-sqrt2-sqrt2-sqrt2-sqr/1658531" }
In general, a proposition $$P$$ is said to be stronger than $$Q$$ if $$P$$ implies $$Q$$ ( symbolically, $$P\Rightarrow Q$$) and $$NOT$$( $$Q$$ implies $$P$$). In the example at hand, $$f \in \Theta(g) \Rightarrow f \in \mathcal{O}(g)$$ , so that $$f \in \Theta(g)$$ is a stronger assertion than $$f \in \mathcal{O}(g)$$. When you say $$f(n) = \mathcal{O}(g(n))$$, it means that $$g$$ is an upper bound for $$f$$, up to a constant. So $$f(n) \leq c \cdot g(n)$$ for all $$n \geq k$$, and for some $$c_1$$. $$c_1$$ and $$k$$ are fixed. Now we must introduce $$\Omega$$. If $$f(n) = \Omega(g(n))$$, then $$g$$ is a lower bound for $$f$$, up to a constant. So $$f(n) \geq c_2\cdot g(n)$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9869795098861571, "lm_q1q2_score": 0.8069292601960698, "lm_q2_score": 0.8175744806385543, "openwebmath_perplexity": 141.32139379104382, "openwebmath_score": 0.9229351878166199, "tags": null, "url": "https://cs.stackexchange.com/questions/131413/set-relationship-between-big-oh-and-theta-notations/131417" }
motor, underwater, auv, protection Title: Preventing leaks in motor shafts for underwater bots Whenever building an aquatic bot, we always have to take care to prevent leakages, for obvious reasons. Now, holes for wires can be made watertight easily--but what about motors? We can easily seal the casing in place (and fill in any holes in the casing), but the part where the axle meets the casing is still left unprotected. Water leaking into the motor is still quite bad. I doubt there's any way to seal up this area properly, since any solid seal will not let the axle move, and any liquid seal (or something like grease) will rub off eventually. I was thinking of putting a second casing around the motor, maybe with a custom rubber orifice for the shaft. Something like (forgive the bad drawing, not used to GIMP): This would probably stop leakage, but would reduce the torque/rpm significantly via friction. So, how does one prevent water from leaking into a motor without significantly affecting the motor's performance? (To clarify, I don't want to buy a special underwater motor, I'd prefer a way to make my own motors watertight) I'm not sure if an 'aquabot' is a fully submersible vehicle, or a surface one. If it's a surface vehicle, then you just need to look at RC boats. They've got this solved pretty well.
{ "domain": "robotics.stackexchange", "id": 787, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "motor, underwater, auv, protection", "url": null }
laplace-transform, books Title: The Laplace transform - Steven W. Smith Book - impulse response cancellation method While studying the Laplace transform using Steven W. Smith Book I found something uncomprehending. In the 32th chapter - The Laplace Transform, page 590, last paragraph describes the cancelling phenomena when an impulse response is cancelled using an exponentially weighted sinusoid (see picture below). When cancelling occurs then we are dealing with zero or pole at the s-plane. What is not clear for are the products of the probing waveform and impulse response examples (3rd column in the figure below): a) Decreasing with time: how it can be said that $p(t) \times h(t)$ is finite? b) Exact cancellation (zero): how it can be said that $p(t) \times h(t)$ is zero? c) Too slow of increase: how it can be said that $p(t) \times h(t)$ is finite? d) Exact cancellation (pole): how it can be said that $p(t) \times h(t)$ is infinite? e) Too fast of increase: how it can be said that $p(t) \times h(t)$ is undefinied? I would be glad if someone could explain me what is the connection between $p(t) \times h(t)$ shape and if it is pole or zero. Peter's comment is correct, it's about the integral of the product $p(t)h(t)$: $$I=\int_{-\infty}^{\infty}p(t)h(t)dt\tag{1}$$ The impulse response $h(t)$ has the following form: $$h(t)=\delta(t)+c_1\, e^{\sigma t}\cos(\omega_0t),\qquad t\ge 0\tag{2}$$ with some constant $c_1$ and some $\sigma<0$. From what I understand, the function $p(t)$ must look like
{ "domain": "dsp.stackexchange", "id": 10749, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "laplace-transform, books", "url": null }
beginner, bash Title: Three "alias-functions" in my .bashrc file These functions work well for me. Can they be improved or made more standard in some way? Each function has a documentation header block, which contains a description of what it does, along with example usage and reference links where applicable. :<<COMMENT Alias function for recursive deletion, with are-you-sure prompt. Example call: srf /home/myusername/django_files/rest_tutorial/rest_venv/ Short description: Stored in SRF_DESC With the following setting, this is *not* added to the history: export HISTIGNORE="*rm -r*:srf *" - http://superuser.com/questions/232885/can-you-share-wisdom-on-using-histignore-in-bash See: - y/n prompt: http://stackoverflow.com/a/3232082/2736496 - Alias w/param: http://stackoverflow.com/a/7131683/2736496 COMMENT #SRF_DESC: For "aliaf" command (with an 'F'). Must end with a newline. SRF_DESC="srf [path]: Recursive deletion, with y/n prompt\n" srf() { #Actual line-breaks required in order to expand the variable. #- http://stackoverflow.com/a/4296147/2736496 read -r -p "About to sudo rm -rf $1 Are you sure? [y/N] " response response=${response,,} # tolower if [[ $response =~ ^(yes|y)$ ]] then echo -e "sudo rm -rf $1" sudo rm -rf "$1"; else echo "Cancelled." fi } :<<COMMENT Delete item from history based on its line number. No prompt. Short description: Stored in HX_DESC Examples hx 112 hx 3
{ "domain": "codereview.stackexchange", "id": 11650, "lm_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, bash", "url": null }
c#, sql-server, entity-framework I think the presence of DisplayAttribute and NotMappedAttribute smells like you're possibly using your entities as both data entities and presentation / ViewModels. I think I would separate these concerns and create separate classes for presentation purposes, where HighlightedText means something relevant. Also note that relying on a declarative DisplayAttribute will make it quite a pain to localize the application, if you ever need to do that in the future; you'll want these things resolved at run-time, accounting for Thread.CurrentThread.CurrentUICulture. The naming is overall ok, except I don't like the Status column. It's just too vague of a name. What do the null, true and false values mean? The name should convey that meaning. Also I wouldn't prefix most of Document's members with the word "Document", and ID should follow the PascalCasing convention and be Id.
{ "domain": "codereview.stackexchange", "id": 5872, "lm_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#, sql-server, entity-framework", "url": null }
java, multithreading, unit-testing, queue, logging Title: Robust logging solution to file on disk from multiple threads on serverside code I have implemented a socket listener that runs on my Linux Ubuntu server accepting connections and then starting up a new thread to listen on those connections (classic socket listener approach). The socket listener is persistant and the way it is restarted is by restarting the server. I have implemented a logging feature in the code so that information such as the data received, any events that have occurred etc are logged to a file. All threads log to this same file and the file is named by the day it's on. So I end up with log files such as 2012-May-01.txt, 2012-May-02.txt etc etc. In order to provide this logging, I implemented a couple of classes to handle the logging. EventLog - Just a wrapper to hide away my actual logger and what is used by the various threads etc for logging Logstream - The class that does the logging to file I'm a bit concerned about this class and ensuring I capture all log events. As it can be called by multiple threads I do not want to lose any information. I'm pretty sure logging is such a common issue so I'm hoping someone can point out the issues in this code and provide a much more robust solution. I am potentially going to look into other existing logging solutions as suggested by sudmong, but for now this is the easiest for me to get my head around (assuming it's a valid solution). Important: I want to keep the facility to log items in a file naming convention that fits the day the item was logged. I don't want one log file that spans multiple days etc EDIT: Following from X-Zero's comments I've changed my logging mechanism to use a BlockingQueue approach. Does this seem like a scalable solution if I was to look at logging perhaps up to 100 lines per second? The main issue I can see is perhaps the opening and closing of my log file for every log write and whether I should catch the FileWriter handle and only re-create on each new day? // Class interface through which all logging occurs public class EventLog { private static Logstream _eventLog;
{ "domain": "codereview.stackexchange", "id": 2104, "lm_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, multithreading, unit-testing, queue, logging", "url": null }
Let us continue:[BR] Now please, in the "main" function locate the lines that say // That will be our whole scene for now : an incredible Torus NodeRecPtr scene = makeTorus(.5, 2, 16, 16); and replace them with the following code NodeRecPtr scene; // create all that stuff we will need: //one geometry and one transform node NodeRecPtr torus = makeTorus(.5, 2, 16, 16); NodeRecPtr transNode = Node::create(); transCore = Transform::create(); Matrix m; // now provide some data... // no rotation at the beginning m.setIdentity(); // set the core to the matrix we created transCore->setMatrix(m); // now "insert" the core into the node transNode->setCore(transCore); // add the torus as a child to // the transformation node // "declare" the transformation as root scene = transNode; This piece of code will create a little scenegraph with a transformation as the root node and one child, which is the torus geometry. By now you might be asking yourself "If you need a Core for every Node anyway, why is it so complicated to get one?". You will do the whole create Node, create Core, assign Core to Node process a lot in your own programs, and there are very few variations in it. Therefore versions after 1.2 add a convenience method makeCoredNode that helps creating Node and Core in one step. Using it you can replace the above example with something shorter NodeRecPtr scene; // create all that stuff we will need: //one geometry and one transform node NodeRecPtr torus = makeTorus(.5, 2, 16, 16); NodeRecPtr transNode = makeCoredNode<Transform>(&transCore); Matrix m; // now provide some data... // no rotation at the beginning m.setIdentity(); // add the torus as a child to // the transformation node // "declare" the transformation as root scene = transNode;
{ "domain": "opensg.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.960951703918909, "lm_q1q2_score": 0.8007846957492477, "lm_q2_score": 0.8333246015211008, "openwebmath_perplexity": 1165.5234625527432, "openwebmath_score": 0.3680899441242218, "tags": null, "url": "http://opensg.org/wiki/Tutorial/OpenSG2/Basics" }
algorithm, objective-c, ios if (self.tapArray == nil) { self.tapArray = [[NSMutableArray alloc] init]; } [self.tapArray addObject:segment]; } editing1 = FALSE; editing2 = FALSE; editing3 = FALSE; erased = FALSE; /* NSLog(@"TapArray: %lu,",(unsigned long)self.tapArray.count); for(Segment *segment in self.tapArray){ NSLog(@"%@,\n%@,\n%@",NSStringFromCGPoint(segment.firstPoint), NSStringFromCGPoint(segment.secondPoint), NSStringFromCGPoint(segment.thirdPoint)); NSLog(@"NEW ANGLE"); } */ [self drawBitmap]; } - (void)drawRect:(CGRect)rect { [incrementalImage drawInRect:rect]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, r, g, b, opacity); CGContextSetLineWidth(context, strokeWidth); CGContextSetLineCap(context, kCGLineCapRound); CGContextSetLineJoin(context, kCGLineJoinRound); if (!CGPointEqualToPoint(first, CGPointZero)) { CGRect rectangle = CGRectMake(first.x - 10, first.y - 10, handleSize, handleSize); CGContextAddEllipseInRect(context, rectangle); CGContextMoveToPoint(context, first.x, first.y);
{ "domain": "codereview.stackexchange", "id": 14621, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm, objective-c, ios", "url": null }
java, swing Title: Student and Lecturer views How can I improve the following two views? Should the action listeners stay in the views? StudentView.java package com.studentenverwaltung.view; import com.studentenverwaltung.controller.StudentController; import com.studentenverwaltung.helpers.MyTableCellRenderer; import com.studentenverwaltung.model.User; import com.studentenverwaltung.persistence.PerformanceDAO; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Observable; import java.util.Observer; import javax.swing.*; import javax.swing.table.DefaultTableModel; public class StudentView implements IView { private final static String WELCOME = "Herzlich Willkommen"; private final static String MEDIAN = "Notendurchschnitt"; private final static Object[] COLUMNS = {"Vorlesung", "Note"}; public JPanel contentPane; private JLabel lblWelcome; private JButton btnChangePassword; private JButton btnLogout; private JTextField txtId; private JTextField txtPassword; private JTextField txtDegreeProgram; private JLabel lblMedian; private JTable tblPerformance; private StudentController studentController; private User user; public StudentView(StudentController studentController, User user) { this.studentController = studentController; this.user = user; this.user.addObserver(new ModelObserver()); this.btnChangePassword.addActionListener(new ChangePasswordListener()); this.btnLogout.addActionListener(new LogoutListener()); } @Override public JPanel getContentPane() { return this.contentPane; } private double calculateMedian(DefaultTableModel tableModel) { int i = 0, rows = tableModel.getRowCount(); double total = 0;
{ "domain": "codereview.stackexchange", "id": 3872, "lm_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, swing", "url": null }
it forming an inscribed triangle. Find the radius of its incircle. Forums. When a circle inscribes a triangle, the triangle is outside of the circle and the circle touches the sides of the triangle at one point on each side. For the general case a … Question from Daksh: O is the centre of the inscribed circle in a 30°-60°-90° triangle ABC right angled at C. If the circle is tangent to AB at D then the angle COD is- and 4 in. Find the lengths of AB and CB so that the area of the the shaded region is twice the area of the triangle. What is the smallest it can be is right algebraically or by construction the. Half of that angles aresupplementary terms of x then this angle right here would be a right.! Is πr², so these two base angles have to be inscribed in a right angled triangle ABC ) if... Center O and radius r and center I this triangle, the vertical line is 4 and the of... Hypotenuse that are determined by the point where they intersect = 10.. If two vertices ( of a circle if each vertex of the incircle is called the inner center, incenter! Asked Oct 1, diameter is 2, triangle has side lengths of 3,4,5 and area of circle =,. N'T understand how to Inscribe a circle the circle ’ s asking for: area of the circle this... Fits inside a triangle if you know all three sides are all tangents to a with... Can interact with teachers/experts/students to get the largest circle that just touches the 's... Also going to be inscribed in a circle is 2 in., the. Using just a compass and straightedge or ruler the triangle inscribed inside the circle the! Hypotenuse.The sides that form the right angle is called the hypotenuse that are determined by the point of tangency find! The lengths of the inscribed circle, then the hypotenuse is a right angle is called hypotenuse! Of it another line right there DC? $right over here is 180 degrees and! Triangle ACB is a triangle May 2015 13 0 Canada May 14, 2015 1. Cd drawn || to AB, then the hypotenuse is a right triangle to! Triangle case, the
{ "domain": "morethanahomemom.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9736446471538803, "lm_q1q2_score": 0.8527053196215987, "lm_q2_score": 0.8757869948899666, "openwebmath_perplexity": 390.44542158692235, "openwebmath_score": 0.6869009733200073, "tags": null, "url": "http://morethanahomemom.com/cayden-boyd-qxj/circle-inscribed-in-a-right-triangle-e874be" }
quantum-mechanics, electromagnetism, waves, photons Title: Do photons oscillate or not? This is not a duplicate. I am not asking about the connection between photons and EM waves nor wave particle duality. I have read these questions: What is the relation between electromagnetic wave and photon? where annav says: Conceptually watching the build up of interference fringes from single photons in a two slit experiment might give you an intuition of how even though light is composed of individual elementary particles, photons, the classical wave pattern emerges when the ensemble becomes large. How many photons are needed to make a light wave? where CuriusOne says in a comment: Light doesn't ever behave like a particle or a wave. It behaves like a quantum field. People need to stop talking about it the way their great-grandfathers talked about it for a dozen years before Dirac wrote up with the correct explanation in the early 1930s! We have been over this wave-particle duality nonsense almost as long as we have been over the aether. How does light oscillate? where fffred says: In light propagation, oscillation does not mean any movement in space. It is the value of the electromagnetic field, at one given point in space, that oscillates. For electromagnetic waves, there is no matter or photons that go up and down. Instead, you have to imagine that there is a little arrow associated to each point in space: this little arrow is the electric field direction. Another arrow, at the same point, is the magnetic field. These two arrows change size and direction with time, and in fact they oscillate. How to imagine the electromagnetic waves? where annav says: The electromagnetic wave is described by the solution of classical maxwell's equation which has a sinusoidal dependence for the electric and magnetic fields perpendicular to the direction of motion of the wave. It is called a wave for this reason and the frequency is the repetition rate of the sinusoidal pattern. A single photon has only a detection probability distribution that "waves", as explained above. It is not a wave. Can photons oscillate? Why do electromagnetic waves oscillate? where Bjornw says:
{ "domain": "physics.stackexchange", "id": 62031, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, electromagnetism, waves, photons", "url": null }
• At this point, you may "expect" $$\sin x \approx x$$ and $$1-\cos x \approx x^2/2$$ around $$0$$ (by a Taylor series expansion), which tells you the limit should be $$1/\sqrt{3}$$. If you don't have that intuition, no problem! It's not necessary. What we want to use are standard limits around $$0$$, like $$\lim_{x\to 0}\frac{\sin x}{x} = 1$$. • You can rewrite $$\frac{\sin x}{1-2\cos\left(x+\frac{\pi }{3}\right)} = \frac{\sin x}{1-\cos x + \sqrt{3}\sin x} = \frac{1}{\frac{1-\cos x}{x}\cdot \frac{x}{{\sin x}} + \sqrt{3}}$$ and use the facts that $$\lim_{x\to0} \frac{1-\cos x}{x} = 0, \qquad \lim_{x\to0} \frac{\sin x}{x} = 1$$ (can you see why?) to conclude that $$\lim_{x\to\frac{\pi}{3}}\frac{\sin x}{1-2\cos\left(x+\frac{\pi }{3}\right)} = \frac{1}{0\cdot 1 + \sqrt{3}} = \frac{1}{\sqrt{3}}$$ This is a variant on Clement C.'s answer, showing a way to further simplify the calculation of the limit.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9905874112460201, "lm_q1q2_score": 0.8121760236596033, "lm_q2_score": 0.8198933425148213, "openwebmath_perplexity": 919.1412436360392, "openwebmath_score": 0.9811649918556213, "tags": null, "url": "https://math.stackexchange.com/questions/4051844/estimate-limit-without-using-lhopital" }
context-free Title: Algorithm for checking unambiguity in the derivation of a string It is known that given a Context Free Grammar $G$, checking that it is ambiguous or not is undecidable. But, if I have a string $s \in L(G)$, does there exist an algorithm to check whether $s$ particularly can be derived unambiguously in $G$? gnasher's comment more or less answers this. A sketch of an algorithm would be: enumerate all derivations of the grammar that do not generate strings longer than $s$. This can be done, because CFGs do not have deleting rules (or if yours do, they can be converted for example to Chomsky Normal Form) check how many of the strings generated are equal to $s$. This takes a long time, of course. But I doubt that there is a fundamentally better way.
{ "domain": "cs.stackexchange", "id": 7418, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "context-free", "url": null }
Topic: Operational and Integrated Risk Management Subtopic: Liquidity risk AIMS: Describe and calculate LVaR using the Constant Spread approach and the Exogenous Spread approach. Reference: Dowd, Measuring Market Risk, 2nd Edition (West Sussex, England: John Wiley & Sons, 2005), Chapter 14. #### Kavita.bhangdia ##### Active Member Hi David, What I understand is that you have computer the liquidity cost for 1000 shares.. (72000*.5*.16/72) But I was calculating liquidity cost for the entire position value AND NOT for 1000 UNITS OF SHARE = 72000*.5*.16. I think the liquidity cost should be on units of share.. so it should be just 0.5*.16*1000. AM I right? Thanks Kavita #### Deepak Chitnis ##### Active Member Subscriber Hi @Kavita.bhangdia, I think you are something missing here. Liquidity cost should be=72000*(0.5*0.16/72)=79.99 or 80. Because as per the formula liquidity cost=P*(0.5*spread). Hope that helps! Thank you #### David Harper CFA FRM
{ "domain": "bionicturtle.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.961533812390815, "lm_q1q2_score": 0.8229298108795572, "lm_q2_score": 0.8558511414521923, "openwebmath_perplexity": 6204.831062071856, "openwebmath_score": 0.6339238882064819, "tags": null, "url": "https://www.bionicturtle.com/forum/threads/p2-focus-review-problem.9435/" }
• My point above is that "P implies Q" is the same as the statement "P and not-Q is impossible". "Q implies P" is the same as "Q and not-P is impossible". Taken together, these two statements mean that P and Q always have the same truth value; in other words, they have the same truth value in every model. So if you prove both "P implies Q" and "Q implies P", then you actually have a proof that the biconditional holds in all models. Does that answer? Feb 7, 2020 at 3:13 • Feb 8, 2020 at 16:26
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407179787798, "lm_q1q2_score": 0.8152058485903082, "lm_q2_score": 0.8376199572530448, "openwebmath_perplexity": 226.75898337167803, "openwebmath_score": 0.8172138333320618, "tags": null, "url": "https://math.stackexchange.com/questions/3536040/when-is-proving-the-truth-of-a-biconditional-statement-the-same-as-proving-tha" }
Last Non-Zero Digit Of A Factorial April 5, 2013 The obvious brute-force solution is to calculate n factorial, then repeatedly divide by 10 until the remainder is non-zero: (define (factorial n)   (let loop ((n n) (f 1))     (if (zero? n) f       (loop (- n 1) (* f n))))) (define (lnz1 n)   (let loop ((f (factorial n)))     (if (zero? (modulo f 10))         (loop (quotient f 10))         (modulo f 10)))) > (lnz1 15) 8 The problem, of course, is that n! grows very quickly, so this solution is either slow or impossible to calculate. A common solution that does not work is to calculate the factorial in the normal way, but remove all trailing zeros at each step. For instance, 15! = 1307674368000 and the last non-zero digit is 8, but removing all trailing zeros at each step gives a last non-zero digit of 3: (define (lnz2 n) ; doesn't work   (let loop ((i 2) (f 1))     (cond ((zero? (modulo f 10)) (loop i (/ f 10)))           ((< 9 f) (loop i (modulo f 10)))           ((< n i) f)           (else (loop (+ i 1) (* f i)))))) > (lnz2 15) 3 We can fix that solution with a little bit of work. Factors of 2 and 5 are special because they are the factors of 10 that we remove with the trailing zeros. Thus we remove factors of 2 and 5 from each number from 1 to n, counting them as we go, multiply the remainder of each number from 1 to n after removing factors of 2 and 5 by the accumulating product, using arithmetic modulo 10, and finally multiply by the excess 2s greater than the count of 5s, again using arithmetic modulo 10:
{ "domain": "programmingpraxis.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676454700793, "lm_q1q2_score": 0.8458368394360776, "lm_q2_score": 0.863391624034103, "openwebmath_perplexity": 8769.960280260688, "openwebmath_score": 0.4678383469581604, "tags": null, "url": "https://programmingpraxis.com/2013/04/05/last-non-zero-digit-of-a-factorial/2/" }
regression, feature-selection, linear-regression, feature-extraction, feature-engineering Title: Why is duplicating inputs bad? I am trying to predict an output value based on several continuously-valued inputs using a regression model. I am not sure what approach is appropriate to scale/transform the input data for the regression. Let's just pretend that it is unlabeled data. My most naive approach would be to add each input multiple times: input log(input) sqrt(input) and then let the regression model worry about finding which flavor of each input (if any) is significant. What are the risks with using this approach? The issue with building a regression model on all 3 of these is that you are potentially introducing multicollinearity into the model. Although log(input) and sqrt(input) are not linear functions of the input a quick test (using Matlab) shows they are still highly correlated (depending on the range) input=rand(1,100); input_log=log(input); input_rt=sqrt(input); corrcoef(input, input_log) %->0.8549 corrcoef(input, input_rt) %->0.9779 corrcoef(input_sq, input_rt) %0>0.9407 Multicollinearity will not reduce the predictive power of the model, but it will make the regression coefficients of these variables difficult to interpret since small adjustments in the data may cause the regression model to switch which of the 3 input variations it finds significant. It also adds unnecessary complexity to the model. I would train the models with the 3 separately if you want to observe the effects. Additionally, applying things like sqrt and log to your output can be useful if the data currently can't be described by a linear relationship.
{ "domain": "datascience.stackexchange", "id": 1869, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "regression, feature-selection, linear-regression, feature-extraction, feature-engineering", "url": null }
javascript, algorithm, programming-challenge, interview-questions for(var word in wordCounts) { var count = wordCounts[word]; maxCount = count > maxCount ? count : maxCount; wordsIndexedByCount[count] = wordsIndexedByCount[count] || []; wordsIndexedByCount[count].push(word); } // Flatten the array from above, starting with the most // often occurring word(s) - i.e. the highest index. var sorted = []; for(var i = maxCount; i > 0; i--) { // Skip "holes" in the array (not that it's necessary; the // code works without this check, since push.apply ignores // an undefined argument) if(!wordsIndexedByCount[i]) { continue; } [].push.apply(sorted, wordsIndexedByCount[i]); if(sorted.length >= n) { break; // if we've got enough to return, there's no reason to keep going } } return sorted.slice(0, n).join("\n"); }
{ "domain": "codereview.stackexchange", "id": 10429, "lm_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, algorithm, programming-challenge, interview-questions", "url": null }
homework-and-exercises, newtonian-mechanics, newtonian-gravity, orbital-motion E+\frac kr - \frac{\ell^2}{2\mu r^2} \right)}}. $$ The solution to this integral shows that the orbit is a conic section $$ \begin{align} \frac\alpha r &= 1 + \epsilon\cos\theta & \alpha &= \frac{\ell^2}{\mu k} & \epsilon &= \sqrt{1 + \frac{2E\ell^2}{\mu k^2}} \end{align}. $$ Closed conic sections are ellipses with semi-major and semi-minor axes $a$ and $b$ related by $b=\sqrt{\alpha a}$, and area $\pi ab$. We already learned the time required to sweep out the area of the ellipse $\tau\propto A$, and so we immediately get Kepler's third law $\tau \propto a^{3/2}$.
{ "domain": "physics.stackexchange", "id": 65915, "lm_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, newtonian-gravity, orbital-motion", "url": null }
python, programming-challenge, primes The entire project can be found on Github. Its only additions are a Sublime Text 2 project and some scripts to enable running the doctests from within the editor. I do have some specific concerns about this code. I find that smallest_multiple() is weird and clunky - especially iterating through each element of factors and asking for its count. It seems there should be some more elegant way to aggregate the factors and their exponents. I wonder if my docstrings and doctests are reasonably correct, and if my module organization is coherent. I'm also wondering if I'm abusing generators, particularly in the doctests where I call list() on each generator to get the result, and the nested generator functions in primegen(). Generally, I'd also like feedback on how Pythonic this code is. I've tried to keep PEP 8 in mind, but any deviations I've hastily overlooked would be good to know about. I also didn't do much in terms of input validation and robustness, so general advice on the idiomatic ways of doing so would be appreciated. Let me put what @tokland said in another way. In the Zen of Python there is a sentence If the implementation is hard to explain, it's a bad idea.. The same thing that you are doing can be done much more efficiently and clearly by changing the algorithm used. Unless you wanted to make a prime generator for some other thing and used this exercise as an excuse to get on with making it, using prime generation here is a bad idea. Bad according to Python's readability view because Simple is better than complex.. For efficiency just try running your code and this code for 1000. Now getting with your code itself. primegen.py Why didn't you make the generate_primes as your top level function with a nested next_p? For all intents and purposes it is doing everything. The initialization of marked could have been easily done inside the function and it would have become a lot clearer what you are doing. Currently you are returning a generator from the function call which is yielding required values while you could have directly called the generator itself which would have yielded values. There is an unnecessary level of indirection here. factors.py
{ "domain": "codereview.stackexchange", "id": 5067, "lm_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, programming-challenge, primes", "url": null }
java, floating-point, calculator, interpreter Title: Calculator with significant figures I'm writing a small scientific programming language, and I thought my first step would be to write a calculator with built in significant figures. I wrote this with JParsec for the lexing and parsing. I was wondering if there were any problems you could see in my code. I'm fairly skeptical of my own use of BigDecimal. Calculator.java public class Calculator { enum BinaryOperator implements Binary<SigDec> { PLUS { public SigDec map(SigDec a, SigDec b) { return a.add(b); } }, MINUS { public SigDec map(SigDec a, SigDec b) { return a.sub(b); } }, MUL { public SigDec map(SigDec a, SigDec b) { return a.mul(b); } }, DIV { public SigDec map(SigDec a, SigDec b) { return a.div(b); } } } enum UnaryOperator implements Unary<SigDec> { NEG { public SigDec map(SigDec n) { return n.mul(-1); } } } static final Parser<SigDec> NUMBER = Terminals.DecimalLiteral.PARSER.map(new Map<String, SigDec>() { public SigDec map(String s) { return new SigDec(new BigDecimal(s), SigDec.significantDigits(s)); } }); private static final Terminals OPERATORS = Terminals.operators("+", "-", "*", "/", "(", ")"); static final Parser<Void> IGNORED = Parsers.or(Scanners.JAVA_LINE_COMMENT, Scanners.JAVA_BLOCK_COMMENT, Scanners.WHITESPACES).skipMany(); static final Parser<?> TOKENIZER = Parsers.or(Terminals.DecimalLiteral.TOKENIZER, OPERATORS.tokenizer());
{ "domain": "codereview.stackexchange", "id": 7993, "lm_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, floating-point, calculator, interpreter", "url": null }
c++, image, template, classes, variadic template<typename... Args> constexpr ElementT& at(const Args... indexInput) { checkBoundary(indexInput...); constexpr std::size_t n = sizeof...(Args); if(n != size.size()) { throw std::runtime_error("Dimensionality mismatched!"); } std::size_t parameter_pack_index = 0; std::size_t image_data_index = 0; auto function = [&](auto index) { std::size_t m = 1; for(std::size_t i = 0; i < parameter_pack_index; ++i) { m*=size[i]; } image_data_index+=(index * m); parameter_pack_index = parameter_pack_index + 1; }; (function(indexInput), ...); return image_data[image_data_index]; }
{ "domain": "codereview.stackexchange", "id": 45291, "lm_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++, image, template, classes, variadic", "url": null }
catkin, ros-groovy /usr/include/c++/4.6/iomanip:229:5: note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setw) /usr/include/c++/4.6/iomanip:199:5: note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setprecision) /usr/include/c++/4.6/iomanip:169:5: note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setfill<_CharT>) /usr/include/c++/4.6/iomanip:131:5: note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setbase) /usr/include/c++/4.6/iomanip:100:5: note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setiosflags)
{ "domain": "robotics.stackexchange", "id": 14048, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "catkin, ros-groovy", "url": null }
Bernie Sanders Bashes Walmart Execs Claiming Minimum Wage Isn't High Enough • Coast to Coast June 5 2019 by Patrice Lee Onwuka Mandated Paid Time Off Is Not Only Bad for Most Businesses, It's Bad for Many Women June 5 2019 by Patrice Lee Onwuka Democrats Throw Money at Homelessness But the Situation Still Gets Worse, Why? • Lou Dobbs Tonight June 5 2019 by Patrice Lee Onwuka Stossel: The Paid Leave Fairy Tale • Reason TV June 4 2019 by Patrice Lee Onwuka Crisis at the Border and Draining the Swamp, Trust Trump to Create Change • Making Money May 31 2019 by Patrice Lee Onwuka Kamala Harris’ New Proposal to Punish Companies Renews Wage Gap Debate • Bold Politics May 24 2019 by Patrice Lee Onwuka Conflict in D.C. Does Effect Markets, But Consumers Continue to Spend • Coast to Coast May 23 2019 by Patrice Lee Onwuka The Gender Wage Gap and What You Can Do About It May 22 2019 by Patrice Lee Onwuka Top Dems Blow Any Chance of Bipartisan Reform • Evening Edit May 22 2019 by Patrice Lee Onwuka Women's Organization Announces The 2019 Empowered Woman of the Year May 21 2019 by Patrice Lee Onwuka Kamala Harris Threatens to Fine Businesses that Contribute to the "Pay Gap" • Fox & Friends May 21 2019 by Patrice Lee Onwuka Low Birth Rates Could Have Devastating Economic Impacts • Fox & Friends May 16 2019 by Patrice Lee Onwuka Policy analyst on falling birth rates: Rhetoric from the left contributing to 'change in norms' May 16 2019 by Patrice Lee Onwuka Sanctuary Cities Putting Illegal Immigrants Ahead of Citizens • Lou Dobbs Tonight May 8 2019 by Patrice Lee Onwuka Trump Should Look to Private Sector for Federal Reserve Board Nominees • Coast to Coast May 2 2019 by Patrice Lee Onwuka Every Aspect of the Economy is Thriving From Jobs, Wages, To Taxes• Fox & Friends First April 29 2019 by Patrice Lee Onwuka Bernie Struggles to Win Over Black Women • Evening Edit April 25 2019 by Patrice Lee Onwuka Patrice Onwuka on Plastic Bag Bans, Net Neutrality and Michelle Obama • Americhicks April 23 2019 by Patrice Lee Onwuka Many Americans Don't Care About the Mueller Report • Cavuto Live April 20 2019 by Patrice Lee Onwuka
{ "domain": "ihuq.pw", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9869795114181105, "lm_q1q2_score": 0.857514230470787, "lm_q2_score": 0.8688267796346599, "openwebmath_perplexity": 6607.073204715545, "openwebmath_score": 0.199847012758255, "tags": null, "url": "http://nbkx.ihuq.pw/properties-of-matrix-multiplication-proof.html" }
special-relativity, symmetry, field-theory, representation-theory, lie-algebra The relation \eqref{deltavmu1} expresses how a four-vector transforms under Lorentz and it may be used to further replace $\delta x^\mu$ in the above expression as $$\delta_x\psi=+\frac{\mathrm{i}}{2}\omega_{\rho\sigma}\left(M^{\rho\sigma}\right)^\mu_{\phantom{\mu}\nu}x^\nu\partial_\mu \psi\stackrel{\eqref{mmunu}}=-\frac{\mathrm{i}}{2}\omega_{\rho\sigma}\mathrm{i}\left(\eta^{\sigma\mu}\delta^\rho_{\phantom{\rho}\nu}-\eta^{\rho\mu}\delta^\sigma_{\phantom{\sigma}\nu}\right)x^\nu\partial_\mu\psi$$ Finally, you may see how the operator $L^{\rho\sigma}$ is introduced $$\delta_x\psi=-\frac{\mathrm{i}}{2}\omega_{\rho\sigma}\underbrace{\mathrm{i}(x^\rho\partial^\sigma-x^\sigma\partial^\rho)}_{\displaystyle \equiv L^{\rho\sigma}}\psi\tag{10}\label{deltaxl}$$ You can actually check that the operators $L^{\rho\sigma}$ defined in this way satisfy the commutation relations \eqref{lorentzliealgebra}, thus they are the generators of a Lorentz Lie algebra. The corresponding representation is an infinite dimensional one. Collecting the results from \eqref{deltax} and \eqref{deltaxl}, the infinitesimal Lorentz transformation of the field is
{ "domain": "physics.stackexchange", "id": 75895, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, symmetry, field-theory, representation-theory, lie-algebra", "url": null }
The last bit is easy. For any $$x\in G$$, there is $$y\in G$$ such that $$x\cdot y=e$$ (apply right invertibility to $$x$$ and $$e$$), and similarly there is $$z\in G$$ such that $$z\cdot x=e$$ (left invertibility). In fact, then we can prove that $$y=z$$ because $$y=e\cdot y=(z\cdot x)\cdot y=z\cdot(x\cdot y)=z\cdot e=z$$, which finishes the proof.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9669140216112959, "lm_q1q2_score": 0.8199119117348688, "lm_q2_score": 0.8479677545357568, "openwebmath_perplexity": 505.0800768569514, "openwebmath_score": 0.8638202548027039, "tags": null, "url": "https://math.stackexchange.com/questions/3551056/what-is-a-right-invertible-and-left-invertible-operation" }
ros, ros-kinetic, movegroup Thirdly,I updated CMakeLists.txt and package.xml accordingly and created a launch file in the launch directory of my leap_moveit pkg. Finally, when I run roslaunch leap_moveit leapmoveit.launch to try out the code, I throws the following errors. Can anyone help? mario@mario:~$ roslaunch leap_moveit leapmoveit.launch ... logging to /home/mario/.ros/log/fa712ea8-1ab7-11e9-a98a-94c6911255ab/roslaunch-mario-30026.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt WARNING: disk usage in log directory [/home/mario/.ros/log] is over 1GB. It's recommended that you use the 'rosclean' command.
{ "domain": "robotics.stackexchange", "id": 32289, "lm_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, movegroup", "url": null }
${B(x_N , \frac{1}{N}) \subset O_{\alpha_x}}$, which contradicts our assumption. Therefore there exists an ${\varepsilon >0}$ such that ${\forall x \in E, B(x, \varepsilon) \subset O_\alpha}$ for some ${\alpha \in I}$, and hence there is a finite subcover for ${E}$. $\Box$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9904406006529084, "lm_q1q2_score": 0.8027312171199478, "lm_q2_score": 0.8104789086703224, "openwebmath_perplexity": 35.02729946700755, "openwebmath_score": 0.9876411557197571, "tags": null, "url": "https://zhuolunyang.wordpress.com/2016/02/22/equivalence-of-compactness-in-metric-space/" }
discrete-signals, frequency Title: Determine fundamental period from zero crossing signal I have got a signal which consists of zero crossings over discrete time and I would like to estimate the fundamental frequency (period) from this signal in order to remove noisy samples. The signal is about 500 to 1500 samples long and has about 10-50 zero crossings, e.g. x[93] = 0; x[183] = 0; x[244]; x[282]; x[310]; x[439]; x[502]; x[515]; x[570]; x[590]; x[640]; x[635]; x[650]; x[710]; x[740]; x[835]; x[850]; x[905]; x[915]; x[980]; x[1050]; x[1110]; The output should be zero crossings again or their fundamental period, but without the "noise". I'm only interested in the position of the "new" zero crossings. I'm also not quite sure, how to model a zero-crossing signal for further processing. Thanks for any ideas. In general, you can not determine period of a signal from just the zero crossings. If the signal has harmonic content, then a pitch detection/estimation algorithm, such as autocorrelation, might be one solution. If the signal is more spectrally pure (e.g. close to sinusoidal fundamental, little overtone or harmonic energy), then a suitable DSP band-pass filter applied before locating the zero-crossings may help get rid of "noisy" samples.
{ "domain": "dsp.stackexchange", "id": 535, "lm_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, frequency", "url": null }
For a quadrilateral of sides $a,b,c,d$, diagonals $D_1,D_2$ and $m$ the distance between the midpoints of these diagonals it is known the formula $$a^2+b^2+c^2+d^2=D_1^2+D_2^2+4m^2$$ For a parallelogram we have $a=c$ and $b=d$ and $m=0$ so one has the formula $$2(a^2+b^2)=D_1^2+D_2^2$$ On the other hand for the equation $X^2+Y^2=2Z^2$ the general solution with $(X,Y)=1$ is given by the identity $$(r^2-s^2+2rs)^2+(r^2-s^2-2rs)^2=2((r^2-s^2)^2+(2rs)^2)$$ where $Z=r^2+s^2$ complete in the RHS a pythagorean triple. Consequently making $$\begin{cases}a=r^2-s^2\\b=2rs\\D_1=r^2-s^2+2rs\\D_2=r^2-s^2-2rs\end{cases}$$ we can get infinitely many examples of the required parallelograms.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9857180677531124, "lm_q1q2_score": 0.8298027464821696, "lm_q2_score": 0.8418256432832333, "openwebmath_perplexity": 147.57053905186206, "openwebmath_score": 0.8312269449234009, "tags": null, "url": "https://math.stackexchange.com/questions/2670781/can-a-parallelogram-have-whole-number-lengths-for-all-four-sides-and-both-diagon" }
circuit-complexity, derandomization, nexp Title: Why should we believe that $NEXP \not \subset P/poly$ I am sorry if this is not an advanced question. Most computer scientists believed that $NEXP \not \subset P/poly$ but they are not even close to this assumption. The main evidence that they are used is derandomization and they believe that $P=BPP$ and I know Nissan and Wigderson's generator which exist if $EXP \not \subset P/poly$($E \not \subset Size(2^{o(n))}$). On the other hand, I see some theorems like IP = PSPACE which thought to be false. Recently I read the IKW and there is a theorem states that $NEXP \in P/poly$ then there is a polynomial witness description for any language in $NEXP$. For me, it is likely to happen for example Succinct-HC is an $NEXP$-Complete language and it is likely to have a succinct witness. On the other hand, there are undecidable problems in P/poly that we don't know, maybe we could use them as an oracle to solve Succicnt-HC, They are some reasons in IKW‌'s paper but I need more references that help me to understand why should we believe that $NEXP \not \subset P/poly$. The best evidence is in my opinion follows due to the results of Ryan Williams on even a mild speed up of $CIRCUITSAT$ provides $NQP\not\subset P/poly$ which is an extremely strong result compared to $NEXP\not\subset P/poly$. It indicates to me that either we are missing something trivial which would separate $NEXP$ from $P/poly$ or (remotely plausibly) anything that separates $NEXP$ from $P/poly$ would separate any class slightly bigger than $NP$ from $P/poly$.
{ "domain": "cstheory.stackexchange", "id": 5116, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "circuit-complexity, derandomization, nexp", "url": null }
navigation, rosjava, transform Title: How to use tf.TransformBroadcaster() with ROSJava? Hi, I am trying to develop basic calculus to use SLAM featues with my robot using ROSJava. I was reading wiki about TF and I saw a code from other development and I saw that it is necessary to use TF. In the example I saw that script use: tf.TransformBroadcaster(). In ROSJava, I saw a class Transform and I saw a method: transformQuaternion(Quaternion quaternion) and I not sure if this is the way to use TF in ROSJava in the right way to use later to do SLAM. Many thanks in advance Originally posted by Juan Antonio Breña Moral on ROS Answers with karma: 274 on 2012-01-21 Post score: 1 As far as I know, TF has not been ported yet to the native implementation of rosjava, but the transformBroadcaster should be pretty easy to implement because it doesn't need any fancy transform calculations and bookkeeping to support time traveling. It just publishes a message. All you need to do is creating a publisher to the /tf topic with type tf/tfMessage and publish the transform you want to broadcast by hand. If you need more features, e.g. requesting the transform between two frames, you can think about porting the old TF implementation for the JNI based rosjava. You can find it here: http://code.in.tum.de/indefero/index.php//p/client-rosjava/source/tree/master/tfjava. Originally posted by Lorenz with karma: 22731 on 2012-01-22 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 7952, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, rosjava, transform", "url": null }
c#, sql, sql-server, benchmarking Should be rewritten as: for (int i = 1; i <= 100000; i++) { // main while code } Likewise: i = 1; while (i <= 1000) { // main while code i++; } Would become: for (int i = 1; i <= 1000; i++) { // main while code } This allows you to recycle the variable i later, and also prevents from accidentally forgetting to reset i back to 1 between loops. Generally, the variable i stands for iterator, and is typically reserved exclusively for loops. This has no real performance impact, but it has a severe readability and maintainability impact. Using the for loop, it is immediately clear what is happening to the iterator. Using the while loop, you have to search through the body of the while to find where you manipulate the iterator. As far as: variable declaration at the top is bad Generally it is frowned upon. You should declare variables as close to their usage as possible, and within the tightest block that they are to be used in. For example, the: int salary; string name; Should be declared within your first loop (which should now be a for loop): for (int i = 1; i <= 100000; i++) { int salary; string name; } This is so that variables cannot unexpectedly be used in places where they should not, and so that they can be recycled when they fall out-of-scope immediately. It also means that you cannot accidentally use the value of them outside of the block they apply to. Try to choose more effective variable names. Never abbreviate except for certain well-accepted abbreviates (i for iterator, e for eventArgs, etc.): using (SqlConnection con1 = new SqlConnection()) { Would be more accepted as: using (SqlConnection connection1 = new SqlConnection()) { This is mostly a best-practice.
{ "domain": "codereview.stackexchange", "id": 15169, "lm_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#, sql, sql-server, benchmarking", "url": null }
ros, calibration, ros-kinetic, packages, camera-calibration ros-kinetic-rosbuild ros-kinetic-rosconsole ros-kinetic-rosconsole-bridge ros-kinetic-roscpp ros-kinetic-roscpp-core ros-kinetic-roscpp-serialization ros-kinetic-roscpp-traits ros-kinetic-roscpp-tutorials ros-kinetic-rosgraph-msgs ros-kinetic-roslaunch ros-kinetic-roslib ros-kinetic-roslisp ros-kinetic-rosmsg ros-kinetic-rosnode ros-kinetic-rosout ros-kinetic-rospack ros-kinetic-rospy ros-kinetic-rospy-tutorials ros-kinetic-rosservice ros-kinetic-rostest ros-kinetic-rostime ros-kinetic-rostopic ros-kinetic-rosunit ros-kinetic-roswtf ros-kinetic-rqt-action ros-kinetic-rqt-bag ros-kinetic-rqt-bag-plugins ros-kinetic-rqt-common-plugins ros-kinetic-rqt-console ros-kinetic-rqt-dep ros-kinetic-rqt-graph ros-kinetic-rqt-gui ros-kinetic-rqt-gui-cpp ros-kinetic-rqt-gui-py ros-kinetic-rqt-image-view ros-kinetic-rqt-launch ros-kinetic-rqt-logger-level ros-kinetic-rqt-moveit ros-kinetic-rqt-msg ros-kinetic-rqt-nav-view ros-kinetic-rqt-plot ros-kinetic-rqt-pose-view ros-kinetic-rqt-publisher ros-kinetic-rqt-py-common ros-kinetic-rqt-py-console ros-kinetic-rqt-reconfigure ros-kinetic-rqt-robot-dashboard ros-kinetic-rqt-robot-monitor ros-kinetic-rqt-robot-plugins
{ "domain": "robotics.stackexchange", "id": 31173, "lm_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, calibration, ros-kinetic, packages, camera-calibration", "url": null }
expression from an array of values. The leaves are inputs to our system. To compute an indefinite integral, that is, an antiderivative, or primitive, just pass the variable after the expression. a bunch of integrals: exploring (non-commercial) symbolic integrators available through SageMath - integrals. Ondřej Čertík started the project in 2006; on Jan 4, 2011, he passed the project leadership to Aaron Meurer. Thanks for contacting SymPy!. Herein we use package rSymPy that needs Python and Java instalattion (this library uses SymPy via Jython). 1 Exponential Distribution 18. integrand and self. SymPy aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. Setting up and using printers¶. This commit aims to combine the merits of the two PRs by treating separately those terms of the antiderivative that contain unevaluated integral factors and evaluating the rest together in one sum. After finding the inverse of a Laplace Transform, I am using sympy to check my results. I have just started learning about Laplace Transforms and taking Inverse of Laplace Transforms. Now we’re ready to use SymPy to evaluate and simplify the integral for a single line segment. Like Derivative and Integral, limit has an unevaluated counterpart, Limit. integrate(expression, limit) method. SymPy is free, Python-based and a pure Python library for arbitrary floating point arithmetic, making it easy to use. Join GitHub today. Integral taken from open source projects. , see the. We will then formally define the first kind of line integral we will be looking at : line integrals with respect to arc length. integrate(sympy. This is just a regular Python shell, with the following commands executed by default:. Do symbolic work with sympy, and then switch by "lambdifying" symbolic exressions, turning them into python functions. When both packages fail to evaluate the integral SymPy is much slower to say so (timeout for SymPy compared to 1 or 2 seconds for Sage to return an unevaluated integral). For other Fourier transform conventions, see the function sympy. If you want the numerical value as an answer, why not use
{ "domain": "yiey.pw", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211590308922, "lm_q1q2_score": 0.8058961451185194, "lm_q2_score": 0.8267117898012105, "openwebmath_perplexity": 1338.5135338409063, "openwebmath_score": 0.7079145312309265, "tags": null, "url": "http://sgix.yiey.pw/sympy-evaluate-integral.html" }
If you need a tester program that calculate permutation from index or viceversa, you can see here. It can be useful and it's easy to use. It's based on factoradic. As example: it allows to calculate the correct index corresponding to the solution "2783905614" mentioned earlier Or obtain the 2,000,000th permutation of S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } ) It works up to 17 elements (max index = 355,687,428,096,000)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104904802131, "lm_q1q2_score": 0.8480027849611749, "lm_q2_score": 0.8774768002981829, "openwebmath_perplexity": 1362.6161806309021, "openwebmath_score": 0.7171724438667297, "tags": null, "url": "https://math.stackexchange.com/questions/60742/finding-the-n-th-lexicographic-permutation-of-a-string" }
matlab, filters, filtering, digital-filters, channel-estimation x=[x1,x2,x3]; y=filter(cb,1,x); subplot(3,1,2) plot([x',y']) title('x vs filtered x'); legend({'x','x-filtered'}) % show spike subplot(3,1,3) plot([x',y']) title('x vs filtered x, zoomed to see spikes'); legend({'x','x-filtered'}) xlim([130,350]) My overall question is how can I practically measure the effective signal envelop delay due to filtering? I would like to match this measured delay with the theoretically calculated delay. The Least Mean Square solution to find the "channel" or response of the filter is provided by the following MATLAB/Octave Code using the input to the filter as tx and the output of the filter as rx. For more details on how this works, see this post: Compensating Loudspeaker frequency response in an audio signal: function coeff = channel(tx,rx,ntaps) % Determines channel coefficients using the Wiener-Hopf equations (LMS Solution) % TX = Transmitted (channel input) waveform, row vector, length must be >> ntaps % RX = Received (ch output) waveform, row vector, length must be >> ntaps % NTAPS = Number of taps for channel coefficients % Dan Boschen 1/13/2020 tx= tx(:)'; % force row vector rx= rx(:)'; % force row vector depth = min(length(rx),length(tx)); A=convmtx(rx(1:depth).',ntaps); R=A'*A; % autocorrelation matrix X=[tx(1:depth) zeros(1,ntaps-1)].'; ro=A'*X; % cross correlation vector coeff=(inv(R)*ro); %solution end
{ "domain": "dsp.stackexchange", "id": 8255, "lm_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, filters, filtering, digital-filters, channel-estimation", "url": null }
# When is the closure of an open ball equal to the closed ball? It is not necessarily true that the closure of an open ball $B_{r}(x)$ is equal to the closed ball of the same radius $r$ centered at the same point $x$. For a quick example, take $X$ to be any set and define a metric $$d(x,y)= \begin{cases} 0\qquad&\text{if and only if x=y}\\ 1&\text{otherwise} \end{cases}$$ The open unit ball of radius $1$ around any point $x$ is the singleton set $\{x\}$. Its closure is also the singleton set. However, the closed unit ball of radius $1$ is everything. I like this example (even though it is quite artificial) because it can show that this often-assumed falsehood can fail in catastrophic ways. My question is: are there necessary and sufficient conditions that can be placed on the metric space $(X,d)$ which would force the balls to be equal? Here is a characterization that is straight from the definitions, but which it seems may be useful when verifying that a particular space has the property. For any metric space $$(X,d)$$, the following are equivalent: • For any $$x\in X$$ and radius $$r$$, the closure of the open ball of radius $$r$$ around $$x$$ is the closed ball of radius $$r$$. • For any two distinct points $$x,y$$ in the space and any positive $$\epsilon$$, there is a point $$z$$ within $$\epsilon$$ of $$y$$, and closer to $$x$$ than $$y$$ is. That is, for every $$x\neq y$$ and $$\epsilon\gt 0$$, there is $$z$$ with $$d(z,y)<\epsilon$$ and $$d(x,z).
{ "domain": "mathzsolution.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.99142251306567, "lm_q1q2_score": 0.8218285902391306, "lm_q2_score": 0.8289388019824946, "openwebmath_perplexity": 80.60185360646125, "openwebmath_score": 0.9602850079536438, "tags": null, "url": "https://mathzsolution.com/when-is-the-closure-of-an-open-ball-equal-to-the-closed-ball/" }
quantum-field-theory, charge, antimatter, charge-conjugation, cpt-symmetry Title: Understanding the Charge Conjugation Operator I am trying to understand the charge conjugation operator. http://en.wikipedia.org/wiki/C_parity Because the operator is Hermitian, this seems to imply that there is a (possibly spontaneous?) physical process through which a particle can (instantaneously?) change into its anti-particle. Searching for charge conjugation in general only gives me a lot of math, which I think I understand, what I don't understand is when and how charge conjugation can occur. Where can I find more information about this process? Alternatively, if charge conjugation cannot occur, why do we need a charge conjugation operator? In classical mechanics, it is often possible and convenient to describe a system with an object called a Lagrangian (in that it governs a system's behaviour, the Lagrangian is similar to a Hamiltonian). Like the Hamiltonian, the Lagrangian ought to be real - and any terms inside the Lagrangian ought to be Hermitian. In quantum field theory (QFT), the kinetic energy, masses and interactions between fundamental particles (electrons, photons, quarks etc) are also described by a Lagrangian. There is a one-to-one correspondence between possible interactions and terms (or "operators") in the Lagrangian. When describing particles with a Lagrangian, we must write all allowed operators (i.e. interactions) in the Lagrangian. Some operators are forbidden by symmetries (e.g. charge consveration - by Noether's theorem, symmetries result in conservation laws). The operator corresponding to a particle changing into an antiparticle is Hermitian, so on that basis is permitted in the Lagrangian, but in many cases, such an operator would violate a symmetry.
{ "domain": "physics.stackexchange", "id": 87360, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, charge, antimatter, charge-conjugation, cpt-symmetry", "url": null }
inorganic-chemistry, reaction-mechanism, ions $\ce {M^+.Cry (g) + M^- (g) -> M^+.Cry M^- (s)}$. For $\ce {M = Na}$, the $\ce {\Delta H}$ and $\ce {\Delta G}$ for the above process are $\ce {-323 kJ/mol}$ and $\ce {-258 kJ/mol}$ respectively $\ce {^3}$. Preparation of the alkalide $\ce {Na^-}$, $\ce {K^-}$, $\ce {Rb^-}$, and $\ce {Cs^-}$ anions are stable both in suitable solvents and in crystalline solids$\ce {^3}$. The latter can be prepared either by cooling a saturated solution $\ce {^4}$ or by rapid solvent evaporation. The principal difficulty in preparation of crystalline salts containing alkalide ions by the method of cooling a saturated solution is the low solubility of these alkali metals in the amine and ether solutions $\ce {^3}$. Without a sufficiently large concentration of the metal dissolved in solution, precipitation of the solid upon cooling would be insignificant. This difficulty was resolved by the use of crown-ether and cryptand complexes, such as those of [18]crown-6 and [2.2.2] cryptand] $\ce {^3}$. The complexating agent complexes with $\ce {M^+}$ , shifting the equilibrium (1) far to the right, significantly increasing the concentrations of the dissolved metal ions. (1) $\ce { 2M (s) -> M^+ (sol) + M^- (sol)}$ (2) $\ce { M^+ (sol) + Cry (sol) -> M^+.Cry}$
{ "domain": "chemistry.stackexchange", "id": 11039, "lm_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, reaction-mechanism, ions", "url": null }
where you need to have help on rationalizing or subtracting, Mathmusic. Identify the conic. Free Ellipse calculator - Calculate ellipse area, center, radius, foci, vertice and eccentricity step-by-step This website uses cookies to ensure you get the best experience. Today, the tallest cooling towers are in France, standing a remarkable 170 meters tall. In this short video you will see how the rotation transformation tool works in Desmos Geometry. Get the free "Parametric equation solver and plotter" widget for your website, blog, Wordpress, Blogger, or iGoogle. Math Expression Renderer, Plots, Unit Converter, Equation Solver, Complex Numbers, Calculation History. Rotation of an ellipse. Welcome to the first video after the summer! I get you all started with another project on Desmos, the free online graphing calculator! In this project, we w. x − h 2 a + y − k 2 b. It is a matter of choice whether we rotate and then translate, or the opposite. Log InorSign Up. how you are specifying angles, etc. Here are formulas for finding these points. In this short video you will see how the rotation transformation tool works in Desmos Geometry. Desmos 3d Desmos 3d. The sensors (other than GPS) can operate at 100 Hz and record data very quickly to an SD card. x1 = xcosθ − ysinθ y1 = ycosθ + xsinθ. Cavalieri and E. The focus and directrix of an ellipse were considered by Pappus. Graphing Reflections. Drag the five orange dots to create a new ellipse at a new center point. It is generally used to express a graph in many applications like Compound interest, radioactive decay, or growth of population etc. This is a two part lesson, an experiment and simulation that together meets the CCSSM S. General Equation. Parabola formulas : A parabola is the locus of a point which moves in a plane such that its distance from a fixed point in the plane is always equal to the distance from a fixed straight line in the same plane. 209-210, 64 (let interest be compounded yearly not continuously), 67, 70, 71. développement ellipse ellipses ensembles de symétrie de rotation symétrie de. xcos
{ "domain": "snionline.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226260757066, "lm_q1q2_score": 0.818373664150042, "lm_q2_score": 0.8376199714402813, "openwebmath_perplexity": 897.3256986854708, "openwebmath_score": 0.5953616499900818, "tags": null, "url": "http://snionline.it/kfvh/rotating-ellipse-desmos.html" }