text
stringlengths
1
1.11k
source
dict
python, python-3.x, image, numpy, opencv cv2.imwrite('n001New.tif', res) ######################################################################## img = cv2.cvtColor(res, cv2.COLOR_BGR2RGB) Z = img.reshape((-1,3)) Z = np.float32(Z) criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 250 , 1.0) K=2 ret, label, center= cv2.kmeans(Z, K, None, criteria, 250, cv2.KMEANS_RANDOM_CENTERS) center = np.uint8(center) res = center[label.flatten()] output = res.reshape((img.shape)) plt.imshow(output) plt.show() Data set consists of tif extension image: benign, inSitu, invasive and normal Output images: I have a few questions: Are my methods correct? Are the outputs correct? Do I find the right areas? Did I use the K-Means algorithm correctly? I would appreciate it if you could answer the questions above. Are my methods correct?
{ "domain": "codereview.stackexchange", "id": 33454, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, image, numpy, opencv", "url": null }
• Thank you for this explanation! It was extremely clear and I really appreciate it! After a little WolframAlpha magic, I found 128 questions to be the maximum. So if I understand this correctly, the test bank is composed of anywhere between 53-128 questions, with 128 questions being the most probable? – ProfessorStealth Jan 1 '16 at 20:59 • @ProfessorStealth Well there could be more than $128$ questions, it's just that $128$ is the most likely. There could be $500$ questions, but then having $7$ come up in common starts to be quite unlikely when there are that many in the pool. – Gregory Grant Jan 1 '16 at 21:01 • @ProfessorStealth Oh and you're very welcome :-) – Gregory Grant Jan 1 '16 at 21:03
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407175907054, "lm_q1q2_score": 0.8402878632106372, "lm_q2_score": 0.863391602943619, "openwebmath_perplexity": 675.0126831861228, "openwebmath_score": 0.6235116124153137, "tags": null, "url": "https://math.stackexchange.com/questions/1596392/determine-the-size-of-a-test-bank" }
fluid-mechanics The problem is I don't understand which densities to use for each boundary condition. At the bottom of the tank, I'm guessing that I should use the tank fluid density (or some weighted average if there is more than one kind of fluid layer in the tank). But what should I use at the top (where the boundary condition is the pressure of the atmosphere)? When I divide atmospheric pressure by the density of air, I get a value that is higher than the bottom boundary of the tank and flow goes the wrong way (down, not up to the outlet). When I divide atmospheric pressure by the same density that I use for the bottom boundary (the density of the fluid in the tank), my output shows pressure values that are lower than atmospheric. It seems like I should get this, but I don't. Any help would be appreciated, but unfortunately, I'm not allowed to post the code. The reason you're dividing the pressure's by the density is that in the naiver stokes equations that describe fluid flow have three types of
{ "domain": "engineering.stackexchange", "id": 707, "lm_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 }
thermodynamics, temperature, ion-traps Title: Temperature of a trapped particle How is the temperature of the center of mass of a trapped particle (e.g. in a Paul or Penning trap with laser cooling) defined? I assume it has something to do with the equipartition theorem and Brownian motion, but there are so many "temperatures" that I'm having doubts of the standard temperature measurements in this case. Strictly speaking, the thermodynamic temperature is only defined when the particle is in thermodynamic equilibrium, where the quantum state is of the Gibbs form $$ \rho = \frac{e^{-H/k_B T}}{\mathrm{Tr} \left(e^{-H/k_BT}\right)}, $$ where $H$ is the Hamiltonian and $T$ is the temperature. However, generally a cold trapped atom will not be in thermodynamic equilibrium, so that the temperature is not strictly defined.
{ "domain": "physics.stackexchange", "id": 25669, "lm_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, temperature, ion-traps", "url": null }
tensor-calculus, elasticity Title: Why is the distortion in a non-homogeneous strain described as $\Delta u_i = \displaystyle \sum_j (e_{ij}- \omega_{ij})\Delta x_j$? When we have a homogeneous strain - which may include both stretching and shear - all of the $e_{ij}$ are constants, and we can write $$u_x = e_{xx}\mathsf x + e_{xy}\mathsf y +e_{xz}\mathsf z\,.\tag{39.9}$$ [...] When the strains are not homogeneous, any piece of the jello may also get somewhat twisted - there will be a local relation. If the distortions are all small, we should have $$\Delta u_i = \sum_j (e_{ij}- \omega_{ij})\Delta x_j\,,\tag{39.10}$$ where $\omega_{ij}$ is an anti-symmetric tensor, $$\omega_{ij}= \tfrac12 (\partial u_j/\partial x_i- \partial u_i/\partial x_j)\,,\tag{39.11}$$ which describes the rotation.
{ "domain": "physics.stackexchange", "id": 33856, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "tensor-calculus, elasticity", "url": null }
cc.complexity-theory, smoothed-analysis Title: Smoothed Analysis: If a Problem has Pseudopolynomial Complexity, is it in Smooth P? I have been facinated by the extraordinary explosion in Smoothed Analysis and was struck by a assertion in the paper Smoothed Analysis of Integer Programming. This stated that Integer Linear Programming is in Smoothed P if Polynomially Bounded. This was essential true by the virtue that Integer Programming is Pseudo-polynomial! The question therefore is:
{ "domain": "cstheory.stackexchange", "id": 2294, "lm_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, smoothed-analysis", "url": null }
ros, ros-kinetic, gripper, joint-states, joint-state-publisher Title: Usage of joint_state_publisher Hi everyone, I am working with a new UR10e robot and a 2F-140 Robotiq Gripper. And the new models of UR robot comes with a set of script functions to control the gripper. The thing is that working this way to command the gripper, you have no information publish by /ur_driver into the robot_state_publisher topic. So I created a node in order to publish the finger_joint value into the robot_state. I know that i have to use joint_state_publisher to achieve this task but I do not know how I have to write the code into the launch file just to publish finger_joint state. I'm launching joint_state_publisher in the following way: <node name="joint_state_publisher" type="joint_state_publisher" pkg="joint_state_publisher" output="screen"/> And ROS publishes all the joint states defined in my MoveIt *.srdf config. Thanks in advance for your help. Originally posted by drodgu on ROS Answers with karma: 59 on 2019-07-04 Post score: 0
{ "domain": "robotics.stackexchange", "id": 33337, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, gripper, joint-states, joint-state-publisher", "url": null }
• I do not understand how this answers the question. You have only shown that there are (finite or) countably many finite-index, normal subgroups of a finitely generated group (note: finitely generated, not countable, as mixedmath's answer demonstrates). Which is not awfully relevant... – user1729 Oct 14 '14 at 8:22 • Your now answer has some issues - not every $(b_n)\in\prod(\mathbb{Z}/2\mathbb{Z})$ corresponds to an element of the direct sum. This is because the direct sum contains only those elements with finite support (it is not the Cartesian product). Also, this is just a re-hashing of mixedmath's answer. If I were you, I would just delete everything above "The example of @seirios..." – user1729 Oct 17 '14 at 10:39 • @user1729: The kernel of the functional given by $(b_n)\ne (0)$ is a subgroup of index $2$. – Orest Bucicovschi Oct 17 '14 at 11:29
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471684931717, "lm_q1q2_score": 0.8439127159524495, "lm_q2_score": 0.8577680995361899, "openwebmath_perplexity": 207.11658112225055, "openwebmath_score": 0.9011984467506409, "tags": null, "url": "https://math.stackexchange.com/questions/971232/can-a-countable-group-have-uncountably-many-subgroups" }
complexity-theory, np-complete, reductions Title: Mistake in Karp's paper on NP-Complete problems? I read on a blog that there are mistakes in Karp's paper where he proved that 0-1 programming is NP-Complete, but I couldn't find it, can anyone explain? And I doubt that there are also mistakes where he proved Steiner Tree Problem is NP-Compelete but not sure. The blog post a little old and I thought asking the writer of the blog may not receive answer quickly enough. I didn't find any referrence in other places so I thought this question may worth asking. To cite the blog post: For arguments sake, lets say that in Karp's classic paper Reducibility Among Combinatorial Problems, where he proves 21 problems NP-compete, he made a mistake on 0-1 programming. That is, the blog author does not state that there is a mistake. It is just a gedankenexperiment. That is, of course, not to say that there is none.
{ "domain": "cs.stackexchange", "id": 18602, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, np-complete, reductions", "url": null }
newtonian-mechanics, optics, camera, astrophotography Title: Photographing the night sky - How important is fixed alignment of the camera? If I set up my long exposure camera on a tripod and point it at the sky at night with the pole star in the centre we get a lovely image of concentric circles or arcs of circles depending on exposure times. Once one of the legs of the tripod went faulty (slowly collapsed a few mm) and the image was fuzzy and no longer circles. But it occurred to me that if this trivial angular movement distorted the image so much then why does the relative rotation of the earth on its axis not have the same effect on the photograph. Surely movement of the earth on its axis with a fixed camera would produce an angular displacement of the image in the same way as an accidental movement of the camera. What is the explanation for this? The answer: it does.
{ "domain": "physics.stackexchange", "id": 38948, "lm_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, optics, camera, astrophotography", "url": null }
ros, opencv, opencv2, vision-opencv, catkin-create-pkg Title: vision_opencv can't be found by ROS but it's installed I was trying to make a package using the catkin_create_pkg but later it gives me an error for a package I have. My command was: catkin_create_pkg opencv_ros sensor_msgs cv_bridge roscpp std_msgs vision_opencv and it says that is was successful, after I run this command: rospack depends1 opencv_ros and I get this error: [rospack] Error: package 'opencv_ros' depends on non-existent package 'vision_opencv' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update' the problem is that the package exist. If I run the command: roscd vision_opencv it takes me to this location /opt/ros/indigo/share/vision_opencv
{ "domain": "robotics.stackexchange", "id": 19197, "lm_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, opencv, opencv2, vision-opencv, catkin-create-pkg", "url": null }
neuroscience For simplicity let's look at abnormally high levels of thyroid hormones called hyperthyroidism. In a patient with a primary or thyroid gland problem we expect high levels of thyroid hormones but low levels of TSH. The pituitary gland is trying its best to tell the thyroid gland, "No more!" but it won't listen. In secondary or pituitary disease, the pituitary gland is the bully pushing the thyroid gland to make lots of thyroid hormone by over production of TSH. Usually there are other hormone disturbances too in this case as the pituitary gland has a range of hormones it secretes. Also the swollen pituitary gland puts pressure on the nerves carrying vision leading to visual loss (specifically in the temporal fields). In this case the hypothalamus will be secreting low levels of TRH (which isn't routinely measured) trying to get the pituitary gland to stop acting out. The rarest situation is when the hypothalamus has the problem where every hormone is increased. However again this will
{ "domain": "biology.stackexchange", "id": 2015, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience", "url": null }
• There ought to be a Textbook badge. :) Sorry, can't upvote more than once. Cheers! – Michael E2 Nov 25 '15 at 21:13 • @Michael E2: thank you very much. It was great fun for me to take the opportunity to delve into Jacobi elliptic functions, elliptic functions, inverse functions, non linear differential equations, and I have still some points to make here. Don't worry, not too many ;-) By the way, I have found out (tacitly) that, despite of its name, a non linear Schrödinger equation has nothing to do with quantum mechanics. – Dr. Wolfgang Hintze Nov 25 '15 at 22:57 • @Dr.WolfgangHintze I am so waiting for section 4!!! By the way, the ref in question is this article: J. Zittartz and J. S. Langer Phys. Rev. 148, 741, 1966 where also the different coefficient of the 2D problem is clarified. I approve the Textbook badge. – user50473 Dec 1 '15 at 16:18
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211561049158, "lm_q1q2_score": 0.8503826682210279, "lm_q2_score": 0.8723473663814338, "openwebmath_perplexity": 3513.3421188503535, "openwebmath_score": 0.597770094871521, "tags": null, "url": "https://mathematica.stackexchange.com/questions/99044/find-solution-of-nonlinear-ode-in-terms-of-jacobicn" }
newtonian-mechanics, classical-mechanics, coordinate-systems, vectors Title: Expressing cartesian unit vectors in terms of plane polar unit vectors to prove that former doesn't depend on position I understand that polar unit vectors are given by $e_r= \cos(θ)i + \sin(θ)j$ $e_θ=−\sin(θ)i + \cos(θ)j$ How do I now express cartesian unit vectors in terms of polar unit vectors to show that they are independent of the $r$ and $θ$? How do I now express cartesian unit vectors in terms of polar unit vectors to show that they are independent of the $r$ and $θ$?
{ "domain": "physics.stackexchange", "id": 73103, "lm_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, classical-mechanics, coordinate-systems, vectors", "url": null }
units, conventions, si-units Title: Does the imperial system have any advantages (besides its wide acceptance in the US)? The United States (and one other country, somewhere in Africa I think) uses the imperial system (feet, pounds, etc.), while pretty much everyone else uses the metric system (meters, kilograms). The reason the US still does so is probably for historical reasons; said reasons are not within the scope of this question, however. Does the imperial system of units have any advantages over the metric system besides its widespread use in the United States? The United States legalized the metric system in 1866; here is the Canadian view.
{ "domain": "physics.stackexchange", "id": 29297, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "units, conventions, si-units", "url": null }
quantum-mechanics, terminology Quantum tank system Now imagine a quantum tank system. The state of either tank can be represented by a complex number, so it takes four real numbers to represent the system. Now we know the square magnitudes of these complex numbers must add to one, and we know that multiplying both numbers by the same phase factor has no physical significance, but there are still two real numbers which specify the phase of the system. One of them is the difference in square amplitude. This is analogous to the $\Delta$ of the classical system. The new degree of freedom is the difference in phase between the two amplitudes. This makes it a two dimensional dynamical system and allows for more complicated behavior. Suppose for example the Hamiltonian was $\begin{pmatrix} 0 & i \\ -i & 0
{ "domain": "physics.stackexchange", "id": 25189, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, terminology", "url": null }
c++, c++17 [[nodiscard]] constexpr bool operator==(const T& rhs) const noexcept { return *m_component_it == rhs; } [[nodiscard]] constexpr bool operator!=(const T& rhs) const noexcept { return *m_component_it != rhs; } [[nodiscard]] constexpr bool operator<=(const T& rhs) const noexcept { return *m_component_it <= rhs; } [[nodiscard]] constexpr bool operator>=(const T& rhs) const noexcept { return *m_component_it >= rhs; } [[nodiscard]] constexpr bool operator<(const T& rhs) const noexcept { return *m_component_it < rhs; } [[nodiscard]] constexpr bool operator>(const T& rhs) const noexcept { return *m_component_it > rhs; }
{ "domain": "codereview.stackexchange", "id": 32403, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++17", "url": null }
c#, winforms, pdf PdfPTable tab = new PdfPTable(billsDGV.ColumnCount); tab.WidthPercentage = 75; tab.DefaultCell.Padding = 3; tab.HorizontalAlignment = Element.ALIGN_CENTER; PdfPCell headcell = new PdfPCell(new Phrase(kryptonComboBox1.Text,headerFont)); headcell.BackgroundColor = new BaseColor(255, 255, 30); headcell.Colspan=3; headcell.HorizontalAlignment=Element.ALIGN_CENTER; tab.AddCell(headcell); PdfPTable pdfTable = new PdfPTable(billsDGV.ColumnCount); pdfTable.DefaultCell.Padding = 3; pdfTable.WidthPercentage = 75; pdfTable.HorizontalAlignment = Element.ALIGN_CENTER; foreach (DataGridViewColumn column in billsDGV.Columns) { PdfPCell cell = new PdfPCell(new Phrase(column.HeaderText,headerFont)); cell.BackgroundColor = new BaseColor(137, 220, 165); pdfTable.AddCell(cell); }
{ "domain": "codereview.stackexchange", "id": 42839, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, winforms, pdf", "url": null }
skin Macrophages are long lived, so unless they receive transcriptional signals to get them to move out of the tissue they are in, they will just sit there, and if they happened to have engulfed the heavy metals in tattoo ink, or the graphite from a pencil jab, then they sit there with a vesicle filled with that compound. As graphite is pure carbon, I wouldn't worry that much about it, but it is also not not in a form that the body can use, so it will persist. If eventually the macrophages are induced to move, they will likely take their contents with them, which is why tattoos fade over time. It also is likely that the graphite was taken up by several macrophages in the region, in particles large enough that they cannot be cleared and remain visible, but not so large that the macrophages could not phagocytose them.
{ "domain": "biology.stackexchange", "id": 4574, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "skin", "url": null }
python, python-3.x, formatting It works, but I am wondering how could it be improved. I think there was a way to format it like {xx:2:2} or something but I can't remember how to do it. Note: We never know how many gold digits we have, it could be 999999 to 1 It may less fragile if you deal with the numbers directly rather than converting to strings. It will also be cleaner code. You could start with your values in a list sorted highest to lowest. Then in your function you can find the next-largest value and remained with divmod(). After than it's a matter of deciding how you want to format the resulting dict: coins = [ ("gold", 100 * 100), ("silver", 100), ("copper", 1) ] def translate_coins(value, coins): res = {} for coin, v in coins: res[coin], value = divmod(value, v) return res translate_coins(1013323, coins) Result: {'gold': 101, 'silver': 33, 'copper': 23}
{ "domain": "codereview.stackexchange", "id": 34284, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, formatting", "url": null }
homework-and-exercises, electromagnetism, electric-circuits, induction p.s. - This question can't be asked on electronics SE, since their site doesn't allow for such a question. When you close the switch the inductor "charges", gaining magnetic energy and hence an associated flux. When you open the switch, there is a potential energy associated with the inductor, and hence it will "discharge", generating a current in the circuit. So under the assumption that all the flux discharges, then $\Delta \phi$ will be $1.4 \times 10^{-5}$ $Wb$. Now that there is a current flowing in the circuit, the current will see all the resistances in the circuit, not just the ones in front of it (since the circuit is closed and the sums of the sources and potential drops around the whole circuit must be zero.)
{ "domain": "physics.stackexchange", "id": 6142, "lm_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, electromagnetism, electric-circuits, induction", "url": null }
thermodynamics, kinetic-theory, heat-conduction Any ideas? It comes from the Maxwellian distribution function (6.11) $$F \sim \exp\left({-\frac{\vec{v}^2}{2mT}}\right) $$ The relativistic version should be $$ F \sim \exp\left({-\frac{\sqrt{m^2+\vec{p}^2}}{T}}\right).$$ And is now a distribution over $\vec{p}$. You could also subtract out the rest mass $m$ in the exponent because it cancels out when you normalize $F$. (I have used units where $c=k_B=1$ but hopefully it's obvious where they go.)
{ "domain": "physics.stackexchange", "id": 56433, "lm_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, kinetic-theory, heat-conduction", "url": null }
Smallest number of points on plane that guarantees existence of a small angle What is the smallest number $n$, that in any arrangement of $n$ points on the plane, there are three of them making an angle of at most $18^\circ$? It is clear that $n>9$, since the vertices of a regular 9-gon is a counterexample. One can prove using pigeonhole principle that $n\le 11$. Take a edge of the convex hull of points. All the points lie to one side of this line. cut the half-plane into 10 slices of $18^\circ$ each. There can't be any points in the first and last slice. Thus, by pigeonhole principle some slice contains more than one point. So we have an angle of size at most $18^\circ$. Now, for $n=10$, I can not come up with a counterexample nor a proof of correctness. Any ideas? Hmm this appears pretty complicated. I hope there is a simpler solution.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717468373084, "lm_q1q2_score": 0.86734135902434, "lm_q2_score": 0.8791467643431002, "openwebmath_perplexity": 321.4883431942435, "openwebmath_score": 0.9971634149551392, "tags": null, "url": "https://math.stackexchange.com/questions/1223486/smallest-number-of-points-on-plane-that-guarantees-existence-of-a-small-angle/1224693" }
electromagnetism, forces, magnetic-fields, maxwell-equations In theory I can now find the magnetic forces in 2D by utilizing the Maxwell stress tensor: $$ F_x = \int_{-\infty}^\infty \frac{1}{\mu_0}( B_x(x,0)^2 - \frac{1}{2}(B_x(x,0)^2+B_y(x,0)^2) + B_x(x,0)\cdot B_y(x,0) dx $$ $$ F_y = \int_{-\infty}^\infty \frac{1}{\mu_0}(B_x(x,0)\cdot B_y(x,0) + B_y(x,0)^2 - \frac{1}{2}(B_x(x,0)^2+B_y(x,0)^2) dx $$ Note: in the graphic the $0$ is at the $y$ value $50$ I just kept the zero in the equation to explain it here. This works fine for $F_y$. The result matches the Lorentz force equation well. For $F_x$ however the results and the equation itself makes no sense at all. I would be expecting zero force in the direction of $x$. However if we insert $B_x(x,0) = 0$ (based in symmetry) into the equation for $B_x$ we get $$ F_x = \int_{-\infty}^\infty \frac{1}{\mu_0}( 0 - \frac{1}{2}(0^2+B_y(x,0)^2) + 0 dx = \int_{-\infty}^\infty \frac{1}{\mu_0}(\frac{1}{2}(B_y(x,0)^2) dx \neq 0 $$
{ "domain": "physics.stackexchange", "id": 92856, "lm_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, forces, magnetic-fields, maxwell-equations", "url": null }
paper revised so on the features of Khan Academy, please enable JavaScript in your browser web. And use all the features of Khan Academy, please make sure leave. Are consenting to our use of cookies proven to be our \modulus.. Important role both in theoretical and applied mathematics published on 11.10.2006 mathematics Stack Exchange is a of! Of 1 level and professionals in related fields ' for math Matriculation to be effective! Euclidean algorithm, or it never existed here our use of cookies been searching for modular systems but! Number is divided by 4 is 2 with a modulus of 3 we make a clock with numbers,... Trouble loading external resources on our website that you can find with the extended Euclidean algorithm visit! You the congruence... system of modular equations with unknown modulus inverse you! 20 more warranty days to request any revisions, for free is 2 with modulus. Expert without agents or intermediaries, which considers the remainder with numbers 0, 1,.. In lower
{ "domain": "webreus.net", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854111860906, "lm_q1q2_score": 0.8299919493444887, "lm_q2_score": 0.8558511396138365, "openwebmath_perplexity": 1311.5734329508234, "openwebmath_score": 0.30894050002098083, "tags": null, "url": "http://43929101674.srv040130.webreus.net/how-many-tludi/modular-system-math-cdb971" }
climate-change, climatology check, they asked the original researchers themselves to evaluate their own abstracts, presumably to control for any bias which Cook et al. might be bringing to the evaluation. The proportions of abstracts endorsing the consensus were 97.1% and 97.2% respectively for the two methodologies.
{ "domain": "earthscience.stackexchange", "id": 170, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "climate-change, climatology", "url": null }
### Show Tags 28 Jan 2011, 10:25 Karishma, Thanks a lot. +1. I understood everything until the step of *3/5. can u please explain? bc every time we take out 1 liter of mixture and add 2 liters of water. how is *3/5*4/6****calculate that? thanks a lot. Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 10784 Location: Pune, India Re: A container has 3L of pure wine. 1L from the container is taken out an  [#permalink] ### Show Tags 28 Jan 2011, 11:55 4 1 144144 wrote: Karishma, Thanks a lot. +1. I understood everything until the step of *3/5. can u please explain? bc every time we take out 1 liter of mixture and add 2 liters of water. how is *3/5*4/6****calculate that? thanks a lot. First time, $$C_f = 1 * 2/4$$ Second time when you remove 1 litre from 4 litres, Initial Volume becomes 3 lts. When you add 2 lts of water back, final volume becomes 5 lts.
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.8128673246376009, "lm_q2_score": 0.8128673246376009, "openwebmath_perplexity": 3838.2262119774055, "openwebmath_score": 0.710469663143158, "tags": null, "url": "https://gmatclub.com/forum/a-container-has-3l-of-pure-wine-1l-from-the-container-is-taken-out-an-86312.html" }
performance, vba, excel, hash-map If Cells(w, OF_stationColumn) <> Cells(w - 1, OF_stationColumn) Then stationHash = Cells(w, OF_stationColumn).Value & " " & Cells(w, OF_trafficColumn).Value & " Total" On Error Resume Next Cells(w, OF_clearanceColumn1) = stationclearanceData(Cells(w, OF_stationColumn).Value & Cells(orderStart - 1, OF_clearanceColumn1).Value) Cells(w, OF_clearanceColumn2) = stationclearanceData(Cells(w, OF_stationColumn).Value & Cells(orderStart - 1, OF_clearanceColumn2).Value) Cells(w, OF_clearanceColumn3) = stationclearanceData(Cells(w, OF_stationColumn).Value & Cells(orderStart - 1, OF_clearanceColumn3).Value) Cells(w, OF_clearanceColumn4) = stationclearanceData(Cells(w, OF_stationColumn).Value & Cells(orderStart - 1, OF_clearanceColumn4).Value)
{ "domain": "codereview.stackexchange", "id": 33929, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, vba, excel, hash-map", "url": null }
## Least Common Multiplier of First N Numbers There is a famous result that is quite surprising if you see it the first time: The log of the least common multiplier of the first n integers is approximately n. The quotient converges to 1. Or to say it another way: It’s n-th root converges to e. You will find this result in the net. It is equivalent to the theorem about the distribution of prime numbers. Let us check that with software. >&load("functs"); >&lcm(makelist(n,n,1,500)), &log(float(%))/500 7323962231895284659386387451904229882976133825128925904634919\ 003459630742080371339432775981989132698526831260664840887571331401331\ 362333709431244066365980335206141556095539831625389222073894558545019\ 7206138869521568000 1.003304233299495 Of course, this infinite integer arithmetic of Maxima is not an effective way to check the result. Instead, we can use the following code to get the quotient for much higher numbers.
{ "domain": "rene-grothmann.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9481545362802363, "lm_q1q2_score": 0.8020841575247337, "lm_q2_score": 0.8459424353665381, "openwebmath_perplexity": 889.7325823049831, "openwebmath_score": 0.5407470464706421, "tags": null, "url": "http://observations.rene-grothmann.de/" }
molecular-structure, vsepr-theory In the case of an $\ce{sp^2}$ hybridized carbon, the 3 sigma bonds will arrange themselves in a plane with an approximate angle of 120 degrees between the bonds. This arrangement again minimizes the electron - electron repulsion between the 3 sigma bonds in this geometry. Finally, what geometry will minimize electron - electron repulsion between the two sigma bonds in the $\ce{sp}$ hybridized case?
{ "domain": "chemistry.stackexchange", "id": 1107, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "molecular-structure, vsepr-theory", "url": null }
machine-learning, deep-learning, keras, tensorflow, time-series I am inputting the LSTM network with the past 3 timesteps (t-3) to (t-1) of all 4 variables and then feed the output of the LSTM with the current timestep value of the var2,var3,var4 with an MLP with functional API in Keras. So I prepared the inputs for the LSTM and MLP like below : #subset the 3 previous timesteps of the 4 variables for the time sries part train_X_LSTM=train_X[train_X.columns[:12]].reset_index(drop=True).values #target is always var1(t) train_y_LSTM=train_y.values #take the current timestep fatures which are var2,var3,var4 which are realised at t=t train_X_MLP=train_X[train_X.columns[-3:]].reset_index(drop=True).values #target is always var1(t) train_y_MLP=train_y.values
{ "domain": "datascience.stackexchange", "id": 7860, "lm_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, keras, tensorflow, time-series", "url": null }
# Absolute Maximum And Minimum Calculator On Interval
{ "domain": "rciretedimpresa.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9890130576932457, "lm_q1q2_score": 0.8520725317968266, "lm_q2_score": 0.86153820232079, "openwebmath_perplexity": 373.11161112116935, "openwebmath_score": 0.6303600668907166, "tags": null, "url": "http://hefc.rciretedimpresa.it/absolute-maximum-and-minimum-calculator-on-interval.html" }
experimental-physics, space-expansion, dark-energy There is another possibility, but you need to be aware that this is even more speculative that the spacetime I described above. This is discussed in my question Building a wormhole. If you have a cube whose edges are made from exotic matter then the spacetime geometry around it looks like a wormhole. So if you were to construct such a cube starting in flat spacetime it's possible that would create a bag of gold spacetime rather more manageable that the black hole/universe spacetime discussed above. But (as far as we know) exotic matter doesn't exist, and even if it did where constructing the cube would actually create a bag of gold spacetime is unknown.
{ "domain": "physics.stackexchange", "id": 34822, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-physics, space-expansion, dark-energy", "url": null }
python, python-3.x, functional-programming def left(b): """ Returns a left merged board >>> merge([2, 2, 4, 0]) [4, 4, 0, 0] """ return [list(x) for x in map(merge, iter(b))] def right(b): """ Returns a right merged board >>> reverse(merge(reverse([2, 2, 4, 0]))) [0, 0, 4, 4] >>> reverse(merge(reverse([4, 4, 4, 4]))) [0, 0, 8, 8] """ t = map(reverse, iter(b)) return [reverse(x) for x in map(merge, iter(t))] def up(b): """ Returns an upward merged board NOTE: zip(*t) is transpose >>> b = [[2, 4, 0, 4],[2, 4, 4, 4],[2, 0, 0, 2],[2, 2, 0, 4]] >>> up(b) [[4, 8, 4, 8], [4, 2, 0, 2], [0, 0, 0, 4], [0, 0, 0, 0]] """ t = left(zip(*b)) return [list(x) for x in zip(*t)] def down(b): """ Returns an upward merged board NOTE: zip(*t) is transpose >>> b = [[2, 4, 0, 4],[2, 4, 4, 4],[2, 0, 0, 2],[2, 2, 0, 4]] >>> down(b) [[0, 0, 0, 0], [0, 0, 0, 8], [4, 8, 0, 2], [4, 2, 4, 4]] """
{ "domain": "codereview.stackexchange", "id": 13698, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, functional-programming", "url": null }
java, beginner, strings public class PassTest { public static int upperCase = 0; public static int lowerCase = 0; public static int numberCount = 0; public static int specialCharCount = 0; public static void main(String[] args) throws IOException { BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter your password: "); for (char c : dataIn.readLine().toCharArray()) { if (Character.isUpperCase(c)){ upperCase++; } else if (Character.isLowerCase(c)){ lowerCase++; } else if (Character.isDigit(c)){ numberCount++;} else { specialCharCount++; } } System.out.printf("Your password contains %d uppercases, %d lowercases, %d digits and %d special characters.\n\n", upperCase, lowerCase, numberCount, specialCharCount); } }
{ "domain": "codereview.stackexchange", "id": 11564, "lm_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, strings", "url": null }
digital-filters Unfortunately books in the radar and communications fields are not free, but in my opinion are worth their asking price (as far as texts are concerned). Bassem Mahafza: Radar System Analysis and Design using MATLAB, Chapman & Hall This book is an awesome treatment of many of the aspects of a radar/comms system. As the title suggests, buying this book gives you access to all of the MATLAB functions provided by the author. As you work through the theory of the book, many sections have accompanying examples that you can play with allowing you to both see implementation details and visuals. Merril I. Skolnik: Radar Handbook, Third Edition, McGraw-Hill
{ "domain": "dsp.stackexchange", "id": 9627, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "digital-filters", "url": null }
python, beginner, object-oriented, tkinter Title: python tkinter Monty Hall GUI visualization I created a visualization to Monty Hall with python. this is my first program with python tkinter. I'm new to python (and OOP in python). I used three pictures for the doors. Adding them here. download the doors gifs - https://ufile.io/2h7fb Or, download separately: door1.gif - https://ibb.co/jSNntw door2.gif - https://ibb.co/bTCntw door3.gif - https://ibb.co/bs0U6G Would love to get some review. I'm sure my object oriented skills are not good at the moment. from tkinter import Tk, Canvas, Button, PhotoImage import random DOOR_1 = 1 DOOR_2 = 2 DOOR_3 = 3 DOORS = (DOOR_1, DOOR_2, DOOR_3)
{ "domain": "codereview.stackexchange", "id": 45509, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, object-oriented, tkinter", "url": null }
python, beginner, python-3.x, statistics def mean(): return 'Mean: {}'.format(sum(list_one) / len(list_one)) def median(): length = len(list_one) if length % 2 == 0: return 'Median: {}'.format(sum(list_one[length // 2 - 1:length // 2 + 1]) / 2) else: return 'Median: {}'.format(list_one[length // 2]) def range_(): return 'Range: {}'.format(list_one[-1] - list_one[0]) def main(): list_one = [] while True: q = input('Type a number or type stop at any time: ').lower() if q.isnumeric(): list_one.append(int(q)) print("\nGreat choice! Choose again or type stop the sequence.") elif q == 'stop': list_one.sort(key=int) print("\nAnd the values are...") print("{}\n{}\n{}".format(mean(), median(), range_())) break else: print("\nThat\'s not a number or stop! Try again brudda man.") main()
{ "domain": "codereview.stackexchange", "id": 32310, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, statistics", "url": null }
python, selenium, xpath return string xpath = [split_xpath_at_i("//table/tbody/tr[","]/td[2]/a"), "//table/tbody/tr/td[3]/a[1]" ] def xpath_index_iterator(): xpath_index_iterator.i = 0 lst = [] for xpath_index_iterator.i in range(10): # print(split_xpath_at_i("//table/tbody/tr[","]/td[2]/a")) lst.append(xpath[0]) return lst xpath_index_iterator() # ['//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a', # '//table/tbody/tr[9]/td[2]/a'] What would a professional approach to this problem look like?
{ "domain": "codereview.stackexchange", "id": 41482, "lm_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, selenium, xpath", "url": null }
It is shorter in coding lines, more elegant mathematically, and so much faster: microbenchmark(Prob_Off_k_and_mate_yr_convolution(k,yr), Prob_Off_k_and_mate_yr(k,yr)) Unit: microseconds expr min lq mean median uq max neval Prob_Off_k_and_mate_yr_convolution(k, yr) 281.220 288.7165 298.6452 294.5675 301.333 376.300 100 Prob_Off_k_and_mate_yr(k, yr) 3959.012 4046.9615 4236.5416 4111.1405 4187.023 6195.602 100
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9728307676766119, "lm_q1q2_score": 0.8064171772562586, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 1353.9488427063588, "openwebmath_score": 0.7196151614189148, "tags": null, "url": "https://stats.stackexchange.com/questions/237154/probability-of-at-least-k-bernoulli-successes-with-varying-probabilities-condi" }
haskell, primes, matrix, mathematics assertEq :: (Eq a, Show a) => a -> a -> b -> b assertEq expected actual | expected /= actual = error (printf "\n Expected: %s \n Actual: %s" (show expected) (show actual)) | otherwise = id tests :: () tests = id .(assertEq 155 $ length $ universeForVolume 8) .(assertEq [[-10,5],[2,3]] $ opAddMultiple 3 1 0 $ [[-16,-4],[2,3]]) .(assertEq 77 $ length $ equivalenceClasses scAction (Set.toList scGroup) (universeForVolume 20)) $()
{ "domain": "codereview.stackexchange", "id": 20290, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "haskell, primes, matrix, mathematics", "url": null }
quantum-mechanics, commutator, poisson-brackets Note that the last quantity on the RHS is the derivative of a product, so you must use the product rule. Now $$\left[x,\frac{\partial}{\partial x} \right]f = (x \frac{\partial f}{\partial x} -\frac{\partial}{\partial x}[xf]) = x \frac{\partial f}{\partial x} - \frac{\partial x}{\partial x}f - \frac{\partial f}{\partial x}x $$ Since $\large \frac{\partial x}{\partial x} = 1$ we are left with $$\left[x,\frac{\partial}{\partial x} \right]f = -f $$ leaving $$\left[x,\frac{\partial}{\partial x} \right] = -1 $$
{ "domain": "physics.stackexchange", "id": 74258, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, commutator, poisson-brackets", "url": null }
special-relativity, rotation, precession Title: What's wrong with this application of Thomas Precession to circular motion velocity measurements? If you happen to have the Third Edition of Classical Electrodynamics by John David Jackson, turn to section 11.8, as that's where I'm getting all this from. If not, you should still be able to follow along. In said section, Jackson gives us this equation that relates any physical vector G in a rotating vs. non-rotating reference frame: $\left(\frac{d\mathbf{G}}{dt}\right)_{nonrot} = \left(\frac{d\mathbf{G}}{dt}\right)_{rest frame} + \boldsymbol{\omega}_T \times \mathbf{G}$ where $\boldsymbol{\omega}_T = \frac{\gamma^2}{\gamma+1}\frac{\mathbf{a}\times\mathbf{v}}{c^2}$ "where a is the acceleration in the laboratory frame," according to the textbook. Also, gamma is defined using v, the velocity of the particle as measured in the lab frame.
{ "domain": "physics.stackexchange", "id": 7965, "lm_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, rotation, precession", "url": null }
ros, gazebo, pioneer <arg name="headless" value="$(arg headless)"/> </include> <!-- No namespace here as we will share this description. Access with slash at the beginning --> <!-- Load the URDF into the ROS Parameter Server --> <param name="robot_description" command="$(find xacro)/xacro.py '$(find pioneer_description)/urdf/pioneer3dx.xacro'" /> <!-- BEGIN PIONEER 1--> <include file="$(find pioneer_description)/launch/one_pioneer.launch" > <arg name="init_pose" value="-x 0 -y -55 -z 0" /> </include> <param name="/use_sim_time" value="true"/>
{ "domain": "robotics.stackexchange", "id": 24817, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, pioneer", "url": null }
mathematics, chatgpt Bard is no different. The second mistake they both made is they both got reshape wrong but I am only concerned with matrix calculation here. I let Bard do it many times and the closest I can get is 3 out 4 calculations right. d_10 = [[2, 1, 3]] @ [[2, 1, 1]] = 2 * 2 + 1 * 1 + 3 * 1 = 7 is wrong: ---- update for chatgpt 4 turbo ---- I tried chatgpt 4 turbo, this time although it still got reshape wrong (and a silly mistake I really don't understand) but it finally got the 4 arithmetic calculations right. The last row should [4,0]! Finally, 4 arithmetic calculations right (but to the wrong reshape matrix)
{ "domain": "datascience.stackexchange", "id": 11987, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mathematics, chatgpt", "url": null }
you simply cannot do the same thing with two different bases, 5^m x 2^n, for example. These Exponents Worksheets are a good resource for students in the 5th Grade through the 8th Grade. Khan Academy is a 501(c)(3) nonprofit organization. by Ron Kurtus (revised 8 July 2019) When you multiply exponential expressions, there are some simple rules to follow.If they have the same base, you simply add the exponents. Some of the worksheets displayed are exponents and multiplication exponents and division exponent rules practice applying the exponent rule for dividing same bases exercise work model practice challenge problems vi multiplying dividing rational expressions multiplying dividing monomials. multiplying different bases with fractional exponents. Here’s how you do it: 54 × 24 = ? Jan 11, 2014: fractional exponents by: Staff . When the bases are different and the exponents of a and b are the same, we can divide a and b first: a n / b n = (a / b) n. For example: And then I add the
{ "domain": "scorpiones.pl", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9740426420486941, "lm_q1q2_score": 0.8052525484266924, "lm_q2_score": 0.8267118026095991, "openwebmath_perplexity": 1035.3396795192405, "openwebmath_score": 0.7913548350334167, "tags": null, "url": "https://scorpiones.pl/bhftoayf/multiplying-exponents-with-different-bases-d4be0b" }
dynamic-programming, graph-traversal The problem with graph traversal algorithms is that you do not revisit nodes that you have already seen but many unique paths can visit the same node. So if you got rid of the constraint that you cannot revisit a node, would a graph traversal method work here? This is also a special case where you cannot get stuck in an infinite loop because the robot can only go down or right so it can never go back to a node it has already been to. There could be many paths. For example, if the grid is $n \times n$ and all edges are present, then there are $\binom{2n}{n} = \Theta\left(\frac{2^n}{\sqrt{n}}\right)$ paths. You don't want to be going through all of them. Using dynamic programming, you can come up with the answer without going over all paths individually. In other words, dynamic programming is much more efficient than your suggested algorithm.
{ "domain": "cs.stackexchange", "id": 12190, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dynamic-programming, graph-traversal", "url": null }
electromagnetism, photons, magnetic-fields, electric-fields, virtual-particles 3) Would it be possible, then, to determine the wavelength of magnetic-field-mediating photons? If so, what is the wavelength - is it random or constant? 4) How can a photon (which has momentum) from one electrically charged particle to an oppositely charged particle cause these particles to be pulled toward each other - or how can a magnetic field cause an electrically charged moving particle to experience a force perpendicular to the source of the magnetic field if a particle with a non-zero mass moving between the two is the mediator of that force? If "virtual photons" are involved, please explain why they work differently from regular photons. What force particle mediates electric fields and magnetic fields?
{ "domain": "physics.stackexchange", "id": 11384, "lm_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, photons, magnetic-fields, electric-fields, virtual-particles", "url": null }
thermodynamics a process using infinitesimal steps during which disequilibrium exists and then write a definition which says at all the time equilibrium is maintained? Why? Another question which arises in my mind that how by performing reversible process ie. infinitesimally slowly to reach a certain state,maximum work is obtained and while doing the same process irreversibly ie. rapidly,least work is obtained. Why? Is work proportional to time? I will be very grateful if anyone answer these two questions. Plz help. I think André Neves' answer to your other question says the opposite of what you think it says. But let me try to make it a little bit clearer for you, if I can.
{ "domain": "physics.stackexchange", "id": 16479, "lm_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 }
... different things! –  t.b. May 30 '11 at 21:43 Let $\mathbf{u} = \begin{pmatrix} u_1 \\\ u_2 \end{pmatrix}$. The map $dx$ is a linear form and $dx (\mathbf{u}) = u_1$ and analogously $dy(\mathbf{u}) = u_2$, thus writing $d_{\mathbf{a}}f = \frac{\partial}{\partial x}f(\mathbf{a)} dx + \frac{\partial}{\partial y}f(\mathbf{a)} dy$ means when evaluating at $\mathbf{u}$ that $d_{\mathbf{a}}f (\mathbf{u}) = \frac{\partial}{\partial x}f(\mathbf{a)} dx (\mathbf{u}) + \frac{\partial}{\partial y}f(\mathbf{a)} dy (\mathbf{u}) = \frac{\partial}{\partial x}f(\mathbf{a)} u_1 + \frac{\partial}{\partial y}f(\mathbf{a)} u_2$ again, so it's the same thing. –  t.b. May 30 '11 at 21:49
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9715639644850629, "lm_q1q2_score": 0.8178874593934464, "lm_q2_score": 0.8418256432832333, "openwebmath_perplexity": 182.5687728569924, "openwebmath_score": 0.9387704133987427, "tags": null, "url": "http://math.stackexchange.com/questions/42177/what-does-d-textbfa-f-mean" }
image-processing, computer-vision, soft-question, theory discipline in which both the input and output of a process are images.We believe this to be a limiting and somewhat artificial boundary. For example, under this definition, even the trivial task of computing the average intensity of an image (which yields a single number) would not be considered an image processing operation. On the other hand, there are fields such as computer vision whose ultimate goal is to use computers to emulate human vision, including learning and being able to make inferences and take actions based on visual inputs. This area itself is a branch of artificial intelligence (AI) whose objective is to emulate human intelligence. The field of AI is in its earliest stages of infancy in terms of development, with progress having been much slower than originally anticipated. The area of image analysis (also called image understanding) is in between image processing and computer vision.
{ "domain": "dsp.stackexchange", "id": 347, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, computer-vision, soft-question, theory", "url": null }
5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 6 5 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8 5 7 4 8 5 6 5 8 5 7 4 8 4 7 5 8 5 7 4 8 4 7 5 8 5 6 5 8 4 7 5 8
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759604539051, "lm_q1q2_score": 0.8317511932013877, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 132.92558510085934, "openwebmath_score": 0.9415972232818604, "tags": null, "url": "https://mathoverflow.net/questions/312778/a-curious-process-with-positive-integers/312812" }
Cycle Complete Bipartite that differs by more than 1 partition will not have Hamiltonian Path nor Cycle (edges connect only between vertices of. Determine whether there exist Euler trails in the following graphs Determine the number of Hamiltonian cycles in K2,3 and K4,4 My approach: A1. Here, a Hamiltonian cycle is represented as a permutation cycle of length n whose permutation and its corresponding inverse. A graph is cubic if each of its vertex is of degree 3 and it is hamiltonian if it contains a cycle passing through all its vertices. Further-more, this graph has n2/8+n/2+1/2 edges, demonstrating the extremal number of edges is at least this number. Figure 2: Hamiltonian cycles on the cube (a), the octahedron (b), and the. Let denote a balanced complete bipartite graph. Figures1(a) and1(b) show examples of Hamiltonian and non-Hamiltonian graphs on ve nodes. Info Systems Syllabus Essay School of Business Mission Statement The mission of the UTB/TSC School of is to prepare students
{ "domain": "giardinilegnone.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9888419703960398, "lm_q1q2_score": 0.8037973224824343, "lm_q2_score": 0.8128673201042493, "openwebmath_perplexity": 421.31380160784477, "openwebmath_score": 0.6590907573699951, "tags": null, "url": "http://nhri.giardinilegnone.it/number-of-hamiltonian-cycles-in-a-complete-graph.html" }
# Convergence/absolute convergence of $\sum_{n=1}^\infty \left(\sin \frac{1}{2n} - \sin \frac{1}{2n+1}\right)$ Does the following sum converge? Does it converge absolutely? $$\sum_{n=1}^\infty \left(\sin \frac{1}{2n} - \sin \frac{1}{2n+1}\right)$$ I promise this is the last one for today: Using Simpson's rules: $$\sum_{n=1}^\infty \left(\sin \frac{1}{2n} - \sin \frac{1}{2n+1}\right) = \sum_{n=1}^\infty 2\cos\frac{4n+1}{4n² + 2n}\sin\frac{1}{8n² + 4n}$$ Now, $$\left|2\cos\frac{4n+1}{4n² + 2n}\sin\frac{1}{8n² + 4n}\right| \leq \frac{2}{8n² + 4n}$$ hence by the comparison test, the series converges absolutely, and hence it also converges. Is this correct?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347853343059, "lm_q1q2_score": 0.8033843865493504, "lm_q2_score": 0.824461932846258, "openwebmath_perplexity": 621.7446752611916, "openwebmath_score": 0.984332263469696, "tags": null, "url": "https://math.stackexchange.com/questions/2580209/convergence-absolute-convergence-of-sum-n-1-infty-left-sin-frac12n/2580581" }
electronic-configuration, periodic-trends, electron-affinity Are there any major exceptions to the rules when comparing electron affinity? I'm hesitant to use nitrogen as an exception, because I don't know how far it extends. If nitrogen has a more positive EA than carbon, does that also extend to boron, aluminium, or phosphorus? I later found that this also applies when comparing silicon and phosphorus. The explanation given was the same.
{ "domain": "chemistry.stackexchange", "id": 5520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electronic-configuration, periodic-trends, electron-affinity", "url": null }
ros target_pose2.position.x = UFtrans[0] + Tpoint[0]; target_pose2.position.y = UFtrans[1] + Tpoint[1]; target_pose2.position.z = UFtrans[2] + Tpoint[2]; target_pose2.orientation.x = interm_pose.x; target_pose2.orientation.y = interm_pose.y; target_pose2.orientation.z = interm_pose.z; target_pose2.orientation.w = interm_pose.w; waypoints.push_back(target_pose2); } } moveit_msgs::RobotTrajectory trajectory; double fraction = move_group.computeCartesianPath(waypoints, 0.02, // eef_step 1, // jump_threshold trajectory); ROS_INFO("Visualizing plan 4 (cartesian path) (%.2f%% acheived)",fraction * 100.0); sleep(10); So my questions are: Is there a limit on the maximum number of waypoints one can have? Does anyone have any idea why it suddenly stops calculating trajectories around point 115.
{ "domain": "robotics.stackexchange", "id": 27986, "lm_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 }
While Hadamard gate is defined as $$H= \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},$$ $y$-rotation by $\pi/2$ leads to gate $$Ry(\pi/2)= \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}.$$ So, there is a difference in position of -1 in the second column. Application of the $X$ gate returns the -1 in $... 9 One way order to perform Z rotations by arbitrary angles is to approximate them with a sequence of Hadamard and T gates. If you need the approximation to have maximum error$\epsilon$, there are known constructions that do this using roughly$3 \lg \frac{1}{\epsilon}$T gates. See "Optimal ancilla-free Clifford+T approximation of z-rotations" by Ross et al. ... 9 The Pauli matrices form an orthogonal basis of$\mathcal{M}_2$, this vector space can be endowed with a scalar product called the Hilbert-Schmidt inner product $$\langle A,B\rangle=\mathrm{Tr}(A^\dagger B)$$ since the Pauli matrices anticommute, their product is traceless, and since they are
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812309063187, "lm_q1q2_score": 0.8027287896868014, "lm_q2_score": 0.8289388146603365, "openwebmath_perplexity": 397.2587703742323, "openwebmath_score": 0.9997968077659607, "tags": null, "url": "https://quantumcomputing.stackexchange.com/tags/pauli-gates/hot" }
$$a_1 \geq 0$$ and $$a_2 \leq 3 - 2\cdot a_1$$ but this does not imply $$f'(x) \geq 0$$ in general. Is there a simple way to achieve what I want, even for the general case, where the degree of the polynomial is not restricted to 3 and can be any integer number? As a result, I want to choose the coefficients of the polynomial according to some constraints and the function is always strictly monotonic, includes the points $$(0, 0)$$ and $$(1, 1)$$ and is inside the unit square (see curves). EDIT: I performed a Monte Carlo simulation to determine the constraints graphically (see monte carlo). The black lines correspond to $$a_1 \geq 0$$ and $$a_2 \leq 3 - 2\cdot a_1\quad .$$ The rest looks elliptic to me. All dots inside the yellow area give monotonic increasing functions (see array of curves). EDIT2: The accepted answer is correct. See the visual proof.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.957912273285902, "lm_q1q2_score": 0.8179735045871682, "lm_q2_score": 0.8539127510928476, "openwebmath_perplexity": 188.78806188954562, "openwebmath_score": 0.8027058839797974, "tags": null, "url": "https://math.stackexchange.com/questions/3129051/how-to-restrict-coefficients-of-polynomial-so-the-function-is-strictly-monotoni" }
electrical-engineering, embedded-systems Title: How to select a micro controller for a low power application? I am interested in a microcontroller for a low power application. I have been advise to look at MSP430 or Microchip PIC microcontrollers. I also wonder if ARM-Cortex-M0 is a good choice too. At a high level the system will have two analog sensors, few GPIO to control LED, and actuation mechanisms. The systems is intended to be powered with standard batteries. What are the critical parameters that warrant attention in researching for a suitable low power micro controllers? The critical parameters depends on the application. Beside Low Power, other critical parameters need to be considered. These may include code size, serial communication ports etc. Below is analysis that was preformed to choose MSP430 microcontroller. For this particular application active mode and standby mode power consumption was critical, together with the number of serial ports, and storage size.
{ "domain": "engineering.stackexchange", "id": 948, "lm_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, embedded-systems", "url": null }
newtonian-mechanics, rotation Title: Rotation of rotating axis I was recently solving a problem which had rotation of rotating axis. The answer was pretty simple: just vector addition of their angular velocities. After searching up a bit about rotation of axis of rotation, I came across Euler rotational theorem. But I was a bit confused with the statement that the resultant axis of rotation is not necessarily fixed and can change with time. What does that even mean? The theorem clearly states that there can be only one axis of rotation, but if that axis is itself changing, won't it result in some new axis of rotation and so on? I know I am missing something but have no idea what. (Please try to keep the language simple as I am a high school student.) The is only one rotation axis at each instant in time, but as time evolves the axis can change. In fact, it can change abruptly and its location/direction cannot be determined from the values at previous times.
{ "domain": "physics.stackexchange", "id": 79683, "lm_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, rotation", "url": null }
This is a bit simpler than usual. For one thing, the zero frequency is in the upper left hand corner (instead of the center, where one usually plots it). You can move this to the center using RotateLeft on the transformed image, or by multiplying in the spatial domain by +/-1^(i,j) as in Nasser's answer. Of course, then, to reconstruct, you have to rotate back. This also uses the default FourierParameters, which may or may not be exactly what you want. • +1 for stripping all superfluous distraction away, and zeroing in on the essence of the answer. – Paul_A Dec 23 '17 at 19:52 Mathematica also has a builtin function called ImagePeriodogram that returns an Image representing the power spectrum of the image. This won't help with phase spectra or reconstructing images, however.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9372107966642554, "lm_q1q2_score": 0.8142738287549982, "lm_q2_score": 0.868826769445233, "openwebmath_perplexity": 1500.894495538341, "openwebmath_score": 0.41496872901916504, "tags": null, "url": "https://mathematica.stackexchange.com/questions/29203/calculate-the-2d-fourier-transform-of-an-image/133007" }
javascript, to-do-list Title: Simple todo script This is my Todo script. It's working well. I'm looking for feedback on what I've done well, and what I could have done better. todos = { // It needs to store todos todos: [], // Settings settings: { quickDelete: false }, // Target container targetElement: document.getElementById("todos"), // Input txt box inputBox: document.getElementById("todo_input"), // Priority checkboxes - returns checked radio element priorityCheck: function() { var inputs = document.getElementsByTagName('INPUT'); var filtered; Array.prototype.forEach.call(inputs, function(input) { if (input.type === "radio" && input.checked === true) { filtered = input; } }); return filtered; }, // Input button inputButton: document.getElementById("add_edit_button"), // Input label label: document.getElementById("add_edit_label"),
{ "domain": "codereview.stackexchange", "id": 36278, "lm_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, to-do-list", "url": null }
python, object-oriented, design-patterns, unit-testing, unit-conversion def test_canAddPairCurrencyinExchangerClass(exchanger, USD_GBP, GBP_USD): assert USD_GBP == exchanger.pair_currencies[-2] assert GBP_USD == exchanger.last_pair def test_cannotAddDuplicatePair(exchanger, USD_GBP): USD_GBP2 = PairCurrency('USDGBP') USD_GBP2.setRate(5) exchanger = Exchanger() exchanger.addPairCurrency(USD_GBP) with pytest.raises(DuplicatePairError) as excinfo: exchanger.addPairCurrency(USD_GBP2) assert str(excinfo.value) == 'Cannot add duplicate pair of currency' def test_canEditRateInPairCurrencyClass(USD_GBP): USD_GBP.editRate(3) assert USD_GBP.rate == 3 USD_GBP.editRate(4) assert USD_GBP.rate == 4 def test_canEditRateinExhangerClass(exchanger): USD_GBP = PairCurrency('USDGBP') USD_GBP.setRate(5) exchanger.editRate(USD_GBP) assert exchanger.getRate('USDGBP') == 5 def test_canConvertInExchangerClass(exchanger, USD_GBP, GBP_USD):
{ "domain": "codereview.stackexchange", "id": 35100, "lm_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, design-patterns, unit-testing, unit-conversion", "url": null }
I'm fairly new to StackExchange. Please forgive me if I've worded this question poorly. • That's a very nice observation that only the units digit has any bearing, and is essentially the underlying idea of "modular arithmetic." This is an interesting problem, and I'll be fairly surprised if it's true. However, there are $3$ ways to order $a, b, c$, a couple choices of symbols between $a,b$ and $b,c$ and with the ability to use parentheses... very interesting! If we have the three numbers $a, b, c$, are we allowed to order them any way we like? – pjs36 Nov 5 '17 at 6:47 • How do you get a multiple of $10$ this way using $1$, $2$, and $4$? – alex.jordan Nov 5 '17 at 7:58 • @alex.jordan $2\cdot (4+1)$ – Kyle Miller Nov 5 '17 at 7:59 • Oh, I see. I somehow thought only addition and subtraction were in play. Didn't read well. – alex.jordan Nov 5 '17 at 8:00 • @pjs36 From the two examples in the OP, it seems clear that reordering is permitted. – Erick Wong Nov 5 '17 at 8:07
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692305124305, "lm_q1q2_score": 0.8618401407831018, "lm_q2_score": 0.8824278618165526, "openwebmath_perplexity": 323.0975641751593, "openwebmath_score": 0.9033935070037842, "tags": null, "url": "https://math.stackexchange.com/questions/2499649/proof-of-obtaining-multiple-of-10-by-using-arithmetic-operations-on-any-three-nu" }
php, http, php5, cache, session $cachedItems = $this->readFromCache(); if(empty($cachedItems)) { $cachedItems = []; } // Keep other values in the cache, but if the cookie name already exists, overwrite it $cachedItems[ $this->buildCookieName() ] = [ 'name' => $this->buildCookieName(), 'value' => $this->value, 'expire' => $this->expire, 'path' => is_null($this->path) ? 'null' : $this->path, 'domain' => is_null($this->domain) ? 'null' : $this->domain, 'secure' => is_null($this->secure) || false === $this->secure ? 'false' : $this->secure, 'httponly' => is_null($this->httponly) || false === $this->httponly ? 'false' : $this->httponly, ]; $this->writeToCache($cachedItems); return $this; }
{ "domain": "codereview.stackexchange", "id": 22283, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, http, php5, cache, session", "url": null }
navigation, move-base, ros-hydro, costmap-2d Update 1 As requested by David, here is the output of 'rosparam get /move_base/local_costmap': ros@Base:~$ rosparam get /move_base/local_costmap footprint: '[[-0.4,-0.2],[0.4,-0.2],[0.4,0.2],[-0.4,0.2]]' footprint_layer: {enabled: true} footprint_padding: 0.01 global_frame: /odom_combined height: 6 inflation_layer: {cost_scaling_factor: 10.0, enabled: true, inflation_radius: 0.5, robot_radius: 0.46} laser_scan_sensor: {clearing: true, data_type: LaserScan, marking: true, sensor_frame: /base_laser, topic: /scan} obstacle_layer: {enabled: true, max_obstacle_height: 2.0, obstacle_range: 2.5, raytrace_range: 3.0} obstacle_layer_footprint: {enabled: true} obstacles: {observation_sources: laser_scan_sensor} origin_x: 0.0 origin_y: 0.0 plugins: - {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'} - {name: footprint_layer, type: 'costmap_2d::FootprintLayer'} - {name: inflation_layer, type: 'costmap_2d::InflationLayer'} publish_frequency: 2.0 publish_voxel_map: false
{ "domain": "robotics.stackexchange", "id": 15849, "lm_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, move-base, ros-hydro, costmap-2d", "url": null }
c#, unit-testing, selenium, webdriver So, all of that is working, but I am not sure about quality of that code. On the other hand, I don't need anything over-fancy. It just should be good, clean and understandable. Should I keep it intact or update some parts? Your IsElementVisible method can be condensed to: public bool IsElementVisible(IWebDriver driver, By element) { return driver.FindElements(element).Count > 0 && driver.FindElement(element).Displayed; } I guess the method IsElementNotVisible should return boolean negation of result of the IsElementVisible method: public bool IsElementNotVisible(IWebDriver driver, By element) { return !IsElementVisible(driver, element); } Boolean comparisons Expressions x == true and just x are eqivalent. Expressions x == false and just !x are also eqivalent. For example, you don't need to write: if (productIssue == false || productIssueB == false) you could write instead: if (!productIssue || !productIssueB)
{ "domain": "codereview.stackexchange", "id": 16319, "lm_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#, unit-testing, selenium, webdriver", "url": null }
javascript, functional-programming Title: JavaScript function that composes other functions to create a master function I wrote a little Compose function, which takes a variable number of arguments of type function and then calls each of those in order, passing in the value of the previously called function. My function works just like I want it to, however since the function provides a way to program functionally, I figured it's application should be functional as well--but it's not. The Compose function: const Compose = (...functions) => { return val => { let i = 0, len = functions.length, fnResult = functions[i](val); while (++i < len) { fnResult = functions[i](fnResult); } return fnResult; }; }; Application: const add7 = num => num + 7; const squared = num => num * num; const subtract13 = num => num - 13; const add7ThenSquareThenSubtract13 = Compose(add7, squared, subtract13);
{ "domain": "codereview.stackexchange", "id": 21853, "lm_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, functional-programming", "url": null }
c#, entity-framework // I would prefer the next three statements to be in a separate method : var socialMailingListSubscriber = new socialMailingListSubscriber { EmployeeId = employee.employeeId } dbContext.SocialMailingListSubscribers.Add(socialMailingListSubscriber); dbContext.SaveChanges(); // I would prefer the next three statements to be in a separate method : var subscription = new Subscription { subscription.EmployeeId = employee.Id } dbContext.Subscriptions.Add(subscription); dbContext.SaveChanges();
{ "domain": "codereview.stackexchange", "id": 10706, "lm_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", "url": null }
rotation, conventions There is one situation where inherent physical considerations affect the choice, as Olin Lathrop alludes to in a comment. Motor fans can be quite heavy and can rotate quite fast. When they do, they produce a huge angular momentum, which can make steering difficult. Using two fans pitched in opposite directions allows you to have both fans push air the same direction, and rotate in opposite directions. You then have zero or very little net angular momentum, and easier steering.
{ "domain": "physics.stackexchange", "id": 36029, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rotation, conventions", "url": null }
complexity-theory, computation-models, parallel-computing Title: Doing matrix multiplication with $\lceil n^3 / \log n \rceil$ processors in $2\log n$ steps by Brent's principle On a parallel machine with $n$ processors we can compute the sum (or product, or the result of any associative operation) on $n$ numbers in $\log n$ steps. In the first step combine neighbors to get $n/2$ numbers left, then combine them so that $n/4$ numbers are left and so on until a single number, the result, is left which happens after $\lceil \log n \rceil$ steps. With this is it obvious that we can compute the matrix product of two $n \times n$ matrices $A = (A_{ij}), B = (B_{ij})$ with $n^3$ processors in $\log n + 1$ steps, in a first step compute all the $n^3$ products of the entries $A_{ik} \cdot B_{kj}$ for $i,j,k \in \{1,\ldots, n\}$. Then with $n^2$ processors compute the $n^2$ sums of the $n$ numbers $A_{i1}\cdot B_{1j} + \ldots + A_{ik}\cdot B_{kj}$. Hence we get by with $1 + \log n$ parallel steps.
{ "domain": "cs.stackexchange", "id": 13425, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, computation-models, parallel-computing", "url": null }
python, beginner, assembly, compiler print("...Done\n") print("Assembling finished") Tables.py # Categorized opcodes based on number of arguments and type # RRR, RRI, RI, JMP RRR = { "add" : "0000", "sub" : "0001", "nor" : "0010", "and" : "0011", "ior" : "0100", "eor" : "0101", "shl" : "0110", "shr" : "0111", "eql" : "1000", "neq" : "1001", "gtr" : "1010", "lss" : "1011", "mul" : "1100", "mulu" : "1101", "div" : "1110", "mod" : "1111" } RRI = { "addi" : "001", "jalr" : "010", "lwm" : "011", "swm" : "100" } RI = { "lui" : "101" } JMP = { "brtr" : "110", "brfl" : "111" } Example multiplication program start: lwm r1 r0 numA lwm r1 r1 0 lwm r2 r0 numB lwm r2 r2 0 addi r3 r0 0 # r3 = 0 addi r7 r0 1 # r7 = 1 brfl r0 enter # enter loop
{ "domain": "codereview.stackexchange", "id": 22843, "lm_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, assembly, compiler", "url": null }
mysql, bash, configuration # load all allowed arguments into $config array parseargs() { (getopt --test > /dev/null) || true [[ "$?" -gt 4 ]] && die 'I’m sorry, `getopt --test` failed in this environment.' OPTIONS="" LONGOPTS="help,webmaster:,webgroup:,webroot:,domain:,subdomain:,virtualhost:,virtualport:,serveradmin:" ! PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTS --name "$0" -- "$@") if [[ ${PIPESTATUS[0]} -ne 0 ]]; then # e.g. return value is 1 # then getopt has complained about wrong arguments to stdout exit 2 fi # read getopt’s output this way to handle the quoting right: eval set -- "$PARSED" while true; do case "$1" in --help) man -P cat ./virtualhost.1 exit 0 ;; --) shift break ;; *) index=${1#--} # limited to LONGOPTS config[$index]=$2 shift 2 ;; esac done }
{ "domain": "codereview.stackexchange", "id": 34133, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mysql, bash, configuration", "url": null }
We can get an immediate upper bound: if n=59*5, then the first term will be greater than 58. Since 59*5 - 1 < 625, clearly we have just the first three terms: $\displaystyle 58 = \left \lfloor \frac{n}{5} \right \rfloor + \left \lfloor \frac{n}{25} \right \rfloor + \left \lfloor \frac{n}{125} \right \rfloor$ This is easy to play around with; 58/5 is about 12, so as an estimate we can subtract about 10*5 from our upper bound to get 59*5-51 = 244. Plugging in results in 48 + 9 + 1 = 58, as desired. So $n \in \{240,...,244\}$. 3. Or let $n = 125a + 25b + 5c + d$ as a representation in base 5 , since it does not exceed $625$ Therefore , $[ \frac{n}{5} ] = 25a + 5b + c ~ [ \frac{n}{25} ] = 5a + b ~,~ [ \frac{n}{125} ] = a$ $25a + 5b + c + 5a + b + a = 31a + 6b + c = 58$ $a = 1 ~,~ b = 4 ~,~ c =3$ and $d$ ranges from $0$ to $4$ . $125(1) + 25(4) + 5(3) + 0 \leq n \leq 125(1) + 25(4) + 5(3) + 4$ $240 \leq n \leq 244$ .
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9921841109796004, "lm_q1q2_score": 0.8017514430115322, "lm_q2_score": 0.8080672066194945, "openwebmath_perplexity": 527.8416576917629, "openwebmath_score": 0.9096351265907288, "tags": null, "url": "http://mathhelpforum.com/number-theory/148891-n.html" }
python, html, python-2.x, sqlite, geospatial i = 0; var markers = []; for ( pos in locations ) { i = i + 1; var row = locations[pos]; window.console && console.log(row); console.log(row) var currentCoord = new google.maps.LatLng(row[1], row[2]); var marker = new google.maps.Marker({ position: currentCoord, map: map, title: row[0] }); markers.push(marker); } } </script> </head> <body onload="initialize()"> <div id="map_canvas" style="height: 100%"></div> </body> </html>
{ "domain": "codereview.stackexchange", "id": 23122, "lm_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, html, python-2.x, sqlite, geospatial", "url": null }
Notice that $P$ is not divisible by any of the given primes. Hence $P$ is either a prime or is divisible by a prime $> n$. It can be easily seen that $$P<n!$$ Furthermore, $P$ needs to be greater than $n$, otherwise we would find another prime (other than $p_{1},p_{2},\cdots,p_{k}$) which would lead to a contradiction. • I think you mean that $p_1, p_2, \cdots , p_k$ are less than or equal to $n$. You also have to be careful when claiming that $P < n!$; this isn't true in the case $n = 3$. – 6005 Jul 26 '13 at 14:42 • You need it to not be divisible by $n$ if $n$ is prime, so you need to include primes less than or equal to $n$ in the product. Thus you get $3*2 + 1 = 7$, not less than $3! = 6$. – 6005 Jul 26 '13 at 14:47 • Sorry!My bad,I guess the case n=3 has to be checked manually.Other than that I think there are no exceptions. – Shaswata Jul 26 '13 at 14:49
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232909876816, "lm_q1q2_score": 0.8539031881824951, "lm_q2_score": 0.8688267728417087, "openwebmath_perplexity": 104.26105333668434, "openwebmath_score": 0.8525522351264954, "tags": null, "url": "https://math.stackexchange.com/questions/452806/prove-forall-n-2-exists-p-in-bbbp-n-p-n/452816" }
mathematics, matrix-representation, nielsen-and-chuang $$\mathcal{M}(BA)=\mathcal{M}(B)\mathcal{M}(A)$$ Note: I've omitted the ket notation given in the original question, for ease of typing. By default, $|v_i\rangle = v_i,|w_j\rangle = w_j$ and $|x_k\rangle = x_k$ for indices $i,j,k$.
{ "domain": "quantumcomputing.stackexchange", "id": 234, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mathematics, matrix-representation, nielsen-and-chuang", "url": null }
python, performance, regex, csv, pandas Title: Optimize a simple and quick python script for transposing a .csv file I need to transpose the following file output1.csv, which is is a result from a quantum chemistry calculation into a single colum efficiently: Frequencies -- 18.8210 44.7624 46.9673 Frequencies -- 66.6706 102.0432 112.4930 Frequencies -- 124.4601 138.4393 180.1404 Frequencies -- 230.0306 240.4389 258.2459 Frequencies -- 282.7781 340.8302 357.7789 Frequencies -- 378.9043 384.1284 401.4285 Frequencies -- 418.0523 444.2264 447.6885 Frequencies -- 473.2391 501.0937 518.9083 Frequencies -- 559.5925 609.9256 623.7729 Frequencies -- 657.4144 672.5480 728.2009
{ "domain": "codereview.stackexchange", "id": 20808, "lm_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, regex, csv, pandas", "url": null }
python, simulation, statistics Title: Monte Carlo coin flip simulation I've been learning about Monte Carlo simulations on MIT's intro to programming class, and I'm trying to implement one that calculates the probability of flipping a coin heads side up 4 times in a row out of ten flips. Basically, I calculate if the current flip in a 10 flip session is equal to the prior flip, and if it is, I increment a counter. Once that counter has reached 3, I exit the loop even if I haven't done all 10 coin flips since subsequent flips have no bearing on the probability. Then I increment a counter counting the number of flip sessions that successfully had 4 consecutive heads in a row. At the end, I divide the number of successful sessions by the total number of trials. The simulation runs 10,000 trials. def simThrows(numFlips): consecSuccess = 0 ## number of trials where 4 heads were flipped consecutively coin = 0 ## to be assigned to a number between 0 and 1 numTrials = 10000 for i in range(numTrials):
{ "domain": "codereview.stackexchange", "id": 12572, "lm_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, simulation, statistics", "url": null }
discrete-signals, sampling, analog-to-digital A 5 Mhz has sine wave has no harmonics. If the signal has harmonics, it is not a sine wave any more but a different signal (rectangular, triangle, etc.) For ANY signal: you need to determine the highest frequency that's in the signal and then chose the Nyquist frequency to be higher. Otherwise you get either loss of information or aliasing Most ADC do have an anti-aliasing low-pass filter build in: if you have harmonics higher than Nyquist, the filter will just chop them off. Points 2 and 3 apply to ANY signal: noise, music, video, OFDM, and also harmonic signals like rectangle our saw-tooth waves. There really is nothing special about "harmonics".
{ "domain": "dsp.stackexchange", "id": 7143, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "discrete-signals, sampling, analog-to-digital", "url": null }
heat-transfer, energy-efficiency, heat-exchanger, engines, diesel Cat has a nice engineering primer on engine cooling - http://s7d2.scene7.com/is/content/Caterpillar/CM20160713-53120-13199 Vehicles often use air-to-air aftercooling and oil cooling, so the aftercooler and oil cooler heat doesn't end up in the radiator. Most larger engines use jacket water for aftercooling and oil cooling, so you need to add those values to the internal jacket water heat to size the radiator. Cat 3412 genset technical data sheet (see section titled heat rejection on page 2) I'll try to dig up a similar sheet for mobile equipment engines later. Or someone else can ;)
{ "domain": "engineering.stackexchange", "id": 3264, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "heat-transfer, energy-efficiency, heat-exchanger, engines, diesel", "url": null }
organic-chemistry, stereochemistry By the way to clear up any confusion, this step-by-step is essentially rotating the molecule (you aren't changing the structure or stereochemistry). I simply laid out detailed directions so that if you were having difficulties visualizing rotating the molecule in your head, you wouldn't have to think about it. As long as you follow the directions and rules I have laid out, it should result in a new drawing of the original molecule from a different angle, the angle in which the lowest priority group is in the dashed (going away from you) position
{ "domain": "chemistry.stackexchange", "id": 17957, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, stereochemistry", "url": null }
climate-change, temperature 1960–1969 −0.014 −0.0252 1970–1979 −0.001 −0.0018 This seems odd considering massive oil consumption started in 1880 IIRC, and by 1980 over 350 billions of oil barrels were already consumed (much more probably, since the data before 1950 isn't considered because there weren't reliable records). Why was there a negative temperature anomaly between 1950 to 1980? This phenomenon is known as global dimming. It was due to the particles and aerosols mostly released by combustion of fossil fuels such as diesel. Those particles block the radiation from the sun, so they have a cooling effect. For some decades this effect counterbalanced the warming effect of greenhouse gases, although it is no longer the case at a global scale (see for instance Wild et al. 2007). Particles emission has been reduced thanks to better engines and new regulations, which stopped their masking effect on global warming. Which is a good thing since those particles have a serious impact on health.
{ "domain": "earthscience.stackexchange", "id": 1929, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "climate-change, temperature", "url": null }
electromagnetism, units, unit-conversion Title: Finding a substitution of $\mu_0$ to convert from SI to c.g.s in EM laws In c.g.s, we set $$k=\frac 1{4\pi\epsilon_0}=1$$ which gives $$\epsilon_0=\frac 1{4\pi}$$ This conversion works, for example, in Gauss' law: in SI $$\vec{\nabla}\cdot\vec{E}=\frac\rho{\epsilon_0}$$ and in c.g.s $$\vec{\nabla}\cdot\vec{E}=4\pi\rho$$ Now, we know $c^2=\frac 1{\epsilon_0\mu_0}$, so in order to convert $\mu_0$ (that usually appears in the SI form) into c.g.s, I thought the substitution would be $$\mu_0=\frac {4\pi}{c^2}$$ However, this doesn't yield the correct laws in c.g.s. For example, Amper's law in SI is $$\vec{\nabla}\times\vec{B}=\mu_0\vec{j}$$ But in c.g.s it is $$\vec{\nabla}\times\vec{B}=\frac {4\pi}c \vec{j}$$ And not $$\vec{\nabla}\times\vec{B}=\frac {4\pi}{c^2} \vec{j}$$ as I would have expected. So it seems $\mu_0=\frac{4\pi}c$ is the correct substitution.
{ "domain": "physics.stackexchange", "id": 43170, "lm_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, units, unit-conversion", "url": null }
neural-network, classification, training Title: Training neural network classifier with one class after another Is it possible to train a neural network classifier with only one class, and after that with only another class? For example, first train it only on recognizing dogs, and after finishing that training, only train it on recognizing cats, so in the end the net can classify between dogs and cats. Or do the classes always need to be mixed for training? Please tell me any scientific papers explaining why classes have to be mixed or explaining why they do not need to be mixed. It will probably work but less Efficiently(or lower Accuracy) if you train the Network one after the another (like trained for Dog's first , followed by Cats etc..) because It will Change The Weights of The Hidden Layers which in turn will destroy the same Recognition Capability of The Network ... Also Dogs and Cats differ in their natural looks a lot, So the Net Will Have a tough Time Doing So Simultaneously..
{ "domain": "datascience.stackexchange", "id": 2722, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neural-network, classification, training", "url": null }
kinect, rviz Originally posted by Ken_in_JAPAN with karma: 894 on 2014-04-17 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 11791, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "kinect, rviz", "url": null }
machine-learning, python, svm, naive-bayes-classifier, text-classification Title: Classifiers and accuracy I would like to ask you how to use classifier and determine accuracy of models. I have my dataset and I already cleaned the text (remove stopwords, punctuation, removed empty rows,...). Then I split it into train and test. Since I want to determine if an email is spam or not, I have used the common classifiers, I.e. Naive Bayes, SVM and logistic regression. Here I just included my train and test datasets: nothing else! I am using Python to run this analysis. My question is: should it be enough or should I implement new algorithms? If you could provide me with an example of how an already existing algorithm was improved it would be also good. I read a lot of literature regarding accuracy of text classification and in all the papers the authors use SVM, Naïve Bayes, logistic regression to classify spam. But I do not know if they built their own classifier or just used the existing one in Python.
{ "domain": "datascience.stackexchange", "id": 8097, "lm_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, python, svm, naive-bayes-classifier, text-classification", "url": null }
solid-state-physics, symmetry, group-theory, crystals, dispersion FCC with two atom basis A zincblende crystal is FCC but has a two atom basis (like CdTe). It has space group $F\bar{4}3m$ (#216). Looking at the same high symmetry line $\Delta:\Gamma\to X$, the little cogroup in this case is $2mm$ ($C_{2v}$) (as found here). $C_{2v}$ has only 4 irreps and they are all 1D. So the symmetry classification is clearly different.
{ "domain": "physics.stackexchange", "id": 72149, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "solid-state-physics, symmetry, group-theory, crystals, dispersion", "url": null }
c# private List<Error> _ErrorList = null; public List<Error> ErrorList { get { if (_ErrorList == null) { _ErrorList = new List<Error>(); } return _ErrorList; } } public ErrorBase() { HasError = false; } } If you have multiple threads adding to it then you need to add some locking in the get - but then on the other hand List<> itself is not thread-safe so I assume that's not the case. In .NET 4.0 and later you have Lazy<> which will make the code a little bit shorter.
{ "domain": "codereview.stackexchange", "id": 5609, "lm_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#", "url": null }
classical-mechanics, lagrangian-formalism, momentum, hamiltonian-formalism, action Title: Momentum $p = \nabla S$ My book mentions the following equation: $$p = \nabla S\tag{1.2}$$ where $S$ is the action integral, nabla operator is gradient, $p$ is momentum. After discussing it with @hft, on here, it turns out book must have meant impulse is only such at initial and final points. $$ \frac{\partial S_{cl}}{\partial x_2} = \left.\frac{\partial L}{\partial \dot x}\right|_{x_{cl}}(t_2) = p_2 $$ and also $$ \frac{\partial S_{cl}}{\partial x_1} = -\left.\frac{\partial L}{\partial \dot x}\right|_{x_{cl}}(t_1) = p_1. $$ While this is definitely clear, I still feel doubtful as I asked my professor very abruptly(couldn't have chance to have conversation) and he said that $p = \nabla S$ not only applies to initial and final points, but everywhere.
{ "domain": "physics.stackexchange", "id": 96186, "lm_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, momentum, hamiltonian-formalism, action", "url": null }
c# var classes = race.GetClasses(); return classes[random.Next(0, classes.Count)]; } } } Appreciate this is on the chunky side but would appreciate any feedback people are willing to give to help me improve. Thanks in advance! Not sure why you've gone this far using the classes instead of Enum. I can understand if you're planning to include some functionalities to each class, but if is it just for the current context, then it would be useless. For instance, Warrior, Hunter, Rogue ..etc. are some work descriptions to Races like Human, Orc, Troll...etc. And Alliance, Horde... are another type of these races. So Race is the main type, while others are just some descriptive types of these races. Since they're all descriptive types, we can use Enum : public enum RaceType { Warrior, Paladin, Rogue, Priest, Mage, Warlock, Hunter, Druid, Shaman }
{ "domain": "codereview.stackexchange", "id": 37572, "lm_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#", "url": null }
Now we can compute what the basis vectors are after the transformation above (by using each of the basis vectors as $\mbold{v}$ on \eqref{3d-rotation}) to construct a rotation matrix \begin{align*} \mbold{p} &= \begin{bmatrix}1 \\ 0 \\ 0\end{bmatrix} \quad \quad \quad \quad \mbold{p'} = \begin{bmatrix} n_x^2(1 - \cost) + \cost \\ n_xn_y(1 - \cost) + n_z \sint \\ n_xn_z(1 - \cost) - n_z \sint \end{bmatrix}\\ \\ \mbold{q} &= \begin{bmatrix}0 \\ 1 \\ 0\end{bmatrix} \quad \quad \quad \quad \mbold{q'} = \begin{bmatrix} n_yn_x(1 - \cost) - n_z \sint \\ n_y^2(1 - \cost) + \cost \\ n_yn_z(1 - \cost) + n_x \sint \end{bmatrix}\\ \\ \mbold{r} &= \begin{bmatrix}0 \\ 0 \\ 1\end{bmatrix} \quad \quad \quad \quad \mbold{r'} = \begin{bmatrix} n_zn_x(1 - \cost) + n_y \sint \\ n_zn_y(1 - \cost) - n_x \sint \\ n_z^2(1 - \cost) + \cost \end{bmatrix}\\ \end{align*} Constructing the matrix from these vectors
{ "domain": "mauriciopoppe.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9943580913327833, "lm_q1q2_score": 0.8129617912504787, "lm_q2_score": 0.817574471748733, "openwebmath_perplexity": 2282.403926947458, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://www.mauriciopoppe.com/notes/computer-graphics/transformation-matrices/rotation/introduction/" }
rosjava, android Staged and commited/pushed artifact changes to forked maven repo cd ~/rosjava_mvn_repo ./update_maven_repo Note: When i perform Step 6, the update script does not list any android_core .aar files as upgraded or new which makes me believe my updates in the android_10 library did not get built. Pull in repository artifacts into Android Project using build.gradle repositories { maven { url 'https://github.com/stratomda/rosjava_mvn_repo/raw/master' } } Add android_core dependencies to build.gradle
{ "domain": "robotics.stackexchange", "id": 23879, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosjava, android", "url": null }
gatk, cnv echo "Starting Step 7: Run PostprocessGermlineCNVCalls (Mandatory Step)" # Step 7: Run PostprocessGermlineCNVCalls (Mandatory Step) singularity exec $singularity_image PostprocessGermlineCNVCalls \ --model-shard-path "${shard_file}" \ --cnv-call-path $(basename "${shard_file}" .interval_list).calls.tsv \ --output-dir postprocess-sm \ --scatter-count ${NUM_THREADS} \ --num-scatter-plot-columns 8 \ --max-zeros-in-sample-percentage 40.0 \ --annotation-cutoffs "QD=2.0" "SOR=2.0" "FS=10.0" "MQ=50.0" \ --interval-merging-rule OVERLAPPING_ONLY \ --minimum-contig-length 46709983 \ --minimum-interval-median-percentile 5.0 done done done #______________________________________________________________________________________________________________________________________________________________ The ".out" file I received after the run aborted is:
{ "domain": "bioinformatics.stackexchange", "id": 2453, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gatk, cnv", "url": null }
quantum-field-theory, statistical-mechanics, mathematical-physics, symmetry-breaking Let me first discuss this in the classical case, and then give you pointers to where you can learn more about the quantum case. You first have to be careful, when writing down your expectations, to specify the state with respect to which you are actually computing the expectation. In this respect, the physicists' habit of denoting expectation simply by generic brackets $\langle \cdot \rangle$ is very bad. There is no problem for your "double limit" expectation (provided you let $h\to 0$ using positive values only), but the expectation in your "long-range order" case is ambiguous and results actually depend on what it is supposed to mean.
{ "domain": "physics.stackexchange", "id": 58285, "lm_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, statistical-mechanics, mathematical-physics, symmetry-breaking", "url": null }
energy Now for (stimulated) absorption. The probability of this absorption is actually proportional to the population density of ground state atoms. So a gain (or fluorescent) medium can become saturated: if the atoms are truly two-level atoms, then they cannot absorb a further photon whilst not in their ground state. Each photon propagates according to Maxwell's equations, so it is equally likely to be absorbed on any contour of equal intensity of a laser cavity mode, for example. So, if photon propagation is confined to a region of $A\mathrm{m^2}$ and the intensity of the propagating mode is roughly constant over this cross section, the probability of absorption for each photon is roughly the proportion of area "shrouded" by the absorbing atoms. So, if a slice of our cavity is $\delta z$ long, there are $\rho$ atoms per cubic metre and each "atom" has a cross-section $\sigma\mathrm{\,m^2}$ (effective target size) then the photon's probability of absorption is simply:
{ "domain": "physics.stackexchange", "id": 9579, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy", "url": null }
As you've said, using the binomial theorem, $$2\sum_{r=0}^{m}{m \choose r}1^r 1^{m-r} = 2(1+1)^m = 2^{m+1}$$ The second part, can be explained as having a bunch of people ($m$), in how many ways can you pick a group and designate one of them as a leader: 1. You either pick a group of size $r$ (${m \choose r}$ ways) and pick one as the leader ($r$ ways), for every group size - Leading to sum: $$\sum_{r=0}^{m}{m \choose r}r$$ 1. Pick one as the leader ($m$ choices) and for every one of the remainning people ($m-1$) decide whether they are in the group or not ($2^{m-1}$ ways) leading to $$m 2^{m-1}$$ So that together you have $$m 2^{m-1} + 2^{m+1} = (m+4) 2^{m-1} = n 2 ^{-5}$$ - Thank you very much for the reasoning to the second part. That makes perfect sense. I didn't think to change n-4 to m! –  user60126 Jan 29 '13 at 18:33 The summation you quote will be useful. Then note the following trick, which has a vast scope (http://www.math.upenn.edu/~wilf/DownldGF.html).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517462851321, "lm_q1q2_score": 0.833253929394059, "lm_q2_score": 0.8519528057272543, "openwebmath_perplexity": 234.7870060103098, "openwebmath_score": 0.9028167724609375, "tags": null, "url": "http://math.stackexchange.com/questions/289921/help-with-a-summation" }
c#, entity-framework, crud public bool UpdateMan(TestDatabaseEntities dbEntities, IQueryable<Man> query, Man man) { return TryDataBase(dbEntities, "Man updated successfully", () => { foreach (Man M in query) { M.Name = man.Name; } }); } public bool DeleteMan(TestDatabaseEntities dbEntities, IQueryable myQuery) { return TryDataBase(dbEntities, "Man deleted successfully", () => { foreach (Man M in myQuery) { dbEntities.Men.Remove(M); } }); } public bool ReadMan(TestDatabaseEntities dbEntities, IQueryable myQuery) { UserInterface MyUI = new UserInterface(); bool bSuccessful;
{ "domain": "codereview.stackexchange", "id": 2666, "lm_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, crud", "url": null }
verilog, fpga, hdl, system-verilog The module instance output port. The continuous driver of your logic declaration. Just declare the signals without an assignment: logic prbs ; logic prbs_n; Aside from that, I do not see any other functional problems with your code. The layout follows good coding practices, and you make good use of parameters. In the testbench, you could take advantage of 2-state signal types. This could lead to better simulation performance, and it also better conveys the intent of your code. Since there is no need to drive x or z for your instance inputs, you can use bit instead of logic: bit clk; bit s_rst_n; bit en; Since all 2-state types default to 0, there is no need to explicitly initialize them to 0 in the declaration or elsewhere. This is purely a matter of convenience and preference. The situation is similar for your testbench counter: int tick; You could simplify your clock using a single line of code: always #( CLOCK_PERIOD / 2 ) clk = !clk;
{ "domain": "codereview.stackexchange", "id": 42449, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "verilog, fpga, hdl, system-verilog", "url": null }
c++, c++20, constant-expression to int main() { for (std::size_t i = 0; i < 6; ++i) { std::cout << flatArray[i] << " "; } std::cout << std::endl; } which can then be improved to: int main() { for (auto v : flatArray) { std::cout << v << ' '; } std::cout << '\n'; } We can use some shorthand to make nested arrays easier to understand: namespace detail { template <typename T, std::size_t... Dims> struct multi_array; template <typename T> struct multi_array<T> { using type = T; }; template <typename T, std::size_t Dim, std::size_t... Dims> struct multi_array<T, Dim, Dims...> { using type = std::array< typename multi_array<T, Dims...>::type, Dim >; }; } template <typename T, std::size_t... Dims> using multi_array = typename detail::multi_array<T, Dims...>::type;
{ "domain": "codereview.stackexchange", "id": 37956, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++20, constant-expression", "url": null }