text
stringlengths
1
1.11k
source
dict
java, design-patterns, jpa, jsf ClientsQueryBean: package dur.database; import java.io.Serializable; import java.util.List; import java.util.logging.Logger; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.ejb.LocalBean; @Stateless @LocalBean public class ClientsQueryBean implements Serializable { private static final long serialVersionUID = 1L; private final Logger log = Logger.getLogger(ClientsQueryBean.class.getName()); @EJB private QueryBeanWithEntityManager queryBean; public List<Clients> getClients() { return queryBean.getClients(); } public Clients getClientById(int id) { return queryBean.getClientById(id); } } QueryBeanWithEntityManager: package dur.database; import java.util.List; import java.util.logging.Logger; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.persistence.TypedQuery;
{ "domain": "codereview.stackexchange", "id": 9797, "lm_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, design-patterns, jpa, jsf", "url": null }
quantum-mechanics, electromagnetic-radiation, double-slit-experiment, wave-particle-duality In this double slit experiment, the cylindrical waves (elastic scattering in air), the ones that go through a slit without any filter, will create visible bright interference pattern. Now in this experiment, the photons or electrons are shot one at a time, still they create interference, because they travel as waves and the partial waves that go through the slits interfere with each other. But why does it matter what spatial shape the waves have, shouldn't both type of shape of waves go through the slits and interfere and create an interference pattern? We are talking about single electrons or photons shot at a time. Even a single particle should create an interference pattern, and it should not matter what spatial shape the partial waves have. Question:
{ "domain": "physics.stackexchange", "id": 51066, "lm_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, electromagnetic-radiation, double-slit-experiment, wave-particle-duality", "url": null }
Thanks, - Does someone feel like writing an "abstract duplicate" for this kind of question? I think I've seen several of them, but I don't know whether we have one that deals with this more generally and would serve as a good duplicate for all of them. –  joriki Nov 12 '11 at 15:55 The actual correct answer to this question is $\approx 3.7219$. I do not know what "quantitative aptitude test" means, but would not 3.7 be a better answer than 3.75? –  Aleksey Pichugin Nov 12 '11 at 16:36 We'll split the sum you're looking for up into $$10 \sum_{i=1}^{10} {i \over 2^{i+2}} - 5 \sum_{i=1}^{10} {1 \over 2^{i+2}}.$$ Call this $10S_1 - 5S_2$. We can write $$S_1 = \sum_{i=1}^{10} {i \over 2^{i+2}} = {1 \over 4} \sum_{i=1}^{10} {i \over 2^i}$$ and the result $\sum_{i=1}^\infty i/2^i = 2$ is well-known; thus $S_1 \approx 1/2$. Similarly, $S_2 \approx \sum_{i=1}^\infty 1/2^{i+2} = 1/4$ by the usual sum of a geometric series. So your sum is approximately $15/4$. In fact the infinite sum
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717448632122, "lm_q1q2_score": 0.8606332797484871, "lm_q2_score": 0.8723473829749844, "openwebmath_perplexity": 578.1400014659729, "openwebmath_score": 0.9958812594413757, "tags": null, "url": "http://math.stackexchange.com/questions/81362/which-is-the-fastest-way-to-compute-sum-limits-i-110-frac10i-52i" }
javascript, html, css, responsive-design 4 Rating Especially since you are new you should read into the Dunning-Kruger-Effect and Mt. Stupid and Valley of Death. With your statement: I have used "responsive design" so please also be sure to try this in a full screen and adjust the width of the browser if you want to see that functionality. I'm not exclusively looking for feedback on that aspect or anything, but it was a tough part for me being new to CSS you where actually quite wrong. Responsive Web Design and UX and UI should be your next big topic to learn. You underestimate the influence of the frontend part of those topics. While you show a really good start, you need still to learn some of the basics especially with correctness and semantics in mind.
{ "domain": "codereview.stackexchange", "id": 44636, "lm_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, html, css, responsive-design", "url": null }
visible-light, electromagnetic-radiation Realistically, All wavelengths should differ in shades considering the red hue increases in every colour as wavelength increases. Then how come we say that only Seven colours form White light? The important thing here is that this spectrum is a $\textbf{continuum}$, which results in no clearly defined limit or frontier between colours because of the smooth color gradient that exists. Looking at this spectrum the first thing that we can tell is that there are seven big categories that result in a range (continuum) of wavelenghts that we can very easily distinguish: purple, blue, cyan, green, yellow, orange and red. Looking for example at 550 nm and 600 nm in the previous figure, we can say that both wavelenghts correspond to the same "bag" of wavelenghts which we name $\textbf{green}$, but if we carefully observe those colours we note that we can actually tell that they are $\textit{different}$ hues of green because of the shading.
{ "domain": "physics.stackexchange", "id": 62400, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light, electromagnetic-radiation", "url": null }
java, performance, strings, formatting In which way can this method be better? This function has a few inefficiencies: Calling hex.substring(2, hex.length()) makes a fresh copy of hex, copying the entire contents except the first two characters. (Before Java 7, there used to be an optimization for .substring().) This is very bad, since it turns an algorithm that should be O(n) into O(n2). Similarly, calling .trim() at the end copies nearly the entire string, just to drop the trailing whitespace. It would be more efficient to truncate builder by calling builder.setLength(…) before .toString(). Better yet, design your loop so that it doesn't append superfluous whitespace at the end. The StringBuilder has to guess how large its buffer needs to be, and if it underestimates, it will need to reallocate and copy the buffer. We know that for every eight characters of input, there will be approximately 13 characters of output (overestimating slightly).
{ "domain": "codereview.stackexchange", "id": 32128, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, strings, formatting", "url": null }
In the Partial Differential Equation Toolbox™ definition for an elliptic system, the and dependent variables are u(1) and u(2). The two second order partial differential equations can be rewritten as which is the form supported by the toolbox. The input corresponding to this formulation is shown in the sections below. Problem Parameters E = 1.0e6; % modulus of elasticity nu = .3; % Poisson's ratio thick = .1; % plate thickness len = 10.0; % side length for the square plate hmax = len/20; % mesh size parameter D = E*thick^3/(12*(1 - nu^2)); pres = 2; % external pressure Geometry and Mesh For a single square, the geometry and mesh are easily defined as shown below. gdmTrans = [3 4 0 len len 0 0 0 len len]; sf = 'S1'; nsmTrans = 'S1'; g = decsg(gdmTrans', sf, nsmTrans'); [p, e, t] = initmesh(g, 'Hmax', hmax); Boundary Conditions
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676442828175, "lm_q1q2_score": 0.8009512632956529, "lm_q2_score": 0.817574478416099, "openwebmath_perplexity": 1585.5923151346587, "openwebmath_score": 0.8672457933425903, "tags": null, "url": "http://www.mathworks.com/examples/pde/community/19606-clampedsquareplateexample" }
universe, mass & = & 4\pi R^2 \times c\,dt \times \rho_\mathrm{M}\\ & \sim & 10^6\,M_\odot\,\text{per second,} \end{array} $$ where $A=4\pi R^2$ is the surface area of the Universe. Dark energy However, another factor contributes to the mass increase, namely the so-called dark energy, which is a form of energy attributed to empty space. And since new space is created as the Universe expands, dark energy is being created all the time. Currently, the energy density of dark energy, expressed as mass density through $E=mc^2$, is more than twice that of matter ($\rho_\Lambda \simeq 6\times10^{-30}\,\mathrm{g}\,\mathrm{cm}^{-3}$). The rate at which the observable Universe grows due to expansion can be calculated from the Hubble law, which says that objects at a distance $d$ from us recedes at a velocity $$ v = H_0 \, d, $$
{ "domain": "astronomy.stackexchange", "id": 2026, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "universe, mass", "url": null }
python, tkinter, polymorphism Title: Parametric visibility and order of tkinter labels I'm writing software which allows a user to view data in a number of different formats, and they can switch between formats at any time. I'm wondering if there's a better way to do this than switching between subclasses, and if not, if there's a better way to write this than I have. import tkinter as tk from tkinter import ttk class Display(ttk.Frame): def __init__(self, master=None): ttk.Frame.__init__(self, master, relief='sunken', padding='20')
{ "domain": "codereview.stackexchange", "id": 43684, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, tkinter, polymorphism", "url": null }
• The contestant makes an initial choice, but that door isn’t opened. • At least one of the other two doors must have a goat behind it. Monty opens one of these doors to reveal a goat, displayed in all its glory in Wikipedia: • There are two doors left, one of which was the contestant’s original choice. One of the doors has the car behind it, and the other one has a goat. The contestant now gets to choose which of the two doors to open. The contestant has a decision to make. Which door should she choose to open, if she wants the car? Should she stick with her initial choice, or switch to the other door? That is the Monty Hall problem. ### The Solution In any problem involving chances, the assumptions about randomness are important. It’s reasonable to assume that there is a 1/3 chance that the contestant’s initial choice is the door that has the car behind it.
{ "domain": "inferentialthinking.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.987946222968067, "lm_q1q2_score": 0.8167467986532759, "lm_q2_score": 0.8267117983401363, "openwebmath_perplexity": 1612.501662929554, "openwebmath_score": 0.5877624154090881, "tags": null, "url": "https://www.inferentialthinking.com/chapters/09/4/Monty_Hall_Problem" }
Let's say that our subspace S\\subset V admits u_1, u_2, , u_n as an orthogonal basis. If we use the standard inner product in ##\mathbb R^n##, for which the standard basis is orthonormal, we can use the least square method to find the orthogonal projection onto a subspace of ##\mathbb R^n##: Form the matrix ##A## whose column vectors are the given, possibly non-orthonormal, basis of the subspace (it does not even need to be a basis, the vectors just need to span the subspace). A square matrix A is a projection if it is idempotent, 2. Suppose that p0,p1,p2 is an orthogonal basis for P3. (4) If A is invertible then so is AT, and (AT) − 1 = (A − 1)T. Furthermore, the vector. An orthogonal projection from a factor to the line y = x is only the perpendicular intercept of the factor and line. 2, P is the projection matrix onto Sp(P) along Sp(P)?; that is, the orthogonal projection matrix onto Sp(P). Answer to: Find the orthogonal projection of v→=(-3,18,-2,30) onto the subspace __W__
{ "domain": "lillij.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850867332735, "lm_q1q2_score": 0.8014429047089664, "lm_q2_score": 0.8152324915965392, "openwebmath_perplexity": 472.1401612031661, "openwebmath_score": 0.8669081926345825, "tags": null, "url": "http://epmc.lillij.it/orthogonal-projection-onto-subspace-calculator.html" }
On this page you can read or download exponential functions pdf algebra test with answer key in PDF format. For example; V(t)= 100(1. 25 ? 2n y x –30 –60 –90 –120 –150 –180 –210 –240 0 192345678 6. Displaying all worksheets related to - Exponential Growth And Decay Homework. We start with a gentle introduction to exponential growth and decay and show how to analyze exponential data using semilog and log-log plots. Exponential growth has a positive rate of growth or growth constant, k k, and exponential decay has a negative rate of growth or decay constant, k. 7 Modeling with Exponential and Power Functions 8. Here is an assessment test on the exponential growth and decay. y=7x^2_____ and c. Find an exponential function f(t) = ke at that models this growth, and use it to predict the size of the population at 8:00 PM. Recall: 12,24,48,96,… 12,6,3,1. In the allowance riddle, the son requested that his father double the dollar amount (or increase the amount by 100%) each day beginning at
{ "domain": "reteomnes.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.988841966778967, "lm_q1q2_score": 0.8130151233520805, "lm_q2_score": 0.8221891370573388, "openwebmath_perplexity": 1013.4247772213141, "openwebmath_score": 0.47716018557548523, "tags": null, "url": "http://reteomnes.it/buca/exponential-growth-and-decay-test-answers.html" }
python, python-3.x, programming-challenge def hexagonal_numbers(): n = 0 while True: n += 1 yield (n * (2 * n - 1)) And combine them to generate each number that are the 3 at the same time: def triangular_pentagonal_and_hexagonal_numbers(): """yields triangles that are also pentagons and hexagons.""" triangles = triangular_numbers() pentagons = pentagonal_numbers() hexagons = hexagonal_numbers() t = next(triangles) p = next(pentagons) h = next(hexagons) while True: if t == p == h: yield t m = min(t, p, h) if m == t: t = next(triangles) elif m == p: p = next(pentagons) else: h = next(hexagons) You now only need to ask this function for the number you’re after: def main(): numbers = triangular_pentagonal_and_hexagonal_numbers() one = next(numbers) assert one == 1 given = next(numbers) assert given == 40755 return next(numbers)
{ "domain": "codereview.stackexchange", "id": 35315, "lm_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, programming-challenge", "url": null }
homework-and-exercises, quantum-field-theory, tensor-calculus, covariance, dimensional-regularization Sketched proof of eq. (2): First Wick-rotate to Euclidean signature $$g^{\mu\nu}~=~\delta^{\mu\nu}.\tag{3}$$ Secondly, off-diagonal $I^{\mu\nu}$ must be zero, because the integrand is then odd. Thirdly, the diagonal elements $$ I^{11}~=~I^{22}~=~\ldots~=~I^{dd} \tag{4}$$ must all be equal. Fourthly, by definition $$ I~\stackrel{(1)}{=}~I^{11}+I^{22}+\ldots+I^{dd}.\tag{5}$$ Combine the above observations to derive the sought-for eq. (2). $\Box$ It is not hard to see that the sought-for identity does not hold without the integral sign. References: M.E. Peskin & D.V. Schroeder, An Intro to QFT; eq. (6.46).
{ "domain": "physics.stackexchange", "id": 85062, "lm_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, quantum-field-theory, tensor-calculus, covariance, dimensional-regularization", "url": null }
So when the fourth person arrives we have $$\quad A(4) = 0 \text{ and } B(4) = 2$$ seating arrangements. Suppose we have a list of all the seating arrangements for $$n$$ people, and now we have to seat the next $$(n+1)^{\text{th}}$$ person. Using combinatorial/counting arguments, it can be demonstrated that $$\tag A A(n+1) = (n-1)A(n) + 4B(n)$$ and $$\tag B B(n+1) = (n-2) B(n)$$ A fun thing about combinatorial problems is they can often be solved in several ways, and then you can confirm the answer when the different solutions give the same result. The interested reader can work on the following: Exercise: Using inductin, show that the recursive model discussed here gives the same results as the the seating arrangement methods found in this answer. It is also possible to derive the closed formula answer starting with this recursion model - see this.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357248544007, "lm_q1q2_score": 0.8264503139534716, "lm_q2_score": 0.8418256492357358, "openwebmath_perplexity": 362.06172272724353, "openwebmath_score": 0.8525682687759399, "tags": null, "url": "https://math.stackexchange.com/questions/3418983/for-dinner-n-people-came-and-sat-at-a-round-table-at-random-if-ana-ivan-and/3438678#3438678" }
ros, external-libraries find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs ) catkin_package( ) include_directories( ~/aaio/include ${catkin_INCLUDE_DIRS} ) link_directories(~/aaio/lib) add_executable(ros_aaio_node src/soft_trig.c) target_link_libraries(ros_aaio_node rtd-aaio ${catkin_LIBRARIES} ) So now I want to add ROS stuff to the file so I can publish data as ROS Topics. This is where I don't know what to do. I added #include <ros/ros.h>
{ "domain": "robotics.stackexchange", "id": 23840, "lm_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, external-libraries", "url": null }
air, ideal-gas, kinetic-theory $$ \frac{1}{P_1} \frac{dP_1}{dz} > \frac{1}{P_2} \frac{dP_2}{dz} $$ for clarity, rewritten with absolute value: $$ \frac{1}{P_1} \left| \frac{dP_1}{dz} \right| < \frac{1}{P_2} \left| \frac{dP_2}{dz} \right| $$ In other words, the ratio of the heavy constituent to the lighter constituent increases as you decrease in altitude.
{ "domain": "physics.stackexchange", "id": 4371, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "air, ideal-gas, kinetic-theory", "url": null }
$A$ times $N$ is divisible by $B$: . $\frac{2\cdot3\cdot5\cdot N}{2^3\cdot3^2}$ is an integer. This reduces to: . $\frac{5N}{12}$ . . . Hence. $N$ is a multiple of 12. $B$ times $N$ is divisible by $A$: . $\frac{2^3\cdot3^2\cdot N}{2\cdot3\cdot5}$ is an integer. This reduces to: . $\frac{2^2\cdot3\cdot N}{5}$ . . . Hence, $N$ is a multiple of 5. The least number which is a multiple of 12 and a multiple of 5 is: . $N \:=\:60$ • May 17th 2010, 03:12 AM FlacidCelery Quote: Originally Posted by Soroban Hello, FlacidCelery! We have: . $\begin{array}{ccccc}A &=&30 &=& 2\cdot3\cdot5 \\ B &=& 72 &=& 2^3\cdot3^2 \end{array}$ $A$ times $N$ is divisible by $B$: . $\frac{2\cdot3\cdot5\cdot N}{2^3\cdot3^2}$ is an integer. This reduces to: . $\frac{5N}{12}$ . . . Hence. $N$ is a multiple of 12. $B$ times $N$ is divisible by $A$: . $\frac{2^3\cdot3^2\cdot N}{2\cdot3\cdot5}$ is an integer. This reduces to: . $\frac{2^2\cdot3\cdot N}{5}$ . . . Hence, $N$ is a multiple of 5.
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.984336353126336, "lm_q1q2_score": 0.8904804174314712, "lm_q2_score": 0.9046505440982948, "openwebmath_perplexity": 237.8788061809354, "openwebmath_score": 0.8534181714057922, "tags": null, "url": "http://mathhelpforum.com/number-theory/145058-simple-number-theory-print.html" }
continuous-signals, eeg Is there a standardized way to do this, or is it just a matter of taste? Remember that the signal is not the samples; the signal passes through the samples and exists between them, too. So the maximum value of one chunk cannot be less than the minimum value of the next; they can only be equal, as the signal passes from a lower sample in one chunk to a higher sample in the next chunk. Plotting a solid line from the min of a chunk to the max sample value of a chunk is not a very accurate representation of the signal anyway (because of intersample peaks and not showing the density of the wave). If that's good enough of a representation for you, I'd just approximate it by drawing to the midpoint in this case: find max of chunk 1 find min of chunk 2 if max(chunk 1) < min(chunk 2): in column 1: draw line from min of chunk 1 to average(max(chunk 1), min(chunk 2)) in column 2: draw line from average(max(chunk 1), min(chunk 2)) to max(chunk 2)
{ "domain": "dsp.stackexchange", "id": 2255, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "continuous-signals, eeg", "url": null }
c++, multithreading std::function<void()> getNextWorkItem(); void workerAction(); void tellAllThreadsToStop(); public: SimpleWorkQueue(int initialThreadCount); ~SimpleWorkQueue(); void addWorkItem(std::function<void()> action); }; SimpleWorkQueue::SimpleWorkQueue(int initialThreadCount) : stopping(false) , finished(false) { std::condition_variable constructBarrier; int count = 0;
{ "domain": "codereview.stackexchange", "id": 7274, "lm_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++, multithreading", "url": null }
on the figure. This program show the effect of Gaussian filter. Use ppval to evaluate the spline fit over 101 points in the interpolation interval. 766 cm and b 12. This method has no limitations on location of points, which can be sampled irregularly or even be non-distinct. I am going to perform two-dimensional (2D) interpolation in a region of interest (ROI) in an image as shown below. Development. The Ezyfit toolbox for Matlab enables you to perform simple curve fitting of one-dimensional data using arbitrary (non linear) fitting functions. This is the main Ncorr based paper which describes the algorithms used in Ncorr, added features implemented in Ncorr for specialized analyses (discontinuous displacement fields and high strain), and verification analyses using images. The method DATAPLOT uses is based on the construction of local thin plate splines, which are then blended together via univariate piecewise Hermite cubic polynomials. B-spline fitting to 2D discrete data points
{ "domain": "otticamuti.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97241471777321, "lm_q1q2_score": 0.8165696750288508, "lm_q2_score": 0.8397339736884711, "openwebmath_perplexity": 1972.3408258527913, "openwebmath_score": 0.5017431378364563, "tags": null, "url": "http://qxm.otticamuti.it/2d-spline-matlab.html" }
c#, .net, file, file-system, portability public string Name { get; } public Architecture Description { get; } I know the Main program is just an example, but consider Path.Combine() rather than hard-coding backslashes like C:\\users\\ etc. Similarly, in class Validation, the SlashChar property is already implemented in .NET as Path.DirectorySeparatorChar. This may change in the future, but I don't believe the operating system will change while the program is running, so the two methods internal static bool IsWindows() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); internal static bool IsLinux() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); could be rewritten as properties internal static bool IsWindows { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); internal static bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux); and forego calling the runtime information methods repeatedly.
{ "domain": "codereview.stackexchange", "id": 43615, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, file, file-system, portability", "url": null }
php, design-patterns Now you can pass one of the constants to buildChartGroups which will forward it to getSumProperty and greatly simplify the code at the cost of exposing those constants. You could still provide the property-specific one-liners, though. private function buildChartGroups(PropelCollection $groups, $property) { return array_map(function ($group) { return array( 'name' => $group->getName(), 'y' => $group->getSumProperty($property), ); }, $groups); }
{ "domain": "codereview.stackexchange", "id": 6999, "lm_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, design-patterns", "url": null }
microbiology Thus, if both "have capsular antigen" and "have a capsule" is defined by a positive serotyping result for a capsular antigen, then all strains with a capsular antigen as detected by serotyping have a capsule per definition. If on the other hand you define encapsulation based on ink staining microscopy or colony morphology, there are definitely strains that produce K-antigens and don't qualify as "encapsulated". Note that while bacterial capsules consist mostly of polysaccharides, capsule proteins make up a second class of capsule antigens. One example is the Caf1 capsule antigen protein produced by Yersinia pestis: http://en.wikipedia.org/wiki/Caf1_capsule_antigen
{ "domain": "biology.stackexchange", "id": 1887, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "microbiology", "url": null }
automata, finite-automata, nondeterminism This is important concept, because it's used in NFA to DFA, PDA and turing machine. Please help me! It happens both before and after. Remember this is a non-deterministic automaton. Any time there is an epsilon transition, the automaton can either take that transition, or not take it -- it's a free choice. The automaton has the choice to do so before reading anything, and after, and in between reading every symbol. In fact, it can take as many epsilon transitions as it wants, at any time. This is non-deterministic, so even though you have only a single input, there are many possible paths that might be taken through the automaton. The input is accepted if at least one of those paths is an accepting path. See also How does an NFA use epsilon transitions?. Also, your textbook undoubtedly has a formal mathematical definition. Try working through that definition, for the specific example you gave. You will discover what happens.
{ "domain": "cs.stackexchange", "id": 20745, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "automata, finite-automata, nondeterminism", "url": null }
python, python-3.x, mathematics If you do use such a while-loop, then there should be an empty line above your num_1 = 1, not under it. Because it belongs to the solution, not to the input. Floating-point in general has precision issues, better avoid it if you can. Here it's simple to use just integers. For num = 1, you don't print anything. You should print 1, 1. Unless you have an actual reason for that formatting, keep it simple and don't format. If you use the output of your program as input for something else, it might also very well be easier to parse without that extra comma. Resulting code: from math import isqrt num = 498 for i in range(1, isqrt(num) + 1): if num % i == 0: print(i, num // i)
{ "domain": "codereview.stackexchange", "id": 39148, "lm_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, mathematics", "url": null }
quantum-mechanics, quantum-chemistry, born-oppenheimer-approximation As Ben points out in his answer, this usage of "wave packet" may be an abuse of terminology, since "wave packet" typically suggests a propagating wave, whereas the probability density of the nuclei in atoms or molecules in stationary states are time-independent, but I believe this usage is standard. (See for example Fig. 6 in this review: J. H. Posthumus, "The dynamics of small molecules in intense laser fields," Reports on Progress in Physics, in which the $v=4$ vibrational wavefunction of $H_2^+$ is referred to as the "nuclear wavepacket.")
{ "domain": "physics.stackexchange", "id": 57988, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-chemistry, born-oppenheimer-approximation", "url": null }
Any help is greatly appreciated! - Picture is almost always necessary. Second integral is natural for polar coordinates, replace the (missing!) $dx\,dy$ by $r\,dr\,d\theta$, $r$ $1$ to $2$, $\theta$ $-\pi/2$ to $\pi/2$. For first integral, draw $x+y=0$, $x+y=1$, $x-y=0$, $x-y=1$. Make natural change of variable $u=x+y$, $v=x-y$. But integral is not terrible to evaluate "as is." –  André Nicolas Sep 5 '11 at 9:50 I (almost) take back picture part of comment for first integral, if you are stressed for time. Even without picture $u$ $0$ to $1$, $v$ $0$ to $\pi$ is clear. Don't forget the Jacobian. –  André Nicolas Sep 5 '11 at 10:07 Don't take it back; if anything, I would omit the "almost". Always draw a picture. –  Robert Israel Sep 5 '11 at 18:33 Thank you somehow it clicked after reading your comments! Sometimes I just need to read the right words and it all comes together. –  entrance_exam Sep 6 '11 at 10:20
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9857180681726683, "lm_q1q2_score": 0.8397852701304949, "lm_q2_score": 0.8519528019683105, "openwebmath_perplexity": 384.07049080502577, "openwebmath_score": 0.9517147541046143, "tags": null, "url": "http://math.stackexchange.com/questions/61982/trouble-setting-up-double-integrals" }
ros, moveit, ros-kinetic, ikfast Comment by Humpelstilzchen on 2021-09-04: points on answers.ros.org. The first axis on openmanipulator is rotating about upwards axis which is z in my coordinate system. Does your generated *ikfast_moveit_plugin.cpp have code in "case IKP_TranslationZAxisAngle4D"? (also X any Y) Comment by peng cheng on 2021-09-04: @Humpelstilzchen, apologize, you are correct, the first joint of the open manipulator is rotating about the z-axis. Yes, it has such case, and I also cherry-picked this MR, so it loos like this for Y Axis case: case IKP_TranslationYAxisAngle4D: case IKP_TranslationYAxisAngleXNorm4D: // For **TranslationYAxisAngleXNorm4D** - end effector origin reaches desired 3D translation, manipulator // direction needs to be orthogonal to x axis and be rotated at a certain angle starting from the y axis (defined // in the manipulator base link’s coordinate system) pose_frame.M.GetRPY(roll, pitch, yaw); ComputeIk(trans, &roll, vfree.size() > 0 ? &vfree[0] : NULL, solutions);
{ "domain": "robotics.stackexchange", "id": 36876, "lm_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, moveit, ros-kinetic, ikfast", "url": null }
when those limits exist. The arguments to the array command are ll, indicating two cells that are left-aligned. • Choose XY scatter, under Hold down the CRTL key subtype, select the first one as and select the y-column shown next. See the introduction to the graph_latex module for more information on the use of this routine. js Object-oriented-programming Physics Poker Programming Python Raspberry Pi SAP Science Screen Space Space-flight Spotify Telegram Telegram bot Tools Windows. All x such that f(x) = 0 I can't show the graph on here it won't copy and paste, but I dont' understand what I need to do. Then one runs pdflatex or latex on x. The student draws a graph on the axes by clicking points to be used as interpolation nodes. The complete source is in the Birthday Paradox Archive. 5 - Shifting, Reflecting, and Stretching Graphs Definitions Abscissa The x-coordinate Ordinate The y-coordinate Shift A translation in which the size and shape of a graph of a function is not changed, but
{ "domain": "cogoo-epaper.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812327313545, "lm_q1q2_score": 0.821156065034656, "lm_q2_score": 0.8479677602988602, "openwebmath_perplexity": 843.2423676801535, "openwebmath_score": 0.6379912495613098, "tags": null, "url": "http://nwxu.cogoo-epaper.de/latex-function-graph.html" }
nuclear-engineering Title: Chernobyl - why didn't they power their own circulation system? The test that led to the Chernobyl accident was to see if they could keep cooling water circulating long enough in the event of a power cut for the generators to kick in. So, why didn't they just power their own circulation system? Why be dependent on the grid, and not just use some of the power they were outputting to run their own systems? Or at least have it as an insta-backup? Even more directly, why not just link the turbine and the pump together mechanically with some gearing to govern the speed-ratios? Chernobyl does power its own cooling system during normal operation. It would be very strange if it did not. It uses the grid as backup and then uses diesel generators as a backup for the backup. This report here supports that: https://www.rri.kyoto-u.ac.jp/NSRG/reports/kr79/kr79pdf/Malko1.pdf On page 8, it states that before the incident, the four main pump were connected to the turbogenerator.
{ "domain": "engineering.stackexchange", "id": 5150, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nuclear-engineering", "url": null }
angles, and is the standard unit of angular measure used in many areas of mathematics. The chord is the line segment that runs through the circle from each endpoint of the arc length. We can do this by determining what fraction of the circle we are looking at, then multiplying by the circumference of the circle. 3° and results when the arc length is equal to the radius of the. s = r θ = 1· x = x. It is better to say that one degree corresponds to 0. ̂, is called a sector. CHAPTER 5A Central Angles, Arc Length, and Sector Area An angle whose vertex is the centre of a circle and whose sides pass through a pair of points on the circle is called a central angle. If you are given degrees, round the answer to the nearest tenth of a degree. Note that this is supported by what we know of circles. An arc is a part of the circumference of a circle. Example 1 Find the arc length. Radius € r → 80 kilometers Arc Length € s → 160 kilometers. Derive using similarity the fact that the length of the
{ "domain": "chbw.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9924227587321393, "lm_q1q2_score": 0.8312731127689452, "lm_q2_score": 0.837619961306541, "openwebmath_perplexity": 314.259178800609, "openwebmath_score": 0.9388828277587891, "tags": null, "url": "http://nvfk.chbw.pw/arc-length-formula-radians.html" }
quantum-mechanics, reference-frames, hamiltonian Second question: I can't for the life of me figure out how he breaks it up like that, whether I include the aforementioned factor 2 or not.. Both multiplying by $\frac{m - m_e}{m - m_e}$ and ignoring terms quadratic in $m_e$, and deriving the first order taylor expansion around $m$ (in both cases inclluding the factor 2 which I believe should be there) give $$\frac{p^2}{2m} - \frac{p^2m_e}{2m^2}$$ which looks kind of close, but not quite it. Of course this is not a hugely significant part of the text but it's really bugging me so a bit of help would be greatly appreciated... You are right; Hamiltonian for center of mass of hydrogen atom should be : $H=\displaystyle\frac{p^2}{2(m+m_e)}$ Where $p$ is momentum of Hydrogen atom (please check what is $p$ in your book). Now you can also write it as : $H=\displaystyle\frac{p^2}{2m}(\frac {m}{m+m_e})$ $=\displaystyle\frac{p^2}{2m}(\frac {(m+m_e)-m_e}{m+m_e})$ $=\displaystyle\frac{p^2}{2m}(1-\frac {m_e}{m+m_e})$
{ "domain": "physics.stackexchange", "id": 3989, "lm_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, reference-frames, hamiltonian", "url": null }
java, programming-challenge, change-making-problem public static int multiply(Map.Entry<CoinType, Integer> entrySet){ return entrySet.getKey().getValue() * entrySet.getValue(); } public void add(CoinType coinType, int amount) { change.put(coinType, amount); } @Override public String toString() { return change.entrySet().stream().map(e -> ""+e.getValue()+" coins of "+e.getKey()).collect(Collectors.joining(",")); } public int getAmountCoins() { return change.values().stream().mapToInt(i -> i).sum(); } public boolean hasRemaining() { return getRemaining() != 0; } } CoinChanger public class CoinChanger { private final CoinTypes coinTypes; public CoinChanger(int[] coinTypes) { this.coinTypes = new CoinTypes(coinTypes); }
{ "domain": "codereview.stackexchange", "id": 43687, "lm_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, programming-challenge, change-making-problem", "url": null }
javascript, beginner, jquery, api, reddit var RedditInterface = function(username) { this.userName = username; this.commentCount = 0; this.submissionCount = 0; this.lastCall = 0; }; RedditInterface.prototype.getUsername = function() { return this.userName; }; RedditInterface.prototype.sendQuery = function(endpoint, after, func) { var curDate = new Date().getTime(); var timeSince = curDate - this.lastCall; if (timeSince < 5000) return null; this.lastCall = curDate; var urlD = ''; if (after === '') urlD = "http://www.reddit.com/user/" + this.userName + "/" + endpoint + ".json?limit=100&jsonp=?"; else urlD = "http://www.reddit.com/user/" + this.userName + "/" + endpoint + ".json?limit=100&after=" + after + "&jsonp=?"; $.ajax({ url: urlD, dataType: 'json', success: func }); };
{ "domain": "codereview.stackexchange", "id": 5486, "lm_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, beginner, jquery, api, reddit", "url": null }
astronomy, planets, spectroscopy, exoplanets The hot center sends photons within the black body spectrum with appropriate energies to excite surface cold atoms ,so the black body curve will have holes, where energy of the photons has been absorbed in exciting surface molecules. Similarly, why do we see emission lines if the planet is hot on the surface and gets cooler as you move to the center? The black body spectrum is a continuous spectrum from thermal excitations. There exists though a probability that from the high energy tail of the black body energy spectrum , electrons from atoms on the surface are taken to a higher energy level and then relax back to the ground state emitting the specific line of that atom.
{ "domain": "physics.stackexchange", "id": 15024, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, planets, spectroscopy, exoplanets", "url": null }
$\emptyset$ is the empty set. It contains no elements. $\{\emptyset\}$ is the set containing the empty set. It contains one element: the empty set. Since $\{\emptyset\}$ contains one element and $\emptyset$ does not contain any elements, they cannot be the same. $\#\emptyset=0$ while $\#\{\emptyset\}=1$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9678992914310605, "lm_q1q2_score": 0.8148024436423381, "lm_q2_score": 0.8418256432832333, "openwebmath_perplexity": 258.11892124509035, "openwebmath_score": 0.7415946125984192, "tags": null, "url": "https://math.stackexchange.com/questions/1844748/prove-or-disprove-emptyset-emptyset" }
programming-challenge, parsing, rust In this example, traversing the map using this slope would cause you to encounter 7 trees. Starting at the top-left corner of your map and following a slope of right 3 and down 1, how many trees would you encounter? [...] Part Two Time to check the rest of the slopes - you need to minimize the probability of a sudden arboreal stop, after all. Determine the number of trees you would encounter if, for each of the following slopes, you start at the top-left corner and traverse the map all the way to the bottom: Right 1, down 1. Right 3, down 1. (This is the slope you already checked.) Right 5, down 1. Right 7, down 1. Right 1, down 2. In the above example, these slopes would find 2, 7, 3, 4, and 2 tree(s) respectively; multiplied together, these produce the answer 336. What do you get if you multiply together the number of trees encountered on each of the listed slopes?
{ "domain": "codereview.stackexchange", "id": 40621, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming-challenge, parsing, rust", "url": null }
• "we really mean." Who are the "we" ? Oct 4 '20 at 5:39 • @JCAA: the mathematics community Oct 4 '20 at 13:54 • What makes you think that you can speak for that community or that you even belong to it? Oct 4 '20 at 14:25 • This was unnecessarily hostile and rude, imo. Instead of attacking Ross personally, it would be more productive to explain why you think this is not what "the mathematics community really means". Also, I don't see the words "we really mean" in their answer, but perhaps it was edited. Oct 4 '20 at 18:46 The cyclic group generated by an element $$a\in G$$ is by definition $$G\ge\langle a\rangle:=\{a^n:n\in\Bbb Z\}$$. From this it follows easily that $$\Bbb Z\ge\langle 1\rangle=\Bbb Z$$. Interestingly enough, this is the only infinite cyclic group. Also interestingly, for finite groups we have the simplification that $$\langle a\rangle=\{a^n:n\in\Bbb Z^+\}$$, since for some $$n\gt0$$, $$a^n=e$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517437261226, "lm_q1q2_score": 0.8063664226191734, "lm_q2_score": 0.8244619242200082, "openwebmath_perplexity": 131.8736256147401, "openwebmath_score": 0.774782657623291, "tags": null, "url": "https://math.stackexchange.com/questions/3850689/how-can-cyclic-groups-be-infinite/3850690" }
acid-base, titration Title: Is the following procedure for antacid titration correct? I'm trying to check which antacid is more effective by determining the amount of $\ce{HCl}$ they can neutralize. Take $\pu{10 mL}$ antacid suspension and add excess $\pu{1 M}$ $\ce{HCl}$. Back titrate the excess 1M $\ce{HCl}$ with 1M $\ce{NaOH/Na2CO3}$. Do the required calculations. Also, can I directly titrate the antacid with $\ce{HCl}$? Some solids remain. Yes, you should titrate to pH 6 (the pH at the entrance to the small intestine, 7.4 (the end of the small intestine) and 4.5. Multiply the mL of HCl used by its normality to get the mEq of protons absorbed by the antacid. Multiply the pH 4.5 result by 84 to get the sodium bicarbonate equivalent (mg of NaHCO3 that neutralizes the same amount of acid as the test sample). The antacid may contain some insoluble material (such as SiO2) but try to get everything dissolved. Also, when titrating wait a good long time before accepting the pH reading
{ "domain": "chemistry.stackexchange", "id": 9496, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acid-base, titration", "url": null }
The way you go about learning these problems is significantly different. For "math with a for loop" problems, study math. Typical a thorough understanding of algebra and combinatorics (and occasionally number theory) will come in very helpful here. But this is not so important for real computer science questions. Algorithm design is hard. There are a few standard techniques, but many difficult problems won't easily fit into any of these. Here the solution is just to learn as much as you can, and to practice. But your problem above is not a computer science problem. It's a math problem. It can very easily be rewritten into Let $$S$$ be the set of all multiples of $$3$$ or $$5$$, and let $$f(n)$$ be the sum of the elements of $$S$$ below $$n$$. Compute $$f(1000)$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357205793902, "lm_q1q2_score": 0.852958277894421, "lm_q2_score": 0.8688267728417087, "openwebmath_perplexity": 269.92985415659786, "openwebmath_score": 0.7302531599998474, "tags": null, "url": "https://math.stackexchange.com/questions/2979100/method-for-finding-efficient-algorithms/2979141" }
c++, opengl, pthreads Map::~Map() { } Makefile all : linux_main linux_main : map.o linux_main.o g++ -pthread -Wall linux_main.o map.o -o linux_main -lGL -lXext -lX11 -lGLU linux_main.o : linux_main.cpp g++ -pthread -Wall -c -o linux_main.o linux_main.cpp map.o : map.cpp g++ -pthread -Wall -c -o map.o map.cpp clean : rm -f ./*.o linux_main I would clean up the makefile You don't want to do it separately for each file as you then get cut/paste errors. You want to generalize this as much as possible (so that any change only needs to be done in one place (not in multiple locations). PS. Not tested. CXX = g++ CXXFLAGS += -Wall -pthread TARGET = linux_main SRC_FILES = $(wildcard *.cpp) OBJ_FILES = $(patsubst %.cpp,%.o,$(SRC_FILES)) all: $(TARGET) $(TARGET): $(OBJ_FILES) $(CXX) -o $(TARGET) $* $(CXXFLAGS) -lGL -lXext -lX11 -lGLU clean: rm -f $(OBJ_FILES) $(TARGET)
{ "domain": "codereview.stackexchange", "id": 30360, "lm_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++, opengl, pthreads", "url": null }
homework-and-exercises, special-relativity, collision, faster-than-light i. "collision faster than the speed of light" ii. "collision of high speed particles" iii. "lorentz transformation in a collision" iv. "collision analysis at light speed" Classically we would add the speeds to get $1.8c$, which is obviously not allowed. In relativity you simply use the relativistic velocity addition formula: $$V = \frac{u+v}{1+uv/c^2}$$ Where $u$ and $v$ are the velocities of the particles as seen from some reference frame, and $V$ is the velocity of one particle in the rest frame of the other, i.e., the relative velocity when we consider one of the particles to be stationary. Plugging in $u = v = 0.9c$, we get $V = \frac{180}{181}c \approx 0.9945c$. Edit: As pointed out by Alfred Centauri, the above explanation is perhaps too simplistic. A more rigorous version would be the following:
{ "domain": "physics.stackexchange", "id": 13894, "lm_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, special-relativity, collision, faster-than-light", "url": null }
terminology, definition, second-quantization, quantization So my question is what's the difference of the two concepts? Second quantization is a term used to describe the quantization of the fields in order to describe situations with variable number of particles. You can do this in more than one way and one of the ways is to quantize the fields by introducing the field operators which correspond to classical field and conjugate momentum operator. Of course to know how to use these operators you have to define the states and commutation relations. This is canonical quantization. But you can also use path integral formalism or some other methods. So second quantization is actually just quantum theory used on systems with many degrees of freedom like many particle systems. But these methods can also be used in systems like crystals where you describe vibrations of the crystal using these field theory methods. In relativistic situations where you have variable number of particles this is very useful.
{ "domain": "physics.stackexchange", "id": 60226, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "terminology, definition, second-quantization, quantization", "url": null }
• The random variables are the outcomes of the next toss. This type of argument comes from thinking about Markov processes (which I strongly recommend learning about). The idea is this: writing out all the paths is tedious and difficult (as you learned) but it is also unnecessary. You don't need the full history...all you need to keep track of is the list of values you have observed. That's the meaning of my $E_S$...it says "just look at the list of values you have observed and go from there...forget about the exact path you took in seeing those values." – lulu Apr 18 '16 at 23:51
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9934102289222084, "lm_q1q2_score": 0.8121868563877214, "lm_q2_score": 0.8175744850834648, "openwebmath_perplexity": 248.03063299764776, "openwebmath_score": 0.8307856321334839, "tags": null, "url": "https://math.stackexchange.com/questions/1748549/rolling-a-die-until-two-rolls-sum-to-seven" }
genetics, population-biology Or Nature Reviews, 2002 Przeworski... showed that population growth tends to decrease the extent of LD, especially for longer periods of growth. By contrast, population subdivision tends to increase the extent of LD, especially when a sample contains individuals from several strongly differentiated subpopulations. See also box 1: Rapid population growth decreases LD by reducing genetic drift.
{ "domain": "biology.stackexchange", "id": 1386, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genetics, population-biology", "url": null }
12 By default, Mathematica assumes symbols to be complex. However the elements on the main diagonal of a Hermitian matrix are necessarily real. To force Mathematica to interpret the elements on diagonal of m to be real you could replace them by their real part, i.e. m = {{Re[n], a, b, b}, {Conjugate[a], Re[n], b, b}, {Conjugate[b], Conjugate[b], Re[c], ... 12 Here is simple (unweighted) Mma version of the Matlab implementation of Covariance Bending. ClearAll[covBending]; covBending[mat_, tol_: 1/10000]:=If[PositiveDefiniteMatrixQ[mat], mat, NestWhile[(Eigensystem[#][[2]].DiagonalMatrix[ Max[#, tol] & /@(Eigensystem[#][[1]])].Transpose[ Eigensystem[#][[2]]]) &, N@mat, Min[Eigensystem[#][[1]]] < ... 12
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9381240177362486, "lm_q1q2_score": 0.8247486992011269, "lm_q2_score": 0.8791467690927438, "openwebmath_perplexity": 907.8172204481391, "openwebmath_score": 0.44771647453308105, "tags": null, "url": "http://mathematica.stackexchange.com/tags/linear-algebra/hot?filter=all" }
cosmology My focus is upon the counter-intuitive nature of the Hubble Volume's definition, rather than the actual equations which describe the furthest point identifiable. A crucial mistake in the question's reasoning is that the electromagnetic radiation doesn't need to be emitted by us and reflected by the receding body. Any radiation from there can help us see. But yes, we can see objects beyond the Hubble sphere right now. The main concept behind this is the fact that the Hubble sphere is expanding as the universe expands. Let's imagine a photon traveling towards us from a body beyond the Hubble Sphere. The definition of the Hubble Volume tells us that the photon's traveling through a region which is receding from us faster than the speed of light, hence the photon will be receding from us as well, at the difference between the speed of expansion of the universe at that point and the speed of light.
{ "domain": "physics.stackexchange", "id": 49130, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology", "url": null }
so you would end up with (1/4)*(1/4)*(3/4) * 3 + (1/4)*(3/4)*(3/4) * 3 + (3/4)(3/4)(3/4) = 63/64 3. Jun 17, 2014 ### phinds Also, how do you get, using your method, P(2 hits in 3 shots) = 2/8 ??? What matters in my question is that is clearly shows that you do not attempt even the simplest double-check on your work, and that will cause you grief in ALL problems. From your table, there are 7 ways out of 8 that there is at least one hit, so it should have jumped out at you that an answer of 6/8 (using your method) could not be correct. 4. Jun 17, 2014 cpscdave: Thank you! It makes sense now. phinds: It did jump out at me that my answer was not correct. That's why I posted for help on physicsforums. Intuitively, if the marksman can hit 3/4 of his shots, he should have way more than a 0.75 probability of hitting at least one out of three shots. This is why I knew I was travelling down the wrong road and why I asked for help. 5. Jun 17, 2014 ### Ray Vickson
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.96323053709097, "lm_q1q2_score": 0.8108721741615029, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 714.4496779637649, "openwebmath_score": 0.5645660161972046, "tags": null, "url": "https://www.physicsforums.com/threads/probability-of-hitting-a-bulls-eye.758342/" }
python, performance, python-2.x return output.getvalue() This final iteration indeed improves the decompression. Testing the same test file, decompression now takes only about 63 seconds. However, I still feel the code can be optimized further. Can you provide suggestions as to how I can further optimize the code? Note: I've made available test vectors for this function. After unzipping the .7z archive, there should be a pair of files: testblob_compressed.bin and testblob_uncompressed.xml. The following code should be enough to test: filename = 'testblob_compressed.bin' ba = bytearray(os.path.getsize(filename)) with open(filename, 'rb') as fin: fin.readinto(ba) mv = memoryview(ba) output = decompress(mv) (output should be byte-identical with testblob_uncompressed.xml)
{ "domain": "codereview.stackexchange", "id": 12243, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, python-2.x", "url": null }
special-relativity, spacetime, inertial-frames This is a modification of a paradox found in Herbert Dingle's book Science at the Crossroads. It depends what you mean by their clocks both being at noon when they're at positions A and B, and their speeds differing by 161,000 miles per second. By the way the question was stated, I'll assume you meant their positions were measured in an outside observer's frame, i.e., at noon in the outside observer's frame ship A is at position A and ship B is at position B. We can also assume ship A sync's up its own clock to read noon when it's at point A, and similarly for ship B. (It is impossible for both ships to see both clocks at noon at once. If ship A sees both clocks at noon at one time, then ship B won't, and vice versa. Specifically, if ship A sees the event of itself being at point A (with its clock at noon) coincide with the event of ship B being at point B (with its clock at noon), then ship B will not see these events coincide.)
{ "domain": "physics.stackexchange", "id": 31497, "lm_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, spacetime, inertial-frames", "url": null }
signal-analysis, digital-communications, gnuradio, diversity Now, I am confused. Should I attenuate/amplify the received signal (signal+noise) from each receiver to make the mean signal power same across both receivers or should I attenuate/amplify the received signal (signal+noise) in a way that noise level become same in the signal from both receivers before performing EGC. Once I am done with EGC, should I simply multiply the weight at each branch to perform MRC? Since, in theory, it is assumed that long term average SNR and noise remain same across all branches, first, I configured my USRPs to have same noise levels and then placed them in a way that average SNR across both branches also remain the same. Finally, simply combining them or first multiplying instantaneous SNR factor with each branch leads to EGC and MRC, respectively.
{ "domain": "dsp.stackexchange", "id": 4780, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "signal-analysis, digital-communications, gnuradio, diversity", "url": null }
php, laravel } if(!filter_var($emailSettings[1],FILTER_VALIDATE_INT)) { $message .= 'Port is not a valid integer. port=' . $emailSettings[1] . '\n'; } if(!filter_var($emailSettings[2],FILTER_VALIDATE_EMAIL)) { $message .= 'Username is not a valid email address. username=' . $emailSettings[2] . '\n'; } throw new OutOfBoundsException($message); } putenv("MAIL_HOST=$emailSettings[0]"); putenv("MAIL_PORT=$emailSettings[1]"); putenv("MAIL_USERNAME=$emailSettings[2]"); putenv("MAIL_PASSWORD=$emailSettings[3]"); }
{ "domain": "codereview.stackexchange", "id": 20959, "lm_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, laravel", "url": null }
I tried a lot for finding the general formula, but I only found recurrent formula: $a_{n+1} = 5a_{n}-6a_{n-1}$. Any help will be much appreciated. • – lab bhattacharjee May 18 '16 at 16:53 • Here is one (out of infinitely many). – barak manos May 18 '16 at 17:01 • OEIS has a few entries for this sequence. – Jules May 18 '16 at 18:38 • I would like to reopen the question since my answer below could be a reference for similar questions (what is the next number in$\ldots$), often appearing here on MSE. For instance, it just happened: math.stackexchange.com/questions/1848089/unknown-formula – Jack D'Aurizio Jul 3 '16 at 21:43 • What distinguishes this Question from many of this ilk is the OP's statement of a recurrence relation. It is certainly a well founded problem to solve that recurrence relation (with the given initial conditions) for an explicit formula. – hardmath Jul 3 '16 at 23:34
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138177076645, "lm_q1q2_score": 0.8367774958856141, "lm_q2_score": 0.8558511506439708, "openwebmath_perplexity": 447.47283512904306, "openwebmath_score": 0.920082151889801, "tags": null, "url": "https://math.stackexchange.com/questions/1790642/general-formula-for-the-1-5-19-65-211-sequence" }
electromagnetism, classical-mechanics, lagrangian-formalism, momentum, gauge-invariance Title: Gauge ivariance and canonical versus kinetic momenta for a charged particle in an EM field I all, I am struggling to grasp the notion of gauge invariant when talking about an object like the canonical momenta $\frac{\partial L}{\partial \dot{q}_i}$ or kinetic momenta $m\dot{q}_i$. I am very comfortable with gauge theory in the field theory context, starting with a Lagrangian, requiring its invariance under a local symmetry, partial $\rightarrow$ covariant derivatives and the corresponding transformation of the gauge field connections,etc. But showing an object like a momentum is gauge invariant is new for me. I am looking into the difference between the canonical and kinetic momenta in the case of a charged particle in an EM field, described by the standard Lagrangian \begin{equation} L = \frac{1}{2} m\dot{r}^2 - q \phi + q \dot{r}\cdot A \end{equation} The canonical momenta are $\vec{p}_c=m\dot{\vec{r}} +q\vec{A}$ and the kinetic are just $\vec{p}_k=m\dot{\vec{r}}$.
{ "domain": "physics.stackexchange", "id": 69935, "lm_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, classical-mechanics, lagrangian-formalism, momentum, gauge-invariance", "url": null }
electrostatics, electric-fields, charge, fractals The construction of the area by addition of triangles, distributes them always with polar symmetry in relation to the centroid. This means that components of the electric field of each iteration are cancelled out, and only the components perpendicular to the plane (along the direction of $d$) contribute to the total electrical field. In other words, the electric field of a Koch surface above the centroid is oriented parallel to the perpendicular to the surface, since it has polar symmetry around this point.
{ "domain": "physics.stackexchange", "id": 43640, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, electric-fields, charge, fractals", "url": null }
The lemma mentioned at the beginning is proved easily by writing $a_{n} =1+b_{n}$ so that $nb_{n} \to 0$ and we have via binomial theorem $$|a_{n} ^{n} - 1|=|(1+b_{n})^{n}-1|=\left|nb_{n}+\frac{n(n-1)}{2!}b_{n}^{2}+\dots\right|$$ and clearly the RHS is bounded above by $$|nb_{n} |+|nb_{n} |^{2}+\cdots = \frac{|nb_{n} |} {1-|nb_{n}|}$$ Since $nb_{n} \to 0$ we are done.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464492044004, "lm_q1q2_score": 0.825594514132031, "lm_q2_score": 0.8459424334245618, "openwebmath_perplexity": 227.15610976500872, "openwebmath_score": 0.999612033367157, "tags": null, "url": "https://math.stackexchange.com/questions/374747/if-z-n-to-z-then-1z-n-nn-to-ez/1567761" }
ros, param-server Title: Connect to the parameter server from Windows? Dear ROS users, I am developing the system that user input is done in windows, and ubuntu + ROS system controls a robot based on the user input. What I need is only to read/write parameters on ubuntu ROS's parameter server. Since I use diamondback, I have difficult to develop ROS node in Windows. (Several library is linked in the program in Windows, and I cannot compile a few ROS nodes in Electric. ) Is there any way I can connect to the parameter server from Windows? Best Regards Originally posted by SeongUk Han on ROS Answers with karma: 23 on 2011-12-04 Post score: 1 Communication with the parameter server works through ordinary XMLRPC. Just use an XMLRPC library to communicate with the parameter server. The API is described here. A few basics including a Python example to communicate with the master are described here.
{ "domain": "robotics.stackexchange", "id": 7514, "lm_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, param-server", "url": null }
continuous-variable, quantum-optics, gaussian-states So maybe you want to ask why one only needs to specify the covariance matrix if one wants to completely describe a Gaussian state? The answer is given by Isserlis's theorem (sometimes more familiar in terms of Wick's theorem). To completely describe any state, one could list all of its moments $\langle x_i x_j\cdots\rangle$. Given knowledge of the mean values $\langle\boldsymbol{x}\rangle$, we can instead describe a state by all of its zero-mean moments $\langle X_i X_j\cdots\rangle$. The Isserlis theorem says that, for Gaussian probability distributions, all of the higher-order moments can be found from sums of products of all of the different pairings of the the second-order moments (ie, elements of the covariance matrix), such as \begin{equation}\langle X_i X_j X_k X_l\rangle = \langle X_i X_j\rangle \langle X_k X_l\rangle+\langle X_i X_k\rangle \langle X_l X_l\rangle + \langle X_i X_l\rangle \langle X_k X_j\rangle .\end{equation} Gaussian state $\Rightarrow$ Gaussian probability
{ "domain": "quantumcomputing.stackexchange", "id": 2820, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "continuous-variable, quantum-optics, gaussian-states", "url": null }
python, object-oriented p0 = self.__flatten_attributes() try: p_opt, _ = curve_fit( self.__eval_with_parameters, x, y, p0=p0, *args, **kwargs ) self.__set_attributes_from_flat_array(p_opt) if plot: t = np.linspace(np.min(x), np.max(x), 100) _, ax = plt.subplots() ax.plot(x, y, "o", label="data") ax.plot(t, self.__eval_vectorized(t), "-", label="fit") ax.set_title(f"{self.__class__.__name__} Ansatz") ax.set_xlabel("x") ax.set_ylabel("y") ax.legend() plt.show() except RuntimeError as e: print(e) self.__set_attributes_from_flat_array(p0) def __eval_with_parameters(self, x: Array, *args: float) -> Array: """Evaluate the Ansatz with the given parameters. Changes the instance attributes.
{ "domain": "codereview.stackexchange", "id": 43275, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, object-oriented", "url": null }
c++ int main() { multiset<char> m1; string inp; for (size_t i = 0; i < 2; i++) { cin >> inp; for (size_t j = 0; j < inp.size(); j++) { m1.insert(inp[j]); } } cin >> inp; multiset<char> m2; for (size_t j = 0; j < inp.size(); j++) { m2.insert(inp[j]); } ... } But still I feel somewhat bad for using extra memory. Can I achieve the elegant solution for this problem without using extra memory? refactor to avoid duplication Your instincts are good: Don't Repeat Yourself. You have identical blocks of code with only one variable changed. You should break this out into a function, making the changeable part a parameter to that function. multiset<char> m1; string inp; for (size_t i = 0; i < 2; i++) { cin >> inp; for (size_t j = 0; j < inp.size(); j++) { m1.insert(inp[j]); } }
{ "domain": "codereview.stackexchange", "id": 42515, "lm_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 }
ros-melodic Originally posted by Addy on ROS Answers with karma: 3 on 2020-04-07 Post score: 0 Original comments Comment by Addy on 2020-04-07: should i reinstall ros? Comment by gvdhoorn on 2020-04-07: Have you remembered to source /opt/ros/melodic/setup.bash before trying to run those commands? And: Also when i use these commands roslaunch and roscore,it asks me to install them and when i try installing, it replies me with you have held broken packages
{ "domain": "robotics.stackexchange", "id": 34709, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
c++, c++11, console, formatting, posix agauniyal@lenovo > rang[master] » clang++ test.cpp -std=c++11 -o rang.app -Wall -Weverything In file included from test.cpp:2: ./rang.h:13:7: warning: scoped enumerations are incompatible with C++98 [-Wc++98-compat] enum class style : unsigned char { ^ ./rang.h:13:2: warning: enumeration types with a fixed underlying type are incompatible with C++98 [-Wc++98-compat] enum class style : unsigned char { ^ ./rang.h:24:7: warning: scoped enumerations are incompatible with C++98 [-Wc++98-compat] enum class fg : unsigned char { ^ ./rang.h:24:2: warning: enumeration types with a fixed underlying type are incompatible with C++98 [-Wc++98-compat] enum class fg : unsigned char { ^ ./rang.h:35:7: warning: scoped enumerations are incompatible with C++98 [-Wc++98-compat] enum class bg : unsigned char { ^
{ "domain": "codereview.stackexchange", "id": 18655, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, console, formatting, posix", "url": null }
phylogenetics, phylogeny, software-recommendation, primer Title: programmatic secondary structure prediction for >36-mer DNA oligonucleotides I'm writing a tool to automate Sanger sequencing primer design for a production lab that uses a universal-tail chemistry Sanger sequencing to verify NGS results. Essentially, the template DNA is amplification using primers with universal 5' tails (M13F/R), and then the "BigDye" reaction is performed with an M13F and M13R primers in separate wells. I'm able to design logical primers for each region in a request using Primer3 (v2.5.0), but then I'd like to calculate folding thermodynamics for the M13-appended primers to determine the best primer partner for the 5' M13 appendages. In other words, in the last step, I would like to know if I should use: M13F-forward_primer + M13R-reverse_primer or M13R-forward_primer + M13F-reverse_primer
{ "domain": "bioinformatics.stackexchange", "id": 888, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phylogenetics, phylogeny, software-recommendation, primer", "url": null }
aqueous-solution, solubility, salt Unlike ferrocene, magnesocene displays slight dissociation and subsequent ion association in polar, electron-donating solvents (such as ether and THF).[1] $\displaystyle {\ce {MgCp2 <=> MgCp+ + Cp-}}$ $\displaystyle {\ce {MgCp2 + MgCp+ <=> Mg2Cp3+}}$ $\displaystyle {\ce {MgCp2 + Cp- <=> MgCp3-}}$ Note the single charge on all ionic species. This is to be expected in organic solvents with their weaker polarity and ion solvation power relative to water. Cited reference: 1. Schwarz, Rainer; Pejic, Marijana; Fischer, Philipp; Marinaro, Mario; Jörissen, Ludwig; Wachtler, Mario, "Magnesocene-Based Electrolytes: A New Class of Electrolytes for Magnesium Batteries," Angewandte Chemie International Edition 2016, 55(48), 14958–14962. https://onlinelibrary.wiley.com/doi/abs/10.1002/anie.201606448
{ "domain": "chemistry.stackexchange", "id": 13105, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "aqueous-solution, solubility, salt", "url": null }
and does not suffer from the problems of analogue computers in history, will circuit diagrams for e.g. addition have to be that complicated Didn't Fermat make an analogue calculator or someone similar Well actually it was "digital" in that it worked with digits but it had a gear with ten things on it to represent the digits 0 to 1 (Teeth?) I remember learning about another version of that that was actually sold commercially around WWII By the way What the engine actually looks like (The nozzle isn't pointing down, which I can only assume means they will not go to space today) Probably they are test firing it or something @Semiclassical Accurate @Secret Yeah I think that's what it was Though subtraction is basicaly just addition with an extra step 'cause (2^n-1)-b is easy to find (flip all the bits of b) Call that \bar b Then you can just do a+\bar b to find a-b well actually a+\bar b+1 and throw away the "carry" bit (the 2^ns place) 3 hours later… 6:55 PM I’ve got two statements in
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429599907709, "lm_q1q2_score": 0.839689086749822, "lm_q2_score": 0.8539127455162773, "openwebmath_perplexity": 383.8928336469595, "openwebmath_score": 0.8634619116783142, "tags": null, "url": "https://chat.stackexchange.com/transcript/36/2019/3/27" }
python, python-3.x, file-system Attributes: pathparts: As many arguments as the subpath needs. The new Path will be created as e.g. Path("x", "y", "z"). This gets rid of ambiguities surrounding usage of forward or backward slashes. """ current_frame = inspect.currentframe() # This function's frame previous_frame = current_frame.f_back # One up: the caller's frame caller_filename = inspect.getsourcefile(previous_frame) # Construct a Path relative to the caller's directory: caller_dir = Path(caller_filename).parent sub_path = Path(*pathparts) # Can be anything: file, dir, links return caller_dir.joinpath(sub_path).resolve()
{ "domain": "codereview.stackexchange", "id": 38073, "lm_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, file-system", "url": null }
c++, unit-conversion, overloading Consider marking converting constructors and conversion operators as explicit. Very likely sizeof(Degree) == sizeof(double), so there probable won't be a benefit for taking a const Degree& parameter over just Degree. I'd suggest checking the precision of the constants ' DegToRadandRadToDeg`, especially if calculated on your own. If the precision on these constants is poor, there might be small numeric errors that accumulate over multiple conversions to and fro. A comment reads /// Function Call Operator: Actually, no, this is a conversion operator. A function call operator would look like this: double operator()() const. Generally, the comments don't tell me much about anything. Unless there is a hard requirement for them (in which case they should be improved) I'd suggest removing them. In their current form, they are at best visual clutter, and confusing at worst.
{ "domain": "codereview.stackexchange", "id": 36142, "lm_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-conversion, overloading", "url": null }
php, object-oriented, csv, laravel, network-file-transfer public function exportCSVFileToResponse($filename = 'export.csv') { return new StreamedResponse(function () use ($filename) { $handle = fopen('php://output', 'w'); $handle = $this->buildCsv($handle); fclose($handle); }, 200, [ 'Content-Type' => 'text/csv', 'Content-Disposition' => 'attachment; filename="' . $filename . '"', ]); } public function buildCsv($handle, $header = false) { if ($header) { fputcsv( $handle, array_keys($this->lineMapping(Line::first())), self::DELIMITER ); }
{ "domain": "codereview.stackexchange", "id": 32635, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, csv, laravel, network-file-transfer", "url": null }
java, object-oriented, game, tic-tac-toe I suggest to use braces with all if statements, even if there will be a single line inside. Otherwise embarrassing bugs can happen.
{ "domain": "codereview.stackexchange", "id": 24922, "lm_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, object-oriented, game, tic-tac-toe", "url": null }
- Thanks. I was also thinking of using a ternary string idea at first. I could form the RHS, but was having trouble with the LHS. Thanks for the pointer, this helps. –  user952949 Oct 2 '11 at 17:18 If you are going to tell two stories, one for the right, one for the left, committees ("choose") seem unsuitable. You can easily generalize the above idea in various ways, to get other identities. –  André Nicolas Oct 2 '11 at 17:46 There is a nice double counting proof, from the geometric point of view. Consider all faces of a n-cube. These faces can be encoded by a sequence of "0", "1" and a "*", where the star signifies that the coordinate can be either 0 or 1 in the face. This immediately gives $3^n$ faces. On the other hand, the number of $k$-dimensional faces is equal to $\binom{n}{k}$ way of choosing $k$ coordinates times $2^{n-k}$ ways of fixing the remaining coordinates, all summed over all $k=1..n$. Of course, this proof is actually equivalent to that by Andre above.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9653811601648193, "lm_q1q2_score": 0.8044758606201152, "lm_q2_score": 0.8333245911726382, "openwebmath_perplexity": 270.31253769545833, "openwebmath_score": 0.8772209882736206, "tags": null, "url": "http://math.stackexchange.com/questions/69281/combinatorial-proof-help" }
metabolism, thermodynamics, carbohydrates Title: Do plants need O₂ to consume energy they've stored via sugar? This question came up as I work my way through the answers to another question I just asked. My understanding is that plant photosynthesis looks something like this (though with lots more going on under the hood): $$\ce{6 CO_2 + 6H_2O + light -> C_6 H_{12} O_6 (sugar) + 6 O_2}$$ (source) and that the primary functions of the sugar are to store and transport energy. If that's true, then there's something fishy about the familiar view that plants need CO2 to breathe and produce O2, while animals need O2 and produce CO2. Doesn't a plant need just as much O2 as an animal would when it (the plant) gets around to consuming the sugar it has produced? Doesn't consumption of the sugar take you back to the original reactants? Plants need sugar not only for energy but also for synthesizing essential metabolites and building blocks including cellulose (used in cell wall), glycoproteins and 5-carbon sugars for nucleotides.
{ "domain": "biology.stackexchange", "id": 3471, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "metabolism, thermodynamics, carbohydrates", "url": null }
matlab, audio, deconvolution, least-squares, inverse-problem $$ \arg \min_{f} {\left \| H f - g \right \|}^{2}_{2} + \lambda {\left \| \Sigma f \right \|}^{2}_{2} = { \left( {H}^{T} H + \lambda {\Sigma}^{T} \Sigma \right) }^{-1} {H}^{T} g $$ All the above is pretty straight forward to calculate in MATLAB once the the $ H $ and $ \Sigma $ matrices are formed (Given the Convolution Kernel, the function convmtx can assist you generate the matrix). The way to create those matrices is pretty simple. Given a signal of the length $ N $ (Samples) implies those matrices are $ N \times N $ (Assuming the output has the same number of samples). Where the $ i $ row of the matrix applies the linear combination for the $ i $ output sample. For instance, given the Gradient Kernel and a signal of length 5 the matrix becomes: $$ \begin{bmatrix} 1 & -1 & 0 & 0 & 0 \\ 0 & 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & -1 & 0 \\ 0 & 0 & 0 & 1 & -1 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} $$
{ "domain": "dsp.stackexchange", "id": 3197, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, audio, deconvolution, least-squares, inverse-problem", "url": null }
python, performance, python-3.x, programming-challenge, divide-and-conquer The geometric information of each building is represented by a triplet of integers [Li, Ri, Hi], where Li and Ri are the x coordinates of the left and right edge of the ith building, respectively, and Hi is its height. It is guaranteed that 0 ≤ Li, Ri ≤ INT_MAX, 0 < Hi ≤ INT_MAX, and Ri - Li > 0. You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0. For instance, the dimensions of all buildings in Figure A are recorded as: [[2, 9, 10], [3, 7, 15], [5, 12, 12], [15, 20, 10], [19, 24, 8]]. The output is a list of "key points" (red dots in Figure B) in the format of [[x1,y1], [x2, y2], [x3, y3], ...] that uniquely defines a skyline. A key point is the left endpoint of a horizontal line segment. Note that the last key point, where the rightmost building ends, is merely used to mark the termination of the skyline, and always has zero height. Also, the ground in between any two adjacent
{ "domain": "codereview.stackexchange", "id": 34676, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, python-3.x, programming-challenge, divide-and-conquer", "url": null }
robotic-arm, calibration Is there a general approach to this problem? Is there any library that can help me with this? Any study materials/tutorials or explanations are highly appreciated. Thank you in advance. What you are confused about are frame transformations. If you have ever poked around with ROS, you will see that robot joint locations are determined through frame transformations. These transformations are calculated because the current joint angles are known. Those angles are then passed into what are called homogeneous transformation matrices. The matrices are essentially 4x4 matrices that multiply nicely together to keep track of the end-link orientation (upper left 3x3 part) and the tranlation aka. XYZ of the robot tip (upper right 3x1 vector in homog. matrix). These matrices, before being given current joint angles, are often created from the Denavit-Hartenberg (D-H) parameters.
{ "domain": "robotics.stackexchange", "id": 2062, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "robotic-arm, calibration", "url": null }
algorithms, strings, substrings Given a string $S$ of length $n$, what is the minimal $k$ such that there exists an character $s\in S$ such that for all $i\in\{1,\ldots,n\}$, there exists a $j$ s.t. $|i-j|\leq k$ and $S[j]=s$. Report $k+1$. Your approach seems to take $O(n^4)$ time in the worst case. If you try to see if the above formulation holds for all characters $s\in S$, you should be able to do it in $O(n)$: Do a single linear scan trough $S$, while maintaining the last index you've seen each of the characters present in $S$ and the maximum gap size for each of those characters. After that, pick the character $s\in S$ with the smallest maximum gap size, this size is the value $k$. (Improved to a single pass thanks to @j_random_hacker's remark) So, you can solve this problem in $O(n)$ time, which is a lot better than your initial approach. This approach is even asymptotically optimal, as we have to at least scan the entire string in the worst case, so we require at least $\Omega(n)$ time.
{ "domain": "cs.stackexchange", "id": 10628, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, strings, substrings", "url": null }
linear-programming, integer-programming, modelling Open $w = 1$, provide ${r_1}$ to $s = 1$, then open it. Open $w = 2$, provide $\{ {r_1},{r_2}\} $ to $s = 2$, then open it. Open $s = 3$, by providing resources from $w = \{ 1,2\} $
{ "domain": "cs.stackexchange", "id": 8619, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "linear-programming, integer-programming, modelling", "url": null }
classical-mechanics, lagrangian-formalism, coordinate-systems, time Title: A doubt regarding $L=T-V$ and explicit time dependence Edit: After having some clarity, I chose to write an answer instead of editing the question itself. Scroll down to read it after reading the problem that follows. Let's say $\vec{r}=\vec{r}(q_1,q_2 ... q_n, t)$. Now, if this explicit time dependence is coming due to an external agent, we can't write $L=T-V$. But sometimes this $t$-dependence depends on the choice of coordinates (referring to Goldstein, 3rd edition, page 28). For a bead sliding on a uniformly rotating wire in a force-free space: here, in Cartesian coordinates: $x=r\cos(\omega t)$ and $y=r\sin(\omega t)$, where $\omega$ is the angular frequency of the rotating wire. There is explicit time dependence but switching over to polar coordinates, \begin{equation} T=\frac{1}{2}m(\dot{r}^2+r^2 \omega^2). \end{equation} The explicit time dependence disappears.
{ "domain": "physics.stackexchange", "id": 90933, "lm_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, coordinate-systems, time", "url": null }
electrochemistry, thermodynamics, redox, theoretical-chemistry, electrons Why doesn't a potential difference between a metal and gas occur? Actually it does. There's an interesting paper (which is behind a paywall if you are not at a university that subscribes to this journal) that describes the measurement of potentials across metal/gas interfaces. The challenge in studying metal/gas potentials is the ability of controlling this potential externally. With the metal/liquid scenario, an electrochemist (or budding electrochemist) can add another electrode to the solution and apply a potential between the electrodes. It's much harder to do the same thing with a gas. (Well, technically it's *not harder to connect two electrodes to one another and hold them in air, but the redox work functions, resistance and capacitance issues that arise in gas-phase electrochemistry make this a really challenging feat.)
{ "domain": "chemistry.stackexchange", "id": 564, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrochemistry, thermodynamics, redox, theoretical-chemistry, electrons", "url": null }
# Average velocity of train 1. Aug 24, 2005 A train moving at an essentially constant speed of 60 miles/hr moves eastward for 40 min, then in a direction 45 degrees east of north for 20 min, and finally westward for 50 min. What is the average velocity of the train during this run? So average velocity is $\frac{\Delta r}{\Delta t}$. I am starting at the origin, and have three vectors a , b , and c . $a = 40i$ $b = (10\sqrt{2}) i + (10\sqrt{2}) j$ $c = -50i$ So the resultant vector would be $(10\sqrt{2} - 10)i + (10\sqrt{2})j$. So to find the average velocity would I just do $\frac{(10\sqrt{2} - 10)^{2}) + (10\sqrt{2})^{2})}{110}$ Thanks Last edited: Aug 24, 2005 2. Aug 24, 2005 ### Staff: Mentor The magnitude of the average velocity is the magnitude of that resultant vector. (I think you mistyped your answer.) Careful about units. Since you have the time in minutes, you are measuring velocity in miles/minute, not the given miles per hour.
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471665987075, "lm_q1q2_score": 0.8043683384462078, "lm_q2_score": 0.8175744828610095, "openwebmath_perplexity": 835.1329133730096, "openwebmath_score": 0.7578667402267456, "tags": null, "url": "https://www.physicsforums.com/threads/average-velocity-of-train.86150/" }
properties of a square.Enter any one value and the other three will be calculated. etc. drawing scale 1: Specify dimensions in millimetres Width Y Length X in color black and white drawing . Since any diagonal of a parallelogram divides it into two congruent triangles, you can calculate the diagonal by knowing the sides of the parallelogram and the angle between them. A simple online Square calculator to calculate area, perimeter, diagonal of a square using the length of its side. If you know side lengths of the rectangle, you can easily find the length of the diagonal using the Pythagorean Theorem, since a diagonal divides a rectangle into two right triangles. data-full-width-responsive="false"> data-full-width-responsive="false"> Calculation of the diagonals for markup Foundation. Get this app free now at the Play Store. © Copyright by Rectangle calculator Compute the area and the length of the diagonal of a rectangle Definition of a rectangle: the rectangle is a quadrangle, or a
{ "domain": "motservicecentres.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305318133553, "lm_q1q2_score": 0.8128655246466131, "lm_q2_score": 0.8438950986284991, "openwebmath_perplexity": 507.86432464731814, "openwebmath_score": 0.6339654922485352, "tags": null, "url": "http://motservicecentres.com/0nbaez/diagonal-measurement-calculator-38f5a7" }
python, numpy, simulation, clustering, matplotlib shapefile='CA.shp' spacing=0.20 empty_ratio=0.30 similarity_threshhold=0.01 n_iterations=100 ratio=0.535
{ "domain": "codereview.stackexchange", "id": 35483, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, numpy, simulation, clustering, matplotlib", "url": null }
haskell untokens :: [String] -> String untokens = concat . intersperse "," segregate :: [String] -> ([String], [String]) segregate = partition (not . isInteger) isInteger :: String -> Bool isInteger = all isDigit format :: ([String],[String]) -> String format (xs,ys) = untokens xs ++ '|' : untokens ys parse :: String -> String parse = format . segregate . tokens
{ "domain": "codereview.stackexchange", "id": 5092, "lm_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", "url": null }
python, python-3.x, logging return directory + '/' + logName + '.txt' def log(comment): comment = str(comment) # write to log file retriving most recent log from corresponding file with open(findMostRecentLog(), 'a') as log: log.write(comment + '\n') In case you do not know it yet, I suggest you to use pylint to parse your code and have automatic feedbacks. In fact some of my notes come from pylint. Styling notes: Constant names like var "directory" require uppercase style PEP8 Function and variable names require snake_case style PEP8 Functions require docstring, as well as the module itself PEP8 Inline notes #NOTE: 'from datetime import datetime' allows a shorter line below import datetime import time import os import sys # get user's current directory # NOTE: use os.path.join for concat filesystem paths for cross compatibility (also below) directory = os.path.dirname(os.path.realpath(__file__)) + '/logs' def createNewLog(): # ensure log folder exists
{ "domain": "codereview.stackexchange", "id": 28784, "lm_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, logging", "url": null }
string-theory, supersymmetry, stability, branes Title: The stability of D-Brane In "String Theory and M-Theory: a modern introduction" by K.Becker, M. Becker and J.H.Schwarz, they say that BPS D-brane is stable as it preserves half of the Supersymmetry. I really want to understand more about this statement and see detail calculations. What is the mechanism of D-brane stability? Is there any derivation for the instability of space-filling D-brane (so that open string tachyon will be eliminated from the theory)? Thank you. BPS objects are stable because they're the lightest objects with given values of certain conserved charges. So there exists no potential final state that would be lighter and that the BPS state could decay into, by conserving the energy. The excess energy may be invested to the kinetic energy of the final energy but a deficit energy means that the decay is prohibited. As an analogy, note that the electron has to be stable because there exists no lighter $Q=-e$ object than the electron (and positron).
{ "domain": "physics.stackexchange", "id": 8694, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "string-theory, supersymmetry, stability, branes", "url": null }
quantum-information, quantum-computer Extraction Given a combined state, finding the values of $\alpha$ and $\beta$ for single qubits are what I mean by "extract a single qubit state from a combined state." I would like QuTiP to find those values for me. Of course in this simple case, I know I can do this by inspection; but in more complicated cases, I would like QuTiP to do it for me. Before we talk about how to get QuTip to do what you're asking, we should make sure you understand what it means to "extract" one of the qubits" states. In general, such "extraction" is not possible. Combined quantum systems The question, we have four dimensional vectors representing the states of the combined two-qubit system. Note that when you write a vector in terms of components, there's an underlying assumed basis for the vector space. For example, when the question writes $$\frac{1}{\sqrt{2}}\left[ \begin{array}{c} 0\\1\\0\\1 \end{array} \right] \, ,$$ this really means
{ "domain": "physics.stackexchange", "id": 44373, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-information, quantum-computer", "url": null }
python, beginner, tic-tac-toe You can also rewrite the input methods for getting inputs like @ImperialJustinian suggested. I have rewritten your Game_Start method: # Game Play Function def Game_Start(): print "This is a Tic-Tac-Toe Game To Be Played Between Two Players." print "This Game is Played with a Keypad Using the Numbers 1 Through 9" print "Which Represent Board Locations as Follows;" print ' | 7 | 8 | 9 |' print ' | 4 | 5 | 6 |' print ' | 1 | 2 | 3 |' print "Player 1 Begins By Placing an 'X' Marker On the Board." print "Player 2 Then Places an 'O' Marker On the Board." print "The Game Will End At Any Time Either Player Succeeds In Landing Three Markers In Series" print "This Can Be Done Horizontally, Vertically, Or Diagonally." print "If At Any Time a Player Selects An Already Filled Position An Error Message Will Appear On The Screen"
{ "domain": "codereview.stackexchange", "id": 24137, "lm_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, tic-tac-toe", "url": null }
are called reflections. • After the midterm, we will focus on matrices. Learn how to add, subtract, and multiply matrices, and find the inverses of matrices. Assume that the negligible strain is oriented in the z-direction. The matrix is called the Modelview matrix. L(000) = 00 When we multiply a matrix by an input vector we get an output vector, often in a new space. To find the image of a point P, you multiply the matrix by the position vector of the point. The proof is not deep, the result is hardly startling, but it will be referenced With this mentality, change of basis can be used to rewrite the matrix for a linear transformation in terms of any basis. A matrix with n x m dimensions is multiplied with the coordinate of objects. Solving Systems of Linear Equations. On the other hand, if y is actually a One of the major applications of the z-transform is used as an analysis tool for discrete-time LTI systems. The invertible matrix theorem is a theorem in linear algebra which gives
{ "domain": "kacpergomolski.pl", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754506337405, "lm_q1q2_score": 0.8183230388271673, "lm_q2_score": 0.831143045767024, "openwebmath_perplexity": 628.818077638687, "openwebmath_score": 0.6772881150245667, "tags": null, "url": "http://kacpergomolski.pl/rvxm/matrix-transformation-applications.php" }
quantum-mechanics, hilbert-space, operators, mathematical-physics, observables Title: Resolution of the identity of operator with mixed spectrum In most quantum mechanics text books, the resolution of the identity or completeness relation is stated in the following (or similar) form $$ \mathbb I_\mathcal H = \sum\limits_n |\lambda_n\rangle \langle \lambda_n| + \int |\lambda\rangle\langle \lambda| \,\mathrm d\lambda\quad , \tag{1} $$ where $|\lambda_n\rangle$ and $|\lambda\rangle$ denote the (generalized) eigenvectors of some observable $O$ (here a non-degenerate case is assumed). I wonder why or under which conditions we can do this: In general, the spectral theorem states (at least one formulation of it) that for a given self-adjoint operator, there exists a (unique) spectral family $\{E_\lambda\}_{\lambda\in \mathbb R}$ such that $$ O =\int\limits_\mathbb R \lambda\,\mathrm dE_\lambda \quad . \tag{2} $$ For the identity operator, we thus obtain $$\mathbb I_\mathcal H = \int \limits_\mathbb R \mathrm dE_\lambda \quad .\tag{3} $$
{ "domain": "physics.stackexchange", "id": 88013, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, hilbert-space, operators, mathematical-physics, observables", "url": null }
data-structures, dictionaries, priority-queues Allow for a quick lookup of the key (e.g. a tree, a hashmap) Maintain the order in which elements were inserted (e.g. a list, a queue) A practical example is a list of agents receiving calls. When an agent is called, it's fetched from the list, and when it finishes the call, it's put at the back of the list. Therefore the agent that is first in that list is the most idle agent (waiting for a call the longest). In other words, the list would be sorted according to agent's idleness.
{ "domain": "cs.stackexchange", "id": 7592, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-structures, dictionaries, priority-queues", "url": null }
fusion Ohmic heating is not sufficient to achieve fusion, but sufficient to achieve $100\,\mathrm{eV}$. That is good for you as you do not need to buy external heating sources. Things you need to "sink some money into":
{ "domain": "physics.stackexchange", "id": 49656, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fusion", "url": null }
java, json, hash-map, serialization Don't swallow Exceptions readData() does not appear to handle thrown Exceptions in any meaningful way. Should it log to some console output? Fail fast? Wrap the Exception and throw it to the caller? I'm also not to keen on calling your InputStreamReader instance read, because read.read() sounds... strange. Why not just call it reader? And I think you'll need to close() it when you're done with it. Define variables/parameters with interfaces, not implementations Just one more thing, it's better to declare Map<String, String> map = new HashMap<>(); (>= Java 7 syntax), since your code should not need to be aware of the actual implementation of map. Same goes for public void pushData(Map<String, String> map).
{ "domain": "codereview.stackexchange", "id": 12521, "lm_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, json, hash-map, serialization", "url": null }
ros, octomap-mapping Originally posted by Megacephalo with karma: 106 on 2015-11-04 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 19201, "lm_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, octomap-mapping", "url": null }
knowrob % rdf_cache compiled into rdf_cache 0.00 sec, 15,904 bytes % library(semweb/rdf_db) compiled into rdf_db 0.04 sec, 680,768 bytes % comp_similarity compiled into comp_similarity 0.04 sec, 708,256 bytes % /opt/ros/electric/stacks/knowrob/ias_prolog_addons/prolog/init.pl compiled 0.04 sec, 709,136 bytes % library(broadcast) compiled into broadcast 0.00 sec, 7,344 bytes % library(semweb/rdf_edit) compiled into rdf_edit 0.01 sec, 86,712 bytes % library(semweb/rdfs) compiled into rdfs 0.00 sec, 25,992 bytes % library(semweb/owl) compiled into t20_owl 0.01 sec, 68,496 bytes % library(socket) compiled into socket 0.00 sec, 10,232 bytes % library(base64) compiled into base64 0.00 sec, 17,400 bytes % library(http/http_open.pl) compiled into http_open 0.00 sec, 77,056 bytes % library(thea/owl_parser) compiled into owl_parser 0.01 sec, 155,976 bytes % library(odbc) compiled into odbc 0.00 sec, 37,344 bytes
{ "domain": "robotics.stackexchange", "id": 10508, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "knowrob", "url": null }
javascript, jquery, html, css Or just remove it to prevent confusion if the widths aren't affected by resizing. You also don't end up using rangeX in your code. Consider removing it. More straightforward calculation I think you could simplify the way you calculate the offset in your document.mousemove handler by eliminating the mousePercent variable: $(document).on('mousemove', function(e) { var mouseX = e.pageX, offset = mouseX / docWidth * slidesWidth - mouseX / 2; $images.css({ '-webkit-transform': 'translate3d(' + -offset + 'px,0,0)', 'transform': 'translate3d(' + -offset + 'px,0,0)' }); }); This way you don't multiply by 100 and then divide by it right after, and you also have fewer variables to worry about.
{ "domain": "codereview.stackexchange", "id": 20156, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, html, css", "url": null }
as a sum of impulse responses. 10-12 and are helpful for Exam 1:. Also, later we will find that in some cases it is enlightening to think of an image as a continuous function, but we will begin by considering an image as discrete , meaning as composed of a collection of pixels. The continuous convolution of two functions of a continuous variable is an extension of discrete convolution for two functions of a discrete parameter (i. The first employs finite extent sequences (signals) and the second employs semi-infinite extent signals. In this case, the convolution is a sum instead of an integral: hi ¯ j 0 m fjgi j Here is an example.
{ "domain": "paroleoggi.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9877587239874877, "lm_q1q2_score": 0.8231236471102209, "lm_q2_score": 0.8333246035907932, "openwebmath_perplexity": 817.352576756788, "openwebmath_score": 0.8224692344665527, "tags": null, "url": "http://paroleoggi.it/discrete-convolution-example.html" }
in terms of rigid motions. So we already know, two triangles are congruent if they have the same size and shape. 14 December 2020 . Determine which congruent triangle postulate is likely to be the ticket for proving the triangles congruent. In this lesson, we will consider the four rules to prove triangle congruence. If the two angles and the non included side of one triangle are congruent to the two angles and the non included side of another triangle, then the two triangles are congruent. In today’s geometry lesson, we’re going to tackle two of them, the Side-Side-Side and Side-Angle-Side postulates. SSS (Side-Side-Side): If three pairs of sides of two triangles are equal in length, then the triangles are congruent. Students then glue the diagrams onto the back of the correct tab (see the file “SSS, SAS, and ASA Activity”). pagespeed.lazyLoadImages.overrideAttributeFunctions(); called a linear pair. Given: 1) point C is the midpoint of BF 2) AC = CE. More About Postulate. Now, I’ll
{ "domain": "lincoln-marti.net", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854164256365, "lm_q1q2_score": 0.8355071911996742, "lm_q2_score": 0.8615382094310357, "openwebmath_perplexity": 1198.8124985414095, "openwebmath_score": 0.4220111668109894, "tags": null, "url": "http://lincoln-marti.net/daniel-doheny-msmesob/xzc9s78.php?5668b7=sss-postulate-examples" }
statics When we apply a torque to the beam the forces are (as I've drawn it) in a horizontal plane, but the Poisson effect means there can be a response in the vertical plain. Exactly what motion will occur depends on the geometry. The reason a non-circular cross section is required is that in circular cross sections the symmetry means there can be no net vertical force acting.
{ "domain": "physics.stackexchange", "id": 25752, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statics", "url": null }
organic-chemistry, nitro-compounds Later in the same chapter they explain the Cannizzaro reaction. Why is the yield of this nitroaldol reaction particularly good, while a Cannizzaro reaction is also competing for the benzaldehyde? Is the nitroaldol reaction that much faster?
{ "domain": "chemistry.stackexchange", "id": 3671, "lm_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, nitro-compounds", "url": null }
cosmology, modified-gravity It is worth noting that the cosmological term is so small that it has in essence no effect on gravity's effect for anything except cosmological distances. Black Holes form everywhere in the universe, and that little repulsive effect makes no difference.
{ "domain": "physics.stackexchange", "id": 31847, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, modified-gravity", "url": null }