text
stringlengths
1
1.11k
source
dict
ros Originally posted by karthik with karma: 2831 on 2012-05-21 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by TaylorC on 2012-05-22: Thanks Karthik! Changed to Orbit and I can finally see. Did you run into your robot getting confused as to its location? My gmap is not looking at all like it should. I am having slight lag with gmap updates but controls are responsive (using keypad). I have synced times as well. Comment by TaylorC on 2012-05-22: The turtlebot is detecting obstacles accurately at about a 2s lag but is not drawing the map correctly. I lapped it around my cubicle 6 times with no obstacles except two cabinets and the walls (made a makeshift door to block entrance).
{ "domain": "robotics.stackexchange", "id": 9484, "lm_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 }
openni, asus-xtion-pro-live, xtion, asus, primesense Original comments Comment by dbworth on 2013-02-08: After installing OpenNI 2.1 Beta & avin2/SensorKinect, now the ASUS & PrimeSense both don't work: openni_launch reports: No devices connected.... waiting for devices to be connected . I guess the package name should have been a give away! Comment by dbworth on 2013-02-08: Building OpenNI Version 1.5.4.0 from jspricke/debian-openni doesn't work either, No devices connected. I am using Carmine with ROS. It does not work out of the box, you need to install the drivers after installing ROS openni stuff. Primesense updated their openni webpages and software, it is quite hard to find the old drivers that you need to install. Here is the link: http://www.openni.org/openni-sdk/openni-sdk-history-2/ Choose the OpenNI-Compliant Sensor Driver v5.1.2.1 for your OS. Compile, and install. ROS openni should work perfectly.
{ "domain": "robotics.stackexchange", "id": 12808, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "openni, asus-xtion-pro-live, xtion, asus, primesense", "url": null }
java, pdf int iend = listOfTempFiles[i].getName().lastIndexOf("#"); if (iend != -1) { outputFilename = listOfTempFiles[i].getName().substring(0, iend); } OutputStream out = new FileOutputStream(new File(finalPDFParh + "/" + outputFilename + ".pdf")); doMerge(list, out); list.clear(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (DocumentException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
{ "domain": "codereview.stackexchange", "id": 22799, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, pdf", "url": null }
c#, entity-framework, asp.net-mvc-4 Title: Entity Framework with multiple connections open? I'm learning Entity Framework and I'm wondering if this code is the proper way of doing this. Basically this is my attempt at refactoring a very long controller in ASP.Net MVC 4. I'm using Entity Framework 5 as well. What I did was I separated out some code into a more common method (buildUpdatedAnswerDetailRecord). Notice in my parent function I have a connection open because I'm doing other DB related operations (population of data into properties). But then in the buildUpdatedAnswerDetailRecord method I'm opening another connection and then passing back a AnswerDetail. Is this the right way to do this or should I have just kept 1 connection open and just duplicated code? using (var db = new LEAP_Professional_DAL.DAL.LEAPEntitiesDAL()) { //local variable of a AnswerDetail AnswerDetail adItem; //Doing a lot of other Database work (filling other properties) ....
{ "domain": "codereview.stackexchange", "id": 7515, "lm_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#, entity-framework, asp.net-mvc-4", "url": null }
python, object-oriented, python-2.x, pygame, chess self.lista_gb = None self.cnt_gb = None self.rgb = None self.lista_tn = None self.lista_stn = None self.cnt_tn = None self.rtn = None self.lista_tb = None self.lista_stb = None self.cnt_tb = None self.rtb = None self.lista_bn = None self.lista_sbn = None self.cnt_bn = None self.rbn = None self.lista_bb = None self.lista_sbb = None self.cnt_bb = None self.rbb = None self.rey_n = None self.rey_b = None
{ "domain": "codereview.stackexchange", "id": 14659, "lm_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, python-2.x, pygame, chess", "url": null }
76 views a)if 32400 = 1* 32400 = 2*16200 = 3*10800 = ....................(n times) what is the max value of n 6. Since 1, 2, 3, 4, 5, 6 are all factors of 32400. But 7 is not. Which breaks the streak. what if 7 is skipped and from 8 its considered? what if it was .....what it is the total number of ways it can be split as a multiplication of two numbers oh Sorry. I misinterpreted the question. In that case, I think it should be 38. Because prime factorization of 32400 = $2^43^45^2$. From which we can form a total of 5 x 5 x 3 = 75 factors of 32400. Out of these half will be repeated like this: 2*16200, ... 16200*2. So we get 38.  :) Am I right?? Here is my approach to the questions you just asked in your comment.
{ "domain": "gateoverflow.in", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9736446502128796, "lm_q1q2_score": 0.802732939721302, "lm_q2_score": 0.8244619220634457, "openwebmath_perplexity": 365.9792027199039, "openwebmath_score": 0.7202435731887817, "tags": null, "url": "https://gateoverflow.in/151534/prime-factorisation" }
condensed-matter, spin-models, spin-chains Edit: as suggested, the string order might only be able to study the ground state topological properties, and for systems (Hamiltonian) with different class of symmetry, the string order parameter is different. However, what if one want to study an eigenstate's topological properties in a non-equilibrium scenario? Your mistake is in claiming that that is 'the' string order. There is no such unique string order; rather, it depends on the phase of matter one wants to probe. Let me illustrate the point with an example that is more familiar: suppose someone tells you that 'the' symmetry-breaking order parameter is $$\lim_{|i-j| \to \infty}\langle S^x_i S^x_j \rangle. $$ And then suppose that same person complains that this is not well-defined for an anti-ferromagnet, where the above quantity would have an alternating sign on every other site.
{ "domain": "physics.stackexchange", "id": 50617, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter, spin-models, spin-chains", "url": null }
machine-learning, deep-learning, tensorflow, convolutional-neural-network 150k images in my dataset. in the process of making this dataset I centered all faces in the image and cropped it to be 224*224*3. To increase the size of my dataset I flipped horizontally each image in my dataset to get a total of 300k images in my dataset. I then split the dataset to 240k train, 30k validation and 30k test images.
{ "domain": "datascience.stackexchange", "id": 3166, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, deep-learning, tensorflow, convolutional-neural-network", "url": null }
java, matrix, mathematics public Matrix subtract(final Matrix addend) throws IllegalArgumentException { Matrix temp = new Matrix(this); temp.subtractInPlace(addend); return temp; } public void multiplyInPlace(final Matrix multiplicand) throws IllegalArgumentException { if (multiplicand.rows != rows || multiplicand.cols != cols) { throwIncompatible("addition"); } double[][] product = new double[rows][cols]; storeProduct(multiplicand, product); for (int i = 0; i < rows; i++) { System.arraycopy(product[i], 0, data[i], 0, cols); } } public Matrix multiply(final Matrix multiplicand) throws IllegalArgumentException { if (multiplicand.rows != cols) { throwIncompatible("multiplication"); } double[][] product = new double[rows][cols]; storeProduct(multiplicand, product); return new Matrix(product, false); }
{ "domain": "codereview.stackexchange", "id": 29599, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, matrix, mathematics", "url": null }
homework-and-exercises, electrostatics, electric-fields, potential, capacitance But the result that I showed doesn't seem to convey the feeling that the field is conservative at all, If I understood correctly, you have calculated the potential of the first wire (call it A) considering only its own charge and its image charge. Then you calculate the potential of the second wire (call it B) considering both its own charge and image charge and the charge of wire A. This is why you calculate a different potential for A and B. But the charge on B has just as much effect on the potential of A as the the charge of A has on the potential of B, and you neglected that contribution. From the symmetry of the geometry, it's certain that with equal charge on the wires there will be no potential difference between A and B. If you found a difference then you must have made an error somewhere, even if I haven't understood correctly where the error lies. Can I have a non conservative field in an electrostatic situation?
{ "domain": "physics.stackexchange", "id": 96638, "lm_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, electrostatics, electric-fields, potential, capacitance", "url": null }
ruby, ruby-on-rails Title: Setting the default display name for my model I have a method in my Ruby code that sets the default name for my model. Rubocop complains that Assignment Branch Condition Size is too high, 21.24/15. How can I improve this? def set_default_display_name return unless display_name.blank? count = user.credentials.where(type: type).count if count == 0 self.display_name = name elsif user.credentials.where(display_name: name).count == 0 self.display_name = name else self.display_name = "#{name} #{count + 1}" end end Notes: Conditionals are expressions in Ruby, you can (and, idiomatically, should) move the assignment outside. active_record_relation.count == 0 is ok, but active_record_relation.empty? is more declarative. I'd write: def set_default_display_name credentials_by_type = user.credentials.where(type: type) credentials_by_name = user.credentials.where(display_name: type)
{ "domain": "codereview.stackexchange", "id": 21841, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ruby, ruby-on-rails", "url": null }
matrix of the same size. This interchanging of rows and columns of the actual matrix is Matrices Transposing. The matrix B is called the transpose of A. properties of transpose of matrix. By, writing another matrix B from A by writing rows of A as columns of B. Example. The result depends on rule parameter. Transpose vs Inverse Matrix The transpose and the inverse are two types of matrices with special properties we encounter in matrix algebra. The first element of row one is occupied by the number 1 … It is a rectangular array of rows and columns. Here is the vector [] being transposed: [] = []. Do the transpose of matrix. PLAY. Inverse and Transpose 11:12. The interactive program below produces matrix transpose of the input matrix. $\left[ \begin{array}{cc} 1 & 4 \\ 3 & 1 \\ 2 & 6 \end{array} \right] ^{T}= \ \ \left[ \begin{array}{ccc} 1 & 3 & 2 \\ 4 & 1 & 6 \end{array} \right] \nonumber$ What happened? 2.1 Any orthogonal matrix is invertible; 2.2 The product of orthogonal matrices
{ "domain": "teenjazz.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754479181588, "lm_q1q2_score": 0.8204709346527853, "lm_q2_score": 0.8333245932423308, "openwebmath_perplexity": 800.960960881548, "openwebmath_score": 0.6583818793296814, "tags": null, "url": "http://teenjazz.com/4tk0zn/article.php?5f70c6=transpose-matrix-properties" }
clojure EDIT Removed (loop) from originally-posted version. - I had erroneously copy-pasted code after I had already commenced attempting to introduce loop/recur (tail recursion). How use loop/recur in this function? A couple of random comments on your code: it doesn't parse correctly, I guess the closed paren right after loop bindings is misplaced. I couldn't run it even after fixing that. why do you need a second input parameter? I would expect the signature to only have the input set as parameter (if (nil (first input)) then else) is more idiomatically written (note the inversion of the then-else branches) (if (seq input) else then) input-no-x can be obtained in a simpler way: (let [input-no-x (disj input x)])
{ "domain": "codereview.stackexchange", "id": 2795, "lm_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 }
The mean excess loss function provides information about the tail weight of a distribution, see the previous post The Pareto distribution. Also see Example 3 below. —————————————————————————————————————- The Mean in Question 2 The average that we need to compute is the mean of the following random variable. Note that $(a)_+$ is the function that assigns the value of $a$ whenever $a>0$ and otherwise assigns the value of zero. $\text{ }$ $\displaystyle (6) \ \ \ \ \ (X-d)_+=\left\{\begin{matrix}0&\ X $\text{ }$ The mean $E((X-d)_+)$ is calculated over all losses. When the loss is less than the deductible $d$, the insurer has no obligation to make a payment to the insured and the payment is assumed to be zero in the calculation of $E[(X-d)_+]$. The following is how this expected value is calculated depending on whether the loss $X$ is continuous or discrete. $\text{ }$ $\displaystyle (7) \ \ \ \ \ E((X-d)_+)=\int_d^\infty (x-d) \ f_X(x) \ dx$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9893474904166245, "lm_q1q2_score": 0.8111594208263365, "lm_q2_score": 0.8198933425148214, "openwebmath_perplexity": 262.62715424159506, "openwebmath_score": 0.9560127854347229, "tags": null, "url": "https://statisticalmodeling.wordpress.com/tag/probability-and-statistics/" }
java, beginner, adventure-game Inheritance Your class Adventure extends your TheGame class. This looks OK at first glance since you schould use inheritance when you have an "is a" relationship which is obviously true for Adventure and TheGame by means of the words. But if we look closer to what the classes really do then it is false: Adventure is only launching TheGame so its name is misleading and the inheritance is not justified. Code duplication This code has lots of duplicated code. This should be extracted to parameterized methods.
{ "domain": "codereview.stackexchange", "id": 34893, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, adventure-game", "url": null }
comets From the number of atmospheric holes, it’s possible to calculate that the atmosphere is being hit by a 20 to 40-tonne snowball comet every 3 seconds. According to Frank, this is enough to add an inch of water to the Earth’s surface every 20,000 years. Over the 4.5-billion-year lifetime of the Earth they could have provided all the water in the oceans. (emphasis added)
{ "domain": "astronomy.stackexchange", "id": 2895, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "comets", "url": null }
machine-learning, terminology The same applies to decision trees: you can follow the logic applied by the tree and understand why a certain element was assigned to one class or the other. However, deep neural networks are the paradigmatic example of black box algorithms. No one, not even the most expert person in the world grasp the function that is actually modeled by training a neural network. An insight about this can be provided by adversarial examples: some slight (and unnoticeable by a human) change in a training sample can lead the network to think that it belongs to a totally different label. There are some techniques to create adversarial examples, and some techniques to improve robustness against them. But given that no one actually knows all the relevant properties of the function being modeled by the network, it is always possible to find a novel way to create them. Humans are also black boxes and we are also sensible to adversarial examples.
{ "domain": "datascience.stackexchange", "id": 2706, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, terminology", "url": null }
matlab, transfer-function, control-systems The lesson is that the dominant pole approximations only hold when we truly have two dominant poles, with any other poles (and zeros!) significantly (as in 10x or more) further away from the $j\omega$ axis. The more accurate we desire the response to be, the further away the weaker poles and zeros need to be.
{ "domain": "dsp.stackexchange", "id": 10771, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, transfer-function, control-systems", "url": null }
ros, urdf, roslaunch, tutorial Title: ros urdf tutorial on osx I did some of the turtle sim tutorials and now I'm trying to do an urdf tutorial but I'm running into some issues. What's going on here? $ roslaunch urdf_tutorial display.launch model:='$(find urdf_tutorial)/urdf/01-myfirst.urdf' ... logging to /Users/Jackson/.ros/log/0b166d51-d251-11e5-96bf-a0999b17aec5/roslaunch-lapfeet.local-1073.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt started roslaunch server http://lapfeet.local:51266/ SUMMARY ======== PARAMETERS * /robot_description: <?xml version="1.... * /rosdistro: indigo * /rosversion: 1.11.16 * /use_gui: False NODES / joint_state_publisher (joint_state_publisher/joint_state_publisher) robot_state_publisher (robot_state_publisher/state_publisher) rviz (rviz/rviz) ROS_MASTER_URI=http://localhost:11311
{ "domain": "robotics.stackexchange", "id": 23752, "lm_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, roslaunch, tutorial", "url": null }
classical-mechanics, lagrangian-formalism, symmetry, time-reversal-symmetry symmetries of the action imply symmetries of the EOM asymmetries of the EOM imply asymmetries of the action symmetries of the EOM don't imply symmetries of the action asymmetries of the action don't imply asymmetries of the EOM
{ "domain": "physics.stackexchange", "id": 47566, "lm_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, lagrangian-formalism, symmetry, time-reversal-symmetry", "url": null }
ros, catkin-make, ros-controllers controller_state_publisher_->msg_.antiwindup = static_cast<char>(antiwindup); ^ /home/shantengfei/catkin_ws/src/ros_controllers/velocity_controllers/src/joint_position_controller.cpp: In member function ‘virtual bool velocity_controllers::JointPositionController::init(hardware_interface::VelocityJointInterface*, ros::NodeHandle&)’: /home/shantengfei/catkin_ws/src/ros_controllers/velocity_controllers/src/joint_position_controller.cpp:84:13: error: ‘class urdf::Model’ has no member named ‘initParamWithNodeHandle’ if (!urdf.initParamWithNodeHandle("robot_description", n)) ^
{ "domain": "robotics.stackexchange", "id": 29203, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, catkin-make, ros-controllers", "url": null }
navigation, robot-localization Originally posted by Tom Moore with karma: 13689 on 2015-08-19 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by Mehdi. on 2015-08-19: Actually my bag was taken during an amcl localization, so the transform between odom and map exists also. Comment by Mehdi. on 2015-08-20: Now it is working ! I tested it directly on the robot after I changed the odom publisher to set frame_id's without a slash. I think it was the problem. Thanks
{ "domain": "robotics.stackexchange", "id": 22480, "lm_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, robot-localization", "url": null }
special-relativity $$\Delta t' = \gamma \Delta t \,,$$ and a similar argument with measuring any relative distance $\Delta l$ between points in the direction of relative movement gives $$\Delta l' = \gamma \Delta l \, .$$ The stated relations will hold under any coordinate convention. Now suppose observer $O$ decides to establish a coordinate convention by setting $t=t'=0$ when her coordinate origin $x=0$ met with the coordinate origin $x'=0$ of $O'$. She then asserts that the relative distance between their origins grows as $-vt$, so they have after transforming any relative distances $$x'= \gamma (x - vt) \, .$$ By the same argument, she concludes that $O'$ must see the relative distances as changing in the opposite way with $+v t'$ and after using the same transform (due to the relativity principle), $O$ concludes that $$x = \gamma (x' + v t'\!) \,.$$
{ "domain": "physics.stackexchange", "id": 15645, "lm_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 }
quantum-field-theory, group-theory, lorentz-symmetry, spinors, unitarity This representation is the building block for constructing other representations and in particular the Fock space of Dirac quantum field.
{ "domain": "physics.stackexchange", "id": 43263, "lm_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, group-theory, lorentz-symmetry, spinors, unitarity", "url": null }
lo.logic, type-theory, homotopy-type-theory Title: Squash type vs Propositional truncation type Homotopy type theory has a notion of propositional truncation type. It seems to me that it's strongly related to a notion of squash types. (See https://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ttfp.pdf p. 265). It seems that squash types have serious problems with definitions (see the book), and prop. trunc don't. Why this is so? What are these problems? (The book mentions them, but I can't understand well what they are, they have an example for subtypes but, AFAIU it doesn't apply to squash types). Squash types correspond to judgmental truncation, not propositional truncation. In a type theory without a type for judgmental equality, there's non much of a way to make use of an inhabitant of a squash type; there's no way to write an eliminator into any type except another squash type. Relatedly, having squash types, as presented in the book you linked, makes typechecking undecidable; having propositional truncation types does not result
{ "domain": "cstheory.stackexchange", "id": 3100, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lo.logic, type-theory, homotopy-type-theory", "url": null }
electrical-engineering, control-engineering, control-theory, matlab so what I expected is that the performances with respect to the reference tracking increse as tau gets smaller, but if I do the Bode plot, what I get is: from which I don't really see much of an improvement. Moreover if I change some values: which is somenthing that to me does not makes sense because I should have that with $\tau =1$ I should have better performances than with $\tau =10$, this because with $\tau =1$ the pole is at higher frequencies that with $\tau =10$. Can somebody please help me solving this problem? Thanks in advance. [EDIT] If I plot the step responses I see the same problem: [EDIT 2]For completeness, I post the image of the step response for the first choise of tau's:
{ "domain": "engineering.stackexchange", "id": 3010, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrical-engineering, control-engineering, control-theory, matlab", "url": null }
To add to @svinja's solution, instead of traversing the whole list of a million numbers, do the following - L : List of million integers S : @svinja's algorithm Assuming indices start from 1 in L int positionOfX = binarySearch(L, x), where positionOfX = -(insertionPoint) in case x does not exist in L Apply S to L but traverse from 1 to i where i is at max abs(positionOfX/2) + 1.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305297023093, "lm_q1q2_score": 0.8316451459651582, "lm_q2_score": 0.8633915976709976, "openwebmath_perplexity": 643.2891082334017, "openwebmath_score": 0.5226359367370605, "tags": null, "url": "https://cs.stackexchange.com/questions/13302/average-time-complexity-of-two-nested-loops" }
magnetic-fields, earth, geophysics What is the reason behind it? In short: The Magnetosphere of a planet has its asymetrical shape due to the Magnetic pressure of the solar wind. On the sun side of the planet the solar wind squashes the Magnetosphere untill the magnetic pressure of the solar wind is equal to that of the Magnetic pressure put out by the planet. On the night side of the planet the magnetosphere is under a lot less pressure from the solar wind due to the protection of the planet, but still comes under pressure from the "sides"as the solar wind "expands" causing a very long tail like effect.
{ "domain": "physics.stackexchange", "id": 11342, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetic-fields, earth, geophysics", "url": null }
unit-testing, f# So what are the best practices for code format and file layout? I think F# code formatting guidelines have very concrete suggestions on these issues. There are a few small problems with your code: In naturalCompare, you should move local functions to the top so the logic of the function is clear. In compare, if you remove when in the last clause, you don't have to superficially throw an exception. Value tests is more readable in the form of normal list declaration. let tests = [ test01; test02; test03; test04; test05; test06; test07; test08; test09; ] Here is reformatted version of Katas.NaturalSortKata module. You could do the same for Katas.Testing.Tests. // 0) Declare module to save a level of indentation module Katas.NaturalSortKata open System.Linq type Comparison = | Equal | Lesser | Greater static member Compare x y = if x = y then Equal elif x > y then Greater else Lesser
{ "domain": "codereview.stackexchange", "id": 3060, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "unit-testing, f#", "url": null }
ros Originally posted by niksguru on ROS Answers with karma: 1 on 2015-11-27 Post score: 0 Your question needs a bit more explanation. Did you experience dependency issues while installing ROS? The regular procedure is to skip sudo apt-get install xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic libxatracker-dev-lts-utopic libopenvg1-mesa-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic libgl1-mesa-dev-lts-utopic libgbm-dev-lts-utopic libegl1-mesa-dev-lts-utopic if you do not have dependency issues while ROS installation. There is a clear warning on the installation page which says "If you are using Ubuntu Trusty 14.04.2 and experience dependency issues during the ROS installation, you may have to install some additional system dependencies. Do not install these packages if you are using 14.04, it will destroy your X server "
{ "domain": "robotics.stackexchange", "id": 23098, "lm_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 }
$$\lim_{x→c}f(x)=f(c)+\lim_{y→0}f(y)$$ which implies $f(x)=x$ QED My question is how to use $f(1)=1$ Then how to prove continuity for any rational number? • I don't quite understand the part where you write the limit and then 'which implies $f(x)=x$. As far as I can tell, or at least what the 'usual' approach would be, is to show continuity, then prove by induction $f(n)=n \forall n\in\mathbb{N}$, do the same for $\mathbb{Q}$, and since $\mathbb{Q}$ is dense in $\mathbb{R}$ we are done. But you seem to have somehow skipped that which is great if it works - if it works. – Some Math Student Oct 28 '14 at 21:26 • Just to make sure I get your points: Induction: the base case f(1)=1, then assume f(n)=n, f(n+1)=f(n)+f(1)=n+1? – Linh Phan Oct 29 '14 at 1:34 • Can you be more specific about proof for Q? – Linh Phan Oct 29 '14 at 1:36
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9585377261041521, "lm_q1q2_score": 0.8240201417974489, "lm_q2_score": 0.8596637559030338, "openwebmath_perplexity": 211.35590073258584, "openwebmath_score": 0.9687228798866272, "tags": null, "url": "https://math.stackexchange.com/questions/995673/limit-theorems-prove-function-has-a-limit-at-every-point" }
c#, strings, html, parsing public static HtmlDocument GetHtml(string source) { var html = new HtmlDocument { OptionFixNestedTags = true, OptionAutoCloseOnEnd = true, OptionDefaultStreamEncoding = Encoding.UTF8 }; html.LoadHtml(source); return html; } private static bool HtmlIsJustText(HtmlNode rootNode) { return rootNode == null || rootNode.Descendants().All(n => n.NodeType == HtmlNodeType.Text); } public static string SanitizeResponse(string response) { // temporarily change flags so we render 'proper' empty <p></p> tags HtmlNode.ElementsFlags["p"] = HtmlElementFlag.Closed; var rootNode = GetRootNode(NormalizeResponseBody(response)); if (HtmlIsJustText(rootNode)) { return response; } var whitelist = AllowedResponseHtml; // Omitted some code which can add additional things to the whitelist
{ "domain": "codereview.stackexchange", "id": 15402, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, strings, html, parsing", "url": null }
continuous and therefore is differentiable almost everywhere, that is, differentiable at every point outside a set of Lebesgue measure zero. The Absolute Value Function is Continuous at 0 but is Not Differentiable at 0 Throughout this page, we consider just one special value of a. a = 0 On this page we must do two things. Though the derivative of a differentiable function never has a jump discontinuity, it is possible for the derivative to have an essential discontinuity. Here I discuss the use of everywhere continuous nowhere differentiable functions, as well as the proof of an example of such a function. When a function is differentiable it is also continuous. If x and y are real numbers, and if the graph of f is plotted against x, the derivative is the slope of this graph at each point. geometrically, the function #f# is differentiable at #a# if it has a non-vertical tangent at the corresponding point on the graph, that is, at #(a,f(a))#.That means that the limit #lim_{x\to a}
{ "domain": "webwriter.ie", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9688561694652216, "lm_q1q2_score": 0.8094633833780669, "lm_q2_score": 0.8354835411997897, "openwebmath_perplexity": 290.2482914011687, "openwebmath_score": 0.8581441044807434, "tags": null, "url": "http://webwriter.ie/international-trade-tszq/6cca65-differentiable-vs-continuous-derivative" }
electromagnetism Title: How does motor effect work? Consider a current carrying wire in a uniform magnetic field. Obviously the wire moves due to the force exerted onto the wire. Ok, but why? I have heard 2 explanations. The first one talks about the electrons moving in the wire have Lorentz forces induced onto them according to $F=qv\times B$. This force then sort of "bumps" into the wire and moves the whole thing. There is an obvious fault with this explanation in that it assumes the collision is perfectly conservative.
{ "domain": "physics.stackexchange", "id": 83747, "lm_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", "url": null }
structural-engineering, columns I think it's useful to think as pressure in the pipe, as we have that data easily available - if we use PN10, it can take 10 bar, etc., and we don't need to think about the thickness of the pipe and it's yield strength. But how would the compressive force translate into pressure on the pipe? The concrete is no liquid, so pressue will be less than compressive load / pipe area. How much? I think understanding this will tell us how much, or little, our pillar will carry. Another possible issue is that PE is quite smooth. The pipe can't take forces via friction and in my mind that translates to point loads at the places where the concrete happens to deform most. Your idea could be ok, but depending on the situation it has a major flaw.
{ "domain": "engineering.stackexchange", "id": 1415, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "structural-engineering, columns", "url": null }
quantum-field-theory, renormalization EDIT : arxiv.org/abs/hep-ph/9901312 This might be an useful reference. Please look at the one-loop diagrams in the calculation of the effective potential in $ϕ^4$-theory. The naive power counting approach for a $d$-dimensional theory with coupling constant $\lambda$ tells us that the amplitude of diagrams with $E$ external lines and $V$ vertices behaves with the cutoff $\Lambda$ as $\propto\Lambda^D$ with $$ D = d - [\lambda]V - \frac{d-2}{2}E$$ where $[\dot{}]$ is the mass dimension. Since $\phi^4$ in four dimension has a dimensionless coupling, $$ D = 4-E $$ and since only diagrams with $D \geq 0$ need renormalization, the only diagrams needing it in 4D $\phi^4$ are those with $E \leq 4$. All diagrams with an odd number of external lines vanish due to the $\phi\mapsto-\phi$ symmetry, so what's left to renormalize is $E=0,2,4$, which are the vacuum energy, the propagator, and the 4-vertex, respectively.
{ "domain": "physics.stackexchange", "id": 25024, "lm_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, renormalization", "url": null }
ecology, ecosystem Title: In a typical model ecosystem, what might the percentage of plants be to top predators and everything inbetween? I'm not sure if this will be a simple question that is almost a natural law for an ecologist, or a complex serious of assumptions. I vaguely remember from school that only 10% of the energy is converted to biomass at each 'level up' however I have never seen any academic support of this. Lets say we have a fairly representative model ecosystem. In a pyramid of biomass, what percentage of biomass would I expect to see at each level (top predator, primary predator, herbivores, plant mass)? An additional part I would like to know is does this ever correlate to the ecosystem of any given tier. i.e typically 5 predators will be found in the same area as 20 herbivores rather than 10% of predator biomass for 100% of prey.
{ "domain": "biology.stackexchange", "id": 3369, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ecology, ecosystem", "url": null }
telescope surfaces will distort the image; second, for a given focal length, the lens surfaces will be more strongly curved than the mirror, which is more difficult to get correct; third, the shortest practical focal length is necessarily longer, resulting in a longer and more unwieldy instrument.
{ "domain": "astronomy.stackexchange", "id": 6533, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "telescope", "url": null }
ros, rosjava, publisher at org.ros.node.DefaultNodeFactory.newNode(DefaultNodeFactory.java:46) at Publisher_Test.<init>(Publisher_Test.java:31) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:210)
{ "domain": "robotics.stackexchange", "id": 16163, "lm_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, rosjava, publisher", "url": null }
• I signed up just so I could upvote this. Thank you. Very informative and intuitive. – Matt Klein Oct 9 '13 at 2:37 • Thanks, Matt. I'm glad it helped. – bubba Oct 9 '13 at 6:14 • nice explanation ! +1 only for "3D is where we live, so it's where our intuition works best" I was wondering what would it be if we live in higher dimensional space ? :) – houda Jun 8 '15 at 20:27 I know this is pretty old, but for the people who might find this in a google search (I know I did), I thought I'd add this.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126438601956, "lm_q1q2_score": 0.8279345669743012, "lm_q2_score": 0.8459424450764199, "openwebmath_perplexity": 188.10838829954437, "openwebmath_score": 0.9199366569519043, "tags": null, "url": "https://math.stackexchange.com/questions/507638/intuition-behind-matrix-being-invertible-iff-determinant-is-non-zero" }
int main(void) { unsigned long * primes = make_primes(prime_limit); printf("There are %ld primes <= %ld\n",primes[0],prime_limit); free(primes); return 0; } Say one wanted to form a list of all primes below 1,000,000. That’s what the above program does by default, since “prime_limit = 1000000.” If one compiles this and executes, you would get something like what follows. The timing is relatively respectable. $gcc -O3 -o prime-sieve prime-sieve.c$ time ./prime-sieve There are 78498 primes <= 1000000 real 0m0.008s user 0m0.004s sys 0m0.000s The code is linked here: prime-sieve.c
{ "domain": "jasonbhill.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9907319868927341, "lm_q1q2_score": 0.8553896904395946, "lm_q2_score": 0.8633916152464016, "openwebmath_perplexity": 1756.1766796464285, "openwebmath_score": 0.8579844236373901, "tags": null, "url": "http://code.jasonbhill.com/category/algorithms/" }
# logical consequence that is not tautological I am told that every tautological consequence is also a logical consequence, but what would a simple example be of a logical consequence that is not a tautological consequence? Update To further explain what I have 1. $$Q$$ is a tautological consequence of $$P_1...P_n$$ if and only if every row that assigns $$True$$ to each of $$P_1...P_n$$ also assigns $$True$$ to $$Q$$ 2. If $$Q$$ is a tautological consequence of $$P_1...P_n$$ then $$Q$$ is also a logical consequence of $$P_1...P_n$$ 3. Some logical consequences are not tautological consequences. I understand on how to see if $$Q$$ is a tautological consequence from a truth-table but not sure on how to know if it is a logical consequence in the absence of a tautological one. • And what do you mean by logical consequence? – Gur Ismael Aug 19 '16 at 13:45
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9449947101574299, "lm_q1q2_score": 0.8032182665783777, "lm_q2_score": 0.8499711775577736, "openwebmath_perplexity": 163.28630618095133, "openwebmath_score": 0.9303766489028931, "tags": null, "url": "https://math.stackexchange.com/questions/1896971/logical-consequence-that-is-not-tautological" }
If the samples are independent then: $$2E[(x-\hat{\sigma_x})(y-\hat{\sigma_y})]=0$$ Last edited: Jul 17, 2009 3. Jul 17, 2009 ### mXSCNT Well, let's assume that both samples are from the same distribution. Let z be the combined sample. An estimator of the variance of the distribution based on the combined sample is: $$\hat{\sigma}^2_z = 1/(n+m-1) \sum_z (z-\hat{z})^2$$ $$= 1/(n+m-1)(\sum_x (x-\hat{z})^2 + \sum_y (y-\hat{z})^2)$$ Now, this isn't quite in the form we want because of the $$\hat{z}$$. However, $$\hat{z} = (n\hat{x} + m\hat{y})/(n+m)$$. So (I'll just do the x's): $$\sum_x (x-\hat{z})^2 = \sum_x (x - (n\hat{x} + m\hat{y})/(n+m))^2$$ $$= \sum_x (x - \hat{x} + \hat{x} - (n\hat{x} + m\hat{y})/(n+m))^2$$ $$= \sum_x (x - \hat{x} + c)^2$$ where $$c = - (m\hat{y} - m\hat{x})/(n+m)$$ $$= \sum_x ((x - \hat{x})^2 + 2c(x - \hat{x}) + c^2)$$ $$= (n-1)\hat{\sigma}^2_x + 0 + nc^2$$ You can do the same thing for y, and combine them. Last edited: Jul 17, 2009 4. Jul 17, 2009
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9890130599601177, "lm_q1q2_score": 0.8241689018087119, "lm_q2_score": 0.8333245891029456, "openwebmath_perplexity": 525.4828280426759, "openwebmath_score": 0.9245573878288269, "tags": null, "url": "https://www.physicsforums.com/threads/variance-of-the-union-of-two-samples.325534/" }
geology Would coccoliths alone pile up for a long period of time, then sponges/siliceous plankton pile up for a much shorter time, then back to the coccoliths alone piling up and so on? ... seems very implausible. Sorry if this is a very basic question but this has been bugging me ever since I visited over 10 years ago! :D Thanks Flint formation is complex, and the details still subject of research and debate.
{ "domain": "earthscience.stackexchange", "id": 2436, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "geology", "url": null }
ros, navigation, path, move-base, ros-indigo [global_costmap_params.yaml] global_costmap: global_frame: /map robot_base_frame: base_link update_frequency: 5.0 publish_frequency: 2.0 static_map: true rolling_window: false [base_local_planner_params.yaml] TrajectoryPlannerROS: acc_lim_x: 0.1 acc_lim_theta: 0.25 max_vel_x: 0.1 min_vel_x: 0.1 max_vel_theta: 0.75 min_vel_theta: -0.75 min_in_place_vel_theta: 0.1 escape_vel: -0.05 holonomic_robot: false yaw_goal_tolerance: 0.2 xy_goal_tolerance: 0.3 latch_xy_goal_tolerance: false #pdist_scale: 11.0 have rad this on some other post but doesn't help at all #gdist_scale: 0.5 [move_base_params.yaml] controller_frequency: 10.0 planner_frequency: 0.5 recovery_behaviour_enabled: false recovery_behavior_enabled: false clearing_rotation_allowed: false Originally posted by -LD- on ROS Answers with karma: 135 on 2018-08-21 Post score: 0
{ "domain": "robotics.stackexchange", "id": 31591, "lm_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, navigation, path, move-base, ros-indigo", "url": null }
general-relativity, reference-frames, space-expansion When people talk about the velocity of galaxies receding away from us at or above the speed of light due to the expansion of the Universe, more often than not what they are doing is extrapolating Hubble's law $v=cz$ outside its regime of validity $z\ll 1$. So long as you know what you mean, this is ok-ish, but it can be extremely confusing when you are first learning the subject.
{ "domain": "physics.stackexchange", "id": 87731, "lm_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, reference-frames, space-expansion", "url": null }
gyroscope, matlab, filter :EDIT: You have since changed the units on Figure 2 (x-axis) from seconds to samples, which, at 300Hz, means you've changed the time scale from 5 minutes to 1 second. Again, a huge difference, but now this means that your 3/4 sine wave-looking section occurs in 40 samples, not 40 seconds, which at 300Hz means it happens in 0.1333 seconds. Then, a full sine wave happens in a period of 0.1777 seconds, for a frequency of 5.6257Hz. Note, however, that you are using normalized frequency on your last figure, and your signal frequency, 5.6257Hz, divided by your sampling frequency, 300Hz, gives you 0.0188. This again shows that the low frequency signal I'm assuming you're trying to eliminate is, in fact, the signal you want. As a correction, I had previously stated that you didn't provide time data, but in fact you had provided sampling frequency, which means that you have indirectly provided time data, given the number of samples in the test data you provided.
{ "domain": "robotics.stackexchange", "id": 1372, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gyroscope, matlab, filter", "url": null }
java, android, asynchronous, thread-safety, promise I claim my implementation is thread-safe, but I'm not entirely sure whether I should be using the volatile keyword for certain properties. In particular the private Promise.state. Do you see any other thread-safety issues? Do you see any issues that could arise from posting the callbacks on the main thread? I believe the actual bodies of callbacks posted on another thread will still be executed in that other thread's context, even though I post them to the main thread, but I'm not entirely sure (of possible edge cases). Code On Github package nl.codifier.android.promise; import android.os.Handler; import android.os.Looper; import androidx.annotation.NonNull; import java.util.ArrayList; import java.util.List; /** * This is the {@code Promise} class. * * @param <T> The type with which the {@code Promise} will be fulfilled */ @SuppressWarnings({"WeakerAccess", "UnusedReturnValue", "unused"}) public class Promise<T> {
{ "domain": "codereview.stackexchange", "id": 38248, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, android, asynchronous, thread-safety, promise", "url": null }
acid-base, experimental-chemistry, analytical-chemistry, titration The activity is sometimes described as the amount of $\ce{H3O+}$ ions divided by the volume of the so-called "free water" (and not by the volume of the solution). In concentrated solutions the "free water" is this small amount of water that is free to move, and not attracted and fixed around the ions. One Liter $1 M$ $\ce{HCl}$, should contain much less that $1$ Liter free water, maybe about $0.1$ Liter free water, or less.
{ "domain": "chemistry.stackexchange", "id": 14699, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acid-base, experimental-chemistry, analytical-chemistry, titration", "url": null }
performance, c, strings, memory-management, vigenere-cipher So essentially, I believe that code could be reduced to simply: if (block.data == NULL) break; Memory leak You never free block.data anywhere, so you keep leaking memory every time you read a new block and every time you encrypt/decrypt it. I would actually recommend changing your read_data_block function to take an existing block as an argument instead of allocating a new buffer every time. That way, you can allocate one block in main and reuse it. I would also suggest modifying your encrypt/decrypt function to write over the original contents instead of allocating a new block. Simplification I would rewrite this function: bool isvalid(char input) { if(isupper(input) || islower(input)) return true; else return false; } as this: bool isvalid(char input) { return isupper(input) || islower(input); } Unnecessary fclose() This line is unnecessary: fclose(stdin);
{ "domain": "codereview.stackexchange", "id": 17277, "lm_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, c, strings, memory-management, vigenere-cipher", "url": null }
electromagnetism, field-theory, aether I have seen a lot of animations doing exactly this, depicting the lines of force as changing through time. For example: https://www.youtube.com/watch?v=VdoL8IOwJw0 (go to the very end of the video, or look at minutes 1:53-2:08 , 7:31-7:48) What are the contradictions that Einstein is talking about here? It's because magnetic and electric fields transform into one another depending on your intertial frame, and therefore field lines aren't an invariant intrinsic property of space. In one frame, you could have a region where there's only a uniform magnetic field $\vec B$, so that any stationary charge remains classically at rest. Yet viewed from a frame moving normal to the direction of this magnetic field, the fields now become: $$\vec {E'} = \gamma\vec V\times \vec B, \quad \vec {B'} = \gamma\vec{B} $$ In this frame, a stationary charge will now be accelerated by the electric field $E'$.
{ "domain": "physics.stackexchange", "id": 13136, "lm_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, field-theory, aether", "url": null }
optics, refraction, geometric-optics, complex-numbers Title: Example on Snell's Law with complex solution Snell's Law: $$\frac{\sin(\theta_1)}{\sin(\theta_2)}=\frac{n_2}{n_1}$$ I have read some explanation on understanding complex Snell's Law like Explanation of sin(theta) > 1 for total internal reflection, but still have questions on concrete examples. So I want to list my questions here by calculating a simple examples. (0) Let's begin with a simple example by setting the index of refraction in incident medium $n_1=4$, and the index of refraction in reflecting medium $n_2=2$. When $\theta_1=\frac{\pi}{6}$, we will calculate to get $\theta_2=\frac{\pi}{2}$. We call the angle $\frac{\pi}{6}$ the critical angle.
{ "domain": "physics.stackexchange", "id": 41015, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, refraction, geometric-optics, complex-numbers", "url": null }
rosmake, cmake Originally posted by Sebastian Schneider on ROS Answers with karma: 31 on 2012-02-13 Post score: 2 Original comments Comment by Sebastian Schneider on 2012-03-20: I solved it buy building an arch package based on the *.deb files for ubuntu. See more here: http://answers.ros.org/question/28134/whats-the-best-way-to-package-ros?answer=30029#post-id-30029 As @seanarm said, the current answer is "no". There are significant build changes in the upcoming Fuerte release, using a more generic cmake approach. One of the main goals is to allow external libraries (like PCL) to depend on smaller ROS components, such as messages and message generation, without adopting the entire ROS build methodology. Originally posted by joq with karma: 25443 on 2012-02-14 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 8224, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosmake, cmake", "url": null }
I will deal with the $n\times n$ case only Summarising this :) Let $T_n$ be the total number of squares (including tilted ones) on a square grid and let $N_n$ be the number of 'normal' squares, oriented such that the sides of these squares are parallel to the sides of the original grid. I claim that $T_n=T_{n-1}+N_n$ by providing a bijection between tilted squares in a $n\times n$ grid and all squares in a $(n-1)\times (n-1)$ grid. For any square in a $(n-1)\times (n-1)$ grid, fix the top right corner (top takes priority - so a diagonal square would just be the top corner) and move the vertex that is counterclockwise around from it down one unit. Then this forms a side of a new square (such that the top right vertex is still the top right vertex). This is non-trivially a bijection, but it is not that hard to prove either so I leave it as an exercise. Bijection picture (appropriated from brilliant.org):
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668673560625, "lm_q1q2_score": 0.8067047335684269, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 721.7441907899996, "openwebmath_score": 0.7807345390319824, "tags": null, "url": "https://puzzling.stackexchange.com/questions/51814/how-many-squares-can-you-make-with-equal-ranged-points/51819" }
not be satisfied with this counter-example, but in higher mathematics this kind of identity is in fact the usual kind that we are interested in, rather than identities that can be proven by algebraic manipulation (which are usually considered trivial). Here are some more examples:$\lceil \frac{m}{n} \rceil = \lfloor \frac{m-1}{n}+1 \rfloor$for any$m \in \zz$and$n \in \zz_{>0}$.$\sum_{k=0}^{n-1} 2^k = 2^n-1$for any$n \in \zz_{>0}$. Nevertheless, if you desire an arithmetic identity, the question becomes much more interesting and depends heavily on what you mean by "arithmetic" and what axioms you are allowed to use. Tarski's problem asked whether an arithmetic identity concerning positive integers can be proven using only the basic high-school identities about them, and Wilkie gave an explicit and simple identity that cannot be so proven, basically because any proof needs to use subtraction and hence negative integers. • It seems clear to me that the OP's teacher's advice, "To prove
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9799765557865637, "lm_q1q2_score": 0.8852071480988408, "lm_q2_score": 0.903294209307224, "openwebmath_perplexity": 481.2578683796757, "openwebmath_score": 0.8332354426383972, "tags": null, "url": "https://math.stackexchange.com/questions/1763978/can-you-use-both-sides-of-an-equation-to-prove-equality" }
your independent variable in column A and your dependent variable in column B. We perform a hypothesis test of the As mentioned above correlation look at global movement shared between two variables, for example when one variable increases and the other increases as well, then these two variables are said to be positively correlated. In correlation analysis, we estimate a sample correlation coefficient, more specifically the Pearson Product Moment correlation coefficient. With formulas highlighted, select the Insert Function button to the far left. Das Quadrat des Korrelationskoeffizienten stellt das Bestimmtheitsmaß dar. The linear correlation coefficient is also referred to as Pearson’s product moment correlation coefficient in honor of Karl Pearson, who originally developed it. The correlation coefficient is a measure of how well a line can describe the relationship between X and Y. R is always going to be greater than or equal to negative one and less than or equal to one. The
{ "domain": "tjoget.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9511422186079558, "lm_q1q2_score": 0.8280618110011103, "lm_q2_score": 0.8705972616934408, "openwebmath_perplexity": 694.2967450453659, "openwebmath_score": 0.6670904159545898, "tags": null, "url": "https://tjoget.com/6e0z6432/linear-correlation-coefficient-d435c1" }
In this particular case I saw by your work that you were likely correct (My answer mached the other form). I then made doubly sure my checking your equation in the original equation. Convinced that you were correct I set about reducing each equation to the other, as I knew getting the same answer in different forms is a common occurance. 16. Sep 4, 2005 ### asdf1 wow~ thank you very much!!! :)
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9875683484150417, "lm_q1q2_score": 0.8746216208463123, "lm_q2_score": 0.8856314828740728, "openwebmath_perplexity": 1621.8618494681266, "openwebmath_score": 0.6987043023109436, "tags": null, "url": "https://www.physicsforums.com/threads/o-d-e-question-too.86511/" }
= 5, p= 4/13, and k= 3, so set trials = 4/13 and x value = 3. Input requirements: Probability of success 0 and 1 (that is, 0. Perform the drawings with replacement of the marbles to study independent events, or without replacement to explore dependent events. In today's video, we discussed a simple way to solve the probability problems of bags and balls. two balls are drawn at random. 1 Long run relative frequency. is the theoretical probability of the arrow landing on the shaded section greater than, A bag of equally-sized marbles contains 6 green marbles, 8 blue marbles, and 10 red marbles. Use the slope formula: Slope = Change in y Change in x = y 2 − y 1 x 2 − x 1. Samantha randomly picks marbles from a box. • A probability of 1 means the event is , or has to happen. Task Cards are great for independent math rotations or small groups. Introduction to Probability Exercise Problem Solution 1 Which of the following is an experiment? Tossing a coin. If the probability that Adora
{ "domain": "mirtillhouse.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806512500486, "lm_q1q2_score": 0.8128413523663707, "lm_q2_score": 0.8289388040954683, "openwebmath_perplexity": 667.2365926197297, "openwebmath_score": 0.6545421481132507, "tags": null, "url": "http://mirtillhouse.it/probability-simulator-marbles.html" }
java, algorithm, programming-challenge, binary-search final int nextTowerIndex = HackerlandRadioTransmitters.findNextTowerIndex(houseLocations, houseNotCoveredIndex, transmitterRange); assert nextTowerIndex == 0; } static void test_02() { final int[] houseLocations = {1, 5, 9}; final int houseNotCoveredIndex = 0; final int transmitterRange = 4; final int nextTowerIndex = HackerlandRadioTransmitters.findNextTowerIndex(houseLocations, houseNotCoveredIndex, transmitterRange); assert nextTowerIndex == 1; } static void test_03() { final int[] houseLocations = {1, 5, 9}; final int houseNotCoveredIndex = 2; final int transmitterRange = 20; final int nextTowerIndex = HackerlandRadioTransmitters.findNextTowerIndex(houseLocations, houseNotCoveredIndex, transmitterRange); assert nextTowerIndex == 2; } } MinimumNumberOfTransmittersTest package biz.tugay.test; import biz.tugay.HackerlandRadioTransmitters;
{ "domain": "codereview.stackexchange", "id": 25261, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, programming-challenge, binary-search", "url": null }
fft, discrete-signals, frequency-spectrum, dft = \exp{\left(j2\pi \frac{-N}{2}n/N\right)} \\ \Rightarrow e^{j\pi n} = e^{-j \pi n} \Rightarrow \cos(\pi n) = \cos(-\pi n)=(-1)^n,\ j\sin(\pi n) = j\sin(-\pi n) = 0 $$ MATLAB and Numpy go $[-N/2, ..., N/2-1]$, which is unfortunate for analytic representations (+ freqs only). Note also its value is doubled relative to other bins (but not manually; they correlate this way), so in a sense it's both a negative and positive frequency, so energy's preserved:
{ "domain": "dsp.stackexchange", "id": 11642, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, discrete-signals, frequency-spectrum, dft", "url": null }
ros, include, roscpp tf/frames.hpp include file does not exist, you probably meant kdl/frames.hpp. <depend package="kdl"/> To use Xn* headers you need to depend on nite and openni packages. <depend package="nite"/> <depend package="openni"/> Originally posted by arebgun with karma: 2121 on 2011-07-13 This answer was ACCEPTED on the original site Post score: 3 Original comments Comment by qdocehf on 2011-07-15: He edited it after I made the comment. Comment by Asomerville on 2011-07-14: @qdocehf... he did include the lines. OpenNI. Comment by qdocehf on 2011-07-13: Could you give me exactly what I need to add to the manifest.xml file for the Xn headers()? I do not know where to find it, and it does not fit the pattern of the others. Comment by qdocehf on 2011-07-13: Sorry, the ros headers had not been working earlier, so I did not check when I uploaded the errors.
{ "domain": "robotics.stackexchange", "id": 6123, "lm_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, include, roscpp", "url": null }
phase, linear-algebra, group-delay \end{align} $$ Which finally simplifes to $$ \phi^{'}(w) = \frac{ r \cos(\theta-w) -r^2 } { 1-2r \cos(\theta-w) + r^2}$$ Then since the group delay is the negative of this we finally have: $$ \tau(w) = -\phi^{'}(w) = \frac{ r^2 - r \cos(\theta-w) } { 1 + r^2 -2r \cos(\theta-w) }$$ $$ \tau(w) = -\phi^{'}(w) = \frac{ r^2 - r \cos(w-\theta) } { 1 + r^2 -2r \cos(w -\theta) }$$ Which is the same as the book's formula. Coming to Matlab's output, you may try simplifications. But they are known to produce more verbose outputs than possible with simplifications.
{ "domain": "dsp.stackexchange", "id": 5500, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phase, linear-algebra, group-delay", "url": null }
To see how good the fit is, evaluate the polynomial at the data points and generate a table showing the data, fit, and error. ```f = polyval(p,x); T = table(x,y,f,y-f,'VariableNames',{'X','Y','Fit','FitError'})``` ```T=26×4 table X Y Fit FitError ___ _______ __________ ___________ 0 0 0.00044117 -0.00044117 0.1 0.11246 0.11185 0.00060836 0.2 0.2227 0.22231 0.00039189 0.3 0.32863 0.32872 -9.7429e-05 0.4 0.42839 0.4288 -0.00040661 0.5 0.5205 0.52093 -0.00042568 0.6 0.60386 0.60408 -0.00022824 0.7 0.6778 0.67775 4.6383e-05 0.8 0.7421 0.74183 0.00026992 0.9 0.79691 0.79654 0.00036515 1 0.8427 0.84238 0.0003164 1.1 0.88021 0.88005 0.00015948 1.2 0.91031 0.91035 -3.9919e-05 1.3 0.93401 0.93422 -0.000211 1.4 0.95229 0.95258 -0.00029933 1.5 0.96611 0.96639 -0.00028097 ⋮ ``` In this interval, the interpolated values and the actual values agree fairly closely. Create a plot to show how outside this interval, the extrapolated values quickly diverge from the actual data.
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9871787830929849, "lm_q1q2_score": 0.8330753442736298, "lm_q2_score": 0.8438951064805861, "openwebmath_perplexity": 776.9892564091139, "openwebmath_score": 0.7791977524757385, "tags": null, "url": "https://www.mathworks.com/help/matlab/ref/polyfit.html" }
javascript, algorithm, ecmascript-6 for (let i = 0; i < length; i++) { const x = direction === 'vertical' ? position : i, y = direction === 'vertical' ? i : position; if (grid[y][x]) { if (current > maximum) { maximum = current; offset = start; } current = 0; start = i + 1; } else { current++; } } return { x: direction === 'vertical' ? position : offset, y: direction === 'vertical' ? offset : position, length: maximum, direction }; } function findLongestLineInRowRange(start, end, direction) { let longest = { x: 0, y: 0, length: 0 }; for (let i = start; i < end; i++) { const line = findLongestLineInRow(grid, i, direction); if (line.length > longest.length) { longest = line; } } return longest; }
{ "domain": "codereview.stackexchange", "id": 24124, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, algorithm, ecmascript-6", "url": null }
this ex ample, the data is stored in the file census. is there a possibility to do a 2d-spline interpolation with scattered data in matlab?. DSTOOLS - Descriptor System Tools for MATLAB DSTOOLS is a collection of MATLAB functions for the operation on and manipulation of rational transfer-function matrices via their generalized state-space (or descriptor) system representations. Unlike the other methods, this interpolation is not based on a triangulation. B-spline registration of two 2D / 3D images or corrsp. Matlabe uno dei programmi scientifici di maggior diffusione, grazie alle sue numerose applicazioni in campi quali l’elettronica, la controllistica, l’analisi dei segnali, l’elaborazione di immagini, la chimica, la statistica e numerosi altri. pp = spline(x,Y) yy = spline(x,Y,xx) Description. A MATLAB toolbox for the time-domain simulation of Focussed 2D Array With Directional Elements Number of spline segments used in the smoothing spline if. The simplest spline is something very
{ "domain": "otticamuti.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97241471777321, "lm_q1q2_score": 0.8165696750288508, "lm_q2_score": 0.8397339736884711, "openwebmath_perplexity": 1972.3408258527913, "openwebmath_score": 0.5017431378364563, "tags": null, "url": "http://qxm.otticamuti.it/2d-spline-matlab.html" }
• What's a nice function.? – Nosrati Feb 14 '17 at 3:35 • @Helmut: This is ultimately a consequence of dominated convergence. I purposely avoided the Lebesgue approach to add substance to your correct observation that mass concentrates around $x = T$. All IBP does is shift consideration to the limit of $\int_0^Te^{n(x-T)} f'(x) \, dx$. Under suitable assumptions on $f'$ if it exists and is integrable you would have show that integral converges to $0$. This would require similar consideration of interchanging a limit and an integral as discussed below and brings up the unnecessary details about the derivative. – RRL Feb 14 '17 at 5:51
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936082881853, "lm_q1q2_score": 0.824296460068913, "lm_q2_score": 0.8376199714402812, "openwebmath_perplexity": 145.97242075555266, "openwebmath_score": 0.9540312886238098, "tags": null, "url": "https://math.stackexchange.com/questions/2143446/why-does-int-0t-nenx-tfx-converge-to-ft" }
thermodynamics Title: Is there a hot equivalent of liquid nitrogen? Liquid nitrogen is often used for tasks requiring fast and extreme cooling of other substances. Is there a substance that can play a similar role for fast and extreme heating, yet be portable in some canister? During my PhD I used molten lead as a way of rapidly heating samples. It has a melting point of about 330ºC and its high thermal conductivity means it very rapidly heats anything dropped into it. In terms of portability it's probably about as portable as liquid nitrogen since you could carry it about in a (pyrex!) vacuum flash, though I never attempted this feat. As a general rule heating things is a lot easier than cooling them down, so I'm not sure there is a real parallel for the use of liquid nitrogen.
{ "domain": "physics.stackexchange", "id": 42196, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics", "url": null }
velocity $$2\pi /120$$ Boom! That's already the formula $\omega = \frac{2\pi}{T}$ that we just showed intuitively! $\omega$ is angular velocity, $T$ is your period (how long to go one revolution). But what if I wanted to figure out how far I actually ran (distance-wise) on that track? Well in that 120 seconds, how far did I travel? Going back to geometry, I ran a whole circle circumference of radius $50m$. The formula for that is $2\pi r$. So like before, we'll divide. $$ v= \frac{2\pi * 50}{120} = 2.617 m / s$$ That gives us our other very important formula! $$ v = \frac{2\pi r}{T}$$ Becuase $ v = \frac{2\pi r}{T}$ and $\omega = \frac{2\pi}{T}$, this means that $v = r\omega$. And there you have it, pretty much all the angular equations you need to know.
{ "domain": "physics.stackexchange", "id": 39907, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "velocity", "url": null }
Correct 4(-x+2) ------- (x+4)^4 4(-x+2)=0 4(-x+2)=0 ------- -- 4 4 (-x+2)=0 -x=-2 =2 4. Originally Posted by sderosa518 So the extrema is 2??? no. extrema are function values (y's). x = 2 is a location for a possible function extrema. conduct the 1st or 2nd derivative test for extrema to classify/confirm. 5. Originally Posted by sderosa518 So the extrema is 2??? Is there more extremas. Key Word ALL??? Correct 4(-x+2) ------- (x+4)^4 4(-x+2)=0 4(-x+2)=0 ------- -- 4 4 (-x+2)=0 -x=-2 =2 For $x>2$, $f'(x)>0$ For $x<2$, $f'(x)<0$ $f'(x)$ changes from positive to negative at $x=2$ So $f(x)$ has a local max at $x=2$ To find the value of the local max, find $f(2)$ Yes, there is only 1 extremum 6. Originally Posted by sderosa518 Find All Extrema y=(2x)/(x+4)^3 f '(x)= (x+4)^3(2)-(2x)(3)(x+4)(1) ------------------------- ((x+4)^3)^2)
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822876992225168, "lm_q1q2_score": 0.8164215983682895, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 1093.0515173352653, "openwebmath_score": 0.8958123922348022, "tags": null, "url": "http://mathhelpforum.com/calculus/136988-extrema.html" }
distribution concentrated at 0 — a degenerate distribution — but the notation treats it as if it were a continuous distribution. NCERT Books. The cumulative distribution function (FX) gives the probability that the random variable X is less than or equal to a certain number x. Depending upon the types, we can define these functions. The distribution may in some cases be listed. If Xand Yare continuous, this distribution can be described with a joint probability density function. Consider the coin flip experiment described above. We do not have a table to known the values like the Normal or Chi-Squared Distributions, therefore, we mostly used natural logarithm to change the values of exponential distributions. In other cases, it is presented as a graph. One of the most common examples of a probability distribution is the Normal distribution. The probability distribution function formula is used to represent a density lying between a certain range of values. The distribution may in some
{ "domain": "ape-saint-mathieu.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754461077707, "lm_q1q2_score": 0.8003291953912156, "lm_q2_score": 0.8128673110375457, "openwebmath_perplexity": 527.5026845598305, "openwebmath_score": 0.6972829699516296, "tags": null, "url": "https://ape-saint-mathieu.com/site/probability-distribution-function-example-d6f45b" }
cc.complexity-theory, co.combinatorics, sat The picture is a little nicer for conjunctions of clauses each of which contains exactly one positive literal. Their solution sets are families closed under arbitrary intersections (where in particular the empty intersection is the full set), also known as closure systems or Moore families. These are in 1–1 correspondence with closure operators (functions $C\colon\pw([n])\to\pw([n])$ satisfying $X\subseteq C(Y)\iff C(X)\subseteq C(Y)$), consequence relations (relations ${\vdash}\subseteq\pw([n])\times[n]$ satisfying a handful of natural conditions), and I guess there are more similar combinatorial characterizations (https://oeis.org/A102896 or https://oeis.org/A102897 mention semilattices). These two numbers only differ by a factor of two (given a closure system $S$, we may either retain $[n]\in S$ or throw it out without affecting anything else). Alekseev proved that the number $\alpha(n)$ of closure systems on an $n$-element set satisfies
{ "domain": "cstheory.stackexchange", "id": 3131, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, co.combinatorics, sat", "url": null }
python, image, steganography if custom_image is not None: #Read and process custom image custom_image_input = self._read_image(custom_image) image_width, image_height = custom_image_input.size max_image_bytes = image_width * image_height self._time('Read custom image', t) #Calculate required bits per byte total_data_bytes = len(pixel_data) + 1 self._print('Image resolution: {}x{} ({} pixels)'.format( image_width, image_height, max_image_bytes), 1) self._print('Input data: {} bytes'.format(total_data_bytes), 1) self._print(('Checking the smallest possible ' 'bits per byte to use...'), 1)
{ "domain": "codereview.stackexchange", "id": 15973, "lm_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, image, steganography", "url": null }
quantum-field-theory, hilbert-space, wavefunction, probability, born-rule I think mathematically we square the wavefunction to find the probability of electron at that spot or for every point in space. The wavefunction that is squared is the solution of the specific boundary conditions for the specific measurement and it will give a solution that fits the observed data. It is not the general wavefunctions making up the particle fields and the propagation of paricles with creation and annihilation operators. It is a specific one for the given experiment/observation , and field theory is used to get the Feynman diagrams of the interaction for the specific case. And it is the square of the specific to the interaction wave function that is measurable. The success of the standard model in describing the elementary particle data supports the use of quantum field theory, but one has to keep in mind that it is only the complex conjugate squared of the wavefunction of the specific interaction under study that can be validated by experimental data, i.e. measured.
{ "domain": "physics.stackexchange", "id": 68977, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, hilbert-space, wavefunction, probability, born-rule", "url": null }
computational-geometry, doubly-connected-edge-list next should be equivalent to Lnext in the picture. Thus I tried to derive it and got e.rot.rot.rot.Onext.rot. prev should be equivalent to Lprev, which is the twin of Onext, i.e. e.Onext.rot.rot. Is this correct? I am using quad-edges to prove properties on half-edges, so I want to make sure I got the basics correct before I proceed. It looks like you took these diagrams from this CMU publication. This publication also refers to the C++ header cell/edge.hh, describing basic and derived operations on edges. So, according to this header, operations Rot, InvRot, Sym and Onext are considered basic ones, and all the other operations - derived ones. The DCEL operations next and prev are equivalent to quad-edge operations Lnext and Lprev, which are defined in this header as inline functions (I'm dropping the C++ syntax and keeping the meaning): e.Lnext = e.InvRot.Onext.Rot e.Lprev = e.Onext.Sym So, your formulas look correct, with slightly overused operation Rot.
{ "domain": "cs.stackexchange", "id": 13681, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computational-geometry, doubly-connected-edge-list", "url": null }
data-structures save more values than the vector allows or the hashfuntion is not completely one on one (that is every y has a unique x value it corresponds to) In that case you wil need to make the vector longer and remap every value within the vector or you reshash the value from the hashfunction with that same same value it has returned (usualy slightly edited to avoid all values being at the same place in the vector) as the parameter to find a new adress that wasn't used before. There are a number of other techniques involved and other methods but that is beside the point.
{ "domain": "cs.stackexchange", "id": 7279, "lm_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-structures", "url": null }
### HallsofIvy As others said, the simplest thing to do is to let u= cos(x) so that du= -sin(x)dx $$\int cos^5(x) sin(x)dx= \int u^5(-du)= -\int u^5 du$$. $$= -u^6/6+ c= -cos^6(x)/6+ c$$ If, instead, you write the integral as $$\int (cos^2(x))^2 (cos(x)sin(x)dx)= \int (1- sin^2(x))^2(sin(x))(cos(x)dx)$$ and let $u= sin(x)$, then $du= cos(x)dx$ and your integral becomes $$\int (1- u^2)^2(u)(du)= \int (u^5- 2u^3 + u)du= u^6/6- u^4/2+ u^2/2+ C$$ $$= sin^6(x)/6- sin^4/2+ sin^2/2+ C$$ $$= \frac{1}{6}(sin^6(x)- 3sin^4(x)+ 3sin^2(x))+ C$$ $$= \frac{1}{6}((1- cos^2(x))^3- 3(1- cos^2(x))^2+ 3(1- cos^2(x)))+ C$$ Now, "do the algebra". You will find that the $cos^4(x)$ and $cos^2(x)$ terms cancel leaving $-cos^6(x)/6$ but with a different constant. 6. Jun 22, 2011 ### icesalmon
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.968856165868213, "lm_q1q2_score": 0.8073716763481558, "lm_q2_score": 0.8333245994514082, "openwebmath_perplexity": 1080.7096327561326, "openwebmath_score": 0.8694241046905518, "tags": null, "url": "https://www.physicsforums.com/threads/trigonometric-integral.508756/" }
newtonian-mechanics, energy-conservation, conventions Title: Non-linear pendulum (Whittaker's treatise on analytical dynamics of particles) Reading through Whittaker's "treatise on the analytical dynamics of particles and rigid bodies" I have a question regarding his analysis of the simple nonlinear pendulum at chapter IV. At some point he says that the equation of energy is: $$a \dot \theta^{2} = 2g \cos\theta + \rm{constant} = - 4 g \sin^{2} \left( \frac{\theta}{2} \right) + \rm{constant}$$ Where $a$ is length of the pendulum or radius of the circle. Then he goes on and says "Suppose that when the particle is at the lowest point of the circle, the quantity $\frac{a^{2}\dot\theta^{2}}{2g}$ has the value $h$. Then this last equation can be written $$a^{2} \dot \theta^{2} = 2gh - 4ga \sin^{2}\left(\frac{\theta}{2} \right)$$ I can't follow how he derived that last equation. It's important 'cause the analysis of the types of movements basically depends on $h$ being less, equal or greather than $2a$.
{ "domain": "physics.stackexchange", "id": 25706, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, energy-conservation, conventions", "url": null }
optimization, coffeescript $("<span rel='tooltip' title='Decreased' class='lastweek'> <b>#{a - c}</b> </span>").addClass(sortboxarrowdown).css(css).appendTo(changes) else if a > c && c is 0 $("<span rel='tooltip' title='Started Ranking' class='lastweek'> <b>new</b> </span>").addClass("sortboxnew").css(css).appendTo(changes) else if a < c && a is 0 && c > 0 $("<span class='lastweek' rel='tooltip' title='Dropped'> <b>Dropped</b> </span>").addClass("sortboxdrop").css(css).appendTo(changes) else if a < c $("<span rel='tooltip' title='Increased' class='lastweek'> <b>#{c - a}</b> </span>").addClass(sortboxarrowup).css(css).appendTo(changes) else if a is c $("<span rel='tooltip' title='No Change' class='lastweek'> </span>").addClass(sortboxbarseq).css(css).appendTo(changes) if $(this).val() is "3" $(changes).empty() if a > d && d > 0
{ "domain": "codereview.stackexchange", "id": 7653, "lm_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, coffeescript", "url": null }
neural-networks, training cannot successfully retrieve an image of a dog, if all you've fed in the training phase was cats' and lizards' images. So can you guarantee that new messages to be encoded have the same type as the ones in the training set?! If no, then you might also take this challenge into account.
{ "domain": "ai.stackexchange", "id": 229, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neural-networks, training", "url": null }
machine-learning, backpropagation # Weights (Parameters) # Weight matrix between input and first layer W = np.random.rand(self.inputLayerSize, self.hiddenLayerSize) self.weights.append(W) for i in range(self.numHiddenLayer-1): # Weight matrices between hidden layers W = np.random.rand(self.hiddenLayerSize, self.hiddenLayerSize) self.weights.append(W) # Weight matric between hiddenlayer and outputlayer self.weights.append(np.random.rand(self.hiddenLayerSize, self.outputLayerSize)) def setBatchSize(self, numExamples): # Changes the number of rows (examples) for biases if (self.numExamples > numExamples): self.biases = [b[:numExamples] for b in self.biases] def sigmoid(self, z): # Apply sigmoid activation function return 1/(1+np.exp(-z)) def sigmoidPrime(self, z): # Derivative of sigmoid function return 1-self.sigmoid(z)
{ "domain": "datascience.stackexchange", "id": 2191, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, backpropagation", "url": null }
np-complete, decision-problem, polynomial-time-reductions Proof Forward Direction: Suppose $H$ contains a clique of size at most $k$. Let the vertices of this clique be the set $C_W \subseteq W$. It is easy to see for the graph $G$, the set $W \setminus C_W$ is an odd cycle traversal of $G$. And, the set $W \setminus C_W$ has size $n-k$. This proves the forward direction. Proof Reverse Direction: Suppose $G$ has an odd cycle traversal $V_O$ of size at least $n-k$. Let us define its left side as $V_L = W \cup V_O$ and its right side as $V_R = W' \cup V_O$. Let $G'$ be the bipartite graph obtained by removing $V_O$ from $G$. Now, note the following observations:
{ "domain": "cs.stackexchange", "id": 19412, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np-complete, decision-problem, polynomial-time-reductions", "url": null }
thermodynamics, visible-light, heat, everyday-life, thermal-conductivity At the equator the intensity of sunlight at the ground is about 1kW/m$^{2}$, of which about half is visible and half is IR (plus a few per cent in the UV). The As fffred says in the comment, water absorbs IR radiation so about half the energy is absorbed directly by the water. The visible light will pass through water unabsorbed and will heat the walls of the swimming pool. Because water absorbs IR you get a greenhouse effect that keeps the walls warm, and the walls then warm the water by conduction and convection.
{ "domain": "physics.stackexchange", "id": 8129, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, visible-light, heat, everyday-life, thermal-conductivity", "url": null }
earth, comets, venus, impact, planetary-atmosphere But water vapour is known to be a strong greenhouse gas. So, couldn't be the case, instead of boiling whole oceans, a single impact could release just enough water steam to kickstart a runaway greenhouse like the one in Venus? I imagine that would happen if a substantial fraction of the atmosphere becomes steam (guess 50%). We can estimate the mass of Earth atmosphere by multiplying atmospheric pressure by planet surface area, giving about 5.2 * 10^18 kg. We can estimate the energy necessary to release a equal amount of steam, multiplying this mass by water Enthalpy_of_vaporization, and the impactor kinetic energy required, by E = mv^2/2(see below). I assumed a 20km/sec speed that I read somewhere to be close to average for a collision with Earth (the range goes from about 11km/sec to 70 km/sec).
{ "domain": "astronomy.stackexchange", "id": 4645, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "earth, comets, venus, impact, planetary-atmosphere", "url": null }
bacteriology, antibiotic-resistance, research-process Once you end up with some resistant bacteria and you're done researching it, you can't just flush it down the toilet. How do you safely dispose those colony plates in a way that ensures those bacteria don't get out into the wild and reproduce? You are absolutely right, flushing down the toilet (or the sink) or simply throwing them into the normal waste doesn't work for biosafety reasons. And it is also not allowed, depending on the country you would do this in, this can lead to hefty fines. Biologically contaminated lab waste can be inactivated (=all potential dangerous organisms are destroyed) by two ways: Either by heat or chemically. Which ways is used, depends on the kind of waste.
{ "domain": "biology.stackexchange", "id": 10250, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bacteriology, antibiotic-resistance, research-process", "url": null }
wind, mesoscale-meteorology and because $\frac{T R \rho}{p}=1$ by the ideal gas law we end up with $$\rho c_p \theta \dfrac{\partial \pi}{\partial z} = \left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}\dfrac{\partial p}{\partial z}.$$ This is almost what is stated in $\eqref{wanted}$, but not quite and I do not know how to get rid of the factor $\left(\frac{1}{p_0}\right)^{\frac{R}{c_p}}$ resp. do not see why it remains unmentioned in the textbook. Any help is appreciated. Start with the original equation. Let's first write the Hydrostatic equation: $$\frac{\partial p}{\partial z}=-\rho g$$ So let's prove that $$-g=c_p\theta\frac{\partial \pi}{\partial z}$$ If we use the product rule, we observe $$-g=c_p(\frac{\partial \theta \pi}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$ Since $\pi=\frac{T}{\theta}$, we can say that $T=\pi\theta$, which makes the above equation $$-g=c_p(\frac{\partial T}{\partial z}-\pi\frac{\partial \theta}{\partial z})$$ It can be shown that
{ "domain": "earthscience.stackexchange", "id": 2029, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "wind, mesoscale-meteorology", "url": null }
ros Title: why do I get an Error when I set ROS_WORKSPACE? Hi, I have installed Ros_groovy. And I am creating my workspace with the tutorial: "Installing and Configuring Your ROS Environment" and everything goes okay, until I write: john@john-G41D3C:~$ rosws set ~/groovy_workspace/sandbox ERROR in config: Command requires a target workspace. I try even with other name of my workspace, but i get the same error: john@john-G41D3C:~$ rosws set ~/fuerte_workspace/sandbox ERROR in config: Command requires a target workspace. What am i doing wrong? Originally posted by Jey_316 on ROS Answers with karma: 31 on 2013-02-02 Post score: 1 Did you create a new overlay first? $rosws init ~/groovy_workspace /opt/ros/groovy Originally posted by K_Yousif with karma: 735 on 2013-02-02 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 12698, "lm_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 }
javascript, node.js, asynchronous, async.js function query(connection, sql, params) { return new Promise((res, rej) => { connection.query(sql, params, function (err, rows) { if (err) { rej(err); } else { res(rows); } }); }); } Then you can do something like: async function step_1(connection) { const rows = await query(connection, 'step 1 query'); return rows.insertId; } function step_2(connection, id) { return query(connection, 'step 2 query', id); } function step_3(connection, id, result) { return query(connection, 'step 3 query', id, result); } exports.handler = async (event) => { const connection = await getConnection(); try { const id = await step_1(connection); const rows = await step_2(connection, id); const result = await step_3(connection, id, rows); return JSON.stringify(result); } finally { connection.release(); } };
{ "domain": "codereview.stackexchange", "id": 38615, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, asynchronous, async.js", "url": null }
# If three cards are drawn without replacement, what is the probability of each subsequent card being larger than the previous card? Suppose we have a deck of $$500$$ cards numbered from 1 to 500. If the cards are shuffled randomly and you are asked to pick three cards (without replacement), one at a time, what's the probability of each subsequent card being larger than the previous drawn card? My solution: Let $$i$$ be the second card that is picked, then $$i-1$$ cards will be less that $$i$$ and $$500 - i$$ cards will be greater than $$i$$. Thus: P(subsequent card being larger than the previous card) $${\displaystyle = \sum_{i=1}^{500} \frac {(i -1)(500 - i)}{500 \cdot 499 \cdot 498}}$$ I'm not sure if my answer is correct. • Please read this tutorial on how to typeset mathematics on this site. – N. F. Taussig Sep 26 '19 at 14:32 Suppose you draw three cards. We don't care what they actually are...
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232869627774, "lm_q1q2_score": 0.8190108117690629, "lm_q2_score": 0.8333245891029456, "openwebmath_perplexity": 138.1625778788486, "openwebmath_score": 0.6359350085258484, "tags": null, "url": "https://math.stackexchange.com/questions/3370806/if-three-cards-are-drawn-without-replacement-what-is-the-probability-of-each-su" }
python, performance, object-oriented, library class _NestedList(_NestedBase, collections.MutableSequence): """A pseudo-list class to replace vanilla lists inside a livejson.File. This "watches" for changes made to its content, then tells the base livejson.File instance to update itself so that the file always reflects the changes you've made. This class is what allows for nested calls involving lists like this: >>> f = livejson.File("myfile.json") >>> f["a"].append("foo") to update the file. """ def insert(self, index, value): # See _NestedBase.__setitem__ for details on how this works data = self.base.data d = data for i in self.pathInData: d = d[i] d.insert(index, value) self.base.set_data(data) Here we have the main element of the module, the classes which envelop everything else: # THE MAIN CLASSES class _BaseFile(_ObjectBase): """Class inherited by DictFile and ListFile.
{ "domain": "codereview.stackexchange", "id": 20795, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, object-oriented, library", "url": null }
python, beginner, multithreading, socket, tkinter button.image = buttonImg button.place(y=235,x=200) #Window Settings window.resizable(width=FALSE, height=FALSE) window.minsize(500,500)
{ "domain": "codereview.stackexchange", "id": 18641, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, multithreading, socket, tkinter", "url": null }
r, scrnaseq, seurat, ggplot2 My confusion is: seurat@data dose not give me natural log transformed data rather returns only data divided by column sum and scalled by 10000. So when plotting a violin plot if data are log normalised plot should not look as below picture When I used VlnPlot(object = y, features.plot = "DDB_G0277853", x.lab.rot = FALSE, y.log = TRUE) plot changed totally. Could someone please help me in getting idea about seurat@data that is not really log transformed and by which data violin plot is being produced??? So if a gene has 10000 read counts, without log transformation violin plot should be so This is my seurat object The normalized and log-transformed values are used for the violin plot. The argument y.log changes only the display of the data (scaling of the y axis). Seurat has very good documentation. Section 7 in the FAQ explains what data is stored in the object: How is data stored within the Seurat object? What is the difference between raw.data, data, and scale.data?
{ "domain": "bioinformatics.stackexchange", "id": 615, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "r, scrnaseq, seurat, ggplot2", "url": null }
python, ros-kinetic self.velocity_publisher.publish(vel_msg) return else: marker = msg.markers[0] print "d" self.velocity_publisher.publish(vel_msg) if __name__ == '__main__': rospy.init_node('go_down', anonymous=True) try: rate = rospy.Rate(0.0001) gonna_get_down = gonnaGetDown() while not rospy.is_shutdown(): print "a" rate.sleep() except rospy.ROSInterruptException: rospy.loginfo("Node terminated.") The most basic rqt graph is this https://imgur.com/LlWrhUW (ar_track_alvar node posts on /ar_pose_marker topic) Leaving the code like that, it prints: a --> b --> c --> d --> c --> d --> c --> d --> c --> ... and so on But the time between d's is 1 second. What if I want to make that much faster, like 10 times per second? Where do I change the frequency? Thanks :D
{ "domain": "robotics.stackexchange", "id": 32288, "lm_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, ros-kinetic", "url": null }
quantum-field-theory, gauge-theory, renormalization, confinement Later on in the course, you calculate the beta function (to leading order) for nonabelian gauge theory. You get the same result as above, except that $c$ is negative (unless the gauge field is coupled to a sufficiently high number of flavors of matter field). Therefore $g(\mu)$ decreases with $\mu$, and the function diverges at some value of $\mu$ less than $\mu_0$. Your teacher cheerfully explains that this is a neat feature of nonabelian gauge theory called "confinement", and it indicates that at sufficiently low energies (or equivalently far separations), particles become so strongly interacting that perturbation theory breaks down, and the theory changes qualitatively (as the natural choice of constituent matter "particles" changes from color-charged quarks to color-neutral hadrons).
{ "domain": "physics.stackexchange", "id": 57727, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, gauge-theory, renormalization, confinement", "url": null }
c#, object-oriented Title: Object manager class I have a "manager" class that returns objects when requested. The if the required object already exists in the object collection it is returned, else a new one is created, added to the collection, and returned. I also need to periodically remove the objects from the collection when they're no longer required. This is done by the Purge() method. Initially I had made the Purge method part of the Manager class and made it private, as the intention is to only ever call it via a timer, and only the Manager ever needs to know about it. However due to problems with unit testing it, I moved the Purge method into its own class and made the method public (and added some other public methods for the Manager to use to control its behaviour). This also allowed me to unit test it nicely.
{ "domain": "codereview.stackexchange", "id": 17875, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, object-oriented", "url": null }
statistical-mechanics, field-theory, feynman-diagrams, correlation-functions, functional-derivatives The associated evolution is a Langevin equation, given by : \begin{equation} \frac{\partial S^{\alpha}(x,t)}{\partial t}=-D(i\nabla)^{a} \frac{\delta H[S]}{\delta S^{\alpha}(x,t)}+\zeta^{\alpha}(x,t) \end{equation} Where fluctuations are taken into account via $\zeta$, a zero mean diagonal white noise $\left< \zeta^{\alpha}(x,t) \zeta^{\beta}(x',t') \right> = 2 L\delta(x-x')\delta(t-t')\delta^{\alpha\beta}$, and $L=D(i\nabla)^{a}$. From here is derived the generating functional for correlation functions, \begin{equation} Z[\tilde{j},j]=\left< exp \int d^{d}xdt \sum_{\alpha} \tilde{j^{\alpha}}(x,t) \tilde{S^{\alpha}}(x,t)+j^{\alpha}(x,t)S^{\alpha}(x,t)\right> \end{equation} The $j$'s being the source currents and the tilde quantities the auxiliary MSR fields/source currents By means of functional derivatives w.r.t. the currents, taken at vanishing currents, one obtains the correlation functions.
{ "domain": "physics.stackexchange", "id": 50612, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, field-theory, feynman-diagrams, correlation-functions, functional-derivatives", "url": null }
beginner, datetime, reinventing-the-wheel, rust Title: Simple ISO date, time and datetime implementation I am getting started with rust. To get familiar with the language I implemented a datetime library: main.rs mod datetime; use datetime::DateTime; use datetime::Date; use datetime::Time; fn main() { let date_time = DateTime::create(2022u16, 09, 17, 02, 53, 00); println!("Datetime: {}", date_time); println!("Date: {}", date_time.date); println!("Time: {}", date_time.time); let date = Date::new(2022u16, 09, 17); println!("Date: {}", date); let time = Time::new(03, 51, 00); println!("Time: {}", time); } datetime.rs use std::fmt; mod date; pub use self::date::Date; mod time; pub use self::time::Time; pub struct DateTime { pub date: Date, pub time: Time } impl DateTime { pub fn new(date: impl Into<Date>, time: impl Into<Time>) -> DateTime { DateTime { date: date.into(), time: time.into() } }
{ "domain": "codereview.stackexchange", "id": 43825, "lm_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, datetime, reinventing-the-wheel, rust", "url": null }
ros, robot, beginner Originally posted by Claudio on ROS Answers with karma: 859 on 2012-11-22 Post score: 1 Basically, the number of nodes you have to implement depends on what you want to do with your robot. In your case, I would at least implement the following nodes: A driver for the robot's base. It should subscribe to the topic /cmd_vel of type geometry_msgs/Twist. Whenever it receives commands on that topic, it should move accordingly. Don't forget to add a watchdog to stop the robot when it doesn't receive messages for, say, 0.5 seconds :) This will allow you to use ROS for teleoperating your robot and for using move_base. However, move_base works best if you have a 3D sensor on your robot that can be used for obstacle detection and avoidance.
{ "domain": "robotics.stackexchange", "id": 11848, "lm_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, robot, beginner", "url": null }
fluid-mechanics Title: Force exerted on wall of a rotating cylinder filled with fluid We are given a standard diagram of a rotating cylinder with the parabolic shape in the rotation. Given: the distance between the vertex of parabola to the top of the parabola. the original height of the water.
{ "domain": "engineering.stackexchange", "id": 727, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-mechanics", "url": null }
quantum-algorithms, deutsch-jozsa-algorithm, oracles $Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$ So $U_f = Z$ for Identity. Negation We have: $f(0) = 1, f(1) = 0$ So: $U_f|0\rangle = (-1)^{f(0)}|0\rangle = (-1)^1|0\rangle = -1|0\rangle = -|0\rangle$ $U_f|1\rangle = (-1)^{f(1)}|1\rangle = (-1)^0|1\rangle = 1|1\rangle = |1\rangle$ In this case $U_f = XZX$. Calculating $U_f|+\rangle$ Constant-0 $I|+\rangle = |+\rangle$ Constant-1 $R_y(2\pi)|+\rangle = -|+\rangle$ Identity $Z|+\rangle = |-\rangle$ Negation $XZX|+\rangle = XZ|+\rangle = X|-\rangle = -|-\rangle$ Measurement It's pretty clear that if we measure in the $\{|+\rangle, |-\rangle \}$ basis, we'll get $|+\rangle$ when the oracle function is constant and $|-\rangle$ when the oracle function is variable. Done. Discussion While this approach does have the benefit (for learners) of not requiring multiple qbits or a CNOT gate, the rewriting step seems more like "cheating" given the problem statement.
{ "domain": "quantumcomputing.stackexchange", "id": 845, "lm_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-algorithms, deutsch-jozsa-algorithm, oracles", "url": null }
python, python-2.x, comparative-review, formatting I personally would choose the verbose way. And if you do, you can combat your problem with your linter: Currently using Pylint and other code review tools throws a lot of unused variable warnings because of the way I've been using .format(). If they are un-used, then you can define them in the format arguments, and so rather than assigning to a variable that's 'of no use', you can assign straight to the key word argument: # Current way >>> a = 1 >>> '{a}'.format(a=a) # New way >>> '{a}'.format(a=1) # When you migrate to Python 3.6 way >>> a = 1 >>> f'{a}'
{ "domain": "codereview.stackexchange", "id": 24030, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-2.x, comparative-review, formatting", "url": null }