text
stringlengths
1
1.11k
source
dict
electromagnetism, mathematical-physics, differential-geometry, gauge-theory, topology I've heard that Poincare's Lemma turns out to be true even if $U$ is not star-shaped, but rather, just contractible. Now, in the hypothesis of Poincare's Lemma, the fact that the magnetic field satisfies $\nabla\cdot B = 0$ implies the existance of the vector potential $A$, with $B = \nabla \times A$. But now, what happens if the magnetic field is defined in some region of space that is not simply connected? In that case, the vector potential could not exist according to Poincare's Lemma (it doesn't says that it doesn't exists, but it doesn't guarantees the existance).
{ "domain": "physics.stackexchange", "id": 9574, "lm_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, mathematical-physics, differential-geometry, gauge-theory, topology", "url": null }
2. Each of these white squares contains at least $k^2 - O(k)$ flies, which are all spared as a result. A similar argument applies here. Draw a tiny square of side length $\frac1k$ centered at each fly; then each white square of the flyswatter contains $k^2$ tiny squares, counting fractions of tiny squares only partially contained, the fractions of tiny squares make an $O(k)$ contribution, and all tiny squares completely inside the white square contain a fly which survives.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846722794541, "lm_q1q2_score": 0.8153120050118963, "lm_q2_score": 0.8333245891029457, "openwebmath_perplexity": 274.20686835302774, "openwebmath_score": 0.6954253911972046, "tags": null, "url": "https://math.stackexchange.com/questions/2666678/killing-flies-with-a-checkerboard-flyswatter" }
python, numpy, pandas Title: Calculating speed from a Pandas Dataframe with Time, X, and Y columns I'm trying to calculate speed between consecutive timepoints given data that is in a '.csv' file with the following columns: "Time Elapsed", "x", and "y". The ultimate goal is to get the data into a format where I can plot "Time Elapsed" vs. "speed" I'm fairly sure that my implementation is doing what I want, but it's certainly possible (and likely) that I overlooked something. I'm also wondering whether there are faster/more efficient ways (in Python) to perform these calculations? import pandas as pd import numpy as np def calculate_speeds(path_to_csv): data_df = pd.read_csv(path_to_csv) xy = data_df[['x', 'y']] b = np.roll(xy, -1, axis=0)[:-1] a = xy[:-1] dxy = np.linalg.norm(a - b, axis=1) dt = (np.roll(data_df['Time Elapsed'], -1) - data_df['Time Elapsed'])[:-1] speeds = np.divide(dxy, dt)
{ "domain": "codereview.stackexchange", "id": 24867, "lm_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, pandas", "url": null }
The trouble with letting it mean $U$ is that suddenly the valuye of $\bigcap_{A\in\mathcal A} A$ depends not only on which set $\mathcal A$ is, but also on what you take $U$ to be. This is not a major problem in most everyday mathematics settings where things are (somewhat informally) typed. For example, if you know that all of the $A$'s, if there had been any, would range over subsets of a particular vector space $V$, then it makes excellent sense to decide to let $\bigcap_{A\in\varnothing} A$ mean all of $V$ in that context.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808753491773, "lm_q1q2_score": 0.8082042567664567, "lm_q2_score": 0.8244619242200082, "openwebmath_perplexity": 357.88356486957684, "openwebmath_score": 0.8536144495010376, "tags": null, "url": "http://math.stackexchange.com/questions/188013/i-have-a-question-on-the-concept-of-arbitrary-intersection-of-elements-in-a-set" }
laser, microwaves, infrared-radiation The Advanced Tactical Laser (ATL), to be carried by a transport aircraft, is to emit an infrared laser beam of 300 kilowatts power, provided from a chemical reaction. Via a 0.5 m wide transmitting and directing mirror, the beam can be focused – under ideal conditions – to a spot of 0.1-0.2 m size over 10 km and more. With the 100-fold power of a stove plate applied over a similar area, wood or textiles would start burning and metal would melt through after fractions of a second, under usual atmospheric conditions on the order of one second. Strong turbulence will limit the range, fog, dust or heavy rain can reduce it markedly. With fuel for about 40 seconds of radiating on board and dwell times below a second, the beam will often be directed and fired automatically. The ATL can destroy equipment and kill people, it is not a non-lethal weapon. Its usage in armed conflict against combatants could be compared with flamethrowers which are
{ "domain": "physics.stackexchange", "id": 60396, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "laser, microwaves, infrared-radiation", "url": null }
autocad Title: What is the suitable multiplier for all units? I create Auto CAD Drawing using Primary units decimal (mm). I need to add alternative unit as Architectural. What is the suitable multiplier for all units? After adding new value So 1 Millimeter = 0.0393701 Inches You can get this from many places, some being listed as holding the national standards, while others are just repeating the information. This one has some of the history and explanation which you might find useful. from: https://www.squareyards.com/blog/millimeter-to-inch-cnvart
{ "domain": "engineering.stackexchange", "id": 5119, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "autocad", "url": null }
$$I= \int (x^2 + y^2 +z^2) dm - \int z^2 dm = \frac{3}{5} mr^2 - \int z^2 dm$$ The above simplification used the fact that $$x^2 +y^2 +z^2= r^2$$, i.e: the spherical radius. Due to the symmetery of sphere, we may argue that $$\int x^2 dm = \int y^2 dm = \int z^2 dm$$, hence $$\int z^2 dm = \frac{I}{2}$$: $$I = \frac35 mr^2 - \frac{I}{2}$$ Or, $$I = \frac{2}{5} mr^2$$ QED Since $$V=\int_0^R (4\pi r^2) \space dr$$ produces the correct formula for the volume of a sphere, the problem is elsewhere. Namely in the $$r^2$$ factor inside the volume integral. The problem is that MMOI is measured by the perpendicular distance of a particle to an axis. So the $$r^2$$ factor inside the integral is incorrect, as it used the radial distance and not the perpendicular distance. The correct way to integrate is to consider spherical coordinates and use
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226354423304, "lm_q1q2_score": 0.8304410836605911, "lm_q2_score": 0.849971181358171, "openwebmath_perplexity": 166.70410531597332, "openwebmath_score": 0.9150753617286682, "tags": null, "url": "https://physics.stackexchange.com/questions/656582/why-doesnt-this-way-of-calculating-the-moment-of-inertia-of-a-sphere-work/656669" }
apache-spark, geospatial Title: Filtering outliers in Apache Spark based on calculations of previous values I'm processing geospatial data using Spark 2.0 Dataframes with the following schema: root |-- date: timestamp (nullable = true) |-- lat: double (nullable = true) |-- lon: double (nullable = true) |-- accuracy: double (nullable = true) |-- track_id: long (nullable = true)
{ "domain": "datascience.stackexchange", "id": 1311, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "apache-spark, geospatial", "url": null }
quantum-field-theory, special-relativity, conformal-field-theory, differential-equations Is it known how to give a finite transformation of $K_i$ acting on the spinors? So of the form $$e^{b\cdot K_i}|i\rangle = f_b(|i\rangle)$$ for some function $f_b$ and vector $b$? It looks intuitively to me like it should be straight-forward given that $$K_i |i\rangle =0,$$ however I imagine there are some difficulties in taking the exponential of a second derivative operator. I found the answer I was looking for in twistor space, where the conformal group acts linearly. Under a Fourier transform back to momentum space, we can write a special conformal transformation acting on $|j\rangle$ as $$|j\rangle^\alpha \mapsto |j\rangle^\alpha + i\, b^{\alpha\dot{\alpha}}\frac{\partial}{\partial|j]^{\dot{\alpha}}}.$$ I'm not really sure how useful this statement is, but I think it makes sense. I would be interested to know if it's correct to write that
{ "domain": "physics.stackexchange", "id": 78316, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, special-relativity, conformal-field-theory, differential-equations", "url": null }
assembly mov si, newline ; copy line feed string to buffer call prints ; print line feed jmp newinput ; ready new line
{ "domain": "codereview.stackexchange", "id": 14211, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "assembly", "url": null }
physical-chemistry, everyday-chemistry, equilibrium, molecules, home-experiment Title: For a given teabag and dunking duration - will I get more caffeine in a bigger cup or the same amount? When choosing a cup of tea, I can choose a big cup or a small cup. I'm wondering if I get more caffeine with the bigger cup or the same amount of caffeine. (in moles) My question is: For a given teabag and dunking duration - will I get more caffeine in a bigger cup or the same amount? Assumptions Teabag is placed in cup first - and hot water poured directly onto the bag Same amount of stirring across both cups (assume three spoon swirls) The main varying parameter is the volume of solvent changing Question behind the question - trying to express it another way
{ "domain": "chemistry.stackexchange", "id": 882, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, everyday-chemistry, equilibrium, molecules, home-experiment", "url": null }
slam, computer-vision Title: SLAM : Why is marginalization the same as schur's complement? Consider the system $$ \tag 1 H\delta x=-g $$ where $H$ and $g$ are the Hessian and gradient of some cost function $f$ of the form $f(x)=e(x)^Te(x)$. The function $e(x)=z-\hat{z}(x)$ is an error function, $z$ is an observation (measurement) and $\hat{z}$ maps the estimated parameters to a measurement prediction. This minimization is encountered in each iteration of many SLAM algorithms, e.g.one could think of $H$ as a bundle adjustment Hessian. Suppose $x=(x_1,x_2)^T$, and let $x_2$ be some variables that we seek to marginalize. Many authors claim that this marginalization is equivalent to solving a smaller liner system $M\delta x_1=-b$ where $M$ and $g$ are computed by applying Schur's complement to (1), i.e. if $$H= \begin{pmatrix} H_{11} & H_{12}\\ H_{21} & H_{22} \end{pmatrix} $$ then $$ M=H_{11}-H_{12}H_{22}^{-1}H_{21} $$ and $$ b=g_1-H_{12}H_{22}^{-1}g_2 $$
{ "domain": "robotics.stackexchange", "id": 988, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, computer-vision", "url": null }
You have done everything correctly, but to get to the desired answer, let's pick it up a few lones earlier, where you have: $B'C + A'CD' + A'BC'D'$ From here: $= B'C + A'BCD' + A'B'CD' + A'BC'D'$ (By expansion of A'CD') $= B'C + A'BCD' + A'BC'D'$ (Third term got Absorbed by first) $= B'C + A'BD'$ • I just finished looking through the instructors manual for this questions and this is exactly as it is listed. I just don't understand why I am allowed to throw the B term back in? – Seth Duke Feb 19 '17 at 19:24 • You mean in the first step I do? It's because in general $A = AB + AB'$. So I expand A'CD' to A'BCD' + AB'CD' – Bram28 Feb 19 '17 at 21:20
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9702399030421979, "lm_q1q2_score": 0.8106194640453686, "lm_q2_score": 0.8354835350552604, "openwebmath_perplexity": 954.792816286577, "openwebmath_score": 0.5062270760536194, "tags": null, "url": "https://math.stackexchange.com/questions/2151560/using-boolean-algebra-to-prove-k-map-result" }
The distances from $D$ to each of $A$, $B$, and $C$ must be short or long, so let's write all the possible combinations of each of those distances. Case Distance to $A$ Distance to $B$ Distance to $C$ 0 Short Short Short 1 Short Short Long 2 Short Long Short 3 Short Long Long 4 Long Short Short 5 Long Short Long 6 Long Long Short 7 Long Long Long Cases 1 and 3 are not possible, for then $D$ would be to the left of the blue line, which we have excluded.
{ "domain": "co.uk", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232884721166, "lm_q1q2_score": 0.8253101034912969, "lm_q2_score": 0.8397339716830605, "openwebmath_perplexity": 281.5100214270624, "openwebmath_score": 0.7096157670021057, "tags": null, "url": "https://www.solipsys.co.uk/new/FourPointsTwoDistancesProof.html?MoreMentalModelMissteps" }
python, django elif request.user.is_superuser: try: request.QUERY_PARAMS['company'] except KeyError: return default_qs options = Q(**{self.company_path: request.QUERY_PARAMS['company']}) options |= Q(**{self.company_path: None}) if options: default_qs = default_qs.filter(options) return default_qs These are extremely useful as the amount of views you have start to grow. This remove a LOT of redundancy in your views. I will add more later if I can think of anything else that will help DRY this up.
{ "domain": "codereview.stackexchange", "id": 17913, "lm_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, django", "url": null }
moveit, universal-robots, universal-robot, ros-industrial Comment by Matziieee on 2017-05-09: Thank you. Appreciate the help a lot. Comment by gvdhoorn on 2017-05-09: Be aware that computeCartesianPath(..) is a tricky / sensitive function in MoveIt. Success depends heavily on having a good IK solver plugin configured for your setup, and on the parameters that you give it. Don't be discouraged if at first things don't seem to work. Comment by gvdhoorn on 2017-05-09: But for any realistic welding, I'd look at Descartes. Comment by pmuthu2s on 2018-01-06: Hey guys, with descartes, is it possible to control the velocity in cartesian space? Comment by gvdhoorn on 2018-01-06: This would've been better as a separate question, but to answer it here: no, Descartes is a path planner, not a trajectory generator. See ros-industrial-consortium/descartes#148 for some related discussion.
{ "domain": "robotics.stackexchange", "id": 27846, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "moveit, universal-robots, universal-robot, ros-industrial", "url": null }
thermodynamics, reversibility, adiabatic From the ideal gas law $$\frac{P_{i}V_{i}}{T_i}=\frac{P_{f}V_{f}}{T_f}$$ Now we have two equations and two unknowns, $V_f$ and $T_f$. Solve for the unknowns $V_f$ and $T_f$. EXAMPLE: The following is an example that a friend and I worked on recently. We wanted to compare reversible and irreversible adiabatic expansions of an ideal gas where the expansions both terminated at the same pressure. In this case we chose air, which is essentially a mixture of two diatomic gases (oxygen and nitrogen) where $k$=1.4 and $C_V=0.2053\frac{l.atm}{mol.K}$ . Initial conditions for both processes: $P_i$=10 atm $V_i$=2.46 $l$ $T_i$=300K Final conditions for both processes: $P_f$=5 atm $V_f$=? $T_f$=? For the reversible adiabatic process, the external pressure starts at 10 atm and is very slowly reduced to a final pressure of 5 atm, so that the gas pressure essentially equals the external pressure during the expansion.
{ "domain": "physics.stackexchange", "id": 56768, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, reversibility, adiabatic", "url": null }
[H,H,T,H,H,H,T,H,H,H]. What is the probability that both children are girls? In other words, we want to find the probability that both children are girls, given that the family has at least one daughter named Lilia. So since both cases have equal likelihood, you can take the mean in each. We've found what we want to know. 5 probability each, and one unfair coin which flips heads with 1. 5 unfair = coin 0. Suppose you have an unbiased coin (i. We have coins of three types: Fair, Unfair, and Very Unfair. Let A be the event that heads comes up exactly h times. P1_win_prob_weighted_coin_game(50000) 0. S3 Topic 2: Probability – Simple Events 5 Activity 3: Consider the following events and list all possible outcomes (可能結果). Let X be the random variable for the amount won on a single play of this game. Heads came up 82 times. Repeat this experiment 100 times. Three coins are tossed. Over 50,000 games, we see that player 1 has a distinct advantage by going first. You can change the weight or
{ "domain": "abiliatour.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471647042428, "lm_q1q2_score": 0.8261698812271594, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 409.0145639306824, "openwebmath_score": 0.7566685676574707, "tags": null, "url": "http://uhjr.abiliatour.it/unfair-coin-probability.html" }
homework-and-exercises, newtonian-mechanics, kinematics, textbook-erratum Title: Pulley problem: not sure if my answer is correct Two blocks of mass are connected by a massless string that runs of a pulley as shown. If there is no friction between m1 and the table, find the tension in the string.
{ "domain": "physics.stackexchange", "id": 34132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, kinematics, textbook-erratum", "url": null }
general-relativity, cosmology, space-expansion, redshift $$ \frac{\Lambda c^2}{3} \approx 3 \times 10^{-36} s^{-2} $$ Giving us the current value for $\ddot a$: $$ \ddot a \approx 2 \times 10^{-36} s^{-2} $$ It just remains to decide how far away we can reliably monitor a single star, and how long we want to do the experiment. Let's take a billion light years as the distance ($10^{25}$ metres) and ten years for the experiment duration ($3 \times 10^8$ seconds) and we get: $$ \Delta v \approx 0.006 \,\text{m/s} $$ We can measure the red shift due to velocities this small, for example using the Mossbauer effect, but only under very carefully controlled laboratory conditions. We would have absolutely no hope of doing it using a star a billion light years away. In any case the star will have some proper motion due to the gravitational fields it is travelling in and we could not be sure that a velocity change this small wasn't just due to local gravitational acceleration rather than the expansion of spacetime.
{ "domain": "physics.stackexchange", "id": 52809, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, cosmology, space-expansion, redshift", "url": null }
ros, rviz, global-costmap Title: How to refresh automatically global costmap in Rviz Hello! I'm wondering how to automatically refresh the global costmap visualization on Rviz. The problem is: I have an initial global costmap and I add an obstacle in gazebo. At this point the global costmap in Rviz should update, but it doesn't. Is there any refresh option? I'm sure that at low level the global costmap is updating since if I disable and then enable the global costmap button, Rviz visualize the new costmap. Originally posted by alex920a on ROS Answers with karma: 35 on 2014-08-29 Post score: 2
{ "domain": "robotics.stackexchange", "id": 19228, "lm_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, rviz, global-costmap", "url": null }
python, object-oriented, python-3.x Title: Function that performs a test of whether a number is greater or less than some expected result The program that contains the function I'm asking (handle_non_exact_answer) about has several instances of a class Test, with some options the user can set that determines the behavior of the class. If the class has certain options, we handle the class differently, so I deal with these cases in a separate function, which is below. I would like to learn a) how to better write the function (ideally in the "most pythonic" way,) and b) how to resolve a pylint warning related to this function: Unnecessary "else" after "return". import random class Test: def __init__(self): self.precision = None self.expected_result = None
{ "domain": "codereview.stackexchange", "id": 32209, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, object-oriented, python-3.x", "url": null }
# Let $\theta=\frac{2 \pi}{67}$ consider the rotation matrix $A$. What is $A^{2010}$? Let $\theta=\frac{2 \pi}{67}$. Consider the matrix $$A = \begin{pmatrix} \cos\theta & \sin\theta\\ -\sin \theta& \cos \theta \end{pmatrix}$$ Then the matrix $A^{2010}$ is? My approach $$A^2 = \begin{pmatrix} \cos2\theta & \sin2\theta\\ -\sin 2\theta& \cos 2\theta \end{pmatrix}$$ $2010$ is a multiple of $67$. So I'm trying to convert in such format by taking $A$ matrix as power of $2$ and multiplying. But $2048$ is the nearest $2$ power term. So help please. I dont know if you can understand what I did!! Sorry for being not explaining properly • Is this from TIFR-GS 2015 ? Mar 7, 2015 at 12:37 • No ISI Sample... – N S Mar 7, 2015 at 12:38
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540686581883, "lm_q1q2_score": 0.8074401420506622, "lm_q2_score": 0.8244619263765707, "openwebmath_perplexity": 239.18975486767434, "openwebmath_score": 0.9103987812995911, "tags": null, "url": "https://math.stackexchange.com/questions/1179407/let-theta-frac2-pi67-consider-the-rotation-matrix-a-what-is-a2010/1179415" }
Independence of Normals A well known fact about joint normally distributed random variables, is that they are independent if and only if their covariance is zero. In one direction, this statement is trivial. Any independent pair of random variables has zero covariance (assuming that they are integrable, so that the covariance has a well-defined value). The strength of the statement is in the other direction. Knowing the value of the covariance does not tell us a lot about the joint distribution so, in the case that they are joint normal, the fact that we can determine independence from this is a rather strong statement. Theorem 1 A joint normal pair of random variables are independent if and only if their covariance is zero. Proof: Suppose that X,Y are joint normal, such that ${X\overset d= N(\mu_X,\sigma^2_X)}$ and ${Y\overset d=N(\mu_Y,\sigma_Y^2)}$, and that their covariance is c. Then, the characteristic function of ${(X,Y)}$ can be computed as
{ "domain": "almostsuremath.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9907319862086131, "lm_q1q2_score": 0.8029673857700804, "lm_q2_score": 0.8104789155369048, "openwebmath_perplexity": 174.62662345995793, "openwebmath_score": 0.9165619611740112, "tags": null, "url": "https://almostsuremath.com/tag/normal-distribution/" }
rosbag, sensor-msgs, bagfiles, bagfile, data Title: bag file request I'm working on a project that requires collecting a large set of data; anything from a few hours to a week's worth of scan (sensor_msgs/LaserScan) and tf (tf/tfMessage) topics, preferably recorded from the same environment (one floor of a university building, office, lab, etc). It's fine if people are present in the observed environment. Before setting out to record the bag file(s) for this task, I thought I'd ask to see if anyone had already collected data similar to what I've described and would be willing to share it. General requirements: Bag file of recorded scan and tf topics. Recorded in the same environment. 5hours + (the more data the better!). People present in the environment is okay. Thanks for the help!
{ "domain": "robotics.stackexchange", "id": 13409, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosbag, sensor-msgs, bagfiles, bagfile, data", "url": null }
rotation Another source for an error might be how a quaternion is defined in your software. Namely it could also be that the first element of the quaternion is $w$, which would mean that you would have to use this instead: double w = quat[0]; double x = quat[1]; double y = quat[2]; double z = quat[3];
{ "domain": "robotics.stackexchange", "id": 1774, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rotation", "url": null }
• I like that you have provided a natural construction rather than just giving an equality. Thanks! – Clayton Aug 13 '18 at 18:36 • Thanks for your answer! I was wondering how you observe that $\sqrt[3]{20+14\sqrt{2}}$ may be expressed as $a+b\sqrt{2}$. (I guess if $x^3=20+14\sqrt{2}$, then one may expect that $x$ is a $\mathbb{Z}$-linear combination of $1$ and $\sqrt{2}$?) – user486939 Aug 14 '18 at 0:54 • @Mars Since the original equation has an integer root, I thought that it would be reasonable to expect that $20\pm14\sqrt2$ hade a cube root of the form $a\pm b\sqrt2$, with $a,b\in\mathbb Z$. – José Carlos Santos Aug 14 '18 at 6:31 If you don't spot the values of these cube roots and don't feel like computing them, you can try this. Define $a_\pm:=(20\pm14\sqrt{2})^{1/3},\,s:=\sum_\pm a_\pm$ so $\sum_\pm a_\pm^3=40$ and $\prod_\pm a_\pm=8^{1/3}=2$, so $s^2=\frac{40}{s}+4ab=\frac{40}{s}+6$. Hence $0=s^3-6s-40=(s-4)(s^2+4s+10)$ has only one real root, $4$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232924970204, "lm_q1q2_score": 0.8430344695718146, "lm_q2_score": 0.8577681013541611, "openwebmath_perplexity": 239.42709162008003, "openwebmath_score": 0.8573580384254456, "tags": null, "url": "https://math.stackexchange.com/questions/2881657/how-to-prove-that-sqrt32014-sqrt2-sqrt320-14-sqrt2-4?noredirect=1" }
in Fig. Asunto: phase portraits. Study stable and unstable equilibrium. The following worksheet is designed to analyse the nature of the critical point (when ) and solutions of the linear system X'. Lanchester’s combat models and the battle of Iwo Jima 4. If you took that phase portrait and wrapped it as a cylinder, the edges line up so that the separatrices line up, showing how the position is actually the same and the oscillatory behavior is. A phase curve is a plot of the solution to a set of equations of motion in a phase plane (or more generally, a phase space) as a function of time (Tabor 1989, p. Basic concepts-- using Mathematica-- first order differential equations-- the package ODE. From the phase portrait, we note that there are two special orbits 3 Γ and 4 Γ , which have the same Hamiltonian with that of the center point 1 (,0)u. Quantitative Understanding in Biology Module IV: ODEs Lecture II: Linear ODEs and Stability Linear Differential Equations You will recall from the
{ "domain": "mascali1928.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126457229186, "lm_q1q2_score": 0.8134502092968489, "lm_q2_score": 0.831143045767024, "openwebmath_perplexity": 867.5055131018929, "openwebmath_score": 0.4847550690174103, "tags": null, "url": "http://lwiu.mascali1928.it/phase-portrait-mathematica.html" }
c++, performance, strings, c++17 See, the concatenation function should not be a property of the string size. There is no difference between ct_string<0, char>::cat(...) and ct_string<1, char>::cat(...). No part of the concatenation function has anything to do with N; neither the arguments, the return type, nor the algorithm used. If you had a base class—as in template <std::size_t N, typename Char> class ct_string : public ct_string_base<Char>, then it might make sense to have cat() in the base class (so ct_string_base<Char>::cat(...)). But, really, this seems like something that should be a free function… which, ultimately, it is, in the form of eld::concat(). You’re really kinda going in circles by having both. template <typename To> constexpr explicit operator To() const noexcept{ return _cast<To>{}(std::as_const(this->_value)); }
{ "domain": "codereview.stackexchange", "id": 44386, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, strings, c++17", "url": null }
c#, object-oriented, game, hangman public bool IsRunning { get; private set; } = true; public string DisplayText => new String(_displayChars); public string AttemptCharacter(char attempt) { if (_originalString.Contains(attempt)) { for (int i = 0; i < _originalString.Length; i++) { if (_originalString[i] == attempt) { _displayChars[i] = attempt; } } if (_originalString == DisplayText) { IsRunning = false; return "GG kid you won"; } return "You found a char"; } else { if (_turnsLeft == 0) { IsRunning = false; return "No attemps left originalstring = " + _originalString; } return "Char not in string attemps left = " + _turnsLeft--; } } }
{ "domain": "codereview.stackexchange", "id": 41341, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, object-oriented, game, hangman", "url": null }
rosjava Title: How do I add a jar dependency in rosjava? I have a node written in ROSJava that depends on third party jar files. How do I add these jar files so they can be found when I execute "gradlew installApp"? I notice that by default numerous jar files are located in ~/.m2/repository/ros/rosjava_core/ and ~/.gradle/caches/artifacts-8/filestore/. How do I add more jar files to either of these? Originally posted by liangfok on ROS Answers with karma: 328 on 2012-08-04 Post score: 0 The .m2 directory is where Maven downloads files to. In Maven you add repos and dependencies to your pom files, in gradle to your gradle file. As an example, in the rosjava stack build.gradle: repositories { mavenLocal() maven { url 'http://robotbrains.hideho.org/nexus/content/groups/ros-public' } }
{ "domain": "robotics.stackexchange", "id": 10472, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosjava", "url": null }
newtonian-mechanics, rotational-dynamics, acceleration Title: Rotational analogue of Newton's 2nd law If we are writing torque equation about general point what points must be taken into account for getting the correct result. Also If that general point is accelerated then how do we deal with this. Like the first one that should be taken into account is to have moment of inertia about that general point. Like in given below problem: We have to calculate initial angular acceleration for above cases : if friction is absent. If friction is absent and pure rolling. If coefficient of friction is not enough to provide pure rolling. For example how can we apply torque equation about point "P" to find initial angular acceleration. Figure given in image below: If i understood this question then my concepts would be all clear. I would really appreciate your help. I'm adding original question and it's solution. I found it confusing as they used point C and didn't mentioned any pseudo force. Do you guys approve this.
{ "domain": "physics.stackexchange", "id": 55741, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, rotational-dynamics, acceleration", "url": null }
python, array, numpy There are two things I'm unsatisfied with in the answer I gave that are the reason I'm asking for a CR. The indexing: Isn't particularly readable, and I don't know how to make it more readable. For example [q-1, 2*_+1]. Would it have been better to create a variable j = q-1 because q-1 sees frequent use? Isn't that just moving the ugly to a different place? The idea for the solution itself. The way I see it the original problem can be solved by splitting the answer array to a new array, but that feels somehow wrong. I can see several ways to create the new array, but I don't see a way to do it without creating the new array. Am I wrong and this is an OK solution or not, and why?
{ "domain": "codereview.stackexchange", "id": 39111, "lm_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, array, numpy", "url": null }
filters, kalman-filters Is it possible to estimate velocity values given fuzzy position data? If so, what are some available techniques for doing so? Yes it is. That what's Kalman filter is all about. Your measurement includes position data, and there is a hidden velocity parameter. You will need some kind of model, like constant-velocity. You can input your idea of uncertainty into Kalman noise matrixes to improve results. You can use Kalman filter, which is good to predict the future. If you just want to estimate the velocity in post-processing step (after you have all data), you can use something simpler, like estimating the derivative. This will have the advantage of being smoother and more accurate.
{ "domain": "dsp.stackexchange", "id": 2324, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, kalman-filters", "url": null }
javascript, game-of-life 'use strict'; (function() { let cellSize = 8, cellBorderWidth = 1, height = getSize(), width = getSize(), life = [], delay = getDelay(), canvas = document.getElementById("output").appendChild(document.createElement("canvas")), birthThresh = [3], survThresh = [2, 3], running = null, chkBirth = document.getElementById("BirthThresholds").querySelectorAll("input"), chkSurvival = document.getElementById("SurvivalThresholds").querySelectorAll("input"), thresholdPicker = document.getElementById("thresholdPicker"), CurrentStepSpan = document.getElementById("CurrentStep"), stepNum = 0, foreground = "black", lastHighlightedCell, curr, next; let ctx = canvas.getContext("2d"); resetWorld(getDensity()); // attach all necessary event handlers canvas.addEventListener("mouseup", function(event){ let x = event.pageX - canvas.offsetLeft, y = event.pageY - canvas.offsetTop; x = x / cellSize >>> 0;
{ "domain": "codereview.stackexchange", "id": 23510, "lm_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, game-of-life", "url": null }
ds.algorithms, polynomials, semidefinite-programming, sum-of-squares Firstly, for the most basic problems of the type you discuss, the SVD connection gives a much better solver than the SOS black box; in particular, the latter constructs an SDP with $\binom{n+2}{2}$ terms, where $n$ is the total number of variables in the source optimization problem (for instance, the total number of elements in all unknown matrices; to see where I got these numbers, see lecture 10 from Pablo Parrilo's 2006 course: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-972-algebraic-techniques-and-semidefinite-optimization-spring-2006/lecture-notes/lecture_10.pdf ). This is an SDP you would never want to solve (running time depends on $n$ as $n^{6}$ using an interior point solver?), especially when compared with the ridiculous speed of an SVD solver (using consistent notation, SVD will be something like $\mathcal O(n^{1.5})$; you can de-fudge my computations by tracking the number of columns, rows, and target rank, but it's a disaster no matter how you
{ "domain": "cstheory.stackexchange", "id": 1203, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.algorithms, polynomials, semidefinite-programming, sum-of-squares", "url": null }
moment-of-inertia Title: Moment of Inertia of Tetrahedron How do you calculate the moment of inertia of a regular tetrahedron of side a about an axis passing through the center of one of the phases and perpendicular to it? The moment of inertia is given by $\frac{m*s^2}{20}$, where $m$ refers to mass and $s$ refers to the length of a side of the tetrahedron. You can read up on the proof over here and here.
{ "domain": "physics.stackexchange", "id": 45823, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "moment-of-inertia", "url": null }
graphs, terminology, trees Title: Is the height of the tree the number of edges or number of nodes? I'm so confused by some of the theorems online about tree heights. Does tree height mean the number of edges or nodes? if nodes, does it include the node it is counting from? Can the height of a tree start from 0? As Yuval says, there's no standard definition. This is not because computer scientists are indecisive but because it's sometimes more convenient to use one definition and sometimes more convenient to use the other. For example, a full, balanced binary tree of height $h$ has $2^h$ leaves if you define height as number of edges and $2^h-1$ vertices in total if you define height as number of vertices. Each of these statements becomes less convenient if you use the other definition and have to keep writing $h-1$ or $h+1$.
{ "domain": "cs.stackexchange", "id": 3491, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graphs, terminology, trees", "url": null }
binary-star, apparent-magnitude Title: Computation of magnitude of the secondary How to approximately compute the magnitude of the secondary in a binary when I know the magnitude of the primary, masses, radii, and approximate luminosities for both of them, please? Thank you very much. So the trick here will be to use the magnitude of the primary ($m_1$) and the luminosities of the two ($L_1$ and $L_2$) to get to $m_2$. When first googling for the relationship between luminosity and magnitude you could easily get confused because apparent magnitude isn't a measurement of luminosity, its a measurement of flux! The difference between two magnitudes is related to the ratio of the two fluxs like this: \begin{equation} \label{eq:1} m_1-m_2=-2.5\log\frac{f_1}{f_2} \end{equation} This is done because the definition of the magnitude scale was so that a difference of 5 magnitudes is equivilent to a flux ratio of 100:1 (try the math out to test this!).
{ "domain": "astronomy.stackexchange", "id": 6393, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "binary-star, apparent-magnitude", "url": null }
c#, algorithm, array, jagged-array for (var i = 0; i < e.Count; i++) { for (var j = 0; j < e[i].Count; j++) { Console.Write(e[i][j] + ", "); } Console.WriteLine(); } } Disclaimer: Apologise for my poor visualisation. I've used Excel to draw the bellow diagrams. Finding the diagonal step-by-step Let's play a little bit with your example As you have said it in your question you want to find all left to right diagonals. I've used the following informal definition for the left to right diagonal: A descending line which starts either from the left or from the top side of the matrix until there is a number in the way of it The minimum length of the line is two I haven't read any requirements regarding the ordering so, lets suppose you want to find them from left to right Algorithm I hope you have noticed the following part (highlighted with bold) in my informal definition:
{ "domain": "codereview.stackexchange", "id": 44063, "lm_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#, algorithm, array, jagged-array", "url": null }
computability, sets We define $f(x)$ as follows. Let $M,n$ be such that $\langle M, k \rangle = x$ where $\langle -, - \rangle$ is any computable pairing function (bijection). Then, run $M$ on empty input for $k$ steps. If that halts, return $\langle M \rangle$, otherwise return $\langle M_0 \rangle$. It is then easy to verify that, using such $f$, we have $$ \begin{array}{ll} B &= \{ \langle M' \rangle \ |\ \exists M,k. f(\langle M,k \rangle)= \langle M' \rangle \} \\ &= \{ \langle M' \rangle \ |\ \exists k. M' \mbox{ halts in $k$ steps } \} \\ &= \{ \langle M' \rangle \ |\ M' \mbox{ halts} \} \end{array} $$
{ "domain": "cs.stackexchange", "id": 12856, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computability, sets", "url": null }
Or not this is the process of simplifying radicals Calculator will show the! Simplified form ) if each of the radicand the rule: when a and b are not the roots!, sometimes even not knowing you were using them and factoring – all need... Your handwriting to cause the reader to think about is that radicals can be defined as a symbol indicate! In simplest form when the radicand and factoring radical, try to Evaluate the square roots a! Already done know how to simplify any radical expressions terms of powers not included square! Will spit out only the one defined value for an expression we deal radicals...
{ "domain": "anemon.gr", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9902915240915783, "lm_q1q2_score": 0.875456613728082, "lm_q2_score": 0.8840392878563336, "openwebmath_perplexity": 640.4365673322267, "openwebmath_score": 0.8737838268280029, "tags": null, "url": "http://anemon.gr/ll1mvq6q/2979fc-how-to-simplify-radicals" }
drcsim, gazebo-1.3 Edit3: I'm pretty sure this is a bug, and I've reported it. https://bitbucket.org/osrf/gazebo/issue/339/laserscan-causes-gazebo-to-crash-when The crash is in heightfield.cpp, and I should mention that I am using the drc_sim_v0.launch launch file in atlas_utils.
{ "domain": "robotics.stackexchange", "id": 2893, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "drcsim, gazebo-1.3", "url": null }
metal, organometallic-compounds Both types of magnesium carbide($\ce{MgC2, Mg2C3}$) is formed when acetylene gas is passed over magnesium. At different temperatures, one type of carbide predominates over the other. At 570°C-610° C, $\ce{MgC2}$ converts to $\ce{Mg2C3}$: $$\ce{2MgC2 -> Mg2C3 + C }$$ Above 610° C, $\ce{Mg2C3}$ decomposes: $$\ce{Mg2C3 -> 2Mg + C}$$ Both types of magnesium carbide can be hydrolysed: $$\ce{MgC2 + 2H2O -> Mg(OH)2 + C2H2}$$ $$\ce{Mg2C3 + 4H2O -> 2Mg(OH)2 + C3H4}$$ For more information on the structure of magnesium carbide, see this old paper from 1943. Also, how magnesium carbide behaves at high pressure is discussed in this new paper(2015). Another type of magnesium carbide, $\ce{Mg2C}$ exist at high pressure and it along with $\ce{MgC2}$ behaves as semiconductor while $\ce{Mg2C3}$ behave as insulator-metal transition. (OP is requested to see both papers if interested)
{ "domain": "chemistry.stackexchange", "id": 9751, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "metal, organometallic-compounds", "url": null }
electrostatics, electric-fields, capacitance, dielectric Also when you are trying to find the electric field due to the induced charge it won't matter what dielectric is present inside (except in determining the final electric field which will be $\frac{E_0}{k}$). The usual Gauss' law and Coulomb's law can be used without any kind of correction. When we do make corrections to these laws in the presence of a dielectric it is because we want the electric field by just knowing the free charge and we don't want to consider the induced charge in our calculation. This is also what I meant by overcompensating. When you divide by $epsilon$, you are automatically considering the extra field that will be produced by the charge induced by to the electric field we are applying. But here it is the induced charge whose field you are calculating. This induced charge's field won't induce any other charge. If this doesn't clear your doubt, please make another comment. Edit 2:
{ "domain": "physics.stackexchange", "id": 75116, "lm_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, capacitance, dielectric", "url": null }
thermodynamics, temperature, entropy Title: Why does the second law of thermodynamics prevent 100% efficiency? So far in my thermodynamics lecture course, my understanding of the laws of thermodynamics is that the first law is about the conservation of energy, the second law says entropy must always increase or stay the same which apparently results in the fact you can never achieve 100% efficiency of heat engines, unless at $T = 0\,\mathrm K$, and the last law says that you can't get to $T= 0\,\mathrm K$. I have never explicitly seen why the fact that entropy must always increase or stay the same results in the prevention of achieving 100% efficiency. The only proof I have is showing the Carnot cycle is the most efficient and that is only 100% efficient if the cold reservoir is at absolute zero, which it can not be at.
{ "domain": "physics.stackexchange", "id": 63838, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, temperature, entropy", "url": null }
c++, monads This function seems superfluous, from an API point of view. auto v = composite_expected<T, E1 /*, E2,... */>(/* args */); is shorter, and more intuitive than auto v = composite_expected<T, E1 /*, E2,... */>::fromVal(/* args */);. The problem is, of course, they don’t do the same thing… but we’ll get to that next. template <typename ...Args> explicit composite_expected( Args&& ...args ): variant_( std::forward<Args>( args )... ) {} template <typename TFwd> requires std::convertible_to<std::remove_cvref_t<TFwd>, T> composite_expected( TFwd&& val ): variant_( std::in_place_index<0>, std::forward<TFwd>( val ) ) {}
{ "domain": "codereview.stackexchange", "id": 43610, "lm_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++, monads", "url": null }
cosmology, general-relativity Not at all. It wouldn't even make any sense: if you have an object like an atom or a star in gravitational freefall, by the equivalence principle only tidal forces across it are relevant. The tidal forces stretch the object until the internal forces balance them. But for a Λ-driven accelerated expansion, dark energy contribution to tidal forces is constant. Hence, an object already in equilibrium has no reason to further change its size, no matter how long the cosmic acceleration occurs. This also applies to galaxies, only that the internal forces are also gravitational and balance the dark energy contribution.
{ "domain": "astronomy.stackexchange", "id": 594, "lm_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, general-relativity", "url": null }
• Well-explained!! Best! Oct 2 '17 at 20:53 The difference between supremum and maximum is that for bounded, infinite sets, the maximum may not exist, but the supremum always does. Consider the set $$(0,1)$$. Does this set contain a largest element? The answer is no because for any $$x \in (0,1)$$, $$\tfrac{x+1}{2}$$ is also in $$(0,1)$$ and $$x < \tfrac{x+1}{2}$$. That is, for any $$x \in (0,1)$$, we can find an element in $$(0,1)$$ which is larger than $$x$$. Thus there is no maximal element of $$(0,1)$$. By contrast, the supremum is the least upper bound for the set. The supremum does not need to be in the set. For $$(0,1)$$, the supremum is 1. This means that $$1$$ is an upper bound for $$(0,1)$$ [which is obvious] and that no number smaller than $$1$$ is an upper bound for $$(0,1)$$ [which follows from the above reasoning]. Whenever the maximum exists, it is equal to the supremum. Conversely, if the supremum lies in the set, then the maximum exists and is equal to this supremum.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668706602658, "lm_q1q2_score": 0.8764856049205918, "lm_q2_score": 0.893309416705815, "openwebmath_perplexity": 144.64653524328335, "openwebmath_score": 0.9378753304481506, "tags": null, "url": "https://math.stackexchange.com/questions/1719659/what-is-the-difference-between-a-supremum-and-maximum-and-also-between-the-infi/1719681" }
beginner, python-3.x, hangman mws = '' ow = '' for index_same in same_char: for index_dif in blank_stripped: if other_word[index_dif] == other_word[index_same]: return False else: mws += my_word_stripped[index_same] ow += other_word[index_same] if mws == ow: return True else: return False def show_possible_matches(my_word): ''' my_word: string with _ characters, current guess of secret word returns: nothing, but should print out every word in wordlist that matches my_word Keep in mind that in hangman when a letter is guessed, all the positions at which that letter occurs in the secret word are revealed. Therefore, the hidden letter(_ ) cannot be one of the letters in the word that has already been revealed.
{ "domain": "codereview.stackexchange", "id": 40681, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, python-3.x, hangman", "url": null }
algorithm, c, pointers, binary-search return x; } Variable names The name x is a very bad name in this case. You should change it to found or something. Even better instead of x = true; break; just do: return true; and change the last: return x; to return true;. It is always good to eliminate variables if you can. Don't modify parameters/arguments It is confusing when you change the value of the input parameters for example with n = n/2;. This makes the code hard to follow. Instead choose mid as mid = min + (max - min + 1)/2. This makes your intent much clearer. Avoid while(true) when possible Some times it is impossible to avoid an infinite loop such as while(true) this is not the case. You should avoid formulating infinite loops like this because it makes it harder to analyze the termination condition of the loop to verify that it will terminate. while(true) should be: while(max - min > 0 )
{ "domain": "codereview.stackexchange", "id": 21369, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm, c, pointers, binary-search", "url": null }
ngs, fastq, trimming, cutadapt R2: @read4 CTACTAGACATATACCCTGGGGGGGGTTCCCCGTGAAGACGGTTACGATGTGGACAAGCACTCCAGCG + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF I can now give a minimum length that applies to both in each pair: cutadapt -A GGGGGGGG --interleaved example.R{1,2}.fastq | \ cutadapt -a "^AAAAAAAA...TTTTTTTT" --interleaved --discard-untrimmed --minimum-length 30 -o out.R1.fastq -p out.R2.fastq - With that I get read1 and read3 in the output, as intended.
{ "domain": "bioinformatics.stackexchange", "id": 1978, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ngs, fastq, trimming, cutadapt", "url": null }
computer-architecture Q1: So for the same processor we can have two different Assembly Code which when assembled using the right assembler can produce the same Machince Code? Q2: So let's say I have a PC running another family of processor (ARM) and write an Assembly Code and assemble it by MASM which produces machine code compatible for the 80386 processor. Now, without executing, it I copy the machine code over to another PC with the 80386 processor, would the code run Okay?
{ "domain": "cs.stackexchange", "id": 12314, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computer-architecture", "url": null }
homework-and-exercises, integration, dimensional-analysis Title: What does this equation mean? So I have just entered 11th grade and started limits on my own but my Physics textbook has an equation which I don't understand, I suspect it uses integration which I haven't learned yet. So can someone explain this equation to me:- The question is:- Find the value of $n$ (by using dimensional analysis): $$\int \frac{dx}{\sqrt{2ax-x^2}} = a^n \sin^{-1} [\frac{x}{a} -1] $$ The equation looks similar to $$ v^2-u^2 = 2ax $$ But I don't understand what $dx$ means. Clearly $a$ has the same dimension of $x$ (see the argument of root or of $\sin^{-1}$) so the left member is dimensionless (ratio between dimension of x: remember that differential dx count in dimensional calculus!), and the second member too has to be dimensionless: so n=0.
{ "domain": "physics.stackexchange", "id": 22220, "lm_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, integration, dimensional-analysis", "url": null }
orbital-motion, rocket-science, space-travel, propulsion Unfortunately, current SSTO designs have very low payload fraction. They would be a lot of fuel tank and a little useful payload, so much so that those designs just aren't used. The bottom line is, to do what you want we'd need an engineering breakthrough. Not a physics breakthrough -- a spacecraft propulsion system like the one you're talking about wouldn't violate physical laws as we know them. But we've got no idea how to build a highly efficient rocket (high ISP -- http://en.wikipedia.org/wiki/Specific_impulse -- how much thrust you can get out of a bit of fuel ) that is also a high-thrust rocket. We have designs for rockets with far higher ISP than the shuttle's main engines, but the the rocket would be too heavy to lift itself off the ground. It would just sit on the ground, firing away, wasting fuel. Although it'd be wasting fuel very efficiently.
{ "domain": "physics.stackexchange", "id": 96826, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "orbital-motion, rocket-science, space-travel, propulsion", "url": null }
discuss the relation between these special eigen-functions and the usual hydrodynamic modes in the limit of. Non-local, Eigenvalues, Eigenfunctions, Oscillation Theorem 11 AMS subject classifications. If I write d/dx and ask you what is this?. Proof: Suppose D is an eigenfunction of A, so. (8), leads to the relation αψb¼ Aψb: The values of α where this relation holds are called alpha eigenvalues and bψ are the alpha eigenfunctions. The Fourier Series 2. Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. Note that there is nothing in the above de nition that requires A^ to a matrix|the only requirement is that it is alinear operator. Reasoning: We are given enough information to construct the matrix of the Hermitian operator H in some basis. The eigenvalue has to change accordingly as well. In a concept borrowed from matrix algebra, in which the theory of quantum mechanics was first formulated, an operator can have
{ "domain": "campercom.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9893474866475719, "lm_q1q2_score": 0.8018452803317649, "lm_q2_score": 0.8104789178257654, "openwebmath_perplexity": 549.7118623112633, "openwebmath_score": 0.8859313726425171, "tags": null, "url": "http://campercom.it/inzt/eigenvalues-and-eigenfunctions-of-operators.html" }
@NAME=ECG2 Required fields are marked *, Everything you need to perform real statistical analysis using Excel .. … … .. © Real Statistics 2020, The results are shown in Figure 2. Hello Rami, Thanks again for your suggestion. It was a relatively arbitrary limit. I think that 5 referred to a previous version of the example. Charles. N-tert-Butylbenzenesulfinimidoyl chloride can be synthesized quickly and in near-quantitative yield by reacting phenyl thioacetate with N-tert-butyl-N,N-dichloroamine in benzene. 1.0,0.5189630085503281,-0.34896021596534504,-0.8000624914835336,-0.5043545150938301,0.16813498364430499,0.5761216033068776,0.41692503347430215,-0.06371622277688614,-0.38966662981297634,-0.3246273969517782,-0.031970253360281406,0.16771278110458265,0.13993946271399282,0.012475144157765343,-0.036914291507522644. Download the dataset.Download the dataset and place it in your current working directory with the filename “daily-minimum-temperatures.csv‘”.The example below will lo… Charles,
{ "domain": "com.au", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9702399051935107, "lm_q1q2_score": 0.8246759528872222, "lm_q2_score": 0.8499711756575749, "openwebmath_perplexity": 1312.901651925368, "openwebmath_score": 0.7738346457481384, "tags": null, "url": "http://indigocomputers.com.au/calories-in-onn/9e797b-how-to-calculate-autocorrelation" }
c++, embedded inline void DisableGPIO(const enum GPIO::gpio_selection selection) { this->AHB1ENR.reg &= ~(1 << selection); } /** * @brief Calculate system clock frequency through PLL register values * * @param hs_crystal_freq HS clock signal frequency in Hz * @param pll_m M divisor * @param pll_n N mulitplier * @param pll_p P divisor in register form * @return constexpr int System clock frequency */ static constexpr int CalculateSysClock(uint32_t hs_crystal_freq, uint32_t pll_m, uint32_t pll_n, uint32_t pll_p) { return ((hs_crystal_freq / pll_m) * pll_n) / ((pll_p * 2) + 2); }
{ "domain": "codereview.stackexchange", "id": 43623, "lm_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++, embedded", "url": null }
ros, differential-drive, ros-control How to control your hardware As I said in the comment this is not a ROS specific problem. You better write a driver that talks to your hardware first and then later convert it into a ROS node. How to use diff drive controller. Diff drive controller and ros control are not packages I would give to a ros beginner to setup. While they are probably the right software to solve your problem they won't help you in understanding basic ros concepts. Thats what the tutorials are there for. Next I suggest to do the navigation tutorials on a simulated robot. Just to understand how the navigation stack works and what these odom/cmd_vel messages are. Finally for ros control see this roscon 2014 video. Originally posted by Humpelstilzchen with karma: 1504 on 2017-06-26 This answer was ACCEPTED on the original site Post score: 3 Original comments Comment by kiranmayee on 2017-06-26: Thank you. Will check out the navigation tutorials and get back.
{ "domain": "robotics.stackexchange", "id": 28186, "lm_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, differential-drive, ros-control", "url": null }
quantum-field-theory, resource-recommendations, quantum-electrodynamics Title: Coverage of Quantum Electrodynamics (QED) in introductory Quantum Field Theory (QFT) books Which QFT books also cover QED? I am not very familiar with QED, so I am looking for QFT books which cover QED too (I know they cover Quantum Chromodynamics (QCD).). Yes, it usually is. I would not say that introductory courses teach you much about QCD, rather they start with scalar fields and QED. As the bosonic part of QED is based on a simpler gauge theory than the Yang-Mills theory for QCD, you actually want to learn QED first. (There is only the one-dimensional Lie-Group U(1) <=> one photon, SU(3) <=> 8 gluons)
{ "domain": "physics.stackexchange", "id": 4977, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, resource-recommendations, quantum-electrodynamics", "url": null }
$E(|x-y|)=2\int_{x=0}^1 \int_{y=0}^x (x-y) \;dydx=1/3$ (the 2 is needed to normalise the probability over the lower half unit square) CB
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9871787868650145, "lm_q1q2_score": 0.8047802198514532, "lm_q2_score": 0.815232489352, "openwebmath_perplexity": 354.43839645919394, "openwebmath_score": 0.8809120655059814, "tags": null, "url": "http://mathhelpforum.com/calculus/138235-average-distance-between-2-random-points-print.html" }
would have thought stress matrix and the moment inertia. In 2n mn •numbers q. are called elements of equations using row reduction methods their clever use cookies. Matrix in engineering a focus on computer graphics solve a 3 x linear... Simple presentation explaining matrices and its application in solving linear equations presentation | free download!
{ "domain": "bringingeuropecloser.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575188391107, "lm_q1q2_score": 0.8078481206639933, "lm_q2_score": 0.8221891392358015, "openwebmath_perplexity": 1605.0470169039208, "openwebmath_score": 0.2001257985830307, "tags": null, "url": "https://bringingeuropecloser.com/two-graves-jers/3a774d-applications-of-matrices-in-computer-science-engineering-ppt" }
But this is a special case of something you need to know for all functions. In general, for ANY function f, if you don't take the reflection into account, f(-x + 1) is translated "the wrong way." The symmetry of the absolute value hides the reflection, which means you don't see what's really happening. So let's focus on the general case. The rest is a recap of the general principles I discussed last time, with a little more going on than in any example there: I like to think of these transformations step by step. And when we are working with the horizontal transformations (translate and stretch horizontally, and reflect over the y-axis), we have to be careful about order, which, like everything else, works backwards. You have to think of each transformation as REPLACING the variable with an expression: f(x) original graph f(x + 1) translated left 1 f(-x + 1) reflected over y-axis, which moves it from left to RIGHT!
{ "domain": "themathdoctors.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9934102273614378, "lm_q1q2_score": 0.8003232513895994, "lm_q2_score": 0.8056321843145404, "openwebmath_perplexity": 591.5794150520877, "openwebmath_score": 0.7341336607933044, "tags": null, "url": "https://www.themathdoctors.org/equivocal-function-transformations/" }
A. 5 B. 6 C. 8 D. 10 E. 12 Got stuck in the quadratic. However when i looked a little closely at the question I realized I could work by employing logic. Since the combined rate of work is 25 pages in 3 hours it implies their combined rate is just marginally greater than 8 pages per hour. The question requires us to determine how long Jack takes working alone to type 40 pages. Now since their combined rate is 8 pages an hour working together they would finish 40 pages in about 5 hours. We also know that Jack's rate is slower than Tom's. So if Jack works alone he must take more than double the time it would have taken had they worked together. i.e little more than 10. Only E suffices. P.S. Could anyone let me know if we should follow this approach of using Logic to arrive at the answer if the Work Rate problems become convoluted??(Like involving massive quadratics)
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9372107843878721, "lm_q1q2_score": 0.8056861328707315, "lm_q2_score": 0.8596637451167997, "openwebmath_perplexity": 2007.8409105402648, "openwebmath_score": 0.756268322467804, "tags": null, "url": "https://gmatclub.com/forum/it-takes-jack-2-more-hours-than-tom-to-type-20-pages-if-102407.html" }
### 1 comment @Murali Completely satisfied by ur approach. Nice explanation thank you. ! Simple Uniform hashing function is a hypothetical hashing function that evenly distributes items into the slots of a hash table. Moreover, each item to be hashed has an equal probability of being placed into a slot, regardless of the other elements already placed. (Source: https://en.wikipedia.org/wiki/SUHA_%28computer_science%29). Probability that the first 3 slots are unfilled after the first 3 insertions = (probability that first item doesn't go in any of the first 3 slots)* (probability that second item doesn't go in any of the first 3 slots)* (probability that third item doesn't go in any of the first 3 slots) = (97/100) * (97/100) * (97/100)
{ "domain": "gateoverflow.in", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9871787827157819, "lm_q1q2_score": 0.8289675560117749, "lm_q2_score": 0.8397339676722393, "openwebmath_perplexity": 1337.8036816771669, "openwebmath_score": 0.4997424781322479, "tags": null, "url": "https://gateoverflow.in/2074/gate-cse-2014-set-3-question-40" }
# Extension of Inverse Function Theorem from $\mathbb{R}$ to $\mathbb{R^n}$ Consider the Inverse Function Theorem in $$\mathbb{R}$$: Let $$O ∈\mathbb{R}$$ be open for $$f:O → \mathbb{R}$$. If $$f$$ is continuously differentiable, and for a $$x_0 ∈O$$, $$f'\left(x_0\right) \ne 0$$. Then there exist an open interval $$\boldsymbol{I}$$ about $$x_0$$ and open interval $$\boldsymbol{J}$$ about the image of $$f\left(x_0\right)$$ such that $$f: \boldsymbol{I} → \boldsymbol{J}$$ is one to one and onto. Futhermore, $$f^{-1}: \boldsymbol{J} → \boldsymbol{I}$$ is continuously differentiable, and if $$y ∈\boldsymbol{J}$$, $$x ∈\boldsymbol{I}$$ such that $$f\left(x\right) = y$$, then $$\begin{split} (f^{-1})'(y) = \frac{1}{f'(x)} \end{split}$$ Compared with the Inverse Function Theorem in $$\mathbb{R^n}$$:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9648551495568569, "lm_q1q2_score": 0.808181931082713, "lm_q2_score": 0.8376199592797929, "openwebmath_perplexity": 71.19414627766639, "openwebmath_score": 0.9127711653709412, "tags": null, "url": "https://math.stackexchange.com/questions/2054912/extension-of-inverse-function-theorem-from-mathbbr-to-mathbbrn" }
java, database Title: Basic Java database I just wrote my first Java database program for the purpose of getting feedback on the implementation and coding. It has 1 table and 2 buttons and prompts the user to select a folder, lists the contents of the folder in the table and lists the hash of the files in the table and writes it to a database. It works fine, but I have no idea if I coded it cleanly and split the program into the proper packages and classes. It's definitely a beginner level project so there is nothing too complex about it. I'm also using the h2 database because I was told its the most efficient for small databases. Could you all please give me feedback on this? I used NetBeans 7.3 and uploaded the full project here. This is the class I'm using for the database. It contains most of the code I have in question, but there are other parts of the project as a whole I'm concerned if they were organized correctly: public class CDatabaseLayer {
{ "domain": "codereview.stackexchange", "id": 3786, "lm_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, database", "url": null }
- Let's reduce problem 1 to see where you are going wrong. Let's say that there are 7 fishes, 4 trout and 3 carp, and you want to count how many ways there are of catching 2 fishes, at least one of them a carp. You can catch two carp in $\binom{3}{2}=3$ ways; you can catch a carp and a trout in $\binom{4}{1}\binom{3}{1}=12$ ways; that's a total of $15$ ways.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846640860382, "lm_q1q2_score": 0.8044172426750339, "lm_q2_score": 0.8221891370573386, "openwebmath_perplexity": 622.0141665637818, "openwebmath_score": 0.8796431422233582, "tags": null, "url": "http://math.stackexchange.com/questions/67357/where-am-i-doing-it-wrong-trying-to-develop-intuition-for-probability?answertab=active" }
Note: Accept gender is independent of holiday destination, accept “not associated”, do not accept “not correlated”. a. $$(2 – 1)(5-1)$$     (M1) Note: Award (M1) for correct substitution in the correct formula. $$= 4$$     (A1)     (C2) b. 9.488     (A1)(ft)     (C1) Notes: Follow through from their answer to part (b). Accept 9.49. c. Accept the null hypothesis or Accept H0.     (A1)(ft) Note: Accept gender is independent of holiday destination. $$\chi_{({\text{calc}})}^2 < \chi_{({\text{crit}})}^2$$ or 8.73 < 9.488     (R1)     (C2) Notes: Do not award (A1)(R0). Follow through from their answer in part (c). d. ## Question $$180$$ spectators at a swimming championship were asked which, of four swimming styles, was the one they preferred to watch. The results of their responses are shown in the table. A $${\chi ^2}$$ test was conducted at the $$5\%$$ significance level. Write down the null hypothesis for this test.[1] a.
{ "domain": "iitianacademy.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668701095653, "lm_q1q2_score": 0.8021769877077851, "lm_q2_score": 0.8175744739711883, "openwebmath_perplexity": 7075.911428106488, "openwebmath_score": 0.5281357765197754, "tags": null, "url": "https://www.iitianacademy.com/ibdp-maths-ai-topic-sl-4-11-formulation-of-null-and-alternative-hypotheses-ib-style-questions-sl-paper-1/" }
No Repetition Allowed: For example, the first three people in a race. Later, we will dene binomial coecients, which are written n r, and show that n r = C(n,r). #### combination discrete math ##### この記者が最近書いた記事 ※アジア太平洋大家の会無料メルマガをお送りします。
{ "domain": "asia-pacific.tv", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105273220726, "lm_q1q2_score": 0.8071274359491588, "lm_q2_score": 0.8267118026095991, "openwebmath_perplexity": 716.1330881065412, "openwebmath_score": 0.6230892539024353, "tags": null, "url": "http://new.asia-pacific.tv/rpa/11315481aca6dfb353c0501aec280124-combination-discrete-math" }
c#, game, mvc, winforms, chess public static bool RequiresPromotion(Board board, Coords pieceCoords) { bool requiresPromotion = false; Piece p = board.GetPieceAt(pieceCoords); if (p.GetType() == typeof(Pawn)) { if (pieceCoords.Y == 0 || pieceCoords.Y == board.RowCount - 1) { requiresPromotion = true; } } return requiresPromotion; } private static bool IsInCheckmate(Board board, Player currentPlayer) { if (!IsInCheck(board, currentPlayer)) { return false; } return !CheckIfThereAreRemainingLegalMoves(board, currentPlayer); }
{ "domain": "codereview.stackexchange", "id": 44851, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, game, mvc, winforms, chess", "url": null }
python, image, serialization Title: Writing data into an image I've done a script that will write things as images, which can then be read elsewhere (eg. you could share an mp3 through imgur). This is the first one I've done where I've been trying to improve my writing style and make stuff run as efficient as possible, so if there is anything you see here that I can improve it'd be really helpful to know. For the record, this is an old version, but after this part it got a lot more complicated. I kept the same writing style anyway, so this is a lot easier to understand. This version will make a grey noisy image, but I added some code to use custom images after (which is where it got more complicated). from PIL import Image import cPickle, base64 class ImageStore: def __init__( self, imageName="ImageDataStore" ): self.imageDataPadding = [116, 64, 84, 123, 93, 73, 106] self.imageName = imageName
{ "domain": "codereview.stackexchange", "id": 14383, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, image, serialization", "url": null }
particle-physics, standard-model, elementary-particles Anyhow, let's get back to the "some limits" I mentioned about. Even with the gauge symmetries there are other ways the number of particles can increase. For example the particles seem to come in three families, where each family contains two quarks and two leptons. But the gauge symmetries do not place an upper limit on the number of families and hence there could be infinite families and therefore infinite numbers of particles. We have experimental evidence that there are only three families, giving the six quarks and six leptons in the Standard model, but we don't know of any fundamental law that says why this is so.
{ "domain": "physics.stackexchange", "id": 77520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, standard-model, elementary-particles", "url": null }
performance, sql, time-limit-exceeded, sql-server, stackexchange You can look at the script in the data explorer here. The problem is that the script times out(in around 100 seconds). If I remove the OR post.ParentId=tag.PostId, it still takes around 25 seconds to run (for Stack Overflow) but it does not time out. If I run my script on Super User, it does not time out. (It runs around 4 seconds, I think it is because Super User is smaller than Stack Overflow) Is there a way to run optimize the script so that it does not time out on Stack Overflow without losing functionality and why does that simple OR decrease the performance that much? The OR is that answers do also count for the average score. I've added the execution plan files here. Oh well, I didnt notice the sql-server tag... What a detailed execution plan they have :) But anyway the answer may be as simple as that there is more answers than there are questions.
{ "domain": "codereview.stackexchange", "id": 37607, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, sql, time-limit-exceeded, sql-server, stackexchange", "url": null }
c#, beginner, .net, authentication, interface if (authService.ResetUserPassword(userName, model.Password) != null) { // TODO: do something to indicate password reset success. // either log the user in directly from here or // redirect them to log in with new password. } return View(model); }
{ "domain": "codereview.stackexchange", "id": 8372, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, .net, authentication, interface", "url": null }
the-sun, earth, rotation Here are several proofs; some of them are historically relevant also. Kepler's laws of planetary motion This became one of the earliest proofs, as soon as Newton figured out the law of universal gravitation, and the "fluxions" (what we would call today differential equations). When you assume a heliocentric model, and the inverse square law for gravity, then Kepler's laws in a heliocentric model come out of the equations naturally, as soon as you do the math. This is like saying: "if it's heliocentric, and knowing that the law of gravity is correct, then Kepler's laws should be such-and-such". And then: "oh, but the theoretical calculations for Kepler's laws match the actual observations with great precision. Therefore, our hypothesis (heliocentric, inverse square law) must be correct."
{ "domain": "astronomy.stackexchange", "id": 761, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "the-sun, earth, rotation", "url": null }
ros, planning-environment Title: Undocumented planning_environment parameters The PR2's environment server launch file sets some parameters that are undocumented in the planning_environment package wiki page, in particular: object_padd pointcloud_padd joint_state_cache_allowed_difference Of these, the first two appear in the API docs of the package. My intention is to edit the wiki and document them. My question is mostly concerned with the third (undocumented?) parameter. Does it refer to the maximum allowed (past/future) extrapolation time when querying the joint states cache?. Originally posted by Adolfo Rodriguez T on ROS Answers with karma: 3907 on 2011-06-09 Post score: 0
{ "domain": "robotics.stackexchange", "id": 5797, "lm_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, planning-environment", "url": null }
Now, $L(G)$ is naturally a Lie algebra with the bracket operation $[D,D'] = D \circ D' - D' \circ D$. Using the $k$-vector space isomorphism $L(G) \rightarrow \textrm{Der}_k(A,k)$, we transfer the bracket operation to $\textrm{Der}_k(A,k)$ to give $\textrm{Der}_k(A,k)$ the structure of a Lie algebra. The vector space $\textrm{Der}_k(A,k)$, considered as a Lie algebra, is called the Lie algebra of $G$ and is often denoted $\mathfrak g$. Now you identify the Lie algebra of $G$ with $M_n(k)$, and you want to describe the bracket operation on $M_n(k)$ explicitly. So you need to transfer the bracket operation on $L(G)$ using the isomorphisms $$M_n(k) \rightarrow \textrm{Der}_k(R,k) \rightarrow \textrm{Der}_k(A,k) \rightarrow L(G)$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676466573412, "lm_q1q2_score": 0.8032229684373849, "lm_q2_score": 0.8198933293122506, "openwebmath_perplexity": 87.0806688083148, "openwebmath_score": 0.989150881767273, "tags": null, "url": "https://math.stackexchange.com/questions/1884253/computing-the-lie-bracket-on-the-lie-group-gln-mathbbr/1893798" }
python, python-3.x, game, comparative-review, tkinter main_quesion = Label( current_frame, text="Use the entry boxes on the right to correctly order the conversation", font=STANDARD_CONFIGS["font"]["secondaryhedding"], wraplength=500) main_quesion.grid(columnspan=4, row=0) check_answer_button = Button( current_frame, text="Check Answer", font=STANDARD_CONFIGS["font"]["bodytext"], command=lambda: check_multiple_entry_boxes( list_of_entry_boxes, paired, current_frame, no_of_statements)) check_answer_button.grid(column=0, columnspan=4, row=8) if questiontype == "wordbank": current_frame.grid_rowconfigure(1, weight=1) current_frame.grid_rowconfigure(2, weight=1)
{ "domain": "codereview.stackexchange", "id": 35804, "lm_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, game, comparative-review, tkinter", "url": null }
c#, performance, programming-challenge, primes, factors array[i] == count_of_factors(i) Start at 2. array[2] == 0, so therefore 2 is prime. Now we can add 1 to {array[4], array[6], array[8] ... array[999998]}, because they are factors of 2. Move to 3. array[3] == 0, so add 1 to {array[6], array[9], array[12] ... array[999999]} Move to 4. array[4] == 1. (We've already incremented it) Because it is not 0, we know it is not a prime number, so we ignore it. Move to 5. array[5] == 0, so add 1 to {array[10], array[15], array[20], array[25]...array[999995]
{ "domain": "codereview.stackexchange", "id": 23945, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, programming-challenge, primes, factors", "url": null }
php, beginner, strings, php5 Then use it to build an associative array mapping words to their counts: $content = file_get_contents($argv[1]); $words = explode(' ', $content); $word_counts = array_combine( $words, array_map('most_repeated_count', $words) ); And finally, sort that array: arsort($word_counts); $max = key($word_counts); All together, now!
{ "domain": "codereview.stackexchange", "id": 20778, "lm_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, beginner, strings, php5", "url": null }
p-vs-np NB: The choice of basic functions and operations in Cobham’s characterization is perfectly analogous to the definition of primitive recursive functions. The latter are based on the characterization of natural numbers (considered as written in unary) as the initial algebra with a constant $0$ and the successor function $s(x)$. Here, $\{0,1\}^*$ is treated as the initial algebra with a constant $\epsilon$ and two successor functions $s_0(x)$ and $s_1(x)$. To that end, we have $\epsilon$, $s_0$, and $s_1$ as basic functions, and we have the corresponding recursion schema (recursion on notation). Moreover, we have the usual universal algebra facilities (projections, composition) to construct functions by terms.
{ "domain": "cstheory.stackexchange", "id": 5648, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "p-vs-np", "url": null }
ros, kinect, roshydro, freenect Original comments Comment by blackmamba591 on 2015-09-22: Will openni_launch, support kinect xbox (model 1414) for ubuntu 14.04 lts, ros indigo? Good day everyone. I've been working so far with this problem and I've got a answer. Maybe it's not the most convenient one, but I got results. So far, everything I've been reading says only Kinect, never specifing which type of Kinect. In my lab we had the previously described one. Today, I went to a friends house and borrowed his Kinect for Xbox 360 (model 1414). I tried all the previous instructions, and checked as instructed by expelliarmus the OpenNi_launch page. Finally, Kinect is working with Linux, is being recognized and I can start testing ASAP. Summarizing, use a Kinect for Xbox 360. However, take into consideration that this version does not include a USB, so you need to use an adapter which supplies power to the Kinect and also enables the USB (e.g. The one supplied with Kinect for Windows, which I'm using ATM)
{ "domain": "robotics.stackexchange", "id": 17042, "lm_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, kinect, roshydro, freenect", "url": null }
c#, api public async Task<Movie> GetMovie(int movieId) { return (await new GetRequest<Movie>().ExecuteRequestAsync(GetUrl("movie/" + movieId))).Data; } public async Task<IEnumerable<Keyword>> GetKeywords(int movieId) { return (await new GetRequest<GetKeywordsJsonModel>().ExecuteRequestAsync(GetUrl("movie/" + movieId + "/keywords"))).Data.Keywords; } } } Request baseclass namespace TMDbWrapper.Requests { public abstract class AbstractRequest<TResponse> where TResponse : class { public async Task<Response<TResponse>> ExecuteRequestAsync(string url, AuthenticationHeaderValue authHeader = null, HttpContent httpContent = null) { return await InternalExecuteRequestAsync(url, authHeader, httpContent); }
{ "domain": "codereview.stackexchange", "id": 12060, "lm_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#, api", "url": null }
orbit, solar-system, orbital-mechanics, eccentric-orbit Given $P \text{ and } A: b = \sqrt{A \cdot P}$ Given $P \text{ and } e: b = \sqrt{-\dfrac{P(1+e)}{e-1} \cdot P}$ Given $A \text{ and } e: b = \sqrt{-\dfrac{A(1-e)}{e+1} \cdot A}$ I hope this helps.
{ "domain": "astronomy.stackexchange", "id": 5377, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "orbit, solar-system, orbital-mechanics, eccentric-orbit", "url": null }
magnetic-monopoles, time-reversal-symmetry Remark: In the text above, $\vec{B}$ was assumed to flip sign under time reversal. This can e.g. be derived from Faraday's law of induction (and exploiting the fact that $\vec{E}$ is even under time reversal). Intuitively, this can also be understood with currents generating magnetic fields where the currents (of electric charges) would flip their direction under time reversal (like a velocity) and the moving electric charges don't flip sign. Decomposing a general magnetic field into a 'current' and 'monopole' component: $$ \vec{B}_\mathrm{tot} = \vec{B}_\mathrm{currents} + \vec{B}_\mathrm{monopoles} $$ one would also conclude that in order to keep invariance under time reversal, both parts on the right side must transform the same way, i.e. the monopole field must flip its sign. A monopole field however looks as follows: $$ \vec{B}(\vec{x})_\mathrm{monopole} = K \cdot q_{\mathrm m} \cdot \dfrac{\vec{x}}{|\vec{x}|} \cdot \dfrac{1}{|\vec{x}|^2} $$
{ "domain": "physics.stackexchange", "id": 17703, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetic-monopoles, time-reversal-symmetry", "url": null }
$r^2 \cdot S = g\cdot r^2 + g\cdot r^3 + ...$ (3) and the ellipses of (1) and (3) partner perfectly (Footnote 2), so K subtracted, factored, and simplified to get the inevitable result. $(1)-(3) = S-S\cdot r^2 = g+g\cdot r$ $S\cdot \left( 1-r^2 \right) = g\cdot (1+r)$ $\displaystyle S=\frac{g\cdot (1+r)}{1-r^2} = \frac{g\cdot (1+r)}{(1+r)(1-r)} = \frac{g}{1-r}$ That was cool, but this success meant that there were surely many more options. EXTENDING Why stop at multiplying by r or $r^2$?  Why not multiply both sides of (1) by a generic $r^N$ for any natural number N?   That would give $r^N \cdot S = g\cdot r^N + g\cdot r^{N+1} + ...$ (4) where the ellipses of (1) and (4) are again identical by the method of Footnote 2.  Subtracting (4) from (1) gives $(1)-(4) = S-S\cdot r^N = g+g\cdot r + g\cdot r^2+...+ g\cdot r^{N-1}$ $S\cdot \left( 1-r^N \right) = g\cdot \left( 1+r+r^2+...+r^{N-1} \right)$  (5)
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9895109073481201, "lm_q1q2_score": 0.9111314217527848, "lm_q2_score": 0.9207896699134004, "openwebmath_perplexity": 735.0744202821601, "openwebmath_score": 0.7715824246406555, "tags": null, "url": "https://casmusings.wordpress.com/tag/factoring/" }
singularities, elasticity, continuum-mechanics, greens-functions In one simple scenario, we smear the force evenly over the surface of a small sphere of radius $a$. If the force is sufficiently small, the displacement will also be small and will fall off as $c F/4 \pi r$ for $r>a$ and will be a constant $c F/4 \pi a$ for $r<a$. (The answer here should be familiar to those who have taken a first year electricity and magnetism course.)
{ "domain": "physics.stackexchange", "id": 25592, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "singularities, elasticity, continuum-mechanics, greens-functions", "url": null }
gravity, energy, visible-light, sun, stars The global effects, depend on the structure of a star and differ for one that is fully convective, or one like the Sun that has a radiative interior and a relatively thin convective envelope on top. The phenomenon could be treated in a similar way to the effects of large starspots. The canonical paper on this is by Spruit & Weiss (1986). They show that the effects have a short term character and then a long term nature. The division point is the thermal timescale of the convective envelope, which is of order $10^{5}$ years for the Sun. On short timescales the nuclear luminosity of the Sun is unchanged, the stellar structure remains the same as does the surface temperature. As only a fraction of the flux from the the Sun ultimately gets into space, the net luminosity at infinity will be decreased. However things change if you leave the Dyson sphere in place for longer.
{ "domain": "physics.stackexchange", "id": 69815, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity, energy, visible-light, sun, stars", "url": null }
php, pdo, form, sql-injection Title: POST security with PDO? So I have some code that works as PDO. But is it secure? I'm trying to prevent SQL injection. This is my first PDO script and was hoping to see if it was done correctly. Here it is. <?php echo 'Your query code has been submited'; $host = "localhost"; $pass = "root"; $user= "root"; $dbname = "users"; try{ $con = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass); } catch(PDOException $e){ echo $e->getMessage(); } $code = $_POST['email']; $DATA = $con->prepare("INSERT INTO users (code) VALUES (:code)"); $DATA->bindValue(':code', $code); $DATA->execute(); ?> It depends on what you're looking to be safe. If you're worried about the bobby tables case, you're fine. However, there are many risks that come with user input cases. For such a simple script, little can go wrong. However, below is only one concern that can happen (however it is probably you're most threatening): Cross-site Scripting (XSS)
{ "domain": "codereview.stackexchange", "id": 8142, "lm_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, pdo, form, sql-injection", "url": null }
c#, recursion, interview-questions, xml <subagent name="sub-agent bob"> <phone name="456-789-1230"></phone> </subagent> <subagent name="sub-agent billy"></subagent> </agent> <address name="address line"> <faxnumber name="1234567890"></faxnumber> </address> </office> <office name="office2"></office> <office name="office3"></office> </agency> </report>
{ "domain": "codereview.stackexchange", "id": 27829, "lm_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#, recursion, interview-questions, xml", "url": null }
ros, bagfile, ros-kinetic Originally posted by warriorUSP on ROS Answers with karma: 30 on 2019-12-26 Post score: 1 Look at those speeds. They're 10000 Hz. Which shows that they're not dynamic. They're being published in /tf_static topic. Well, they're not actually being published that fast. And They're being published only once in the beginning. That's why they're not appearing if you play the bag from middle. So there's no problem or bug. "It is expected that publishers on "/tf_static" publish using latched topics, the tf2_ros static_transform_publisher does this correctly." More info about this topic: http://wiki.ros.org/tf2/Migration#Addition_of_.2BAC8-tf_static_topic Originally posted by Orhan with karma: 856 on 2019-12-26 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 34198, "lm_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, bagfile, ros-kinetic", "url": null }
programming-challenge, go Output: $ go test readcsv_test.go readcsv.go -v === RUN TestReadProblems --- PASS: TestReadProblems (0.00s) PASS $ ADDENDUM Comment: Regarding the readcsv.go file, in the readProblems function why did you return problems[:len(problems):len(problems)] instead of problems? Also, when closing the file in the loadProblems function, does the defer wait until the loadProblems function has returned or until the main function is done? – Anthony Gedeon
{ "domain": "codereview.stackexchange", "id": 41285, "lm_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, go", "url": null }
error-analysis, differential-equations, statistics Of course, these methods have their drawbacks. What is the standard approach for this kind of question? p.s: I apologize in advance for not using proper statistical language. It's not entirely clear what your procedure actually is, but I'll write this answer assuming that it's something like the following (let's assume for simplicity of notation that there are three spatial variables $x,y,z$ and three parameters $a,b,c$): You have a system of differential equations: $$x'=f(x,y,z,a,b,c)$$ $$y'=g(x,y,z,a,b,c)$$ $$z'=h(x,y,z,a,b,c)$$ This system of differential equations has a solution: $$x=F(t,a,b,c)$$ $$y=G(t,a,b,c)$$ $$z=H(t,a,b,c)$$ which depends both on time and on the parameters $a,b,c$. You also have a numerical solver that can, for a particular value of $a,b,c$, generate $F,G,H$ from $f,g,h$.
{ "domain": "physics.stackexchange", "id": 70016, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-analysis, differential-equations, statistics", "url": null }
For the real numbers, the "usual metric" is d(x,y)= |x- y|. For the plane, $R^2$ it is $d((x_1,y_1), (x_2, y_2))= \sqrt{(x_2-x_1)^2+ (y_2- y_1)^2}$, the usual distance between two points calculation. A point x is said to be an "interior point" of set A if and only if there is some $\epsilon$ neighborhood of x that is a subset of A. A set is "open" if all of its points are interior points. A set is "closed" if its complement is open. Here is a slight variation on those definitions that I like. "Interior point" is defined as above. A point, x, is called an "exterior point" of set A if it is an interior point of the complement of A. A point, x, is called a "boundary point" of set A if it is neither an interior point nor an exterior point of A.
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9585377320263431, "lm_q1q2_score": 0.8128090919469432, "lm_q2_score": 0.8479677583778258, "openwebmath_perplexity": 203.69815922626256, "openwebmath_score": 0.7939183115959167, "tags": null, "url": "http://mathhelpforum.com/differential-geometry/106905-i-don-t-even-know-where-begin-stuff.html" }
machine-learning, deep-learning, classification, nlp True Negative (TN): Reality: an image does not contains cat. classifier predicts: no cat. False Positive (FP): Reality: an image does not contains cat. classifier predicts: cat. False Negative (FN): Reality: an image contains cat. classifier predicts: no cat. Can anyone gives a concrete example of TP、TN、FP、FN like above, in the context of natural language processing? Imagine a hot news classifier. True Positive (TP): Reality: a piece of hot news. classifier predicts: hot. True Negative (TN): Reality: not a piece of hot news. classifier predicts: not hot. False Positive (FP): Reality: not a piece of hot news. classifier predicts: hot. False Negative (FN): Reality: a piece of hot news. classifier predicts: not hot.
{ "domain": "datascience.stackexchange", "id": 5673, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, deep-learning, classification, nlp", "url": null }
particle-physics, photons, standard-model, electroweak, isospin-symmetry The e.m. current coupling to the photon in the lagrangian in terms of the lightest quarks is $$eA_μ(2/3\bar{u}γ^μu−1/3\bar{d}γ^μ d)=eA_\mu \bar{q}(\tfrac{1}{6} \mathbb {1}+I_3)\gamma^\mu q,$$ since diag(2/3,-1/3)=diag(1/6,1/6) + diag( 1/2,-1/2). Each quark couples to the photon through its (different) charge. So the photon couples to both isoscalars (I=0) and isovectors (I=1), and electromagnetism violates strong isospin. However, if you imagine this coupling term to preserve strong isospin, then you must represent the photon as a linear combination of (strong) isoscalar and isovector. As a consequence, if you had to preserve strong isospin, as a way to track its violation, both vertices $\eta \gamma \gamma$ and $\pi^0 \gamma \gamma$ are allowed (they both have isospin zero) in this accounting, and, indeed, both particles decay to two γs as specified by the vertices. Considerations of weak isospin, spontaneously broken anyway, are irrelevant in these decays.
{ "domain": "physics.stackexchange", "id": 45764, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, photons, standard-model, electroweak, isospin-symmetry", "url": null }
javascript, programming-challenge, functional-programming Title: Sum of Even Fibonacci numbers in functional programming I want to solve this problem in functional programming (fp) way only. Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
{ "domain": "codereview.stackexchange", "id": 28730, "lm_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, programming-challenge, functional-programming", "url": null }
array, go return } Note that we now import the reflect package. We also changed the types of val and array to interface{} so that we may pass any type in. We then use the reflect.Typeof() to glean the reflection reflect.Type of the value in the array interface{}. We then glean the type with Kind(), and use a case to fall into our inner code if its a slice (can add more cases to extend this). In our inner code, we get the value of the array argument, and store it in s. We then iterate over the length of s, and compare val to s at the index i declared as an interface with Interface() and check for truthiness. If its true, we exit with a true and the index. Running the main function with both a slice of strings and a slice of integers, as follows, works: func main() { names := []string{"Mary", "Anna", "Beth", "Johnny", "Beth"} fmt.Println(in_array("Anna", names)) fmt.Println(in_array("Jon", names))
{ "domain": "codereview.stackexchange", "id": 43145, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "array, go", "url": null }
condensed-matter, solid-state-physics, material-science, graphene Note how this is analogous to cimply assembling a chain of atoms, in the spirit of the tight-binding model - small hopping between degenerate states eventually transforms into a band, when the number of atoms becomes very large.
{ "domain": "physics.stackexchange", "id": 77688, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter, solid-state-physics, material-science, graphene", "url": null }