text
stringlengths
49
10.4k
source
dict
temperature, conservation-laws, continuum-mechanics $$ Plugging this into our already rewritten third summand, and again using $\partial_\rho f = \partial_\rho u$, we get $$ \rho \partial_\rho f \cdot \text{Id} : Dv = \rho \partial_\rho f \nabla \cdot v = \partial_\rho f (\nabla \cdot (\rho v) - (\nabla \rho) \cdot v) = \partial_\rho f (-\partial_t \rho - (\nabla \rho) \cdot v) \\= - \partial_\rho f \partial_t \rho - \partial_\rho f (\nabla \rho \cdot v) = - \partial_\rho f \partial_t \rho - \partial_\rho u (\nabla \rho \cdot v). $$ Now plugging everything back into the energy conservation equation we get $$ 0 = \partial_t u + v\cdot \nabla u - \rho \partial_{\rho} f \cdot \text{Id} : Dv \\= \partial_\rho f \partial_t \rho + c\partial_t T + \partial_\rho u (v \cdot \nabla \rho) + cv\cdot\nabla T - \partial_\rho f \partial_t \rho - \partial_\rho u (\nabla \rho \cdot v) \\= c(\partial_t T + v\cdot\nabla T) $$ and thus we get $$ \partial_t T + v\cdot\nabla T = 0. $$
{ "domain": "physics.stackexchange", "id": 63970, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "temperature, conservation-laws, continuum-mechanics", "url": null }
optimization, c Title: Optimised library database code for sorted array of structures I have an array of structure records and function intersection and difference. The intersection function take list1,list2,list3(an array of records),and size of both list1 and list2. Here, intersection and difference both are the boolean operators ( like : A U B , A - B , A intersection B). Also list1 and list2 are given as input and the result is copied to list3. My both functions are working fine. But given that the two lists are already sorted (on author name and if same author name then name of the book), how can I optimize the code? intersection is of O(n2) and difference is less than O(n2). copy() copies a record to first argument from second argument. //Intersection of two lists void intersection(struct books *list1,struct books *list2,struct books *list3,int n1,int n2) { int i,j,size1,size2; if(n1<n2){size1=n1;size2=n2;}else{size1=n2;size2=n1;} for(i=0;i<size1;i++) { for(j=0;j<size2;j++) { if(strcmp(list1[i].name,list2[j].name)==0 && strcmp(list1[i].author,list2[j].author)==0) { if(list1[i].copies < list2[j].copies) { copy(&list3[i],&list1[i]); } else { copy(&list3[i],&list2[j]); } } } } }
{ "domain": "codereview.stackexchange", "id": 4859, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optimization, c", "url": null }
inorganic-chemistry, nomenclature Let's take an example: $\ce{P4O6}$. In one molecule of $\ce{P4O6}$, we can see that it has four atoms of phosphorus and six atoms of oxygen. So, its name should be of the form "Xphosphorus Yoxide". The table of numerical prefixes tells us that we should use the prefix "tetra" for nitrogen and "hexa" for oxygen. Since the name "oxygen" begins with a vowel, we shall write "hexoxide" (and not "hexaoxide"). Thus, the correct name for this chemical formula is "tetraphosphorus hexoxide". Examples: $\ce{CO2}$, $\ce{P4O10}$, $\ce{N2O}$, $\ce{N2S5}$ Answers: (hover to peek!) carbon dioxide, tetraphosphorus decoxide, dinitrogen monoxide, dinitrogen pentasulfide Writing the formula for a covalent compound from its name This is much simpler from the previous case, rather it follows an exactly reverse process. We'll just take a look at two examples: boron triiodide: we see that its formula would be: $\ce{B_$x$I_$y$}$. Now, $x=1$ since boron lacks any numerical prefix, and $y=3$ due to the "tri" prefix. Hence, the formula is $\ce{BI3}$. dinitrogen pentoxide: we see that its formula would be: $\ce{N_$x$O_$y$}$. Now, $x=2$ and $y=5$ due to the "di" and "pent(a)" prefixes. Hence, the formula is $\ce{N2O5}$. Examples: hydrogen bromide, iodine heptafluoride, diboron hexahydride Answers: (hover to peek!) $\ce{HBr}$, $\ce{IF7}$, $\ce{B2H6}$
{ "domain": "chemistry.stackexchange", "id": 10323, "lm_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, nomenclature", "url": null }
a^2cf_{xyy}$$ $$(IV)\qquad f(x-a,y+d)\approx f - a f_x+d f_y +\frac{a^2}{2}f_{xx} -adf_{xy} +\frac{d^2}{2}f_{yy}- \frac{a^3}{6}f_{xxx} + \frac{d^3}{6}f_{yyy} + \frac{1}{2} a^2df_{xxy}- \frac{1}{2} a^2df_{xyy}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936078216782, "lm_q1q2_score": 0.8200694034136066, "lm_q2_score": 0.8333245911726382, "openwebmath_perplexity": 819.4337056270424, "openwebmath_score": 0.8307120203971863, "tags": null, "url": "https://scicomp.stackexchange.com/questions/27503/finite-difference-for-mixed-derivatives-on-nonuniform-grid" }
navigation, mapping, kinect Title: How to execute floor collision map demo in ucsb-ros-pkg Hi, I am very interested in know if anyone knows how to run the floor collision map demo in the ucsb-ros-pkg as seen here in their google docs video. I have downloaded and ran all the other examples in the ucsb package and have even moded it to work with a wii Remote, but cannot find the floor mapping code in the package. http://code.google.com/p/ucsb-ros-pkg/ Thanks, -Scott Originally posted by Scott on ROS Answers with karma: 693 on 2011-04-15 Post score: 0 Hi, I'm the creator of that demo, so I should be able to help you out. I haven't uploaded the code to our public svn because it could do with a little updating to clean up the code, split off sections into functions, etc. It also doesn't compile under electric because it was developed under cturtle and I haven't updated it. This demo was mostly created for me to learn PCL, so there are lots of ways to improve the code. For example, using kd trees instead of brute force collision detection, etc. That said, here's the source code if you want to take a look. -Brian //find_floor.cpp //Author: Brian Satzinger (bsatzinger@gmail.com) //Demonstration of automated floor finding & reorientation through //planar segmentation, with a collision detection function. //Publishes several ros topics with intermediate data for debugging //and illustrative purposes. /* Copyright (c) 2011, Brian Satzinger All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the UCSB Robotics Lab nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
{ "domain": "robotics.stackexchange", "id": 5376, "lm_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, mapping, kinect", "url": null }
entanglement, bell-basis There is though another way based on statistics and a reliable entanglement witness. When Victor entangles his photons 2 and 3, photons 1 and 4 are in a mixture of entangled states. We consider the transmitter (Victor) and the receiver (Alice and Bob) follow an agreed protocol. For each bit of information transferred (0/1), a certain number KN of pairs of photons are measured by both Victor and corespondingly by Alice/Bob. When he wants to send a 0, Victor does not entangle his photons. When he wants to send a 1, Victor entangles his photons. In order to decode the message Alice and Bob need a reliable procedure of entanglement detection . And they don't need to compare their records with Victor. In the paper above it is discussed witnessing entanglement without entanglement witness operators. The method involves measuring the statistical response of a quantum system to an arbitrary nonlocal parametric evolution. The witness of entanglement is solely based on the visibility of an interference signal. If followed closely, this method never gives false positives. In the protocol described , when Victor (the transmitter) and Alice and Bob (the receiver) measure N pairs of photons, then with probability $\frac{1}{4^N}$ all the N photon pairs measured by Alice and Bob will be in the same Bell state. So the transmitter and receiver can repeat measuring N pairs of photons (lets say K times) until the entanglement detection method described above will give a positive. At this point Alice and Bob know that Victor must be entangling his photons. When Victor does not entangle his photons, since the method of entanglement detection mentioned above does not give false positives, Alice and Bob will know that Victor does not entangle his photons for all the KN pairs of photons processed. For large N and K, the probability of error can be made arbitrarily small. Basically, without comparing records, Alice and Bob know what Victor is doing. That's signalling, and the no - signalling theorem can be circumvented due to the method of entanglement detection described above, which does not rely on witness operators. In principle the problem seems to allow a solution. Reliable entanglement detection seems to circumvent the no - signalling theorem.
{ "domain": "quantumcomputing.stackexchange", "id": 1304, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "entanglement, bell-basis", "url": null }
roslaunch Title: File reading and roslaunch Hello, I built a node which simply reads a file and builds a vector of data from it. However, when i tried running the node from roslaunch instead of rosrun, according to the log file, it ca n longer open the said data.txt file, causing my node to shutdown. I tried moving the file around but the problem persists. Here is the code ifstream vel("ros_workspace/odometry/traj.txt"); if(!vel.is_open() { ROS_INFO("file not found!"); ros::shutdown(); } I am new to ROS and not very familiar with the PATHS, don't even know if the problem comes from there, so this might be a very simple question. Thanks! Barbosa Originally posted by Barbosa on ROS Answers with karma: 35 on 2012-05-13 Post score: 0 Original comments Comment by AsifA on 2014-07-29: Hi, I am unable to read a test file to build a vector from it. Would you please share your code of reading a file and building a vector of data. Thanks While using roslaunch, all relative paths are evaluated from ~/.ros. So the file is being searched at the location ~/.ros/ros_workspace/odometry/traj.txt. A much better solution is to provide the filename as an input parameter. You can place the file in one of your packages, and use the find substitution to locate the file. Checkout the roslaunch XML wiki page for an example using manifest.xml. You can then use the roscpp parameter api to obtain this parameter in your code. Originally posted by piyushk with karma: 2871 on 2012-05-13 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 9371, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "roslaunch", "url": null }
formal-languages, context-free, formal-grammars Title: Finding Language of a CFG Say you are given the following CFG $G$: $$ S \to S_1 \mid S_2 \\ S_1 \to AbAS_1c \mid \epsilon \\ S_2 \to BaBS_2c \mid \epsilon \\ A \to Aa \mid \epsilon \\ B \to Bb \mid \epsilon $$ What is $L(G)$? So far I've derived the following regular expressions: $ S \rightarrow (a^*ba^*)^*c \mid (b^*ab^*)^*c$ So far I've come up with this $L(G)$: $L(G) = \{ (a^nba^n)^qc \mid (b^nab^n)^*q : n,q \geq 0 \}$ When you approach the second $S_1$ do you include the $c$ ( As in, finish $S_1c$ and the go recursive)? To find the language for the grammar, You need to understand how does the recursiveness in production rules work. In solving A->Aa|epsilon , you need to know that epsilon works as a stopper for a recursive production, and determine the number of times the recursive production occurred for the given production rule. In solving A->Aa|epsilon to get the expression for A made up of terminals , one of the ways is to keep doing with the production rule. After you do that you consider the epsilon which determines the number of times the production rule have occurred, and use that result to express the A concisely. A->Aa->Aaa->Aaaa ... you see that the a is produced recursively and epsilon makes A to stop at any right arrow, so you can substitute A with a*. As asterisk is defined as n>=0 and n is an integer. It is same for solving S1 and S2. First you use the conclusion that A can be substituted with a* as they are same expressions, then AbA(S1)c is same as (a*)b(a*)(S1)(c) keep doing that production rule again and again until you find the regularity in them.
{ "domain": "cs.stackexchange", "id": 6967, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "formal-languages, context-free, formal-grammars", "url": null }
classical-mechanics, constrained-dynamics, degrees-of-freedom Title: Degrees of freedom for a bead on a parabolic wire? How many degrees of freedom does a bead on a parabolic wire have? I think it must be two degrees of freedom since the bead is constrained to move on the wire (up, down motion and left/right motion). Is this correct, or does it only have one degree of freedom? It has two degrees of freedom: its position along the wire and its rotation around the wire. But in most cases there is no interaction between the rotation and the position along the wire, so the equations of motion can treat the two degrees of freedom separately. That is, the equation describing rotation of the bead around the wire will not have any terms that include position along the wire, and vise versa. This means that for calculating motion along the wire, there is effectively only one degree of freedom.
{ "domain": "physics.stackexchange", "id": 71339, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, constrained-dynamics, degrees-of-freedom", "url": null }
clojure As for your min-time function, I don't think loop/recur is necessarily a bad thing, and I often tend to rely on it in complicated situations where you're doing more involved work on each iteration, checking conditions, etc. I think it's OK to use it here. But if you want to go a more functional route, you could consider writing a step function and creating a lazy sequence of game states using iterate, like so: (note: I'm writing step as a letfn binding so that it can use arbitrary values of c, f and x that you feed into a higher-order function that I'm calling step-seq -- this HOF takes values for c, f and x and generates a lazy sequence of game states or "steps.") (defn step-seq [c f x] (letfn [(step [{:keys [factories time-cost cookie-rate total-time result]}] (let [new-time-cost (+ time-cost (/ c cookie-rate)) new-cookie-rate (+ cookie-rate f) new-total-time (+ new-time-cost (/ x new-cookie-rate))] {:factories (inc factories) :time-cost new-time-cost :cookie-rate new-cookie-rate :total-time new-total-time :result (when (> new-total-time total-time) total-time)}))] (iterate step {:factories 0, :time-cost 0, :cookie-rate 2.0, :total-time (/ x 2.0), :result nil}))) Now, finding the solution is as simple as grabbing the :result value from the first step that has one: (defn min-step [c f x] (some :result (step-seq c f x)))
{ "domain": "codereview.stackexchange", "id": 7481, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "clojure", "url": null }
turing-machines Title: Turing machine accepts any word Let M be a Turing-machine with tape alphabet = {0, 1} that does not move beyond the first 64 cells of its tape. Is the problem "Does M accept any word?" decidable? I would say it does not accept any word because we can have words longer than 64 characters. I would say it does because if it accepts any word, we don't care about the length. It always goes into accepting state. Can someone please explain this to me? Let $P = \{ w \in \{ 0,1 \} \mid |w| \le 64 \land w \in L(M) \}$. Since $P$ contains only words over an alphabet (i.e., a finite set) and all words in $P$ have bounded length, $P$ is finite. Moreover, any word $w \in \{0,1\}^\ast$ with length $|w| > 64$ is in $L(M)$ if and only if there is a prefix of $w$ which is in $P$. Thus, to decide $L(M)$, we only need to check whether the input has a prefix out of finitely many possibilities (i.e., those in $P$). Hence, $L(M)$ is not only decidable, it is decidable in constant time. Note this construction does not require any knowledge of $M$ whatsoever (in particular, there is no need to simulate $M$). We only need to show the existence of a TM which decides $L(M)$, not actually construct one.
{ "domain": "cs.stackexchange", "id": 13578, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "turing-machines", "url": null }
php, object-oriented, url, wordpress And then used eg like this: conditionsRefer->setDateReferrer($_GET['dateReferer']); Naming class names should ideally be the same as the file in which they are stored (possibly with the keyword class added. ConditionsRef.php isn't a very good name (What's a Ref?), ConditionsReferer.php, ConditionsReferer.class.php, conditionsReferer.class.php would all be better (just choose one naming theme, and then stick with it). be consistent: either it's referer or referrer. isVariableName usually implies a boolean value. Your isDateReferrer etc do not seem to be boolean values though. Comments your auto-generated comments seem wrong (eg @param (string)$authorReferrer vs $isAuthorReferrer, or protected $isAuthorReferrer vs @var $authorReferrer). sometimes, auto-generated comments might be fine, but I would prefer some additional information. For example, what is a taxReferrer? What values are $values? class level comments would be great. What is a ConditionsRefer? Misc I'm not sure why you use filter_var in your code. If you want to protect against XSS attacks, I would clean the data when echoing it to the enduser, not at any other point (otherwise it becomes a guessing game when echoing data: did I already clean it?). I don't like using switch(true) instead of if-else, it just looks really wrong. do you actually expect a different implementations of ConditionsReferInterface than ConditionsRefer? It's hard for me to imagine one. If there is only one possible implementation of an interface, the interface isn't really needed.
{ "domain": "codereview.stackexchange", "id": 12276, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, url, wordpress", "url": null }
This is a very mundane explanation (with finite sets). A subset is made of any combination of elements from the set. Suppose a set$S$ is made of three elements: $\{a,b,c\}$. Each element $a$, $b$ or $c$ can be, or not, in the combination. If all of them are not in the combination, they STILL form a combination of "absent elements", or $\emptyset$, a subset of $S$. They are the dual of the subset of "all elements", $\{a,b,c\}$. In the same way that $\{a,b\}$ and $\{c\}$ are (complementary) subsets, $\emptyset$ and $\{a,b,c\}$ belong to the set of subsets. What confused me was that, the following expression was also a vacuous truth. For every object of $$x$$, if $$x$$ belongs to the empty set, then  $$x$$ doesn't belong to the set $$A$$. The contrapositive of the above conditional is: "For every $$x$$, if $$x$$ belongs to set $$A$$, then $$x$$ doesn't belong to the empty set" which is easy to understand as the empty set has no elements at all. NOTE- $$p\rightarrow q$$ has same meaning as $$\lnot q\rightarrow \lnot p$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9902915226589475, "lm_q1q2_score": 0.8586181746826396, "lm_q2_score": 0.867035771827307, "openwebmath_perplexity": 225.69110551115045, "openwebmath_score": 0.7517534494400024, "tags": null, "url": "https://math.stackexchange.com/questions/1953218/is-the-empty-set-is-a-subset-of-any-set-a-convention/1953511" }
python, python-3.x, json file_name = "d:/a.json" #Create a named tuple to store all data later, # Total time is Current time - start_time EmployeeData = namedtuple('EM', ["name", "start_time", "total_time"]) # Here I will store final list of all employee tuples final_list = [] # Get string date as input and convert it to datetime object def format_time(string_time): op_time = dateutil.parser.parse(string_time) return op_time with open(file_name, "r") as data: json_data = json.load(data) for record in json_data["data"]: # Time in JSON file also has timezone so i have to use timezone.utc today = datetime.now(timezone.utc) # create date object from string date record[1] = format_time(record[1]) # Find total number of days, tenure = (today - record[1]).days # create a tuple temp_tuple = EmployeeData(name=record[0], start_time = record[1], total_time = tenure) final_list.append(temp_tuple) pprint.pprint(final_list)
{ "domain": "codereview.stackexchange", "id": 32267, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, json", "url": null }
homework-and-exercises, newtonian-mechanics, energy, energy-conservation, spring $$\frac12ky^2=mgy+\frac12mv^2$$ Let’s now look at the first case, but let's do it correctly. We know that the net work done on the mass is equal to its change in kinetic energy: $$W_\text{net}=W_\text{gravity}+W_\text{spring}=\Delta K=\frac12mv^2-0$$ We can easily determine the work done by gravity and the spring force using the definition of work $W=\int\mathbf F\cdot\text d\mathbf y$ $$W_\text{gravity}=\int_{-y}^0(-mg)\,\text dy'=-mgy$$ $$W_\text{spring}=\int_{-y}^0(-ky')\,\text dy'=\frac12ky^2$$ Putting it all together we have $$W_\text{net}=-mgy+\frac12ky^2=\frac12mv^2$$ You can see this is exactly the same as your second case. So both methods you have proposed are exactly the same. The issue with the first case in your question is just as you said. You didn't include work done by gravity.
{ "domain": "physics.stackexchange", "id": 62353, "lm_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, energy, energy-conservation, spring", "url": null }
quantum-field-theory, string-theory, conformal-field-theory, greens-functions, correlation-functions $r=0$ & $\rho>0$ $\rho=0$ & $r>0$ $r=\rho\geq 0$
{ "domain": "physics.stackexchange", "id": 46437, "lm_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, string-theory, conformal-field-theory, greens-functions, correlation-functions", "url": null }
climate-change, co2, greenhouse-gases, geoengineering, methane Title: What potential geoengineering technologies could help a country "achieve its Paris (agreement) targets"? CNN's China to expand weather modification program to cover area larger than India ends with the following sentence: "While China has not yet shown signs of 'unilaterally' deploying geoengineering projects on the ground, the scale of its weather modification and other massive engineering projects, including mega-dam projects (such as the Three Gorges), suggests China is willing to deploy large-scale geoengineering schemes to tackle the impacts of climate change and achieve its Paris targets." and the scope of my question is limited to the Earth Science aspects of geoengineering projects that could "..tackle the impacts of climate change and achieve... Paris (agreement) targets". To my knowledge the Paris Agreement primarily focuses on the reduction of greenhouse gas emission itself, so I would think that geoengineering solutions might involve removing gases already emitted in the form of new biomass or as gas in geological sequestration sites, or by producing energy with a technology having a lower greenhouse emission rate. Is that so? If so, what are specific examples? Since the same article discusses both cloud seeding for precipitation induction and the dispersal of reflective particles to reduce global warming earlier, could there be some atmospheric dispersal technology that could help a country "...achieve its Paris targets"? I think the third paragraph of the article hints at what might be the thinking. In the next five years, the total area covered by artificial rain or snowfall will reach 5.5 million sq km, while over 580,000 sq km (224,000 sq miles) will be covered by hail suppression technologies. The statement added that the program will help with disaster relief, agricultural production, emergency responses to forest and grassland fires, and dealing with unusually high temperatures or droughts.
{ "domain": "earthscience.stackexchange", "id": 2158, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "climate-change, co2, greenhouse-gases, geoengineering, methane", "url": null }
# Linear Algebra Money Question bleedblue1234 ## Homework Statement I have 32 bills in my wallet in the denominations $1,$5, and $10, worth$100 in total. How many of each denomination do I have? ## Homework Equations A= # $1 bills B= #$5 bills C= # $10 bills A+B+C = 32 1A+5B+10C = 100 ## The Attempt at a Solution So I attempted to solve for C in terms of A and B in terms of A but I'm getting nowhere. ## Answers and Replies E_M_C Hi bleedblue1234, You can only solve for n variables when you have n linearly independent equations. In this case, you have 3 variables and 2 linearly independent equations, so you're one equation short. But if you choose a value of zero for A, B or C then you reduce the problem to 2 variables and 2 linearly independent equations. What do you get when you try out the different combinations? Be careful: There is more than one solution. azizlwl You can narrow the selection.$1 can only be in a group of 5. Homework Helper This not, strictly speaking, a "linear algebra" problem, but a "Diophantine equation" because the "number of bills" of each denomination must be integer. Letting "O", "F", and "T" be, respectively, the number of "ones", "fives" and "tens", we must have O+ F+ T= 32 and O+ 5F+ 10T= 100. Subtracting the first equation from the second, 4F+ 9T= 68. Now you can use the standard "Eucidean algorithm" to find all possible integer values for F and T and then find O. Last edited by a moderator: Homework Helper Dearly Missed ## Homework Statement I have 32 bills in my wallet in the denominations $1,$5, and $10, worth$100 in total. How many of each denomination do I have? ## Homework Equations A= # $1 bills B= #$5 bills C= # \$10 bills A+B+C = 32 1A+5B+10C = 100 ## The Attempt at a Solution
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517507633983, "lm_q1q2_score": 0.8273754894520625, "lm_q2_score": 0.84594244507642, "openwebmath_perplexity": 908.1140618153448, "openwebmath_score": 0.7170826196670532, "tags": null, "url": "https://www.physicsforums.com/threads/linear-algebra-money-question.635777/" }
c++, performance, algorithm, pathfinding, c++20 class EuclideanCoordinates { private: double x_; double y_; public: EuclideanCoordinates(double x = 0.0, double y = 0.0) : x_{ x }, y_{ y } {} double distanceTo(EuclideanCoordinates const& other) const { const auto dx = x_ - other.x_; const auto dy = y_ - other.y_; return std::sqrt(dx * dx + dy * dy); } }; class MyHeuristicFunction : public HeuristicFunction<int, double> { private: std::unordered_map<int, EuclideanCoordinates> map_; public: MyHeuristicFunction( std::unordered_map<int, EuclideanCoordinates> map) : map_{ map } {} MyHeuristicFunction(const MyHeuristicFunction& other) : map_{ other.map_ } { } MyHeuristicFunction(MyHeuristicFunction&& other) { map_ = std::move(other.map_); } MyHeuristicFunction& operator=(const MyHeuristicFunction& other) { map_ = other.map_; return *this; } MyHeuristicFunction& operator=(MyHeuristicFunction&& other) { map_ = std::move(other.map_); return *this; } ~MyHeuristicFunction() { } double estimate(int const& tail, int const& head) override { const auto point1 = map_[tail]; const auto point2 = map_[head]; return point1.distanceTo(point2); } }; class GraphData { private: DirectedGraph<int> graph_; DirectedGraphWeightFunction<int, double> weight_function_; MyHeuristicFunction heuristic_function_;
{ "domain": "codereview.stackexchange", "id": 42941, "lm_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, algorithm, pathfinding, c++20", "url": null }
python, google-translate def __init__(self, from_lang, to_lang, orig_str=None, filename=None): Don't use != or == when comparing with None like this: if filename != None: Write like this: if filename is not None: Actually, since filename is supposed to be a string, this would be the most natural way to write this condition: if filename: Avoid using bare except clauses like this as much as possible: except: res = "Failed to fetch translation from google." This is somewhat better: except Exception: res = "Failed to fetch translation from google." But it's best to use as specific exception type as possible. In this code: def translate(self): """ Parallelization using multiprocessing :return: """ pool = multiprocessing.Pool() self.trans_str = pool.map(self.translate_sentence, self.orig_str) It's not recommended to define attributes outside of __init__. It would be better to initialize the value in the constructor. It's strange that the docstring says: :type orig_str: str But then you have this logic: if orig_str is not None: self.orig_str = str(orig_str) If the parameter is supposed to be a string, then you can simply do this: if orig_str: self.orig_str = orig_str
{ "domain": "codereview.stackexchange", "id": 11080, "lm_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, google-translate", "url": null }
c#, winforms Title: Extendable way of providing metadata on a list We have a winforms application with a lot of grid views. These grids have some basic layout functions (text color, font weight, font style, ....). I need to make sure that other developers can make customizations to the layout of the grids without touching the base code. So this is the solution i came up with. I created a generic meta object that can house the different default properties and the customizable properties public class MetaObject<TModel> { public int ColumnOrder { get; } public bool Editable { get; } public Func<TModel,string> TextFormat { get; set; } public Func<TModel,string> FontStyle { get; set; } public Func<TModel,string> ColorCode { get; set; } } the customizable properties are funcs so the 'user' can insert some custom logic. I created a new object deriving from List so the data and the metaData are in the same object. public class ListWithMetaData<TModel> : List<TModel>, IListWithMetaData<TModel> { private Dictionary<string, MetaObject<TModel>> _metaData; public Dictionary<string, MetaObject<TModel>> MetaData { get => _metaData ?? ( _metaData = new Dictionary<string, MetaObject<TModel>>()); set => _metaData = value; } public MetaObject<TModel> GetMetaDataFor(Expression<Func<TModel, object>> property) { if (property.NodeType != ExpressionType.Lambda) return null; var lambda = (LambdaExpression) property; var memberExpression = ExtractMemberExpression(lambda.Body); if (memberExpression == null) { throw new ArgumentException("Selector must be member access expression", nameof(property)); } if (memberExpression.Member.DeclaringType == null) { throw new InvalidOperationException("Property does not have declaring type"); } var memberName = memberExpression.Member.Name;
{ "domain": "codereview.stackexchange", "id": 30599, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, winforms", "url": null }
general-relativity, newtonian-gravity, reference-frames, conservation-laws, collision Title: Is the center of mass in general relativity equal to the center of mass in newtonian gravity? Consider 2 point masses $A,B$ a distance $d$ away from each other without velocity or rotation spin. Is the center of mass in general relativity equal to the center of mass in newtonian gravity? In newtonian gravity the center of mass is where the particles collide, if they collide. Is the center of mass in general relativity also the place where the particles collide, if they collide? Or maybe the center of mass in general relativity is the place where the particles collide if they had no initial velocity or rotation spin? There is generally no center of mass in general relativity. The notion of center of mass becomes useful in Newtonian (and special relativistic) mechanics since because of simplifications we obtain by using it as a reference point. For instance, we could decouple the motion of COM from the relative motion of various parts of the system. But in general relativity there are generally no conservation of momentum. Moreover the notion of a point particle also has some problems. In certain special cases (such as for an isolated system with an asymptotically flat metric) in general relativity we could still define the notion of center of mass. For instance in the paper: Huisken, G., & Yau, S. T. (1996). Definition of center of mass for isolated physical systems and unique foliations by stable spheres with constant mean curvature. Inventiones mathematicae, 124(1), 281-311. doi:10.1007/s002220050054, (online pdf). the COM is defined not as a 'inner' point of a spacetime, but rather through foliation of asymptotic exterior, that is by considering the behavior of metric in the almost flat region. Such definition is essentially Newtonian. In general spacetime such expansion of the metric is impossible, so the notion of COM does not exist. Its nonexistence is illustrated by the process of relativistic swimming in a curved spacetime. This effect, suggested by J. Wisdom in the paper: Wisdom, J. (2003). Swimming in spacetime: Motion by cyclic changes in body shape. Science, 299(5614), 1865-1869. (free pdf).
{ "domain": "physics.stackexchange", "id": 28277, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, newtonian-gravity, reference-frames, conservation-laws, collision", "url": null }
atoms, mole, units Title: Effects of Changing Avogadro's Constant The Avogadro project suggests that we redefine the Avogadro constant to be equal to our best known estimate, $N_\mathrm{A} = 6.02214179 \times 10^{23}$, and redefine the kilogram based on the Avogadro constant. What happens if we define the Avogadro constant to be exactly $6 \times 10^{23}$ and reassign atomic weights correspondingly? Would any unforeseen complications arise from here? Example: Under current definitions, $N_\mathrm{A}$ atoms of carbon-12 weigh 12 g. If we redefine the constant to have the value $N_\mathrm{A}^\prime = 6.0\times 10^{23}$, then $N_\mathrm{A}^\prime$ atoms of carbon-12 would weigh $\pu{11.955879 g}$, which we would have to assign as the new atomic mass of carbon-12. As of May 20th 2019, the Avogadro constant will be set to $6.02214076 \times 10^{23}\ \rm{mol}^{–1}$, i.e. the Avogadro constant times one mole will be an integer, but not the one the OP asked about. In preparing for the switch of definition, the BIPM looked carefully at two ways of determining the constant, and then set it to the best estimate from experimental values, truncated to nine significant figures. This way, there will be minimal practical changes of units even though the definitions have changed. Also changed is what is defined vs. what is measured. For example, the molar mass of 12-C is now based on measurement, and could change (certainly in terms of how many significant figures are known) as measurement techniques improve. Setting the Avogadro constant to a dimensionless number as the OP asked about would make lots of relationships between quantities and constant dimensionally incorrect, such as $$ R = k_\mathrm{B} N_\mathrm{A}$$ with $k_\mathrm{B}$ the Boltzmann constant, R the universal gas constant and $N_\mathrm{A}$ the Avogadro constant.
{ "domain": "chemistry.stackexchange", "id": 11263, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "atoms, mole, units", "url": null }
orbit, stellar-dynamics This diagram below is an example of a perfectly stable 3 body orbit in a computer program, but like the pencil, a small push on any one of the 3 objects would send it towards instability.
{ "domain": "astronomy.stackexchange", "id": 2403, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "orbit, stellar-dynamics", "url": null }
ros-melodic Originally posted by MrMinemeet on ROS Answers with karma: 41 on 2019-07-17 Post score: 0 I opened an issue on Stackoverflow too. Eventually found the solution myself. Here is the link to Stackoverflow https://stackoverflow.com/questions/57077832/catkin-make-usr-bin-ld-cannot-find-lcsparse/57092644#57092644 Originally posted by MrMinemeet with karma: 41 on 2019-07-18 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 33453, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
visible-light Title: Modelling radiance profile of a light bulb For Graphics I need to model the shape and the radiance profile of an existing light bulb in order to use it in a ray-tracing application. I can freely choose the light bulb. The strategy must not be very detailed or very long, just a few lines. As most light bulbs don't offer the radiance profile, I wondered how to construct it from the given specifications. I'm allowed to make some assumptions. It would be of great help, if someone can guide me in a good direction. If the bulb was a perfect diffuser, each point on the light bulb would scatter all the light that struck it uniformly over a hemisphere. The surface of the bulb would appear uniformly bright. This would be the simplest assumption. If the bulb was perfectly clear, there would be no scattering. Light would travel in a straight line from the filament. The part of the surface between the filament and the observer would appear very bright, and the rest would not be visible. The reality is between the two extremes. You would have to measure the radiance to find anything concrete. If this matters, you could just assume it is somewhat brighter in the center and make up some smooth curve. Try some until your graphics looks good.
{ "domain": "physics.stackexchange", "id": 12320, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light", "url": null }
ros, urdf, openrave, collada-urdf Title: URDF using mimic joints and conversion to OpenRAVE format How is the current state of support for the "mimic" tag for joints in URDF files? On electric, it appears that I can set the tags, but they seem to be ignored by the joint state publisher (and gazebo, from looking at Q/A discussions from the past). Are they used by any ROS tools at all? What I'm most interested in at the moment is converting the urdf with mimic tags to the OpenRAVE COLLADA format (to generate ikfast in the end). The mimic tags seem to get lost in the conversion process, however. There seems to be code for the conversion in collada_urdf, so is this a bug? Example portion of the URDF file: <joint name="joint_j1" type="revolute"> <parent link="connectorj01"/> <child link="link1"/> <origin xyz="0 0.0933 0.0302" rpy="${M_PI_H} 0 ${3*M_PI_H}" /> <axis xyz="0 0 1" /> <limit lower="-1.5708" upper="1.5708" effort="10.0" velocity="1.5708" /> <dynamics damping="1.0" friction="1.0"/> </joint> <joint name="joint_j1m" type="revolute"> <parent link="link1"/> <child link="connectorj2"/> <origin xyz="0.253 0.003 0" rpy="0 0 0" /> <axis xyz="0 0 1" /> <limit lower="-1.5708" upper="1.5708" effort="10.0" velocity="1.5708" /> <mimic joint="joint_j1" multiplier="-1" offset="0"/> <dynamics damping="1.0" friction="1.0"/> </joint>
{ "domain": "robotics.stackexchange", "id": 10538, "lm_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, urdf, openrave, collada-urdf", "url": null }
c++, stream // function to sync up with hardware device. ie we actually write out data here int device_buffer::sync() { if(fp_) { fwrite(buffer_, 1, size_t(pptr() - pbase()), fp_); // reset put ptr setp(pbase(), epptr()); return 0; // success } else return EOF; // return EOF on device failure } Code to exercise: #include "device_ostream.hpp" int main () { device_ostream os; os.write("WRITE", 5); os << "Hi there, how are you today???" << "\n"; os << "Number: " << 33 << std::endl; // std::endl causes sync to be called even if buffer not full yet os << "ABCDEFGHIJKLMNOPQRSTUVWXYZ" << std::endl; os << "abcdefghijklmnopqrstuvwxyz" << std::endl; os << "ABCDEFGHIJKLMNOPQRSTUVWXYZ" << std::endl; if(os) os << "abcdefghijklmnopqrstuvwxyz" << std::endl; return 0; } You should not do this: class device_ostream : public std::ostream { public: device_ostream() : std::ostream(new device_buffer) {} ~device_ostream() { delete rdbuf(); } }; You do not know if the user of the class has reset the buffer while you were not watching. device_ostream data; .... MyImprovedStreamBuffer myBuffer; data.rdbuf(&myBuffer); // Your destructor will not play well with that.
{ "domain": "codereview.stackexchange", "id": 10714, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, stream", "url": null }
the-moon, earth, tidal-locking Title: Earth rising and setting from moon's perspective Why the earth is rising and setting seen from the moon, when the moon is tidally locked? Shouldn't the earth be always on the same spot because of the tidal lock, if observed from the moon? You're quite right. The Earth is (nearly) stationary in the Moon's sky. (I say "nearly" because the Moon is in a slightly elliptical orbit around the Earth, but rotates perfectly smoothly. This means that the Earth's motion through the Lunar sky is a bit faster when the Moon is at perigee and a bit slower when it's at apogee. Because the Moon is tide-locked, on average they match perfectly, but during the course of the sidereal month the Earth appears to move back and forth by a few degrees. The effect isn't huge, but it's easily observable with a telescope. See the Wikipedia article on "libration" for an OK discussion and a really great animated gif illustration of libration as viewed from Earth.) Is it possible that you're reacting to the amazing movie from Apollo 8 showing Earthrise over the Lunar horizon? It's been int he news a lot given that this is the 50th anniversary of the flight. If so, what you saw there was not from the Moon's surface, but from orbit around the Moon and the Earthrise happened as Apollo 8 came around from behind the moon (where the Earth is not visible in the sky) and the Earth first became visible around the edge of the Moon.
{ "domain": "astronomy.stackexchange", "id": 3419, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "the-moon, earth, tidal-locking", "url": null }
genome, assembly, nanopore, illumina Title: Improving prokaryotic assembly with other contig/scaffold-level data? I have what at first sight appears to be a high-quality MAG (~10 pieces, high completion%) that I built from a hybrid assembly (Illumina + Nanopore data) from a cyanobacterium. Workflow: Quality control (BBDuk) > Hybrid assembly (Unicycler) > co-binning multiple different samples (vamb) > Quality control (CheckM, anvi'o) *The Nanopore data is pretty old, and therefore I'd thought Unicycler might be a safer bet rather than long-read-first assemblers, due to the higher error rate The same strain also has 1-2 very fragmented genomes (100s of pieces) available in NCBI at scaffold level. The reads themselves are not available, so I can't just add them to the assembly. Is there a way to use the available NCBI genome(s) to try to check/polish mine? (I've checked out Improve a reference genome with sequencing data but it's already a few years old so I imagine different tools might be applicable) Thank you for your time! If your goal is to compare to the NCBI version I'd suggest using QUAST to compare the two assemblies, supplying the NCBI assembly as the reference genome (-r option I think). This will not guarantee anything, but you would expect the two assemblies to be fairly syntenic and to have good overlap of sequences. The tool includes visualization, but you could also use an approach like circoletto or dot plots for something a little more intuitive/simpler.
{ "domain": "bioinformatics.stackexchange", "id": 2376, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genome, assembly, nanopore, illumina", "url": null }
hilbert-space, operators, group-theory, commutator, coherent-states Here, I wonder what is the group that is represented by $a_i$ (i.e., what is $G$ in $a: G \rightarrow \mathbf{1}_\mathcal{F}$), and how to show $\{a_i\}_{i\in J}$ irreducibly represents that group. Note that Schur's Lemma is both formulated for groups and algebras. Altland & Simons use the Heisenberg Lie algebra generated by creation and annihilation operators and the identity operator. The representation is an infinite-dimensional irreducible Fock space. However, the standard formulation of Schur's Lemma assumes a finite-dimensional representation. Nevertheless, it is straightforward to prove eq. (4.7) directly by converting the coherent states into an eigenbasis for the number operators $\hat{n}_i=\hat{a}^{\dagger}_i\hat{a}_i $.
{ "domain": "physics.stackexchange", "id": 90753, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "hilbert-space, operators, group-theory, commutator, coherent-states", "url": null }
botany, toxicology Title: How can a plant resist glyphosate (Roundup) herbicide? In my area, the most common weeds that strongly resists (N-(phosphonomethyl)glycine) (glyphosate) are the horseweed, or mare's tail, Conyza canadensis, and Canada thistle, Cirsium arvense There are several other weeds with similar resistance. I use the brand Roundup on jobs where a complete kill is necessary. However, I sometimes have to go through again, with glufosinate, to control these weeds. I'd prefer not to, as the glufosinate lingers much longer in the soil. Glyphosate inhibits an enzyme used in the synthesis of the aromatic amino acids tryptophan, tyrosine, and phenylalanine. It is taken in by the stomata in the leaves, and is moved throughout the plant to all the points of growth, acting fastest on those plants which are undergoing fastest growth. I can't seem to find an article on how the weeds mentioned can tolerate this treatment. How do these weeds resist the glyphosate? I found a paper investigating the mechanism of glyphosate resistance in Conyza canadensis. They used 31P NMR to investigate the fate of the glyphosate in vivo. What they found is that the resistant plants are able to transport glyphosate into the vacuole: The following view of horseweed resistance to glyphosate emerges from the data presented herein. Glyphosate enters the cytoplasm of both R and S plant variants at the same rate. Within hours, however, glyphosate begins to occupy the vacuole in the R but not the S biotype. The identical pH values of R and S vacuoles speak against the possibility of a pH-driven process. This, coupled with the preferential movement of glyphosate from the cytosol to the vacuole in R tissue but not in S, suggests the presence of a transporter for glyphosate either specific to R or at a substantially greater concentration in R than in S tissue.
{ "domain": "biology.stackexchange", "id": 2537, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "botany, toxicology", "url": null }
learning » SEO When we take transpose, only the diagonal elements don’t change place. » C# Linear Algebra 11y: The Transpose of a Triple Product - Duration: 2:33. » C Article Summary X. And we notice also this is 2 x 4 times a 4 x 7 gives you a 2 x 7 matrix. » C++ STL Ad: » C++ Interview que. » Content Writers of the Month, SUBSCRIBE /Filter /FlateDecode Thus, the matrix B is known as the Transpose of the matrix A. » Feedback The solver that is used depends upon the structure of A.If A is upper or lower triangular (or diagonal), no factorization of A is required and the system is solved with either forward or backward substitution. » Data Structure For example, element at position a12 (row 1 and column 2) will now be shifted to position a21 (row 2 and column 1), a13 to a31, a21 to a12and so on. Thus Transpose of a Matrix is defined as “A Matrix which is formed by turning all the rows of a given matrix into columns and vice-versa.” If is an eigenvector of the transpose, it satisfies By transposing both sides of the equation, we get. returns the nonconjugate transpose of A, that is, interchanges the row and column index for each element.If A contains complex elements, then A.' i.e., (AT) ij = A ji ∀ i,j. The basic matrix product, %*% is implemented for all ourMatrix and also forsparseVector classes, fully analogously to R'sbase matrixand vector objects. We said that our matrix C is equal to the matrix product A and B. Now, we will understand the transpose matrix by considering two matrices P … B = A.' Numpy.dot () is the dot product of matrix M1 and M2. Enter rows and columns of matrix: 2 3 Enter elements of matrix: Enter element a11: 1 Enter element a12: 2 Enter element a13: 9 Enter element a21: 0 Enter element a22: 4 Enter element a23: 7 Entered Matrix: 1 2 9 0 4 7 Transpose of Matrix: 1 0 2 4 9 7 » About us A transpose will be denoted by original matrix with “T”
{ "domain": "desertdingo.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639694252315, "lm_q1q2_score": 0.8475412764478711, "lm_q2_score": 0.8723473730188542, "openwebmath_perplexity": 7917.3825798895095, "openwebmath_score": 0.21413716673851013, "tags": null, "url": "http://desertdingo.com/l7ocfce/viewtopic.php?1b9ddc=transpose-of-matrix-product" }
ros Title: pylon_camera Error: Grab was not successful Hi, I want to capture images from a Basler acA1300-60gm and the ROS pylon_camera node. I can open and control the camera with Pylon's PylonViewerApp. But when I'm starting the ROS node with roslaunch pylon_camera pylon_camera_node.launch I get error messages that the frames can't be grabbed: started roslaunch server http://192.168.1.2:45055/ SUMMARY ======== PARAMETERS * /pylon_camera_node/binning_x: 2 * /pylon_camera_node/binning_y: 2 * /pylon_camera_node/camera_frame: pylon_camera_node * /pylon_camera_node/camera_info_url: * /pylon_camera_node/device_user_id: 1 * /pylon_camera_node/image_encoding: mono8 * /pylon_camera_node/inter_pkg_delay: 11772 * /rosdistro: kinetic * /rosversion: 1.12.7 NODES / pylon_camera_node (pylon_camera/pylon_camera_node) auto-starting new master process[master]: started with pid [10507] ROS_MASTER_URI=http://localhost:11311
{ "domain": "robotics.stackexchange", "id": 27706, "lm_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 }
openi-tracker check_cxx_source_runs(" #include <pmmintrin.h> int main () { __m128d a, b; double vals[2] = {0}; a = _mm_loadu_pd (vals); b = _mm_hadd_pd (a,a); _mm_storeu_pd (vals, b); return (0); }" HAVE_SSE3_EXTENSIONS) You should copy-paste the C++ code there (everything between #include and }) into a file (e.g. /tmp/sse3_test.cpp). You would then compile that with a command such as g++ -msse3 /tmp/sse3_test.cpp -o sse3_test to generate the file to run. The -msse3 flag was picked because it was the flag set in the block just before this check_cxx_source_runs command. If you can then successfully run ./sse3_test , then you should be fairly certain that your CPU supports SSE3. I don't have a computer without SSE3 extensions to test it on, but that should emulate exactly what those checks in that CMake script are doing. Update It looks like the answer to the other question linked pointed out that NITE (a binary dependency of the tracker) was using SSSE3, not simply SSE3. As far as I can tell, your CPU doesn't support SSSE3, only SSE3. I don't know a good way of checking, but I can say that, on my Intel machines, ssse3 shows up in the /proc/cpuinfo output. Originally posted by Eric Perko with karma: 8406 on 2012-12-29 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 12226, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "openi-tracker", "url": null }
turing-machines, halting-problem, rice-theorem Title: Halting (on empty input tape) for an infinite subset of all Turing machines As is well known, there is no single procedure for deciding whether any given Turing machine halts on an empty input tape. This is easily shown, e. g., by applying Rice's theorem. But what if, instead of considering the entire set of Turing machines, we only focus on a subset thereof? Clearly, if the subset is finite, the problem is decidable. But if the subset is infinite, is there an easy way to prove its undecidability? Take, e.g., the following decision problem (let's call it EVEN): EVEN = determine whether any given Turing machine with an even index halts on an empty input tape. (Just to be clear about quantifiers, I mean: does there exist a procedure that is able, for any given Turing machine with an even index, to decide whether that machine halts on an empty input tape?) In this case, the considered set of Turing machines is infinite, but Rice's theorem is no longer applicable (a.f.a.i.k.) and even a diagonalization argument does not seem to be conclusive, since you may end up with a function with an odd index, so self-reference is lost. So my questions are: is EVEN undecidable? How can you prove its undecidability? what about other infinite subsets of TMs (for which we ask whether they halt on an empty input tape)? would this problem still be undecidable or does that depend on the subset? Regarding question 2, one could take the set of TMs that compute, say, f(x) = x, which certainly always halt; however, the set of indices of those TMs is not a recursive set, so the question seems ill-formulated. is EVEN undecidable? How can you prove its undecidability?
{ "domain": "cs.stackexchange", "id": 17470, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "turing-machines, halting-problem, rice-theorem", "url": null }
On the other hand, $(S \cap N)\cup (S \cap N^c)= S$ so $$\mu^*(S) \leq \mu^*(S \cap N) + \mu^* (S\cap N^c) .$$ Thus $\mu^*(S) = \mu^*(S \cap N) + \mu^* (S\cap N^c)$, so $N \in \mathcal{A}.$ That is, $N$ is measurable. -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9621075722839016, "lm_q1q2_score": 0.8177637079795942, "lm_q2_score": 0.8499711794579723, "openwebmath_perplexity": 90.55280698873298, "openwebmath_score": 0.9765017628669739, "tags": null, "url": "http://math.stackexchange.com/questions/117471/confused-about-property-almost-everywhere" }
electromagnetism, special-relativity, gauge-theory How do the four potentials become the four vector? Is the Lorentz transform related to gauge theory? Is gauge theory related to the development of the four vector? The scalar potential and magnetic vector potential are combined into a four-vector, $A_{\mu}=(\phi,\vec{A})$ which is a gauge field, and in the language of differential geometry, a 1-form. The Lagrangian of the field theory (i.e. Maxwell theory) is, $$\mathcal{L}=-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}$$ where $F_{\mu\nu} = \partial_{[\mu}A_{\nu]}$ is the field-strength tensor, a 2-form constructed from the exterior derivative of the potential. As you stated, it is a gauge theory with a $U(1)$ gauge symmetry. In gauge theory, the Fourier transform arises when attempting to quantize the theory. In canonical quantization we expand it as, $$A_{\mu}(x)=\int \! \frac{\mathrm{d}^3 p}{(2\pi)^3} \frac{1}{\sqrt{2|\vec{p}|}}\sum_{\lambda=0}^3 \epsilon^\lambda_\mu(\vec{p})\left[a^\lambda_{\vec{p}}\,e^{i\vec{p}\cdot \vec{x}} + a^{\lambda \dagger}_{\vec{p}} \, e^{-i\vec{p}\cdot \vec{x}} \right]$$ in Lorenz gauge$^{\dagger}$; this is known as the '(Fourier) mode expansion' where the Fourier coefficients are promoted to operators which are used to construct the Fock space of the theory.
{ "domain": "physics.stackexchange", "id": 13167, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, special-relativity, gauge-theory", "url": null }
biochemistry Title: Why are omega-3 fatty acids so easily oxidized when they're incorporated in cellular membranes? Apparently, this has led to results with clinical significance, as we can see at http://extremelongevity.net/2011/10/03/daily-fish-oil-consumption-may-reduce-lifespan/... The researchers fed a special genetic variety of mice diets that either included 5% daily fish oil + 5% safflower oil or instead 10% daily safflower oil. The mice used were SAMP8 mutants that were bred to have accelerated aging and shortened lifespans. These mice are often used in longevity experiments because their average lifespans are only typically one year. They were fed these diets from 12 weeks of age on. The researchers hypothesized since fish oil is so easily oxidized it may lead to greater oxidative stress within cells and thus actually accelerate aging, a process believed in part due to accumulative damage from oxidative stress. Safflower oil is an omega-6 fatty acid and is not readily oxidized – it could have beneficial effects without causing oxidative stress. Let's not debate the clinical significance here - but I do wonder - why are omega-3 fatty acids so easily oxidized as compared to omega-6 fatty acids? I think the explanation for this description of fish oils as "easily oxidised" can be found in the Introduction to the actual paper (Nutrition 27 (2011) 334–337) that is cited in the article linked to in the question.
{ "domain": "biology.stackexchange", "id": 546, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry", "url": null }
javascript, php, security, image, .htaccess public_html/php_scripts/fetch_images.php <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/../secure_php_scripts/fetch_images.php"); secure_php_scripts/fetch_images.php <?php try { $data["outcome"] = true; $directory = $_SERVER['DOCUMENT_ROOT'] . "/../secure_images/"; $images = glob($directory . "*.{[jJ][pP][gG],[pP][nN][gG],[jJ][pP][eE][gG]}", GLOB_BRACE); $fileinfo = finfo_open(FILEINFO_MIME_TYPE); for ($i = 0; $i < count($images); $i++) { $extention = finfo_file($fileinfo, $images[$i]); header('Content-Type: ' . $extention); $data["extention"][$i] = $extention; $data["images"][$i] = base64_encode(file_get_contents($images[$i])); } echo json_encode($data); } catch(Exception $e) { $data["outcome"] = false; $data["images"][0] = []; echo json_encode($data); } secure_images/.htaccess #Deny access to .htaccess files <Files .htaccess> order allow,deny deny from all </Files> #Enable the DirectoryIndex Protection, preventing directory index listings and defaulting Options -Indexes DirectoryIndex index.html index.php /index.php #Securing directories: Remove the ability to execute scripts AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi Options -ExecCGI First, to your questions Do you spot anything wrong regarding permissions?
{ "domain": "codereview.stackexchange", "id": 32536, "lm_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, php, security, image, .htaccess", "url": null }
ros, create-autonomy, create2 Originally posted by science00000 on ROS Answers with karma: 20 on 2016-12-07 Post score: 0 Original comments Comment by mgruhler on 2016-12-08: This seems like there are problems with access rights or the shebang. crate_2.launch just starts one node, robot_state_publisher and it uses xacro to evaluate the urdf. Is xacro installed? From source? Did you copy something over using a windows PC? Did you change the launchfile? Comment by science00000 on 2016-12-08: Hi, I try to check xacro file rosrun xacro xacro.py ~/dev/catkin_ws/src/create_autonomy/ca_description/urdf/create_2.urdf.xacro output err as below : xacro.XacroException: Some parameters were not set for macro xacro:create_base **Comment by [science00000](https://answers.ros.org/users/25431/science00000/) on 2016-12-08**:\ In file create_base.urdf.xacro the parameter wheel_separation not set to specific value I try set one but have another err xacro.XacroException: Invalid parameter "wheel_separation" while expanding macro "xacro:create_base" **Comment by [science00000](https://answers.ros.org/users/25431/science00000/) on 2016-12-09**:\ Hi mig I have modified launch file for debug then have error --> OSError: [Errno 8] Exec format error thanks you :) Maybe it has something to do with macro default parameters added in Indigo (not in Hydro)? I guess xacro would not be happy with this line in particular. You could try removing all the parameters that have a default and just hardcode the values in create_base_gazebo.urdf.xacro. Originally posted by jacobperron with karma: 1870 on 2016-12-08 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 26432, "lm_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, create-autonomy, create2", "url": null }
slam, navigation, amcl, gmapping NODES / agv_slam_gmapping (gmapping/slam_gmapping) ROS_MASTER_URI=http://localhost:11311 process[agv_slam_gmapping-1]: started with pid [10607] [ INFO] [1655887974.042633926]: Laser is mounted upwards. -maxUrange 3 -maxUrange 24.99 -sigma 0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05 -srr 0.1 -srt 0.2 -str 0.1 -stt 0.2 -linearUpdate 1 -angularUpdate 0.2 -resampleThreshold 0.5 -xmin -10 -xmax 10 -ymin -10 -ymax 10 -delta 0.05 -particles 100 [ INFO] [1655887974.047152824]: Initialization complete update frame 0 update ld=0 ad=0 Laser Pose= 2.09378e-05 4.02459e-09 -9.60449e-05 m_count 0 Registering First Scan
{ "domain": "robotics.stackexchange", "id": 37787, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, amcl, gmapping", "url": null }
ros, parameter, rosparam Title: Running ROS node with a numeric parameter passed as string doesn't work I am trying to run the IAI Kinect2 Bridge node as follows, in order to use multiple sensors: $ kinect2_bridge _sensor:=1234567890 But the node does not recognize the provided sensor ID and falls back to default. The issue here seems to be, that ROS parses this parameter as number (and stores it as an int?) without me being able to force it being a string. This code: priv_nh.param("sensor", sensor, std::string("")); Then tries to read this parameter, but in all subsequent code, sensor.empty() is true. Seems that the parameter is an int, then fails the type check and gets ignored. (Source from here: https://github.com/code-iai/iai_kinect2/blob/master/kinect2_bridge/src/kinect2_bridge.cpp#L248 ) How can I force passing _sensor:=.... as a string, despite it being only numbers without using a launch file? Thanks! Originally posted by Crusty on ROS Answers with karma: 70 on 2016-06-07 Post score: 1 This seems like a bit of a hack, but I'll bet the following would work: rosrun kinect2_bridge kinect2_bridge _sensor:="'123456'" EDIT The above "hack" does indeed trick the parameter into being interpreted as a string. However, this only works because adding the extra set of quotes means the inner value can't be converted into an int32 by boost::lexical_cast. So you end up with a string parameter with an extra quote character on both ends (which is not what is really wanted, or needed). Relevant lines of code in param.cpp. Bottom line: not sure how to produce OP's goal. A launch file could certainly fix the issue. Alternatively, the kinect2_bridge package could be patched to expect the device serial number to be an int rather than a string. All of my Kinect2 devices have purely numeric serial numbers, so I'd expect this would work.
{ "domain": "robotics.stackexchange", "id": 24851, "lm_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, parameter, rosparam", "url": null }
algorithm, c, integer Title: Program to evaluate powers of complex numbers I'm trying to develop a simple program to evaluate integral powers of a complex number \$z\$ , that is, \$z^n\$, where \$z\$ is in the algebrical form \$a+i b\$ and \$n \in \mathbb{Z} ^{*} _{+}\$. How I was trying to proceed: First, I defined a product function, and next I intended to define a exponentiation function inside of which I iterated the product function (the code can bee seen below). Is it correct? Is there a more efficient alternative for doing that? include <stdio.h> include <math.h> struct complex { float real,imag; }; struct complex product (struct complex x, struct complex y){ /* using the distributive property, (a+ib)(c+id) = (ac-bd)+i(ad+bc)*/ struct complex z; z.real = (x.real * y.real)- (x.imag * y.imag); z.imag = (x.real * y.imag) + (x.imag * y.real); return z; }
{ "domain": "codereview.stackexchange", "id": 12414, "lm_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, c, integer", "url": null }
photons, photoelectric-effect, interactions We see that the amount of energy exchanged is maximized when $\theta$ approaches $180$ degrees, at which point the energy transferred is $$E_{T}=E(1-\frac{1}{1+\frac{2E}{m_{e}c^{2}}}).$$ We call this maximum amount of energy absorbed during Compton scattering the Compton edge. Since the energy of the scattered gamma ray must be positive, we see that the energy transferred to the detector through Compton scattering $\eqref{2},$ which has its maximum at the Compton edge, is necessarily smaller than the energy transferred when all of the gamma ray's energy is absorbed by the detector $\eqref{1}.$
{ "domain": "physics.stackexchange", "id": 45720, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "photons, photoelectric-effect, interactions", "url": null }
python, tkinter def add_number_to_screen(): global tile_frame_column_counter global tiles_make_number_counter global tile_frame_column global xpos global ypos if not tile_numbers: return rand = random.choice(tile_numbers) tile_frame_column[tile_frame_column_counter] = Button(root, text=rand, font="Helvetica 16 bold") tile_frame_column[tile_frame_column_counter].place(x=xpos, y=ypos) tile_numbers.remove(rand) # remove that tile from list of tiles xpos += 80 if (len(tiles_make_number) % 7 == 0) & (len(tiles_make_number) > 0): xpos = 35 ypos += 80 tile_frame_column[tile_frame_column_counter].place(x=xpos, y=ypos) xpos += 80 tiles_make_number[tiles_make_number_counter] = rand tile_frame_column_counter += 1 tiles_make_number_counter += 1 root.after(10, add_number_to_screen) root.after(10, add_number_to_screen) root.mainloop() if __name__ == '__main__': main()
{ "domain": "codereview.stackexchange", "id": 27903, "lm_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, tkinter", "url": null }
sql, sql-server Title: Role-based access control query I use SQL Server, and though not pertinent here, Railo's CFML engine. I'm not great at SQL Joins, but I worked through this one and got the result set that I want. This particular SQL will only ever return 10 to 20 records, so even if it's a weak method, I'd probably never see a lot of grief from it since it's on an admin page to edit user profiles. However, obviously it's best to learn early to improve, before habits set in. It's conceivable, and likely, that I'll encounter a similar situation in the future where the potential size of the result could be several times larger. It's also possible that there's a faster way to retrieve the same results. The goal of this page is to list out the user details, and a list of roles along the side with checkboxes. That's easy to code. I'm not asking for help with that. This is the SQL that I came up with, and I'll explain my db layout below it. select r.roleID, r.roleTitle, pu.*, 'constant' as qc from roles r left outer join (select u.*, p.roleID as xrole from permissions p left join users u on p.userID = u.userID and p.userID = 2) pu on pu.xrole = r.roleID and pu.userID = 2 order by len(username) desc (Both occurrences of the number 2 are merely to test, this will naturally be replaced with a variable in my .cfm page) I have three tables: Users - typical users table (UserID, Username, other personal details Permissions Table (UserID, RoleID) Permissions, likely obvious, links the other two tables. If a User doesn't have an entry matching their userID and the role they're trying to access, can't access the role. Roles (RoleID, RoleTitle)
{ "domain": "codereview.stackexchange", "id": 9756, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sql, sql-server", "url": null }
python, numpy, data-visualization # theoretical N for plotting and fitting data points def N_theo(a,b,A,C,th,phi): '''Accepts a,b,th,phi in DEGREES''' a,b,th,phi = np.pi/180 * np.array([a,b,th,phi]) return C + A*( (np.sin(a)*np.sin(b)*np.cos(th))**2 + (np.cos(a)*np.cos(b)*np.sin(th))**2 + 1/4*np.sin(2*a)*np.sin(2*b)*np.sin(2*th)*np.cos(phi) ) # range of values for the x-axis deg = np.linspace(0,180) # plotting plt.figure(fname_epr_quant) plt.cla() for (l_seriesname,l_vars),color in zip(eq_dict.items(),'rgbk'): x = l_vars['HWP A'] y = l_vars['AB-acc'] b_plt = l_vars['HWP B'][0] N_plt = lambda a,A,C,th,phi: N_theo(a,b_plt,A,C,th,phi) popt, pcov = curve_fit( N_plt, x, y, bounds=([100,1,30,15],[1000,100,60,35]) ) print(b_plt,popt) # print fitting parameters for later analysis plt.plot( x, y, '.--'+color, label=l_seriesname+' data' ) plt.plot( deg, N_theo(deg, b_plt, *popt), '-'+color, label=l_seriesname+' fit' ) plt.legend() plt.show(block=False)
{ "domain": "codereview.stackexchange", "id": 25979, "lm_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, numpy, data-visualization", "url": null }
performance, algorithm, rust, median Your calculation of the ranges seems to be just checking for the max value; I assume that's a mistake. Also, why are you ignoring the alpha channel? Can we make stuff more elegant? If we replace Color::channel_val with ColorChannel::value, then a lot of the places where we're repeating stuff per-channel can be reduced. channel_value_by_index no longer needs to be a defined function, for example. You can also add a higher-order Color builder function. This brings the code down to something that feels more intuitive to me: use std::env; use image::{Rgba, RgbaImage}; use image::error::ImageResult as ImageResult; use image::io::Reader as ImageReader; #[derive(Debug,Clone,Copy)] pub struct Color { pub r: u8, pub g: u8, pub b: u8, pub a: u8, } #[derive(Debug,Clone,Copy)] pub enum ColorChannel { R, G, B, A, } impl ColorChannel { pub const ALL: [ColorChannel; 4] = [Self::R, Self::G, Self::B, Self::A]; pub fn value(&self, color: &Color) -> u8 { match self { ColorChannel::R => color.r, ColorChannel::G => color.g, ColorChannel::B => color.b, ColorChannel::A => color.a, } } } impl Color { pub fn from_fn<F>(f: F) -> Option<Color> where F: Fn(ColorChannel) -> Option<u8> { Some(Color {r: f(ColorChannel::R)?, g: f(ColorChannel::G)?, b: f(ColorChannel::B)?, a: f(ColorChannel::A)?, }) } }
{ "domain": "codereview.stackexchange", "id": 43017, "lm_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, algorithm, rust, median", "url": null }
vba, ms-word Compare to: Private Sub V4ToV6Button_Click() ActiveDocument.Sections(2).Range.Font.Hidden = True ActiveDocument.Sections(4).Range.Font.Hidden = True ActiveDocument.Sections(6).Range.Font.Hidden = True ActiveDocument.Sections(8).Range.Font.Hidden = True ActiveDocument.Sections(10).Range.Font.Hidden = True Section15Complete.Caption = "" Section15Complete.BackColor = RGB(255, 255, 255) ActiveDocument.Tables(1).Rows(22).SetHeight 1, wdRowHeightExactly SQLScriptCheckbox.Value = True SQLScriptCheckbox.Height = 1 SQLScriptCheckbox.Width = 1 SQLScriptCheckbox.Enabled = False RestoreEmailScriptCheckBox.Value = True RestoreEmailScriptCheckBox.Height = 1 RestoreEmailScriptCheckBox.Width = 1 RestoreEmailScriptCheckBox.Enabled = False SQLCleanScriptCheckBox.Value = True SQLCleanScriptCheckBox.Height = 1 SQLCleanScriptCheckBox.Width = 1 SQLCleanScriptCheckBox.Enabled = False SandboxJobHasBeenSetUpCheckBox.Value = True SandboxJobHasBeenSetUpCheckBox.Width = 1 SandboxJobHasBeenSetUpCheckBox.Height = 1 SandboxJobHasBeenSetUpCheckBox.Enabled = False LedgerListComplete.Caption = "N/A" LedgerListComplete.BackColor = RGB(139, 0, 139) BankBalanceComplete.Caption = "N/A" BankBalanceComplete.BackColor = RGB(139, 0, 139) BankReconcComplete.Caption = "N/A" BankReconcComplete.BackColor = RGB(139, 0, 139) BudgetComplete.Caption = "N/A" BudgetComplete.BackColor = RGB(139, 0, 139) AllocationComplete.Caption = "N/A" AllocationComplete.BackColor = RGB(139, 0, 139)
{ "domain": "codereview.stackexchange", "id": 22518, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, ms-word", "url": null }
visible-light, geometric-optics Coming to the second question. It is useful to think that the color of the light is associated to the frequency, which never changes in refraction, reflection and diffraction processes. Frequency is important because the "sensors" in our eye are sensitive to the photon energy, which depends on the frequency. On the other hand, the speed of light in our eye depends on the material of the eye itself, so there is also a well defined and fixed relation between wave length and frequency! So said, a beam with a given color, after passing through a glass prism or a lens, will still have the same color. Of course, its wave length will change along its path, but our eye will never know it. Finally, what does it mean that a beam is the superposition of various wave lengths? This would deserve a separate question, but this can help to understand the principles: https://demonstrations.wolfram.com/SuperpositionOfWaves/
{ "domain": "physics.stackexchange", "id": 57646, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light, geometric-optics", "url": null }
string-theory &\times \Bigg\{(-2i\alpha')^3 \left( \frac{k_2^\mu}{y_{12}} + \frac{k_3^\mu}{y_{13}} \right) \left( \frac{k_1^\nu}{y_{21}} + \frac{k_3^\nu}{y_{23}} \right)\left( \frac{k_1^\sigma}{y_{31}} + \frac{k_2^\sigma}{y_{32}} \right) \nonumber\\ & + (-2\alpha')(-2i\alpha') \left[ \left( \frac{k_2^\mu}{y_{12}} + \frac{k_3^\mu}{y_{13}} \right) \frac{\eta^{\nu\sigma}}{y_{23}^2} + \left( \frac{k_1^\nu}{y_{21}} + \frac{k_3^\nu}{y_{23}} \right) \frac{\eta^{\mu\nu}}{y_{13}^2} +\left( \frac{k_1^\sigma}{y_{31}} + \frac{k_2^\sigma}{y_{32}} \right) \frac{\eta^{\mu\sigma}}{y_{12}^2} \right]\Bigg\}\nonumber\\ & \times \mathrm{tr} {\lambda^{a_1} \lambda^{a_2} \lambda^{a_3}} + (k_2,a_2,\epsilon_2) \leftrightarrow (k_3,a_3,\epsilon_3) \end{align} The first thing we note is that because of momentum conservation and mass-shell condition \begin{align}
{ "domain": "physics.stackexchange", "id": 66628, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "string-theory", "url": null }
\documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{amsmath,amsfonts,amssymb} \usepackage[margin=2cm,showframe]{geometry}% http://ctan.org/pkg/geometry \newcommand{\dx}{\mathrm{d}x} \setlength{\parindent}{0pt}% No paragraph indent \begin{document} 43. Let $f(x) = \sqrt{x}$, $x = 100$, $\dx = -0.6$. \bigskip $\begin{array}{@{}r@{}l@{}} f(x + \Delta x) & {}\approx f(x) + f^{\prime}(x)\, \dx \\ & {}= \sqrt{x} + \frac{1}{2\sqrt{x}}\, \dx \\ f(x + \Delta x) & {}= \sqrt{99.4} \\ & {}\approx \sqrt{100} + \frac{-0.6}{2\sqrt{100}} = 9.97 \end{array}$ \bigskip Using a calculator: $\sqrt{99.4} \approx 9.96995$ \vfill 44. Let $f(x) = \sqrt[3]{x}$, $x = 27$, $\dx = -1$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104982195785, "lm_q1q2_score": 0.809484726083589, "lm_q2_score": 0.8376199633332891, "openwebmath_perplexity": 2492.8847200599894, "openwebmath_score": 0.9947049021720886, "tags": null, "url": "https://tex.stackexchange.com/questions/138874/why-are-only-part-indents-nicely-but-the-rest-dont" }
spectroscopy, x-rays, dispersion Title: Principle of Energy Dispersive x-ray Spectroscopy I have a question about the EDS I don't understand how the detector can differentiate the Energy of incident x-ray simultaneously. In my thought, the emitted x-ray from the sample have different energies and It reaches the detector simultaneously in general. So the current made by that x-ray photon bunches is gathered It's impossible to differentiate the energy of each x-ray photon. Am I wrong? But the data of EDS shows the histogram of dispersive energy of emitted x-ray. Plz let me know what I am wrong. I don't understand how the detector can differentiate the Energy of incident x-ray simultaneously. The simple answer is that the detector cannot. Ideally the energy of a single photon is converted into a voltage pulse of size related to the energy of the photon. An incoming photon produces electron-hole pairs and the resulting current pulse is integrated by a fet amplifier whose charge output is then “shaped” into a voltage pulse. The flux rate of incoming photons is adjusted so that the dead time of the detector and peak pile up have a small effect on the accuracy of the output of the detector. Furthermore sophisticated signal processing of the output voltage pulses can reduce the errors due to these effects. This paper gives much more information about the whole process.
{ "domain": "physics.stackexchange", "id": 54960, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "spectroscopy, x-rays, dispersion", "url": null }
python, ros2, roslaunch Comment by danzimmerman on 2023-06-27: Updated my answer with info there. I am not sure there's any way besides OpaqueFunction to get a valid context. It's the only way I know. Creating a new one in generate_launch_description() seems to give an empty dict for context.launch_configurations and a subsequent error: https://github.com/danzimmerman/dz_launch_examples/blob/rolling/launch/multi_nodes_no_opaque.launch.py Comment by SébastienL on 2023-06-27: Well it seems my problem is solved thank you. I'd already tried the solution with OpaqueFunction but i failed at the time. I suppose that forgetting to put my argument in the LaunchDescription was a prerequisite for testing the other solutions. Your example files are very good, simple and clear !
{ "domain": "robotics.stackexchange", "id": 38429, "lm_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, ros2, roslaunch", "url": null }
Write the complex number polar!: Write the complex number from polar to rectangular form and 2\pi the trigonometric form complex! Fields with an asterisk ( * ) 0 +9i therefore only consider the polar form of the complex polar form of 9i... 9 ) 2 + ( 9 ) 2 + ( 9 ) 2 + ( 9 2!, it means we 're having trouble loading external resources on our.! Th quadrant Convert the rectangular equation to polar and exponential forms # e^ -ix. Real part of About this Quiz & Worksheet we want to Convert complex numbers polar! Make with the x_axis ’ ll look at both of those as well as by coordinates! Online STEM Summer camps either # pi/2 # or # ( 5pi ) /2 # and find powers of numbers... 31 + 75j where is the distance from the origin on the number..Kastatic.Org and *.kasandbox.org are unblocked the phase in degrees, not radians! To hundreds of complex numbers Subsection Introduction = 3√10 5+9i b } Convert the rectangular equation polar! Exponential forms equivalent polar form in this Quiz and Worksheet combination make sure that domains! Inverse tan of 9 radical 3/ 9 or pi/3 of a complex number polar! To a complex number b ) Convert the complex number to polar and exponential forms # (... Sqrt ( 6^2 ) = 3√10 + 9i in polar form in this given coordinates as... Find the length of the complex number is the trigonometric form of a complex … please here! ) /2 # points in the set of complex numbers as vectors, as well as couple... A + b I is called the real part of About this Quiz and Worksheet combination 10.3 we the! -2 + 9i in polar form of a complex number in polar form for complex numbers 2 =.! Form with argument between 0 and polar form of 9i be in the correct order!... Summer Courses what is the modulus and is the trigonometric form of a complex to. Questions that are explained in a way to represent a complex number is the distance from the origin form! On the complex number in polar form … the polar form! View Courses! On complex polar form of 9i graphically as a couple of nice facts that arise them! Is
{ "domain": "zong-music.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9799765569561563, "lm_q1q2_score": 0.8101581796404121, "lm_q2_score": 0.8267117962054048, "openwebmath_perplexity": 770.443160506108, "openwebmath_score": 0.8276697397232056, "tags": null, "url": "https://zong-music.com/ha2ten/polar-form-of-9i-9b504e" }
\begin{align*} \lim_{y\to 0} \frac{\displaystyle \log\left(1+\frac{y}{2}\right)}{\displaystyle \frac{y}{2}\cdot 2} &= \frac{1}{2}\\\\ \lim_{y\to 0} \frac{4^y-1}{y}-1 &= \log{4}-1\\\\ \lim_{y\to 0} \frac{\sin\left(\pi\, y\right)}{\pi\, y}\cdot \pi &= \pi \end{align*} and for the remaining one we can use L'Hôpital's rule: \begin{align*} \lim_{y\to 0} \frac{\left(8+y\right)^{1/3}-\left(4+3\, y\right)^{1/2}}{y} &= \lim_{y\to 0} \frac{1}{3}\left(8+y\right)^{-2/3}-\frac{3}{2}\left(4+3\, y\right)^{-1/2}\\ &= \frac{1}{3\cdot 4}-\frac{3}{4} = -\frac{2}{3}\\ \end{align*} Combining all these in $(1)$, we see that \begin{align*} \lim_{x \to 1 }\frac {({\log} (1+x)-{\log}\space 2)(3\times4^{x-1}-3x)}{[(7+x)^{1/3}-(1+3x)^{1/2}]{\sin}\space \pi x} = \frac{9}{4\, \pi}\log\left(\frac{4}{e}\right)\approx 0.276662956773403 \end{align*}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517488441416, "lm_q1q2_score": 0.8085669076293883, "lm_q2_score": 0.8267117855317473, "openwebmath_perplexity": 1125.6201421422154, "openwebmath_score": 0.9999988079071045, "tags": null, "url": "http://math.stackexchange.com/questions/764539/a-horrible-looking-limit" }
compilers, floating-point, numerical-algorithms Title: Program transformations for numeric stability There's tons of research on program transformations for optimization. Is there any research on transformations that improve numeric stability? Examples of such transformations might include: Transform $\log(\exp(a)+\exp(b))$ into $\max(a,b)+\log(\exp(a-\max(a,b))+\exp(b-\max(a,b)))$ Convert multiplication of an inverse matrix times a vector into the solution to a linear system solver. Automatically perform multiplications of small numbers in the log domain. All the tricks I'm aware of for better numeric stability like this are pretty standard and something that every "good" numeric programmer always does. Since the tricks are so standard and always applied, it makes sense that the compiler might be able to do them for us. There actually is some research on improving the numerical stability of floating point expressions, the Herbie project. Herbie is a tool to automatically improve the accuracy of floating point expressions. It's not quite comprehensive, but it will find a lot of accuracy improving transformations automatically. Cheers, Alex Sanchez-Stern
{ "domain": "cs.stackexchange", "id": 5033, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "compilers, floating-point, numerical-algorithms", "url": null }
$$y-\sqrt2=-(x-0)\implies y=-x+\sqrt2$$ Since the given second line is parallel to the given first one (why?), these two are tangent to point of the circle on end points of a diameter (why?). End the exercise now. • Thank you ! The line on which the points lie is y=x+sqrt(2) . I also know the tangents are parallel but I could not understand the equation of the line which you have written. Thank you – Seeker1201 May 27 '15 at 13:06 • Could you please explain the equation? – Seeker1201 May 27 '15 at 13:12 • What equation? The line's?: Its slope is $\;-1\;$ and it passes through $\;(0,\sqrt2)\;$,so according to a well knonw formula that is the equation. – Timbuc May 27 '15 at 13:21 Let the given point be $A(0, \sqrt{2})$ which lines on the lies on the line: $y=x+\sqrt{2}$, Now draw the perpendicular say $AN$ from the point $A(0, \sqrt{2})$ to the parallel line: $y=x-2\sqrt{2}$ at the point N.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9752018354801189, "lm_q1q2_score": 0.8105322237785384, "lm_q2_score": 0.8311430457670241, "openwebmath_perplexity": 221.97232353739764, "openwebmath_score": 0.880295991897583, "tags": null, "url": "https://math.stackexchange.com/questions/1300964/coordinates-of-the-center-of-the-circle" }
c#, winforms Title: Calculate subtotals and totals from a form with many decimal values I've got 17 currency fields on a form and need to do some calculations with their values. I wrote this method some time ago and have come back to try and refactor it to make it more efficient and/or more readable. Could I have some pointers please? Note: The variables appended with d are the decimals used to hold the field values, their counterparts without the d are the fields themselves. I am aware that variables could do with renaming to make more sense. Hopefully it's fairly clear what this is doing by looking at the comments. private void getTotals() { //declarations of decimal variables decimal curPurc1d; decimal curPurc2d; decimal curPurc3d; decimal curPurc4d; //purItemxCost decimal curItem1Totd; decimal curItem2Totd; decimal curItem3Totd; decimal curItem4Totd; //curItemxTot decimal LessItem1Costd; decimal LessItem2Costd; decimal LessItem3Costd; decimal LessItem4Costd; decimal LessItem5Costd; //LessItemxCost decimal ditem1Cost = 0; decimal ditem2Cost = 0; decimal ditem3Cost = 0; decimal ditem4Cost = 0; //Full cost of items
{ "domain": "codereview.stackexchange", "id": 32867, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, winforms", "url": null }
javascript const data = [{"scenario":{"scenarioId":41511,"flag":1,"probability":0.92},"profile":[{"profileId":1,"scenarioId":41511,"capacity":0.77},{"profileId":2,"scenarioId":41511,"capacity":0.74}]},{"scenario":{"scenarioId":41521,"flag":1,"probability":0.8},"profile":[{"profileId":3,"scenarioId":41521,"capacity":0.96}]},{"scenario":{"scenarioId":41530,"flag":0,"probability":0.95},"profile":[{"profileId":4,"scenarioId":41530,"capacity":0.73},{"profileId":5,"scenarioId":41530,"capacity":0.92}]},{"scenario":{"scenarioId":41540,"flag":0,"probability":0.85},"profile":[{"profileId":6,"scenarioId":41540,"capacity":0.88}]},{"scenario":{"scenarioId":41551,"flag":1,"probability":1},"profile":[{"profileId":7,"scenarioId":41551,"capacity":0.88},{"profileId":8,"scenarioId":41551,"capacity":0.99}]}]; const keepers = data .filter(({ scenario }) => scenario.flag === 1 && scenario.probability > 0.9) .map(({ scenario, profile }) => { return { ...scenario, profile } }) console.log(keepers)
{ "domain": "codereview.stackexchange", "id": 44119, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript", "url": null }
algorithm, computer-vision, matlab Title: How to use computer vision to find corners of a soccer field based on location coordinates? I want to use computer vision to allow my robot to detect the corners of a soccer field based on its current position. Matlab has a detectHarrisFeatures feature, but I believe it is only for 2D mapping. The approach that I want to try is to collect the information of the lines (using line detection), store them in a histogram, and then see where the lines intersect based on their angles. My questions are: How do I know where the lines intersect? How do I find the angles of the lines using computer vision? How do I update this information based on my coordinates? I am in the beginning stages of this task, so any guidance is much appreciated! I assume that you are familiar with homogeneous transformations and the meaning of global and local coordinate frames. If not, global frame is the fixed frame; a reference frame for your whole problem, such as the starting position of your robot. Local frame should be placed anywhere on your robot, preferably in the middle-point of the virtual line (called "robot base") that connects the two actuating wheels in the back of your robot (given that you follow the differential drive setup). If not, just place the local frame anywhere that makes sense on the robot, such as its geometrical center. Answering your questions: How do I know where the lines intersect? The accepted answer in this is by far the best I have seen around, which I have also used successfully for a project regarding robotic exploration in an unknown maze. How do I find the angles of the lines using computer vision? You DON'T need computer vision for that. For every line, pick 2 points expressed in global frame (x1,y1),(x2,y2) and calculate the slope of the line as: lambda = (y2-y1) / (x2-x1) Then the angle of the line is atan(lambda), in global frame. Do this for all lines and then subtract the angles of any two lines to find their relative angle (pay attention to the sign). Alternatively, I would personally use the RANSAC algorithm to de-noise the detected points and give me the line equation based on the consensus of all points. This line equation should already have the slope in it: y = ax + b
{ "domain": "ai.stackexchange", "id": 543, "lm_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, computer-vision, matlab", "url": null }
deep-learning, classification, data-augmentation Title: What brings the performance difference in Deep Learning with different data augmentation strategies? I am studying the performance of deep learning models toward abnormality detection in chest X-rays. Due to sparsity of data, I augment the data using different augmentation strategies including: Traditional augmentation methods (Gaussian smoothing, unsharp masking, and minimum filtering) Generative Adversarial Networks Contrary to the existing literature, I find that the models showed promising results with traditional augmentation methods (that i have mentioned herewith) than with GAN-generated synthetic images. What brings this performance difference? In general, you have to be careful when using data augmentation. For example, doing rotation for this kind of image makes sense, we expect to see any of these images as potential 'real-life' example : However, doing rotation for this kind of image is less meaningful. We don't expect to see this in 'real-life' example : And GAN potentially makes generated image meaningless. If your GAN produce 'thrash' augmented-data, then your network will train and learn 'thrash', which you don't want. When you are training your model on GAN generated images, you're actually training your model to recognize GAN-generated image, not real-life example. Sources: - towardsdatascience - quora question
{ "domain": "datascience.stackexchange", "id": 4173, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "deep-learning, classification, data-augmentation", "url": null }
javascript, jquery Title: Match values inside object and add them Does the following code is written correct witout redundant code ? or maybe using Jquery it can be written better? I need to find matching between properties insdie oData & oPushObj and fill aSelData with this content. This code is working as expected jQuery.each(aDataCollection, function(iIndex, oData) { oPushedObject = {}; fnAddEnt(aProperties, oData, oPushObj); Object.getOwnPropertyNames(oData).forEach(function(key) { if (oPushObj.hasOwnProperty(key) { var source = oData[key].results[iIndex]; var destination = oPushObj[key]; Object.getOwnPropertyNames(source).forEach(function(sourceKey) { if (destination.hasOwnProperty(sourceKey)) { var sourceItem = source[sourceKey]; destination[sourceKey] = sourceItem; } }); } }); aSelData.push(oPushObj); }); return aSelData; }; General. I notice that this question is a new expression of the other one you asked previously... but have now deleted! In the previous question you didn't really explained something that becomes clear with this new one: you're looking for matching properties (with unknown names) successively at two nesting levels. In addition, 1st step works at level 1 of each object, while 2nd step works at level 2 for one object and level 3 for the other. It's not a good idea to have deleted your previous question because, in the other hand, it showed an example of the involved objects structure. Since I remembered that, I could understand what your current code does (and BTW, understand what was not previously clear). At the opposite, for somebody reading your current question, and without the knowing of the structure, it's pretty hard to see what your code is intended to. About the current code. The part of code you posted is inconsistent:
{ "domain": "codereview.stackexchange", "id": 19072, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery", "url": null }
c, random, generator most people find it more easily readable if you use more space: for (i=0; i < n; i++) Eliminate "magic numbers" Instead of hard-coding the constants 26 and 4 in the code, it would be better to use a #define or const and name them. Avoid scanf if you can There are so many well known problems with scanf that you're usually better off avoiding it. Don't recursively call main The main() function can be called recursively in C, but it's a bad idea. You could blow up your stack and there's really no good reason to do that here. Just use a loop. See https://stackoverflow.com/questions/4238179/calling-main-in-main-in-c for details. Use a better random number generator You are currently using password[i] = numbers[rand() % 10]; There are a number of problems with this approach. This will generate lower numbers more often than higher ones -- it's not a uniform distribution. Another problem is that the low order bits of the random number generator are not particularly random, so neither is the result. On my machine, there's a slight but measurable bias toward 0 with that. See this answer for details, but I'd recommend changing that to the rand_lim in that link and also duplicated below. Results Here's an alternative that uses all of these ideas. It also gets a length from the command line so there's no need for a prompt or scanf. It eliminates the need for counting characters and uses the better random number generator mentioned above: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> int rand_lim(int limit) { /* return a random number between 0 and limit inclusive. */ int divisor = RAND_MAX/(limit+1); int retval; do { retval = rand() / divisor; } while (retval > limit); return retval; } char picker(const char *charset) { return charset[rand_lim(strlen(charset)-1)]; }
{ "domain": "codereview.stackexchange", "id": 36779, "lm_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, random, generator", "url": null }
Thanks. - When representing real numbers in base notation, you should also consider the case of an infinite trailing string of 1s (or 2s in in the ternary case), although there are only a countable number of such cases and it won't affect the result. Why do you need to show that f is continuous? I think your argument is pretty convincing already. –  Dan Brumleve Sep 14 '11 at 2:56 Maybe this related thread is helpful. –  t.b. Sep 14 '11 at 3:10 @Dan: Thanks for your response. Well, I am to show first that $f$ is continuous and surjective and then conclude that $\mathcal{C}$ is uncountable. –  Kuku Sep 14 '11 at 3:13 Kuku, it seems to me that showing f is a surjection is enough to establish that the Cantor set is uncountable. –  Dan Brumleve Sep 14 '11 at 3:19 "Afterwards can I conclude" has the word order for a question, but the sentence doesn't end in a question mark. Do you mean "Afterwards I can conclude" as a statement, or is the question mark missing? Please clarify this by an edit. (You might also want to tidy up the "My Questions" part while you're at it, though that doesn't lead to ambiguity -- the questions under "1." are both missing question marks, and "I will have" has the word order for a statement.) –  joriki Sep 14 '11 at 6:35 You don’t have to show that $f$ is continuous in order to conclude that $\mathcal{C}$ is uncountable: that follows from the fact that $f$ is surjective, assuming that you know that $[0,1]$ is uncountable. Your argument for surjectivity is correct, though it could be stated a bit better, but for clarity you ought to deal with a point raised by Dan Brumleve. Here’s your argument, slightly restated:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9863631655203046, "lm_q1q2_score": 0.8719837858940576, "lm_q2_score": 0.8840392832736084, "openwebmath_perplexity": 124.76060253792599, "openwebmath_score": 0.9426350593566895, "tags": null, "url": "http://math.stackexchange.com/questions/64354/uncountability-of-the-cantor-set?answertab=active" }
c#, asynchronous, concurrency, http, client Title: Issue tokens concurrently with synchronization per client I have an API application with token authorization. A token is valid for one hour. Each business client has its own instance of the API application: {"client_1": "http://localhost:1"}, ... {"client_n": "http://localhost:n"} In another application I have a class ApiService to make HTTP requests to the API. I create one instance of ApiService. Requests happen concurrently and I want to be sure that for each client token will be issued only once. I use Flurl to make HTTP requests. public class TokenDetails { public string Token { get; set; } public DateTime Expires { get; set; } } public class ClientDetails { public string ClientId { get; set; } public string BaseAddress { get; set; } public string Username { get; set; } public string Password { get; set; } } public class ClientService { private readonly ConcurrentDictionary<string, Task<TokenDetails>> _tokens = new ConcurrentDictionary<string, Task<TokenDetails>>(); private readonly ConcurrentDictionary<string, object> _locks = new ConcurrentDictionary<string, object>(); public async Task<string> GetDataAsync(ClientDetails client) { var token = await GetTokenAsync(client).ConfigureAwait(false); return await new Url(client.BaseAddress).AppendPathSegment("/data") .WithOAuthBearerToken(token.Token) .GetStringAsync().ConfigureAwait(false); }
{ "domain": "codereview.stackexchange", "id": 30705, "lm_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#, asynchronous, concurrency, http, client", "url": null }
quantum-mechanics, wavefunction It's not rotating in real space. Instead, you can think of it like this: each point in space has a complex value attached to it. You've seen this kind of thing before. E.g., with temperature, each point in space has a single real number attached to it, describing the temperature at that point; and these values change over time. With a gravitational field, each point in space has a vector attached to it. This is the same basic concept, except it's complex numbers, and the way they evolve in time over all that space is "wave-like" in some (formal and informal) sense. To "see" the wavefunction in 3D space "with your own eyes", you would have to have the sensory ability to independently sense/judge/estimate the size of the two components of the complex number at every point throughout 3D space. Imagine that at every point there's a little piece of paper with the complex plane depicted on it, and a little arrow drawn. Or, perhaps, a tiny digital screen displaying a 2D grid with a complex number drawn on it, that can be updated in real-time. The visualization you linked to limits itself to 1D physical space, and essentially uses the other two dimensions to represent the complex plane at each point. It's rotating by having all these arrows (complex numbers) rotate in sync - imagine the little screens updating in sync. For a more complicated situation, there would be some more complicated relationship between the arrows; e.g., the screens could update in some wave-like pattern. Here's another screenshot from the video you've posted. The blue wavefunction is the superposition of the two others; that just means that the red and green arrows add up (pretty much like vectors) at each point, to form the blue arrows. I'm guessing that you already understand this, but just for clarity, the quantum state is just the blue wavefunctions (there aren't three sets of arrows rotating around, the other two are just shown as the "building blocks" of the blue one).
{ "domain": "physics.stackexchange", "id": 85319, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction", "url": null }
homework-and-exercises Title: How to calculate distance travelled from velocity vector and angle? I am trying to get the distance a projectile travels, so I can display it in my program. I'm sort of new to physics, but I've tried looking this up. I'm not getting the right results however, and me being new to physics, I'm not sure if I'm just using the wrong formula or what. This is the formula I have tried using: As far as I've read, a projectile launched at 15 degrees would travel the same distance as one launched at 75 degrees, however when I run the calculation I get two different distances for those two instances. Is this not the correct formula, or maybe I'm using it wrong? These are the values I get for 15 degrees and 75: 15: velocity vector = (5,-19) magnitude = 20 vCos = -15.2 vSin = 13 gravity = 9.8 output = 41 75: velocity vector = (19,-5) magnitude = 20 vCos = 18.4 vSin = -7.8 gravity = 9.8 output = 2 The projectile starts on the ground and gets launched at the specified angle over a flat surface. Not sure where I'm going wrong. All help is greatly appreciated. Firstly, since "The projectile starts on the ground and gets launched at the specified angle over a flat surface", $y_0 = 0$ and the equation reduces to: $$ d = \frac{v^2sin(2\theta )}{g} $$ Now you can see that $d$ will be the same for $\theta $ and $90 - \theta$, such as 15 and 75 degrees; however, this is not true for the more general equation in the question where the starting point and ending point are not necessarily the same height. But I think your problem is here: 15: velocity vector = (5,-19) magnitude = 20 vCos = -15.2 vSin = 13 gravity = 9.8 output = 41 75: velocity vector = (19,-5) magnitude = 20 vCos = 18.4 vSin = -7.8 gravity = 9.8 output = 2 Why do you have negative values?
{ "domain": "physics.stackexchange", "id": 13064, "lm_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", "url": null }
beginner, ruby, formatting puts "Enter either \"triangle\" or \"square\"" user_input = gets.chomp newUserInput = UserInput.new(user_input.downcase) newUserInput.printInput Ok, so... there's a lot to talk about here. I've simply gone through it line by line, and added comments. So prepare for a pretty long review. As for the indentation, the reason it's different when you paste it here is probably that you're still using tabs. It should be soft tabs, i.e. just 2 space characters. Not 1 tab character set to be 2 characters wide, but actual spaces. Anyway, long review incoming. # BuildShape is a poor name for a class. Classes should generally be nouns, # but "Build shape" is an imperative. It's true that the class does build a # shape, but the class in itself is not "the act of building". class BuildShape # This class has no "initialize" method, but because its parent # class (which is Object, when nothing else is specified) has one, # I can still call "BuildShape.new.buildSquare" (for instance). But # if I do, things will be weird, because @text and @texture haven't # been defined. And without an initialize method (or attribute # setters), there's no way to define them. # Don't duplicate the name of the class in the names of its methods. # There's simply no need to do that; you don't need to name a file # on your computer after the folder it's in. # Also, Ruby uses underscored method names, so if anything, it should # be called "build_shape_check" def buildShapeCheck if @text == "square" self.buildSquare # no need for "self." here else self.buildTriangle # or here end end
{ "domain": "codereview.stackexchange", "id": 7019, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, ruby, formatting", "url": null }
time-complexity, asymptotics, runtime-analysis, big-o-notation Title: Time complexity analysis of 2 arbitrary algorithms - prove or disprove We are given 2 algorithms A and B such that for each input size, algorithm A performs half the number of steps algorithm B performs on the same input size. We denote the worst time complexity of each one by $g_A(n),g_B(n)$ Also, we know there's a positive function $f(n)$ such that $g_A(n)\in\Omega(f(n))$ Is it possible that $g_B(n)\in\Omega(f(n))$? Is it necessary? It seems naive to think that it's necessary, but I can't figure out to contradict it. It is possible. Example $g_A(n)=1$, $g_B(n)=2$, and $f(n)=1$. It is also necessary, since $g_B(n) = 2 g_A(n) \in\Omega(f(n))$. To see that $ 2 g_A(n) \in\Omega(f(n))$ you can use the definition of $\Omega(\cdot)$. From $g_A(n) = \Omega(f(n))$ you know that here is some $n_0$ and some $c>0$ such that, $\forall n \ge n_0$, $g_A(n) \ge c f(n)$. This implies that, for the same value of $n_0$ and $c$, $2 g_A(n) \ge 2 c f(n) \ge c f(n)$, i.e., $ 2 g_A(n) \in\Omega(f(n))$.
{ "domain": "cs.stackexchange", "id": 16124, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "time-complexity, asymptotics, runtime-analysis, big-o-notation", "url": null }
electricity, everyday-life, atmospheric-science, lightning Title: What causes the color difference of lightning flashes? Some flashes of lightning are seen in a blue shade while some have a yellowish/orange appearance .What is the possible cause of colour difference? First I thought to point to an old answer but I have then realised that it is not really a duplicate. However it does support what I was thinking to write (I am not a specialist of atmosphere physics), at least for the part concerning what causes the lighting to, as for its name, emit light. The visible part of the lightning, that we can consider as a spark of very big length size happening in not well controlled conditions, is a tiny ribbon of plasma surrounded by a hot and thermally ionized atmosphere envelope that the plasma itself generates. Thus, a lightning does emit light both thermally, which leads to a continuum and T dependent spectrum of the black body type and via emission by plasma recombination and by the radiative relaxations of the species excited by the plasma itself.
{ "domain": "physics.stackexchange", "id": 57412, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, everyday-life, atmospheric-science, lightning", "url": null }
quantum-mechanics, wavefunction, schroedinger-equation, potential-energy Title: Bound state in potential less 0 How to prove that there is a bound state in the potential $U(x) = -A e^{-a |x|}$, where for all $a \in \mathbb{R}$ and $A>0$. I heard that we can say something to the minimum of this form $ \left( \psi \right| H \left| \psi \right)$ for some vector of hilbert space, but that it will give us? So i want to know, why if there is $\psi$ such that $\left( \psi \right| H \left| \psi \right) < 0$ then there is bound state? Thank you! The potential energy can have any reference energy without change in the outcome. Thus a negative energy is relative to the assumed reference energy. If you take a large enough negative reference, you will only have positive bound energy states.
{ "domain": "physics.stackexchange", "id": 46616, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, schroedinger-equation, potential-energy", "url": null }
astrophysics, astronomy, spectroscopy, signal-processing Title: Terminology: "3σ detection over the continuum" I am reading a research paper and they use the expression: "This is a weak signal, i.e. 3-4σ detection over the continuum". I saw this sentence in a lot of papers, but I can not find what exactly it means. My interpretation: I only know the 3σ interval from normal distributions, where the 3σ interval contains 99.73 % of all values. So, my interpretation of the above quote is , based on the fact that it is a weak signal, that the signal is only 100%-99.73% = 0.27% above the continuum intensity. Is this right? Thanks a lot! Measurements in Astrophysics are usually done is what is called Signal to Noise Ratio (SNR), r defined as $$r=S/σ$$where S is the net signal - counts, voltage,whatever σ is the standard deviation of the noise process. This determines not just the error on our measurement, but whether we have managed to measure a signal at all. If the true signal is zero, every so often we will see a large value just by chance. For example, if the noise distribution is Gaussian with standard deviation σ then the probability in one experiment of getting $r >2$, i.e. a fake signal with $S= 2σ$, is $1/20$ Here the Signal is 3-4 $\sigma$, it means signal is higher than noise by a factor between 3 to 4 (not 3 subtracted by 4!).
{ "domain": "physics.stackexchange", "id": 76849, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics, astronomy, spectroscopy, signal-processing", "url": null }
Second scenario: Split the points into pairs. Then form parallel planes (blue) through each of the pairs. A third plane parallel to these two and in the center of them is equidistant to all 4 points. There are $1/2 \times \binom {4}{2}$ occurrences of this scenario, since you are choosing 2 pairs from four. Here's a link on choosing pairs: Combination of splitting elements into pairs $$\binom{4}{3} + \frac{1}{2} \binom{4}{2} = 4+3 = 7$$ • Nice figure but in the first one the required plane is not shown (rather some unnecessary plane is shown) and that is confusing. Also it'd have been better had you explained your combinations. Specially the $1/2$ in second case. – Hritik Feb 10 '18 at 9:45 • Thanks for your suggestions! I have amended those faults mentioned. – Mint Mar 21 '18 at 15:11
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9883127406273589, "lm_q1q2_score": 0.8170498031265125, "lm_q2_score": 0.8267117983401363, "openwebmath_perplexity": 205.14165230994587, "openwebmath_score": 0.76088947057724, "tags": null, "url": "https://math.stackexchange.com/questions/790357/number-of-planes-that-are-equidistant-from-4-non-coplanar-points" }
- You can do this by the principle of finite choice (which doesn't need the axiom of choice). Since $\Bbb R$ is partitioned into two sets $f^{-1}(0)$ and $f^{-1}(1)$. –  Bryan Jul 27 '14 at 19:28 @Bryan: Is it the axiom of choice? I can't use it. And, by the way, the question is not about how I can do this, but about how can I persuade myself that the first approach is legitimate. –  MossCross Jul 27 '14 at 19:29 It is legitimate. The Principle of Finite Choice can be proved without AC. –  Bryan Jul 27 '14 at 19:30 I'm pretty sure the ability to pull out an element arbitrarily is exactly what it means for something to be a non-empty set. –  Gina Jul 27 '14 at 19:31 The fact that $f$ is surjective ("onto") means precisely that $f^{-1}(0)$ and $f^{-1}(1)$ are nonempty, right? Which means there exist elements $a\in f^{-1}(0)$ and $b\in f^{-1}(1)$ as you said. There's nothing wrong with this. Maybe your uncertainty is due to the fact that, after all, there are lots of different functions $g$ that do this. You're just constructing one of them. –  MPW Jul 27 '14 at 19:33 1 Answer Generally, in the context of first-order logic, you can "pull one arbitrary element" by what is called "existential instantiation" (not to confuse nights where you ponder the absurdity of human life). So we can choose from a single non-empty set. By induction we can show that we can choose from finitely non-empty sets (this is not repeated instantiations, but rather something a bit more delicate here; but for starters you can think about it that way). For your question, it is enough, since we only have two sets. So we have two sets which we can prove are non-empty, so we can instantiate two quantifiers and be done with it.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.979354071369858, "lm_q1q2_score": 0.8029658744609375, "lm_q2_score": 0.8198933337131076, "openwebmath_perplexity": 177.99738085996478, "openwebmath_score": 0.889769434928894, "tags": null, "url": "http://math.stackexchange.com/questions/879861/can-i-pull-out-an-arbitrary-element-from-a-set" }
php, html, email Title: HTML email template Based on several different sources, I have compiled the following as my basic HTML email template. Please let me know if I have missed anything important. I am not sure if I am using \n and \r\n correctly. $semi_rand = uniqid(); $mime_boundary = "==MULTIPART_BOUNDARY_$semi_rand"; $mime_boundary_header = chr(34) . $mime_boundary . chr(34); $boundary = "nextPart"; $headers = "From: ".$from."\n"; $headers .= "To: ". $to ."\n"; $headers .= "CC: ". $CC ." \r\n"; $headers .= "Reply-To: ".$from."\r\n"; $headers .= "Return-Path: <". $data['from'] .">\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/alternative;\n boundary=" . $mime_boundary_header ; $headers .= "\n--$boundary\n"; // beginning \n added to separate previous content $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n"; $headers .= "\n--$boundary\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-Encoding:base64\r\n"; $body = " --$mime_boundary Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit ". strip_tags($message) ." --$mime_boundary Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding:base64
{ "domain": "codereview.stackexchange", "id": 6879, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, html, email", "url": null }
15. dan815 oh greater so 5/6 16. dan815 |dw:1433020148264:dw| 17. dan815 is that it? 18. dan815 i see that for one case its, 5/6 then therefore for every other point its always 5/6 of the total there so 5/6 all the time :) 19. dan815 i solved it by looking at a number line 20. dan815 |dw:1433020285038:dw| 21. dan815 so i thought about summing all these individual events up (kind of like an integral) however its constant here its always 5/6 of the smaller case, that event 1 happens at the one single point 22. dan815 Hence 5/6 for the complete thing 23. dan815 here is also something interesting... prolly not so much but kinda cool to visualze lol 24. dan815 cause its not good to think ofa number line but a circular number like for this or like a clock 25. dan815 |dw:1433020557004:dw| 26. dan815 |dw:1433020604712:dw| 27. Kainui the problem is your answer seems to be wrong, the answer is 25/36 not 5/6 for the first question 28. dan815 ya i got that i change it xD 29. dan815 for a sec i thought u were asking less than 10 30. dan815 oh dang really 31. dan815 why is it 5^/6^2? 32. dan815 lemmee think 33. Kainui this picture: |dw:1433020730099:dw| imagine each point is when two events happen, so all the points on the diagonal happen simultaneously. so for instance when one event happens, (10,20) at that point, that will fall in the black, so it's greater or equal to 10 min right? So the ratio of the black region to the entire square is the probability. 34. dan815 oh :O i get it 35. dan815 theres a problem here with assuming the circular thing too, because once event 1 occurs later 36. dan815 the prob is greater for 10 mins
{ "domain": "openstudy.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517450056273, "lm_q1q2_score": 0.8407956348208047, "lm_q2_score": 0.8596637541053281, "openwebmath_perplexity": 1866.9834815748513, "openwebmath_score": 0.6549059152603149, "tags": null, "url": "http://openstudy.com/updates/5569d3d8e4b050a18e836654" }
physical-chemistry, everyday-chemistry, thermodynamics As a comparison to this example, let's check out two liquids that do mix. 3. Water and ethanol For the water, we have basically the same situation as before -- water molecules forming good bonds to each other. The ethanol, though, has an -OH group that can form bonds to the water in the same way that the water does (though not as well). This means that ethanol that mixes with water (and vice versa) will tend to stay mixed, and given that the liquids are being mixed around just by random motions, means that you'll get one mixing with the other just as a matter of statistics.
{ "domain": "chemistry.stackexchange", "id": 539, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, everyday-chemistry, thermodynamics", "url": null }
3^{\tfrac{1}{4}}}\\ &=\boxed{\dfrac{\pi \left(\sqrt{3}-1\right)}{2\sqrt{2}\sqrt[4]{3}}} \end{align}
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9518632302488963, "lm_q1q2_score": 0.8383983443917405, "lm_q2_score": 0.8807970701552505, "openwebmath_perplexity": 4471.129323603746, "openwebmath_score": 0.9999955892562866, "tags": null, "url": "https://brilliant.org/discussions/thread/brilliant-integration-contest-season-3-part-2/" }
If we write $f=g+h$ with $g$, $h$ as in the claim, both $f$ and $g$ are increasing, thus locally bounded and with at most countably many discontinuity points. Hence $f$ and $g$ are Riemann integrable, and so is $h$. For $n \ge 1$, we can thus consider : $$g_n : x \mapsto n \displaystyle{\int_x^{x+\frac{1}{n}}} g(t)dt,\quad \ h_n : x \mapsto n \displaystyle{\int_{x-\frac{1}{n}}^x} h(t)dt, \quad \ f_n : x \mapsto g_n(x)+h_n(x).$$ As $g$ (resp. $h$) is right (resp. left)-continuous, it is easy to prove that for all $x$, $g_n(x) \underset{n \to +\infty}{\longrightarrow} g(x)$ and $h_n(x) \underset{n \to +\infty}{\longrightarrow} h(x)$, so $\big(f_n\big)_{n \ge 1}$ converges pointwise to $f$. As $g$ and $h$ are locally bounded, $g_n$ and $h_n$ are continuous for all $n$, and thus $\big( f_n \big)_{n \ge 1}$ is a sequence of continuous functions. So: monotone functions are Baire-one functions, as you can see here and here. This means, by definition, that elements of this class are pointwise limits of continuous functions, see here. Hence the statement is proved.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9724147169737826, "lm_q1q2_score": 0.8060722987371407, "lm_q2_score": 0.8289388104343893, "openwebmath_perplexity": 138.74481136766187, "openwebmath_score": 0.9767380356788635, "tags": null, "url": "https://math.stackexchange.com/questions/2370686/if-f0-1-to-mathbbr-is-increasing-show-that-f-is-the-pointwise-limit" }
laser Title: How can we make coherent laser? When im studying about fundamental physics, book says that induced emission makes two coherent photons so whole family of that photons will be coherence so laser can be configured by coherent photons. But if there is two 'first photon' which is not coherence each other, then after some actions(induced emissions) there will be two family of photons inside of laser. My question is that, how can we make two incoherent families of photons coherent and make real laser which is commonly used in our daily life. Thank you. But if there is two 'first photon' which is not coherence each other, then after some actions(induced emissions) there will be two family of photons inside of laser. This is entirely normal. The "first photons" that start the laser action are generated by spontaneous emission. They are not coherent with each other, and there are normally more than one present in the cavity at a time. how can we make two incoherent families of photons coherent and make real laser?
{ "domain": "physics.stackexchange", "id": 48167, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "laser", "url": null }
rviz Title: rviz: unsaved changes Is it possible to somehow prevent rviz from asking to save unsaved changes? Originally posted by liborw on ROS Answers with karma: 801 on 2012-10-15 Post score: 3 There is no direct way to do this, but fell free to write a patch :) You are not the only one annoyed be this popup. Good practise is not to close rviz at all, only after work with the robot. If you need to restart rviz for some reason, it means there is something wrong with your code or rviz itself (happens too). I use to close rviz from time to time when I am working on battery, it saves some power (opengl likes my cpu). As a workaround: ctrl+s and alt+f4 to speed things up, or alt+tab and ctrl+c, when you don't want changes to be saved I don't know of any better solution. Originally posted by kszonek with karma: 459 on 2012-10-15 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 11374, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz", "url": null }
general-relativity, terminology, field-theory, relativity "Non-inertial frames" may perfectly well be studied already in special relativity - special relativity is just about matter moving on geodesics in the flat Minkowski metric, and ignoring the backreaction of matter on the geometry, which corresponds to "turning off gravity". A non-inertial frame where is simply a coordinate system in which the Minkwoski metric does not take the standard form of $\mathrm{diag}(-1,1,1,1)$ (or signs switched), i.e. one that cannot be reached by a Lorentz transformation from an inertial frame. Whether you want to consider the metric a "field" in this setting is a matter of choice, it is certainly non-dynamical and not a field in the usual sense of a field theory.
{ "domain": "physics.stackexchange", "id": 35464, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, terminology, field-theory, relativity", "url": null }
c#, design-patterns, pdf SetRect(_document, top - 4, top - 11, PDF_Document_Margin, PDF_Document_width - PDF_Document_Margin); _document.Color.String = PDF_Color_Grey; _document.TextStyle.HPos = PDF_Text_Align_Center; _document.AddText($"Document generated at {DateTime.UtcNow:dd.MM.yyyy}"); } // Adds footer on all pages public void AddFooter( FooterInformation footerInfo) { var theCount = _document.PageCount; for (int i = 1; i <= theCount; i++) { _document.PageNumber = i; AddFooterOnPage(footerInfo); } } } public class PageNumbersPdfWriter : PdfWriter { private readonly Doc _document; public PageNumbersPdfWriter( Doc document) { _document = document; } public void AddPageNumbers() { //calculcate pages and insert // page number to each pages } } public abstract class PdfWriter { protected const string PDF_Fonts_Regular = "Helvetica"; protected const int PDF_Document_width = 595; protected const int PDF_Document_page_footer_top = 42; protected const int PDF_Document_Margin = 28; protected const string PDF_Color_Grey = "120 144 156"; protected const double PDF_Text_Align_Left = 0; protected const double PDF_Text_Align_Center = 0.5; protected static void SetRect(Doc theDoc, double top, double bottom, double left, double right) { theDoc.Rect.Top = top; theDoc.Rect.Bottom = bottom; theDoc.Rect.Left = left; theDoc.Rect.Right = right; } } public class FooterInformation { public string OrganizationNumber { get; set; } public string OrganizationName { get; set; } } public class CustomerInformation { public string Name { get; set; } } public class ProjectInformation { public string Name { get; set; } } public class DocumentInformation { public string Name { get; set; }
{ "domain": "codereview.stackexchange", "id": 42411, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, design-patterns, pdf", "url": null }
lagrangian-formalism, field-theory, boundary-conditions, variational-principle, variational-calculus $$ Is this the mathematical underpinning of this identification? If so, why should we enforce this to be zero, which is what allows us to get the field equation? On the other hand, say we have the field equation and consider a general symmetry transformation $x\mapsto\widetilde{x}=\widetilde{x}(x)$ and $\varphi(x)\mapsto\widetilde{\varphi}(\widetilde{x})$. We have $\widetilde{x}^\mu=x^\mu+\delta x^\mu$ and $d^4\widetilde{x}=Jd^4x$, where $J=1+\partial_\mu(\delta x^\mu)$. Expanding the action to lowest order in the coordinate yields $$ S=\int d^4x(\mathcal{L}(\widetilde{\varphi}(x),\partial\widetilde{\varphi}(x))+\partial_\mu(\mathcal{L}\delta x^\mu)). $$ For an infinitesimal transformation, we have $$ \delta S=\int_V\left(\frac{\partial\mathcal{L}}{\partial\varphi}-\partial_\mu\frac{\partial\mathcal{L}}{\partial\partial_\mu\varphi}\right)\delta\varphi(t,x)+\int_V\left(\partial_\mu\left(\delta\varphi\frac{\partial\mathcal{L}}{\partial\partial_\mu\varphi}\right)+\partial_\mu(\mathcal{L}\delta x^\mu)\right). $$ Here, I can immediately justify the identification of $\delta S_V$. The equation of motion tells us that $$
{ "domain": "physics.stackexchange", "id": 100100, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lagrangian-formalism, field-theory, boundary-conditions, variational-principle, variational-calculus", "url": null }
cosmology, astrophysics, dark-matter, matter Title: How do we know Dark Matter is non-baryonic? It seems widely stated, but not thoroughly explained, that Dark Matter is not normal matter as we understand it. Wikipedia states "Consistency with other observations indicates that the vast majority of dark matter in the universe cannot be baryons, and is thus not formed out of atoms." How can we presume to know this? Our best evidence for such dark matter is the rotational speeds of galaxies. It sounds like we can measure/approximate the gas density and stellar masses somehow, yet I don't understand how we can account for things like planets, asteroids, black holes without accretion disks, and other things that have mass but don't glow. How is it we dismiss these explanations for it, and jump right to WIMPs and other exotic explanations? Definitely see the comments on your question. But a very brief outline of the data: Rotation-curves and galaxy-cluster mass measurements show the detailed distribution of matter in those objects, the amount of mass far exceeds the observed mass ---> most mass is non-observed Gravitational-lensing searches show that the "dark-matter" constituents must be composed of objects less than about $10^{-7} \textrm{ M}_\odot \sim 0.03 \textrm{ M}_\oplus$, i.e. it must be asteroid size or smaller. Asteroid size can't really form stably (in such large amounts), and would be rapidly accreted by larger mass objects --> dark-matter constituents must be small. Baryonic matter which is massive and small is constrained to gas and dust. Both of these things, when hot, are easily observable (especially in hot galaxy clusters)... yet the premise is that we can't see them --> dark matter is not baryonic There is lots more evidence, this is just the most basic outline. The biggest additional piece overall is from cosmology: anisotropies in the cosmic microwave background tell you a lot about the initial universe and the seeds of structure formation -- comparing that with what we see in the current universe tells us about the evolution of structure in the universe, which ends up requiring that the dominant component of mass in the universe has no pressure which again rules out baryonic material.
{ "domain": "physics.stackexchange", "id": 3233, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, astrophysics, dark-matter, matter", "url": null }
data-mining, python traceback: TypeError Traceback (most recent call last) <ipython-input-361-a6efc7e46c45> in <module>() 1 plt.plot(decade_mean.index, decade_mean.values, 'o-',color='r',lw=3,label = 'Decade Average') 2 plt.scatter(movieDF.year, movieDF.rating, color='k', alpha = 0.3, lw=2) ----> 3 plt.xlabel('Year') 4 plt.ylabel('Rating') 5 remove_border() TypeError: 'str' object is not callable I have solved remove_border problem. It was a stupid mistake I made. But I couldn't figure out the problem with the 'str'. Seems that remove border is not defined. You have to define the function before used. I do not know where the string error comes, is not clear to me. If you post the full traceback it will be clearer. Finally your label is not show because you have to call the method plt.legend()
{ "domain": "datascience.stackexchange", "id": 262, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-mining, python", "url": null }
beginner, vb.net, fizzbuzz We don't generally declare an iterator variable (i) outside the loop. For i As Integer = 0 To arrayOfStrings.Length - 1 Now, you don't take any input in this programme at all. You just run it procedurally and exit. While this is great for dummy programme's that demonstrate a system, you should consider adding support for user input through arguments or the CLI. I'm not going to detail all that here, but I will say that taking input through the CLI is extremely easy. The next thing we can do is replace the result of FizzBuzzMe with an IEnumerable(Of String), and change it to an Iterator function. This allows us to be lazy in our implementation. We simply Yield whatever value we have at the moment. Private Iterator Function FizzBuzzMe(ByVal arrayOfIntegers As Integer()) As IEnumerable(Of String) For i As Integer = 0 To arrayOfIntegers.Length - 1 Dim line As String = "" If i Mod 3 = 0 Then line &= "fizz" End If If i Mod 5 = 0 Then line &= "buzz" End If Yield line Next End Function
{ "domain": "codereview.stackexchange", "id": 22150, "lm_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, vb.net, fizzbuzz", "url": null }
ros, ros2, ament, c++11 CMakeLists: project(testpackage) if(NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra") endif() find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) include_directories(include ${rclcpp_INCLUDE_DIRS} ${rmw_implementation_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS}) add_library(test_lib src/test.cpp ) target_link_libraries(test_lib ${rclcpp_LIBRARIES} ${rmw_implementation_LIBRARIES} ${std_msgs}) add_executable(test_node src/test_node.cpp) ament_target_dependencies(test_node test_lib rclcpp std_msgs) install( DIRECTORY include/${PROJECT_NAME}/ DESTINATION include ) install( TARGETS test_lib test_node ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ament_package() Originally posted by arunavanag on ROS Answers with karma: 277 on 2017-09-11 Post score: 0
{ "domain": "robotics.stackexchange", "id": 28821, "lm_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, ros2, ament, c++11", "url": null }
scala Title: Printing out a tree set using pattern matching in Scala I'm working on some exercises Scala by Example and I've implemented an excl() method on sets which removes an element from a set, and a toString method that converts a set to a string. I'm practicing use pattern matching here. A bit concerned about shadowing my instance variables on the line case NonEmptySet(elem, left, right) Is there anything obvious that could be improved? trait IntSet { def incl(x: Int): IntSet def excl(x: Int): IntSet def contains(x: Int): Boolean } case object EmptySet extends IntSet { def contains(x: Int): Boolean = false def incl(x: Int): IntSet = new NonEmptySet(x, EmptySet, EmptySet) def excl(x: Int) = this override def toString = "{}" }
{ "domain": "codereview.stackexchange", "id": 4185, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "scala", "url": null }
electromagnetism, general-relativity, gravity, action, stress-energy-momentum-tensor But the equations of motion shouldn't care whether you choose to vary with respect to $A^\mu$ or with respect to $A_\mu$, you should get the same equations. Formally $$\delta S = {\delta S\over \delta g_{\mu\nu}}\delta g_{\mu\nu} + {\delta S \over \delta A_\mu} \delta A_\mu $$ And the Einstein equations are the coefficients of $\delta g$, while the (vector potential non-vacuous) Maxwell equations are the coefficients of $\delta A$. The variations in $A^{\mu},g_{\mu\nu}$ can be easily expressed in terms of the variations in $A_{\mu},g_{\mu\nu}$, $$ \delta A_{\nu} = \delta A^{\mu} g_{\mu\nu} + A^{\mu}\delta g_{\mu\nu} $$ Which, when expressing the total variation of the action, linearly mixes up the Einstein and Maxwell parts: $$ \delta S = ( {\delta S\over \delta g_{\mu\nu}} + {\delta S \over \delta A_{\mu}} A^{\nu})\delta g_{\mu\nu} + {\delta S\over\delta A_{\mu}} g_{\mu\nu} \delta A^{\nu} $$ Where the variational derivatives are all the old variational derivatives, with respect to the pair $g_{\mu\nu},A_{\mu}$ holding the other fixed. These linear combinations give the new variations. It is trivial to see that the new equations of motion are satisfied if and only if the old ones are, so nothing has changed. The new Maxwell equations are, after multiplying by the inverse metric, the same as the old ones. But the new Einstein equation has an extra source term in it: $$ {\delta S \over \delta A_\mu} A^{\nu} $$
{ "domain": "physics.stackexchange", "id": 5347, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, general-relativity, gravity, action, stress-energy-momentum-tensor", "url": null }
Where am i making mistake, and what is the best way to apply comparison test on $\sum_{n=2}^{\infty} \frac{n+1}{n^3-1}$? • try $\sum_{n=2}^{\infty} \frac{2}{n^2+n+1}$. – Yiyi Rao Nov 10 '16 at 17:48 • If you have $0\le u_n\le v_n$, and $\sum v_n$ is not convergent, then you can't say anything about $\sum u_n$. – Nicolas FRANCOIS Nov 10 '16 at 17:52 • $\frac{n+1}{n^3-1}\sim\frac{1}{n^2}$, so $\sum u_n$ is convergent. – Nicolas FRANCOIS Nov 10 '16 at 17:54 • The comparison test says if you're "bigger" than a divergent, then you're divergent, and if you're "smaller" than a convergent, then you're convergent. Remember that for non-negative series, convergence and divergence are basically "size" concepts. – AJY Nov 10 '16 at 17:56 • @TarsNolan Yes, but a constant factor catches that. If you compare to $\frac{2}{n^2}$, you have $\frac{n+1}{n^3-1} < \frac{2}{n^2}$ for $n \geqslant 2$. If you pick any $c > 1$, you have $\frac{n+1}{n^3-1} < \frac{c}{n^2}$ for all large enough $n$. – Daniel Fischer Nov 10 '16 at 18:26
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692291542526, "lm_q1q2_score": 0.8138824941814833, "lm_q2_score": 0.8333245994514084, "openwebmath_perplexity": 309.02896641314624, "openwebmath_score": 0.7419811487197876, "tags": null, "url": "https://math.stackexchange.com/questions/2008306/how-to-prove-if-the-series-sum-limits-n-2-infty-fracn1n3-1-conve/2008324" }
python, object-oriented, role-playing-game if action == "look": print(room.description + '\n') elif actions[0] == "get": index, item = room.get('items', actions[1]) if item is None: print('No item {}.'.format(actions[1])) continue room_actions["get"](item) room.items.pop(index) print("You picked up {}.".format(actions[1])) elif actions[0] == "fight": index, char = room.get('characters', actions[1]) if char is None: print('No character {}.'.format(actions[1])) continue user.Attack(char) if char.hp <= 0: room.characters.pop(index) print('{0.name} died.'.format(char)) else: print('{0.name} has {0.hp} left.'.format(char)) elif actions[0] == "inspect": index, char = room.get('characters', actions[1]) if char is None: print('No character {}.'.format(actions[1])) continue char.inspect() elif actions[0] == "move": if actions[1] in game_map[room.ID]: room = eval(game_map[room.ID][actions[1]]) print("You have moved " + actions[1] + "!") else: print("What does that mean?") room_logic()
{ "domain": "codereview.stackexchange", "id": 21417, "lm_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, role-playing-game", "url": null }
special-relativity What happens as a consequence is that B sees A at a different time after his direction reversal: Right before the reversal B observed A at position $x_B(A) = - x_A^0/\gamma$, corresponding to A's time $t_A = \gamma(t_B^0 + \frac{v}{c^2}x_B(A)) = t_A^0/\gamma^2$. Right after the reversal the new Lorentz transforms show that B still observes A at position $x_B(A) = - x_A^0/\gamma$, but now this corresponds to A's time $\bar{t}_A = \left(1+\left(\frac{v}{c}\right)^2\right)t_A^0$. On the other hand, the 2nd rendezvous still takes place at time $t_B^0 + |x_B(A)|/v = 2t_B^0 = 2t_A^0/\gamma$ for B, and at $t_A^0 + x_A^0/v = 2t_A^0$ for A. So from B's point of view, s/he meets A again after a time $\Delta t_B = 2t_B^0 -t_B^0 = t_A^0/\gamma$, while A only observes a time lapse $\Delta t_A = 2t_A^0 - \left(1+\left(\frac{v}{c}\right)^2\right)t_A^0 = t_A^0/\gamma^2 = \Delta t_B/\gamma$. In other words, B sees A undergoing time dilation, as expected.
{ "domain": "physics.stackexchange", "id": 27251, "lm_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", "url": null }
universe, cosmology, expansion, observable-universe, fate-of-universe $$d_{eh}(t)\propto\frac{1}{a(t)k(t)}$$ In a de Sitter universe (and our own universe, assuming $w = -1$), $k$ is equal to the Hubble constant, so the event horizon’s distance will remain constant (in a de Sitter universe, the $\dot{H} = 0$ because the deceleration parameter $q=-1$). In a Rip universe, $k$ is time dependent; as $k$ increases, the distance to the horizon decreases. From this formula, we can see that the event horizon’s distance is inversely proportional to the scale factor; thus, if $a(t)$ reaches infinity, the event horizon’s distance will reach zero. This means that the Big Rip can be defined as either the scale factor reaching infinity, or the observable universe’s diameter reaching zero — these two events happen at the same time.
{ "domain": "astronomy.stackexchange", "id": 2090, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "universe, cosmology, expansion, observable-universe, fate-of-universe", "url": null }
analytical-chemistry, hydrogen Title: Chemical Test for Hydrogen I know that to perform a chemical test for $\ce{H2}$ we have to take a burning candle flame near to the mouth of the test tube and a blue flame with a characteristic pop sound confirms the presence of hydrogen. But my question is that, is there any other chemical test for hydrogen except this one with a pop sound? There are metals that promote the catalytic oxidation of hydrogen in air, such as platinum and palladium. While these are fairly expensive in bulk, there are reasonably inexpensive sensors which use micrograms of these catalytic metals to detect hydrogen, and other gases. However, as you can see from the specifications for the MQ-8 sensor, it is not hydrogen-specific. That sensor also detects "alcohol" vapor, and even propane, though it is less sensitive to those gases than hydrogen. BTW, the "POP" test is certainly not specific, either, and you'd get a bigger bang (and soot) from acetylene. So, this test might not be exactly what you want: It relies on electrochemistry. It does not differentiate $\ce{H2}$ from $\ce{CH3OH}$, $\ce{C2H5OH}$, $\ce{C3H8}$, etc. However, such a sensor is very useful where batteries are charged, or hydrogen gas is used, to warn of leaks.
{ "domain": "chemistry.stackexchange", "id": 17489, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "analytical-chemistry, hydrogen", "url": null }
python, programming-challenge, python-2.x Title: Simple sum calculator I'm looking to optimize a simple sum calculator used in Project Euler+. The premise is simple: Find the sum of all the numbers divisible by 3 or 5 under X. At first I did it like so: def main(testCases): final_answer = [] for x in range(testCases): answer = 0 test = long(input()) for num in range(test): if (num % 5 == 0 or num % 3 == 0): print(num) answer += num final_answer.append(str(answer)) print('\n'.join(final_answer)) main(input()) Which worked alright. Then I realized it couldn't handle anything like 10,000,000,000 at all, which was bad, so I tried: def main(testCases): for x in range(testCases): answer = 0 num = input() Temp = (num - 1) // 3 answer += (Temp * (3 + Temp * 3)) // 2 Temp = (num - 1) // 5 answer += (Temp * (5 + Temp * 5)) // 2 Temp = (num - 1) // 15 answer -= (Temp * (15 + Temp * 15)) // 2 print answer main(input()) Which was way faster / capable of giant numbers. However, it seems really ugly and unoptimized, but maybe it's in my head. Can anyone help me optimize my answer? Sample Input: 2 10 100
{ "domain": "codereview.stackexchange", "id": 12327, "lm_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, python-2.x", "url": null }
python, multithreading It is pretty unclear which attributes the class will have after calling the constructor, as it is basically up to the caller to decide this. This is not optimal, as you want to be in control of what data is set in an item. I'd suggest to use named arguments instead: def __init__(self, id, type, title): self.type = type self.title = title self.id = id # Add other attributes that I don't know of? While this may seem like blowing up the code, it makes it a lot easier to understand for an uninformed reader, and therefor should be preferred IMHO. Append instead of format Since you are basically just appending something to self.base_url, you might as well append using + instead of using format. I find it a lot easier to read, but that depends a lot on what you prefer. Consequently: self.base_url = 'https://hacker-news.firebaseio.com/v0/' Then uri = self.base_url.format(**{'api': 'item/{}.json'.format(item_id)}) would look like this if using append: uri = self.base_url + "item/{}.json".format(item_id) HackerNews.get() The get() method's name does not explain what the method does. I'd suggest something offering a bit more documentation, for example: download_item() or download_entry(). On a little side note: You can remove the else: statement, as the raise Exception(..) command will only be executed if the if statement evaluates to False. This depends a bit on personal taste though. I'd also change the ordering like this: if response.status_code != requests.codes.ok: raise Exception('HTTP Error {}'.format(response.status_code)) return json.loads(response.text)
{ "domain": "codereview.stackexchange", "id": 10719, "lm_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, multithreading", "url": null }
discrete-signals, signal-analysis, noise, gaussian The output Real Data: 2 Sensor Data: 2.19025 Real Data: 2 Sensor Data: 1.96754 Real Data: 2 Sensor Data: 2.03551 Real Data: 2 Sensor Data: 1.58706 << Why this out of the range Real Data: 2 Sensor Data: 2.11237 Real Data: 2 Sensor Data: 1.98482 Real Data: 2 Sensor Data: 1.94809 Real Data: 2 Sensor Data: 1.8264 Real Data: 2 Sensor Data: 1.9776 Real Data: 2 Sensor Data: 1.70071 << Why this out of the range Looking at your various comments with other answers, let me see if I can restate your question, and you can tell me if that's correct. You have a sensor and are modelling the output to include noise with mean=zero and unknown variance (your wording makes it sound as though variance is also zero). You asked if zero mean noise implies that signal variance describes the magnitude of the signal. Just to be clear: you are talking about the variance of the noise, correct, not the variance of the signal? I will assume you meant noise variance, and also that variance of the noise is non-zero. If the noise has mean=0, that means that the noise is a random signal centered on the true value. If you think about noise as a signal that wiggles randomly through time across some limited range, we can say that the center of this range is equal to the true value of the sensor. The variance of the noise, then, describes how far from the true value this wiggling signal goes - how far away from the true value these random perturbations go. If you look at the true (noise-free) value and the noise separately, the noise would wiggle randomly around the zero line while the true value is whatever its values are. The values that the true value can take on (how much true value moves around, a.k.a. its variance) is entirely independent of the noise's variance (how much noise moves around). In contrast, if noise had a non-zero mean, it would create a bias or an offset to your true value (so, if noise had mean=1 in your example, then your recorded values would be 3.19, 2.97, 3.04...).
{ "domain": "dsp.stackexchange", "id": 1564, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "discrete-signals, signal-analysis, noise, gaussian", "url": null }