text
stringlengths
49
10.4k
source
dict
speech-recognition If you plot the spectrum of this speech signal, you can find something like the following (source). This resembles, for example, the harmonic structure of a brass instrument sound. In contrast, unvoiced signals don't have such a clear harmonic structure. In fact, they have no fundamental frequency, and can be conceived as a noisy signal. You can sing by saying "Ahh", but you can't by saying "Ddd". Unvoiced sounds can be conceived as coloured noise. They usually have less energy than voiced. Taking these differences into account, we can think about a way to detect them automatically. Voiced sounds are periodic while unvoiced aren't. To detect periodicity, you can use methods such as autocorrelation (which has been widely treated in this site). Voiced sounds have more energy than unvoiced. You can divide the signal in 20-40ms windows, compute the energy for each one and decide according to a threshold. Unvoiced sounds are noisy and tend to be prominent in high frequencies, while voiced aren't so. Therefore, unvoiced will cross with zero more often than voiced. This is called Zero Crossing Rate. While these simple methods are not too accurate by themselves, are a good place to start from. Furthermore, I am sure you can get good results by combining them. In any case, this post does not substitute a good book, as the one I mentioned before. It's just some kind of introduction to show you some possibilities.
{ "domain": "dsp.stackexchange", "id": 751, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "speech-recognition", "url": null }
81: Problem Set 3-3: p. partial derivatives can be applied multiple times on. 1 Acceleration and the Derivative 7. Definition of a future? A legally binding (AKA obligation) contract to BUY (long) or SELL (Short) the movement of cash into and out of a business. The derivative of a function describes the function's instantaneous rate of change at a certain point. com/patrickjmt !! Limit Definition of Derivativ. My goal is to make a complete library of applets for Calculus I that are suitable for in-class demonstrations and/or student exploration. Total References: Total number of references to other papers that have been resolved to date, for papers in the SSRN eLibrary. Definition: The organization and coordination of the activities of a business in order to achieve defined Click to read more about management. Definition of a Derivative Notes Definition of the Derivative Notes Definition of the Derivative Notes filled in Homework: Limit Definition of the Derivative Worksheet Derivatives Worksheet Derivatives Limit Definition Worksheet Key. 2 3x3 " (x)= X3 + 1. Applications Of Derivatives Worksheet Pdf. The problem of printing money. Derivatives Practice Problems. Solutions can be found in a number of places on the site. Limits involving functions of two variables can be considerably more difficult to deal with; fortunately, most of the functions we encounter are fairly easy to. Derivatives be used to help us evaluate indeterminate limits of the form 0 0 through L'Hopital's Rule, which is developed by How can derivatives assist us in evaluating indeterminate limits of the form ∞ ∞ ? Because differential calculus is based on the definition of the derivative, and the definition of. The difference quotient for the function is:. Given a list of algebraic and transcendental functions, compute, with no references, the derivative or indefinite integral of each 3. The logistic function is a function with domain and range the open interval, defined as:. f(t) = t2 + t3 − 1 t4. 1 Graphical Interpretation of Derivative (Independent Discovery/Group Collaboration) 3. A linear function is its own linear approximation. We now define that limit to be the base of the natural logarithms, the number we will call e. What does x 2 = 2x mean?. Rolle’s Theorem and the Mean Value Theorem are discussed as they provide foundational support for later technical arguments. The
{ "domain": "fidelylite.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534311480466, "lm_q1q2_score": 0.8282437458578029, "lm_q2_score": 0.8438951045175643, "openwebmath_perplexity": 822.6688501689522, "openwebmath_score": 0.7664351463317871, "tags": null, "url": "http://jogy.fidelylite.it/limit-definition-of-derivative-practice-problems-pdf.html" }
ros, topic, publisher Title: Suspend a publisher Hi! In my system there are 2 nodes that publish on a topic concurrently. This situation leads an unstable state for my system, so I would suspend publication (only for that topic) from one of the two nodes. I wouldn't work on the code of two nodes. There is a way to pause the subscribtion of a publisher to a topic? Thanks Originally posted by jony on ROS Answers with karma: 23 on 2017-03-15 Post score: 0 With a topic_tools mux you can feed both inputs into a node and select which gets published out with a service call: http://wiki.ros.org/topic_tools/mux So instead of node1 -> topicA node2 -> topicA topicA -> node3 it would be node1 -> topicB -> mux node2 -> topicC -> mux mux -> topicA (which is a copy of either B or C depending on mux selection) topicA -> node3 Originally posted by lucasw with karma: 8729 on 2017-03-15 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by jony on 2017-03-15: thank you for the answer, but following your suggestion I should work on the code of node1 and node2 to divert respectively node1 to topic B and node2 to topicC. Right? In this case your solution isn't good for me. Comment by lucasw on 2017-03-15: You don't have to alter the code to change where publications go, remapping can change that at runtime: http://wiki.ros.org/Remapping%20Arguments or http://wiki.ros.org/roslaunch/XML/remap Comment by jony on 2017-03-16: Great! It works. Thank you so much ;)
{ "domain": "robotics.stackexchange", "id": 27318, "lm_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, topic, publisher", "url": null }
gravity, cosmology, general-relativity Title: Is gravity a source of infinite energy at a cosmological scale As I understand it, gravity cannot be attenuated by any medium (in the way that EM radiation can be, for instance). Does this, then, not make it a source (theoretically, I am not talking of practicalities) of infinite energy - if we assume the universe itself is infinite and looks the same everywhere (ie there are objects with mass everywhere)? Or is it more correct to say that gravity has a net contribution of nothing to the universe's energy density because the attractional energy is balanced by a negative potential energy? Gravity travels at light speed (or less, possibly), so even in an infinite non-expanding universe of finite age you'd only be gravitationally interacting with a finite mass in a finite volume. Our universe is observed to be expanding, further inhibiting us from coming into contact with new objects. Furthermore, a common assumption of cosmological models is that the universe is homogeneous and isotropic on large scales. Meaning it is pretty much identical in all directions. Observations support this assumption. One net effect of this is that the gravitational potential energy you experience from objects outside (roughly) your supercluster is zero (and really close to it from things outside your own galaxy, actually). They just balance each other out.
{ "domain": "astronomy.stackexchange", "id": 586, "lm_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, cosmology, general-relativity", "url": null }
c, parsing, linux, status-monitoring, x11 snd_mixer_t *handle = NULL; snd_mixer_elem_t *elem; snd_mixer_selem_id_t *sid; if (snd_mixer_open(&handle, 0)) SND_ERR("Error Open") if (snd_mixer_attach(handle, "default")) SND_ERR("Error Attch") if (snd_mixer_selem_register(handle, NULL, NULL)) SND_ERR("Error Rgstr") if (snd_mixer_load(handle)) SND_ERR("Error Load") snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_name(sid, "Master"); if (!(elem = snd_mixer_find_selem(handle, sid))) SND_ERR("Error Elem") if (snd_mixer_selem_get_playback_switch(elem, SND_MIXER_SCHN_MONO, &swch)) SND_ERR("Error Get S") if (!swch) { snprintf(volume_string, 32, " %c volume:%cmute%c ", COLOR_HEADING, COLOR_NORMAL, COLOR_NORMAL); } else { if (snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_MONO, &pvol)) SND_ERR("Error Get V") // round to the nearest ten volperc = (double)pvol / vol_range * 100; volperc = rint((float)volperc / 10) * 10; snprintf(volume_string, 32, " %c volume:%c%3d%%%c ", COLOR_HEADING, COLOR_NORMAL, volperc, COLOR_NORMAL); } if (snd_mixer_close(handle)) SND_ERR("Error Close") handle = NULL; snd_config_update_free_global(); return 0; }
{ "domain": "codereview.stackexchange", "id": 31497, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, parsing, linux, status-monitoring, x11", "url": null }
# Solving $3x^2 - 4x -2 = 0$ by completing the square I can't understand the solution from the textbook (Stroud & Booth's "Engineering Mathematics" on a problem that involves solving a quadratic equation by completing the square. The equation is this: \begin{align} 3x^2 - 4x -2 = 0 \\ 3x^2 - 4x = 2 \end{align} Now, divide both sides by three: $$x^2 - \frac{4}{3}x = \frac{2}{3}$$ Next, the authors add to both sides the square of the coefficient of $$x$$, completing the square on the LHS: $$x^2 - \frac{4}{3}x + \left(\frac{2}{3}\right)^2 = \frac{2}{3} + \left(\frac{2}{3}\right)^2$$ Now, the next two steps (especially the second step) baffle me. I understand the right-hand side of the first quation (how they get the value of $$\frac{10}{9}$$), but the last step is a complete mystery to me: \begin{align} x^2 - \frac{4}{3}x + \frac{4}{9} = \frac{10}{9} \\ \left(x - \frac{2}{3}\right)^2 = \frac{10}{9} \end{align} Can anyone please explain how they went from the first step to the second step?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822877049262133, "lm_q1q2_score": 0.8007928597659926, "lm_q2_score": 0.8152324983301567, "openwebmath_perplexity": 237.24539457188882, "openwebmath_score": 0.91036057472229, "tags": null, "url": "https://math.stackexchange.com/questions/3203319/solving-3x2-4x-2-0-by-completing-the-square/3203803" }
python, performance if not os.path.exists('results'): os.mkdir('results') with open('results/'+'Summary_Total.csv', "w") as file: file_writer = csv.writer(file) for row in data: file_writer.writerow(row) Copying processResults.py into the subdirectories is unnecessary and clutters up the code and your disk drive. Change processResults.py so that it takes a path of the directory to process. Better still, turn processResults.py into a function and combine the two scripts into one much simpler one. Without the overhead of using POpen() or call() this should run faster. ''' Automates data processing and collection ''' import csv from pathlib import Path def process(directory='.'): ''' Artificial process() function that generates and returns dummy Summary_Total data. ''' header = ['A','B','C','D','E','F','G'] directory = Path(directory).resolve() name = directory.parts[-1] data = [[name] + [i]*(len(header) - 1) for i in range(1, 4)] return [header] + data def write_csv(path, rows): ''' Boilerplate for writing a list of lists to a csv file ''' with path.open('w', newline='') as f: csv.writer(f).writerows(rows) def generate_results(pattern='*'): ''' Automates processing each data directory under folders matching the glob-style pattern and creating individual and collective summary CSV's ''' for folder in Path('.').glob(pattern): summaries_csvs = [] # if the sub_dirs need to be done in order, use sorted(folder.iterdir()) for sub_dir in folder.iterdir(): if sub_dir.is_dir(): sub_dir = sub_dir.resolve()
{ "domain": "codereview.stackexchange", "id": 36716, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance", "url": null }
Comment #726 by Keenan Kidwell on In the proof that (1) implies (3), we know that $\Omega_{S/k}$ is free over $S$ of rank $\dim(S)$. But why is $\dim(S)=\dim_x(X)$? I can't think of an expression for $\dim_x(X)$ that makes this equality clear. We have $\dim_x(X)=\dim(S_\mathfrak{q})+\mathrm{trdeg}_k(k(\mathfrak{q}))=\dim(S_\mathfrak{q})+\dim(S/\mathfrak{q})$, but this can be strictly less than $\dim(S)$ if $S$ is not a domain, right? Comment #728 by on OK, I added a remark which hopefully clarifies the logic. I also fixed the other things you pointed out in the other comments. See this commit. Thanks! Comment #731 by Keenan Kidwell on I think your remark justifies the equality $\dim(S)=\mathrm{rank}_S(\Omega_{S/k})$, but for the equality $\dim(S)=\dim_x(X)$, which I thought about some more, maybe it should be remarked that global complete intersections over $k$ are equidimensional, and this implies via 00OT (2) that $\dim_x(X)=\dim(S)$. Comment #732 by on @#731: Actually, the discussion immediately following Definition 10.133.1 (in Section 10.133) shows that a global complete intersection over a field is equidimensional. The idea of a discussion following a definition is that reader keep this in mind as (s)he is reading the text. Of course, this is kind of impossible with something like the Stacks project, so your criticism is valid and a reference to this discussion would be useful to the reader. Hmm...
{ "domain": "columbia.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.979976559295341, "lm_q1q2_score": 0.8187542840456923, "lm_q2_score": 0.8354835391516132, "openwebmath_perplexity": 256.1466293801142, "openwebmath_score": 0.9761549830436707, "tags": null, "url": "https://stacks.math.columbia.edu/tag/00TT" }
homework-and-exercises, newtonian-mechanics, newtonian-gravity, kinematics, projectile Is this correct? Yes, that's how physics is done! Aside from what I assume is a typo in your final summary, your equations (1) and (2) are both correct. You should note, however, that this is the Newtonian Way of answering your questions. Real-life experiments will show some variation in time and distance traveled, a quicker slow-down time, and a shorter path. This is due to air resistance. You'll need a more complex model if you want super-accurate answers, but these should work for rough estimations and low-level physics classes.
{ "domain": "physics.stackexchange", "id": 13911, "lm_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, newtonian-gravity, kinematics, projectile", "url": null }
quantum-field-theory, vacuum, lorentz-symmetry which is still divergent because $\omega_p = \sqrt{p^2+m^2}$ and the volume element $\mathrm{d}^3p$ is quadratic in $\vert p \vert$ so the integral $$ \epsilon(\mathbb{R}^3) = \frac{1}{(2\pi)^2}\int_0^\infty\omega_p p^2\mathrm{d}p$$ still diverges. The answer is to regularize the integral with a hard momenutm cutoff $\Lambda$, where now $$ \epsilon_\text{vac}(\Lambda) = \frac{1}{(2\pi)^2}\int_0^\Lambda\omega_p p^2\mathrm{d}p$$ is finite. Note that we also have the options to classically add a piece $V_0(\Lambda)$ to the Hamiltonian density - it corresponds to the location of the minimum of the classical potential for the field. In the regularized theory and in the absence of gravity, we are free to choose $V_0(\Lambda)$ however we want, in particular as $V_0(\Lambda) = -\epsilon_\text{vac}(\Lambda) + \chi$ for some finite and cutoff-independent $\chi$. Then we can remove the cutoff again and still end up with a finite vacuum energy $\Lambda$. In particular, we may choose $\chi = 0$, yields the correct prescription for the LSZ formalism. However, in the presence of gravity, the zero of the classical potential is not arbitrary, so for a QFT coupled to gravity, $\chi$ becomes a measureable observable, meaning the expectation value of the energy of the vacuum becomes non-zero. Instead, it becomes an experimental input to the theory.
{ "domain": "physics.stackexchange", "id": 28771, "lm_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, vacuum, lorentz-symmetry", "url": null }
orbit, rotation, definition, pole Title: What is the definition of a "pole" of a celestial body? What is the definition of a "pole" of a celestial body? Earth's pole is defined as it's rotational pole. The North and South Poles are the two points on Earth where its axis of rotation intersects its surface. Apparently, (according to everywhere I've read), the poles of astronomical bodies are determined based on their axis of rotation in relation to the celestial poles of the celestial sphere. But this is an inadequate definition. What about Pluto? Pluto's axis of rotation does not intersect its surface. Pluto is tidally locked with Charon, and Pluto orbits a barycenter that is located outside of Pluto. And yet Pluto has a North and a South Pole. Why are the North and South Poles of Pluto where they are, as opposed to any other location on the surface of Pluto? How are these poles defined for Pluto? What is the definition of a "pole" of a celestial body? I'll just add a supplement to @planetmaker's answer. As long as a body is distinct and not connected to anything else, it will have a center of mass. If the body is roughly spherical its center of mass will be near it's middle. The body's rotational axis by definition passes through its center of mass, and is parallel to it's own angular momentum vector. If there are two bodies orbiting each other, to a good approximation (but not exactly, see Which mass distributions guarantee two bodies have non-Keplerian orbits? Which non-spherical distributions still allow noncircular Keplerian orbits?) we can consider one's center of mass orbiting around the other's center of mass, and the center of both of their masses to be the pair's barycenter. Their mutual rotation and orbital angular momentum will be defined by another axis passing through that barycenter, which may be inside one of them (like the Earth-Moon or Sun-Jupiter system) or in space between them like the Pluto-Charon system. It doesn't matter. One is the rotation of a single body around its own center of mass, the other this the rotation of two centers of mass about their common center of mass. Apples and oranges.
{ "domain": "astronomy.stackexchange", "id": 5059, "lm_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, rotation, definition, pole", "url": null }
python, beginner, programming-challenge, time-limit-exceeded, mathematics This made the performance a fraction of yours: (the number before the percentage is how big the list was.) 721 11.50% new_invert_gcd 1.461 old_invert_gcd 12.7 914 13.28% new_invert_gcd 2.604 old_invert_gcd 19.61 685 11.31% new_invert_gcd 1.336 old_invert_gcd 11.81 292 17.77% new_invert_gcd 0.3298 old_invert_gcd 1.856 215 16.59% new_invert_gcd 0.1467 old_invert_gcd 0.8844 374 11.56% new_invert_gcd 0.4022 old_invert_gcd 3.481 990 13.21% new_invert_gcd 2.881 old_invert_gcd 21.82 220 20.74% new_invert_gcd 0.1673 old_invert_gcd 0.8068 296 19.70% new_invert_gcd 0.3351 old_invert_gcd 1.701 194 18.18% new_invert_gcd 0.1212 old_invert_gcd 0.6667 730 15.83% new_invert_gcd 1.999 old_invert_gcd 12.63 113 22.15% new_invert_gcd 0.05051 old_invert_gcd 0.2281 28 53.15% new_invert_gcd 0.006326 old_invert_gcd 0.0119 884 13.78% new_invert_gcd 2.166 old_invert_gcd 15.71 292 18.45% new_invert_gcd 0.4417 old_invert_gcd 2.394 136 32.23% new_invert_gcd 0.1859 old_invert_gcd 0.5768 20 99.14% new_invert_gcd 0.006373 old_invert_gcd 0.006428 246 17.32%
{ "domain": "codereview.stackexchange", "id": 20869, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, programming-challenge, time-limit-exceeded, mathematics", "url": null }
philosophy, robots Title: What jobs cannot be automatized by AI in the future? AI is progressing drastically, and imagine they tell you you're fired because a robot will take your place. What are some jobs that can never be automated? The Oxford study from 2013 in The future of employment paper assess this and estimated the probability of computerisation for 702 detailed occupations using a Gaussian process classifier (using job data from the UK partially merged with data from US), and based on these estimates they identified three areas of computerisation bottleneck areas and nine skills that people are still needed for each profession, this includes: Perception and Manipulation. Finger dexterity. The ability to make precisely coordinated movements of the fingers of one or both hands to grasp, manipulate, or assemble very small objects. Manual dexterity. The ability to quickly move your hand, your hand together with your arm, or your two hands to grasp, manipulate, or assemble objects. The need for a cramped work space. How often does this job require working in cramped work spaces that requires getting into awkward positions? Creative Intelligence. Originality. The ability to come up with unusual or clever ideas about a given topic or situation, or to develop creative ways to solve a problem. Fine arts. Knowledge of theory and techniques required to compose, produce, and perform works of music, dance, visual arts, drama, and sculpture. Social Intelligence. Social perceptiveness. Being aware of others’ reactions and understanding why they react as they do. Negotiation. Bringing others together and trying to reconcile differences. Persuasion. Persuading others to change their minds or behavior. Assisting and caring for others. Providing personal assistance, medical attention, emotional support, or other personal care to others such as coworkers, customers, or patients. Source: The future of employment: how susceptible are jobs to computerisation: Table 1. What this study is basically saying, around 50% of all jobs will be replaced by robots in the next 20 years. Based on the above study, the BBC assembled a handy guide that calculates which jobs are likely to be automated within the next two decades: Will a robot take your job? See also: replacedbyrobot.info website. With this tool, you can check the prediction of over 700 jobs. Related:
{ "domain": "ai.stackexchange", "id": 235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "philosophy, robots", "url": null }
Solution We next apply the Chain Rule to solve a max/min problem. ##### Example12.5.5Applying the Multivariable Chain Rule Consider the surface $z=x^2+y^2-xy\text{,}$ a paraboloid, on which a particle moves with $x$ and $y$ coordinates given by $x=\cos(t)$ and $y=\sin(t)\text{.}$ Find $\frac{dz}{dt}$ when $t=0\text{,}$ and find where the particle reaches its maximum/minimum $z$-values. Solution We can extend the Chain Rule to include the situation where $z$ is a function of more than one variable, and each of these variables is also a function of more than one variable. The basic case of this is where $z=f(x,y)\text{,}$ and $x$ and $y$ are functions of two variables, say $s$ and $t\text{.}$ ##### Example12.5.8Using the Multivarible Chain Rule, Part II Let $z=x^2y+x\text{,}$ $x=s^2+3t$ and $y=2s-t\text{.}$ Find $\frac{\partial z}{\partial s}$ and $\frac{\partial z}{\partial t}\text{,}$ and evaluate each when $s=1$ and $t=2\text{.}$ Solution ##### Example12.5.9Using the Multivarible Chain Rule, Part II Let $w = xy+z^2\text{,}$ where $x= t^2e^s\text{,}$ $y= t\cos(s)\text{,}$ and $z=s\sin(t)\text{.}$ Find $\frac{\partial w}{\partial t}$ when $s=0$ and $t=\pi\text{.}$ Solution # Subsection12.5.1Implicit Differentiation
{ "domain": "pcc.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9929882058635181, "lm_q1q2_score": 0.8662306478805851, "lm_q2_score": 0.8723473680407889, "openwebmath_perplexity": 343.5654119175654, "openwebmath_score": 0.8992260098457336, "tags": null, "url": "http://spot.pcc.edu/math/APEXCalculus/sec_multi_chain.html" }
context-free Title: Are all non-terminals of the CFG given by the LHS of productions? A definition for terminals and non-terminals of a CFG says that terminals: The symbols that do not appear at the LHS of productions. Therefore, Are all non-terminals of the CFG given by the LHS of productions? Given the definition you appear to be using, yes. There are only two types of symbols in a CFG, so this definition provides a dichotomy. This implicit defintion of CFGs, where the productions are provided and the terminals and non-terminals are inferred from the productions, is common in programming language circles (or at least well known), where the practical form of the grammar is the interesting aspect. Note that this is not the only way to define a CFG, the more typical formal way gives explicit sets of terminals and non-terminals, and expresses the rules as a finite relation from the non-terminals to the set of finite strings over the non-terminals and terminals. So in this there is no "left-hand-side" as such, as being on the left entirely depends on the notation you would use to represent the productions. Moreover there's no specification that all terminals or non-terminals need to be used.
{ "domain": "cs.stackexchange", "id": 5792, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "context-free", "url": null }
For instance, we know that sin0 = 0, but what is sin0. Maclaurin Series Small Angles Approximation Exam Questions with Full Solutions 5. Maclaurin Series(approximation) Thread starter naspek; Start date Dec 10, 2009; Tags use the corresponding Maclaurin polynomial of degree 5 to approximate. For example, the Taylor Series for ex is given by:. The Taylor series for at is (By convention,. Taylor Series in MATLAB First, let's review our two main statements on Taylor polynomials with remainder. 7, exercise 9. Starting with the simplest version, cos x = 1, add terms one at a time to estimate cos(π/3). The second order Taylor approximation provides a parabolic function approximation while the third order provides a cubic function approximation. The general form of a Taylor series is, assuming the function and all its derivatives exist and are continuous on an interval centered at and containing. The infinite series expansion for f (x) about x = 0 becomes:. As we have seen, a general power series can be centered at a point other than zero, and the method that produces the Maclaurin series can also produce such series. Thus, The Remainder Term is z is a number between x and 3. It is often useful to designate the infinite possibilities by what is called the Taylor Series. In the last section, we learned about Taylor Series, where we found an approximating polynomial for a particular function in the region near some value x = a. Using Taylor series to evaluate limits. In the next video, I'll do this with some actual functions just so it makes a little bit more sense. POLYNOMIAL APPROXIMATION OF FUNCTIONS: Linear and Quadratic Approximation, Taylor and Maclaurin Polynomials, Approximation with Taylor Polynomials (1hour) POWER SERIES: Definition, Center and Radius, Interval of Convergence, Endpoint Convergence, Operations with Power Series, Differentiating and Integrating Power Series (1hour) Week 2 4 hours. Maclaurin Series of f(x) = about x = up to order = Calculate: Computing Get this widget. The n th partial sum of the Taylor series for a function $$f$$ at $$a$$ is known as the n th Taylor polynomial. It first prompts the user to enter the number of terms in the Taylor series and the value of x. If f has a power series representation (expansion) at a,.
{ "domain": "timstourenblog.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9938070091084549, "lm_q1q2_score": 0.8634461298002867, "lm_q2_score": 0.8688267660487572, "openwebmath_perplexity": 390.82097345168205, "openwebmath_score": 0.9073213934898376, "tags": null, "url": "http://enej.timstourenblog.de/maclaurin-series-approximation.html" }
c++, performance, game, windows, curses float get_health() {return health;}; void set_health(float numb) {health = numb;}; void add_health (float numb) {health += numb;}; string get_name() {return name;}; string set_name(string aName) {name = aName;}; int* get_location(){return location;}; void set_location(int X, int Y) { location[0] = X; location[1] = Y;}; Getters and setters are bad. But you probably haven't been coding long enough to worry about that. But seriously, unless someone is making you I suggest directly access the data for now. Don't worry about encapsulation until you've got the complete hang of things. (I'd probably get in trouble for saying that, but nobody is going to read this far) //////////////////////////////// Move //////////// bool move(int X, int Y) { location[0] += X; location[1] += Y; return true;}; A function like this is good because it provides a higher level interface, not requiring external objects to deal with getters/setters. };// end of sprite
{ "domain": "codereview.stackexchange", "id": 362, "lm_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, game, windows, curses", "url": null }
php, php5, mysqli A programmer should be notified of the every single error that occurs Not a single system error should be leaked to a user. Only a generalized error message should be sent. So for this purpose a simple code could be used (again taken from my article above): set_error_handler("myErrorHandler"); function myErrorHandler($errno, $errstr, $errfile, $errline) { error_log("[$errno] $errstr in $errfile:$errline"); header('HTTP/1.1 500 Internal Server Error', TRUE, 500); header('Content-Type: application/json'); echo json_encode(["error" => 'Server error']); exit; } For the every error occurred in your script it will log it in the error log, while a generalized message is sent to the client. Some statements could be not that clear, due to vast amount of information I had to deliver. But I'll be glad to answer whatever questions you will have.
{ "domain": "codereview.stackexchange", "id": 24604, "lm_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, php5, mysqli", "url": null }
demodulation Title: Downconversion / Demodulation of RF signal to DC My question is around down conversion of a signal (e.g. RF) to DC and the affect of negative frequencies. If I have a signal whos spectral content is say between 2-4kHz and I mix this with an intermediate frequency of 3kHz, ignoring the upper mirror, I now have a signal whos spectral content is centered around DC +- 1kHz with a bandwidth of 2kHz. What does the signal at -1Khz to DC represent- I believe this is mirrored onto the DC-1kHz signal but does this create artifacts if the spectral content is asymmetric? "If the signal spectrum is asymmetric, the original signal spectrum will be corrupted" If your mixer is a simple multiplication with a single oscillator, then yes, that will be the case. As Dilip explained, real (RF) signals are always symmetrical in spectrum to the 0Hz axis. That means your original doesn't only exist around 3kHz, it also exists around -3kHz, only mirrored! I think your image captures that pretty fine: Now, if you shift your 3kHz signal (black) to 0Hz, the higher spectral peak ends up on the positive frequency side, and the lower on the negative frequency side. Problem is that for real-valued signals, there's no physical difference between positive and negative frequencies – and thus, your mirrored signal also gets overlayed with this. So you have the small and the big spectral peak overlay - and since they were originally two different parts of your signal, this overlay is not actually just a "shifted copy" of your original signal, but a "corrupted" version. The only way this wouldn't happen is if the "upper" half of your signal (3-4 kHz) and the "lower" half (2-3 kHz) were already symmetrical in spectrum to its center frequency – because then, the your mirrored spectrum would be identical to the original, and nothing was lost. But: simply read on. The fact that your text uses negative frequencies definitely works towards showing you how a complex baseband mixer works. In two or three pages, you'll understand what needs to be done to still be
{ "domain": "dsp.stackexchange", "id": 4492, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "demodulation", "url": null }
neural-networks, machine-learning, deep-learning, math, objective-functions Title: Why is MSE used over other quadratic loss functions? So I was wondering, why I have only encountered square loss function also known as MSE. The only nice property of MSE I am so far aware of is its convex nature. But then all equations of the form $x^{2n}$ where $n$ is an integer belongs to the same family. My question is what makes MSE the most suitable candidate among this entire family of curves? Why do other curves in the family, even though having steeper slopes, $(x >1) $, which might result in better optimisation, not used? Here is a picture to what I mean where red is $x^4$ and green is $x^2$: I can comment on several properties of MSE and related losses. As you mentioned MSE (aka $l_2$-loss) is convex which is a great property in optimization in which one can find a single global optimum. MSE is used in linear and non-linear least squares problems which form the basis of many widely used statistical methods. I would imagine the math and implementation would be more difficult if one would use a higher-order loss (e.g. $x^3$) and that would also prove to be futile because MSE already possesses great statistical and optimization properties on its own. Another important aspect, one wouldn't use higher-order loss functions in regression is because it would be extremely prone to outliers. MSE on its own would weigh the outliers much more than l1-loss would! And in real world data there is always noise and outliers present. In comparison l1 loss is more difficult in optimization, one reason for which is it's not differentiable at zero. Other interesting losses you might want to read about are $l_0$ and $l_{inf}$ loss, all of which have their own trade-offs in optimization-sense.
{ "domain": "ai.stackexchange", "id": 1368, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neural-networks, machine-learning, deep-learning, math, objective-functions", "url": null }
lithography Title: What is the difference between NIL and hot embossing? NIL (Nanoimprint lithography) and hot embossing seem to mean the same thing in many instances. Is hot embossing a subset technique of NIL? Or are they completely different methods? I had the same question recently and was doing some research a wile ago. Sorry that I don't have all the literature prepared. NIL is for very small structures, the mold is created with a lithography process. Depth are usually not very large. Can be very fast implemented in R2R. There are two basic types: Thermal NIL: Mold is places on substrated, mold is heated at first, then cooled down and separated from substrate with finished imprint. UV NIL: Same as above but instead of a heating source you have a UV source. [Source: N. Kooy et al. A review of roll-to-roll NIL Nanoscale Research Letters 2014, 9:320] Hot embossing is also used for small structures but also for bigger ones, small structures with great depth can be achieved. In the process the substrate is preheated and in liquid phase. The mold is pressed on the substrate. Temperature and pressure are controlled. During cooling the mold is removed. Speeds are slower, depending on how big the structure is can be very slow. The mold can also be created by lithography but not necessarily as they often exceed the size possibilities of lithography. The molds are bigger than the imprinted structure depending on the flow characteristics of the material imprinted. Delamination happens during cooling. [Source: M. Heckle et al. Hot embossing - The molding technique for plastic microstructures - Microsystem Technologies 4 (1998) 122-124] Differences: Hot embossing is: slower, for bigger structures, or small but great depth (holes, lenses, deep channels...), mold is bigger than structure, substrate is preheated, temp. and pressure are always controlled, mold isn´t necessary made with lithography. For sure there are things I missed but I hope it helps someone.
{ "domain": "engineering.stackexchange", "id": 1433, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lithography", "url": null }
If $$m-n+\frac 12\lt 0$$, then $$m-n+1\lt 0$$, so$$(3)\iff -m+n-1\ge -m+n-1$$which is true. Case 4 : If $$a=2m+1,b=2n+1$$, then both sides of $$(1)$$ equal $$|m-n|$$. There is no need for the assumption that $$a$$ and $$b$$ are integers. You just need to prove that $$|\lceil x\rceil-\lceil y\rceil|\ge\lfloor|x-y|\rfloor$$ for any real numbers $$x$$ and $$y$$. By symmetry, we may assume $$x\ge y$$, in which case we can remove the absolute value signs. If, moreover, we write $$x=y+u$$ with $$u\ge0$$, we are trying to prove $$\lceil y+u\rceil\ge\lceil y\rceil+\lfloor u\rfloor$$ But $$u=\lfloor u\rfloor+r$$ for some $$0\le r\lt1$$, and $$\lceil y+\lfloor u\rfloor +r\rceil=\lceil y+r\rceil+\lfloor u\rfloor$$, so the inequality to prove is simply $$\lceil y+r\rceil\ge\lceil y\rceil$$ which is clearly true, since the ceiling function is never decreasing and $$r\ge0$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846697584033, "lm_q1q2_score": 0.842915774779291, "lm_q2_score": 0.8615382076534742, "openwebmath_perplexity": 83.87450898888883, "openwebmath_score": 0.9506146907806396, "tags": null, "url": "https://math.stackexchange.com/questions/3425971/is-lceil-fraca2-rceil-lceil-fracb2-rceil-geq-lfloor-frac/3426063" }
c#, object-oriented, sql-server Title: Creating multiple objects from SQL server extract I've created a simplified prototype solution as a sort of proof of concept before starting a larger program. Here is the test data used to build the objects: create table blah.dbo.tb_sandpitCreateMultipleLinkedObjects ( CustomerName varchar(50), ItemCode varchar(50) ); insert into blah.dbo.tb_sandpitCreateMultipleLinkedObjects values ('jq','bat'), ('jq','blackRubber'), ('jq','redRubber'), ('mt','redRubberX'), ('mt','redRubberY'), ('mt','redRubberZ'), ('mt','blackRubberA'), ('mt','blackRubberB'), ('mt','bladeFast'), ('mt','bladeVeryFast'), ('mt','bladeTooFast'); It has two concrete classes representing customers and items that the customers have bought. There are a few customers but potentially many items. The only use case I have to address is: An administrator identifies a user, then the system will display the items bought by that user. The system does not need to send any information back to SQL server. Here are the two concrete classes: class: Customer using System; using System.Collections.Generic; namespace SandpitCreateMultipleLinkedObjects { class Customer { //links List<Item> items; Item i; //property public String Name { get; private set; } //constructor public Customer(String name) { items = new List<Item>(); Name = name; } //method to add link to item bought by customer public void addItem(Item i) { items.Add(i); } } } class: Item using System; namespace SandpitCreateMultipleLinkedObjects { class Item { //name property public String Name { get; private set; } public Item(String name) { this.Name = name; } } }
{ "domain": "codereview.stackexchange", "id": 14716, "lm_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, sql-server", "url": null }
The most reasonable way to match the answer in the book would be to define the likelihood to be the ratio of success over failure (aka odds): $$q=\frac{p}{1-p}$$ then the probability as a function of the odds is $$p=\frac{q}{1+q}$$ In your case the odds are $4:1$ so $4$ times as likely would be $16:1$ odds which has a probability of $$\frac{16}{17}=94.1176470588235\%$$ This matches the $3\%$ to $11.0091743119266\%$ transformation, as well. Bayes' Rule Bayes' Rule for a single event says that $$O(A\mid B)=\frac{P(B\mid A)}{P(B\mid\neg A)}\,O(A)$$ where the odds of $X$ is defined as earlier $$O(X)=\frac{P(X)}{P(\neg X)}=\frac{P(X)}{1-P(X)}$$ This is exactly what is being talked about in the later addition to the question, where it is given that $$\frac{P(B\mid A)}{P(B\mid\neg A)}=4$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9702399043329856, "lm_q1q2_score": 0.810619467111023, "lm_q2_score": 0.8354835371034368, "openwebmath_perplexity": 441.8302753288255, "openwebmath_score": 0.8215650320053101, "tags": null, "url": "https://math.stackexchange.com/questions/465718/whats-4-times-more-likely-than-80/465751" }
c++, memory-management Arena(Arena const&) = delete; Arena& operator=(Arena const&) = delete; Arena(Arena&& rhs) : storage_(std::move(rhs.storage_)), alloc_count_(rhs.alloc_count_), free_stack_top_(rhs.free_stack_top_) { rhs.alloc_count_ = 0; rhs.free_stack_top_ = npos; } Arena& operator=(Arena&& rhs) { storage_ = std::move(rhs.storage_); alloc_count_ = rhs.alloc_count_; free_stack_top_ = rhs.free_stack_top_; rhs.alloc_count_ = 0; rhs.free_stack_top_ = npos; } template<typename... ARGS> T* create(ARGS&&... args) { // Find the slot we will allocate from. entry_t* selected_entry = nullptr; if (free_stack_top_ != npos) { // If the free list is not empty, pick from it. assert(free_stack_top_ < storage_.size()); selected_entry = &storage_[free_stack_top_]; // Update the free list free_stack_top_ = selected_entry->next_free; assert(free_stack_top_ < storage_.size() || free_stack_top_ == npos); } else { // Pick from the end of the currently allocated block, which is currently contiguous. if (alloc_count_ == storage_.size()) { throw std::bad_alloc(); } assert(alloc_count_ < storage_.size()); selected_entry = &storage_[alloc_count_]; }
{ "domain": "codereview.stackexchange", "id": 27310, "lm_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++, memory-management", "url": null }
electrostatics, potential, voltage The correct options are given to be (A), (B) and (C). Applying my definition, i found that the option (C) is correct by making the potentials of the plates A and C due to the other two equal to zero. But i am struggling to do so when only one of the plates is grounded. Whatever charge may flow from the earthed plate, it should not affect the potential of the plate itself (does it?). It is influenced only by the other plates and the charges on them. This begs the question, what actually happens on earthing something in electrostatics? Also, how can we solve it without using the capacitor treatment? I am trying to understand the underlying physics of it! Thanks. The credit to this answer goes to @knzhou, who provided it to me in the chat. What earthing does is simply equalizes the potential of the Earth (as in the planet, or the ideal earth, whichever is relevant). Now, we see that to calculate the potential difference between the plate (or whatever it is to which the earth is connected) and any point on or in the earth, we integrate the field as: $$ V_{\text{plate}}-V_{\text{earth}}=-\int_{\text{earth}}^{\text{plate}}\vec{E\,}\cdot\mathrm d\vec{r\,}$$ There are many points which lie on the earth, and hence for the potential difference to always be zero, the electric field (outside of the region between two plates) must always be zero. For the example discussed, this is only possible if the plate A gets a negative charge $-Q$, which it takes from the earth itself.
{ "domain": "physics.stackexchange", "id": 82587, "lm_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, potential, voltage", "url": null }
python, programming-challenge, dynamic-programming Title: Dynamic programming solution to "Climbing Stairs" This is the "Climbing Stairs" problem from leetcode.com: You are climbing a stair case. It takes \$n\$ steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given \$n\$ will be a positive integer. Example 1: Input: 2 Output: 2 Explanation: There are two ways to climb to the top. 1 step + 1 step 2 steps Example 2: Input: 3 Output: 3 Explanation: There are three ways to climb to the top. 1 step + 1 step + 1 step 1 step + 2 steps 2 steps + 1 step I thought this question is very similar to Fibonacci question. I use dynamic programming, dp[n] = dp[n - 1] + dp[n - 2] class Solution: # @param n, an integer # @return an integer def climbStairs(self, n): dp = [1 for i in range(n+1)] for i in range(2, n+1): dp[i] = dp[i-1] + dp[i-2] return dp[n] The code in the post has to compute the \$i\$th Fibonacci number, \$F_i\$, for every \$i \le n\$, in order to compute \$F_n\$. It's possible to do much better than that, by using the recurrence $$ \eqalign{F_{2n−1} &= F_{n}^2 + F_{n−1}^2 \\ F_{2n} &= (2F_{n−1} + F_{n}) F_{n}} $$ combined with memoization. For example, you could use the @functools.lru_cache decorator, like this: from functools import lru_cache
{ "domain": "codereview.stackexchange", "id": 29231, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, programming-challenge, dynamic-programming", "url": null }
solved the mystery of crop circles, you now are able to identify the parts of a circle, identify and recognize a tangent of a circle, demonstrate how circles can be tangent to other circles, and recall and explain three theorems related to tangents of circles. This means that JL = FP. I want to measure the major diameter that would be tangent to the radii, but I can’t seem to create a circle tangent to the OD of the other circles; only the center. Theorem: The nine-point circle of a triangle is tangent to the incircle and each of the three excircles of the triangle. There are numerous everyday examples of circles in both nature and design. circle(10*i) Output of the above program-Explanation of the above code. Also recall that the tangent lines drawn from a point outside the circle form two congruent segments. Circles, Arcs and Sectors The Circle. Tangent Circles. The radical circle of the tangent circles is the incircle. Presently there are two methods available for constructing a common tangent to some systems of two circles. In addition, a radius intersects a point of tangency at a right angle. How to construct a Tangent from a Point to a Circle using just a compass and a straightedge. Great circles through the poles are called lines of longitude (or meridians). General procedure to draw a circle. Circles are widely studied in geometry. The case using three circles is called Apollonius' Problem. So this point (points at the line touching the circle) and this line is called tangent to the circle. The radius of circle A is equal to 10 cm and the radius of circle B is equal to 8 cm. So if you instead want a circle tangent to three objects like lines or circles use that menu option for circle. 908 GE Equilateral Triangle Circumscribes Circle - Duration: 7:56. Five circles lie in five different planes but share the same center and radius. Circle MCQ Pdf Question 32. (The three hollow orange circles denotes three neurons of the middle layer, +1 in the last circle means the neurons can be added if required. #Program to draw tangent circles in Python Turtle import turtle t = turtle. Continue in this fashion. 9th - 12th grade. , the centers of the two tangent circles lie on opposite sides of the mutual tangent line at the point of tangency) or internally tangent (the centers lie on
{ "domain": "fnaarccuneo.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464485047915, "lm_q1q2_score": 0.8153871968170521, "lm_q2_score": 0.8354835432479663, "openwebmath_perplexity": 369.11882035919484, "openwebmath_score": 0.6239675283432007, "tags": null, "url": "http://ahoy.fnaarccuneo.it/circle-tangent-to-three-circles.html" }
c, parsing Regarding this line: for(int i=0;token[i]!=(char)NULL;i++) This will not work quite correctly, as NULL is the size of a pointer and I think the code is looking for '\0', not NULL. I suggest: Note, no need to make any comparison as the contents of token[i] is either in the range 0x01...0xFF or 0x00 - and 0x00 will be seen as false. for(int i=0; token[i];i++) When #defineing a numeric value, always wrap the value in parens to avoid any possibility of 'text replacement' errors. Regarding these lines: fgets(string,sizeof string, fp); while(string!=(char *)NULL || (strcmp(string,"\n"))==0) string will NEVER be NULL because string is not a pointer there is never a need to cast NULL I suggest: while( fgets(string,sizeof string, fp) ) To get the actual reason that a call to fopen() fails, change this: FILE *fp = fopen(param2[1],"r"); if(!fp) { fprintf(stderr,"File access denied on read. \n"); exit(1); } to: (perror() will output the system message for the current value of 'errno') FILE *fp = NULL; if( NULL ==( fp = fopen(param2[1],"r") ) ) { // then fopen failed: perror( "fopen for input file failed" ); exit( EXIT_FAILURE ); } I suggest that main() check the number of parameters and if not correct, then output a 'USAGE' statement and exit. This would greatly simplify the readfile() function, which is not actually reading a file, but rather just opening a file. There are plenty of other details that could be improved, but the above should get you started.
{ "domain": "codereview.stackexchange", "id": 15040, "lm_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, parsing", "url": null }
javascript, vue.js Title: VueJS ReST Client: Vuex Store Methods I'm writing a ReST API Client Tester using VueJS. I'm trying to have a really clean code, But I feel like it's too much, Here is my store.js file, which I use it for Vuex and the application state management, all there variables I use to send a request are store here import Vue from 'vue'; import Vuex from 'vuex'; Vue.use(Vuex); export default new Vuex.Store({ state: { globals: { methods: ['GET', 'POST', 'PUT', 'DELETE'], }, request: { method: 'GET', url: 'http://example.com', body: {}, headers: {}, }, }, mutations: { // Change Methods changeMethod(state, method) { state.request.method = method; }, changeURL(state, url) { state.request.url = url; }, changeBody(state, body) { state.request.body = body; }, changeHeaders(state, headers) { state.request.headers = headers; }, // Add to Data Methods addToHeaders(state, payload) { state.request.headers[payload.key] = payload.value; }, addToBody(state, payload) { state.request.body[payload.key] = payload.value; }, // Delete from Data Methods deleteFromHeaders(state, key) { delete state.request.headers[key]; }, deleteFromBody(state, key) { delete state.request.body[key]; }, // Reset Methods resetMethod(state) { state.request.method = 'GET'; }, resetURL(state) { state.request.url = ''; }, resetBody(state) { state.request.body = {}; }, resetHeaders(state) { state.request.headers = {}; },
{ "domain": "codereview.stackexchange", "id": 32718, "lm_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, vue.js", "url": null }
quantum-field-theory, klein-gordon-equation $$ and $$ \phi(\mathbf{x},t)=\int \frac{d^3p}{(2\pi)^3}\frac{1}{\sqrt{2E_\mathbf{p}}} a_\mathbf{p} e^{-i {p\cdot x}} + a_\mathbf{p}^{\dagger} e^{i{p\cdot x}}\Bigg|_{p^0=E_\mathbf{p}}\,. $$ In P&S, bold symbols represent three-vectors while non bold symbols represent four vectors and there is a Lorentz signature $+---$ in the "four-scalar product": $$ \mathbf{p\cdot x}=p^1x^1+p^2x^2+p^3x^3 ,\quad p\cdot x=p^0x^0-p^1x^1-p^2x^2-p^3x^3\,. $$ Because $x^0$ is time, we see now that $\phi(\mathbf{x})$ has no time dependence while $\phi(\mathbf{x},t)$ has.
{ "domain": "physics.stackexchange", "id": 80653, "lm_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, klein-gordon-equation", "url": null }
Upshot The upshot regarding the question at hand is that if any of the moments of $X$ are infinite or do not exist, we can immediately conclude that the mgf is not finite in an open interval containing the origin. (This is just the contrapositive statement of the proposition.) Thus, the proposition above provides the "right" condition in order to say something about the moments of $X$ based on its mgf. Exponentially bounded tails and the mgf Proposition: The mgf $m(t)$ is finite in an open interval $(\tn,\tp)$ containing the origin if and only if the tails of $F$ are exponentially bounded, i.e., $\mathbb P( |X| > x) \leq C e^{-t_0 x}$ for some $C > 0$ and $t_0 > 0$. Proof. We'll deal with the right tail separately. The left tail is handled completely analogously. $(\Rightarrow)$ Suppose $m(t_0) < \infty$ for some $t_0 > 0$. Then, the right tail of $F$ is exponentially bounded; in other words, there exists $C > 0$ and $b > 0$ such that $$\mathbb P(X > x) \leq C e^{-b x} \>.$$ To see this, note that for any $t > 0$, by Markov's inequality, $$\mathbb P(X > x) = \mathbb P(e^{tX} > e^{tx}) \leq e^{-tx} \mathbb E e^{t X} = m(t) e^{-t x} \>.$$ Take $C = m(t_0)$ and $b = t_0$ to complete this direction of the proof.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9693242009478238, "lm_q1q2_score": 0.8119252996914099, "lm_q2_score": 0.837619961306541, "openwebmath_perplexity": 145.60064692591507, "openwebmath_score": 0.9307129383087158, "tags": null, "url": "https://stats.stackexchange.com/questions/32706/existence-of-the-moment-generating-function-and-variance" }
Hint $\ \ f = x^2+x+1\,$ divides $\,x^{\rm\large 2+\color{#c00}3\,J}+x^{\rm\large 1+\color{#c00}3\,K}+x^{\rm\large \color{#c00}3L} = g,\,\$ e.g. $\,\ g = x^5 + x + 1$ Proof $\ \ {\rm mod}\ f\!:\,\ 0\,\equiv\, (x\!-\!1)f\,\equiv\, x^{\large 3}-1\,\Rightarrow\,\color{#c00}{x^{\large 3}\equiv 1},\,$ therefore $$\begin{eqnarray} g \! &&=\, x^{\large 2}\, (\color{#c00}{x^{\large 3}})^{\rm\large J}\! + x\,(\color{#c00}{x^{\large 3}})^{\rm\large K}\! + (\color{#c00}{x^{\large 3}})^{\rm\large L}\\ &&\equiv\, x^2\ \color{#c00}{(1)}\ \ +\ x\,\ \color{#c00}{(1)}\ \ +\ \ \color{#c00}{(1)}\\ &&\equiv\, f\equiv\, 0\end{eqnarray}\qquad$$ Remark $\$ If modular arithmetic is unfamiliar you can proceed equivalently as follows
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9724147201714923, "lm_q1q2_score": 0.8206160161869259, "lm_q2_score": 0.8438950986284991, "openwebmath_perplexity": 612.7965323358018, "openwebmath_score": 0.9251831769943237, "tags": null, "url": "http://math.stackexchange.com/questions/743440/contest-problem-involving-primes-and-factorization" }
ros, navigation, turtlebot, frontier-exploration, dwa-local-planner local_costmap_params.yaml: local_costmap: global_frame: odom static_map: false rolling_window: true width: 4.0 height: 4.0 plugins: - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"} - {name: inflation_layer, type: "costmap_2d::InflationLayer"} global_costmap_params.yaml: global_costmap: global_frame: map rolling_window: false track_unknown_space: true static_map: true plugins: - {name: static_layer, type: "costmap_2d::StaticLayer"} - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"} - {name: inflation_layer, type: "costmap_2d::InflationLayer"} move_base_params.yaml: shutdown_costmaps: false controller_frequency: 5.0 controller_patience: 3.0 recovery_behaviour_enabled: true planner_frequency: 1.0 planner_patience: 5.0 oscillation_timeout: 10.0 oscillation_distance: 0.2 base_local_planner: "dwa_local_planner/DWAPlannerROS" base_global_planner: "navfn/NavfnROS" dwa_local_planner_params.yaml: DWAPlannerROS: max_vel_x: 0.5 # 0.55 min_vel_x: 0.0 max_vel_y: 0.0 min_vel_y: 0.0 max_trans_vel: 0.5 min_trans_vel: 0.1 trans_stopped_vel: 0.1 max_rot_vel: 5.0 min_rot_vel: 0.4 rot_stopped_vel: 0.4 acc_lim_x: 1.0 acc_lim_theta: 2.0 acc_lim_y: 0.0 # Goal Tolerance Parameters yaw_goal_tolerance: 0.3 xy_goal_tolerance: 0.15
{ "domain": "robotics.stackexchange", "id": 25002, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, turtlebot, frontier-exploration, dwa-local-planner", "url": null }
phylogenetics, phylogeny, statistics, genomics Title: Genomics Statistics Problem I have used a python script to identify target sequences in a DNA sequence file. There are two classes of sequence: coding and non-coding. I have identified 728 sequences of interest. 597 of these fall into the coding regions and 131 of these fall into the non-coding regions. This is the equivalent of 18% non-coding. The total non-coding region in the sequence file is 13%. Is there a statistical tool to demonstrate the python script identified target sequences in a non-random fashion? If the script identified sequences that were randomly distributed then 13% of them would have been found in the non-coding region, from a total of 728 this seems like it should be reliable. If your null hypothesis is that the event of being selected by your program is statistically independent from the event of being non-coding, you can use Fisher's exact test to reject the null hypothesis. Suppose you have 10,000 (I'm making that up but presumably you have the real number) total sequences, 8,700 coding and 1,300 noncoding. Given that your program selects 728 sequences, you would expect around 13%*728 ~= 95 noncoding sequences. But your program picked 131 noncoding sequences and you want to know if 131 is far enough away from 95 to conclude that the difference is not just due to chance. The probability of selecting 131 or more of these noncoding sequences (given that we are choosing 728 total sequences) is given by the so-called hypergeometric distribution. The two-sided test will also incorporate the probably of getting an equally unlikely low number (in this case, somewhere around 57) or less. In R for example, you can calculate this using the 2-by-2 contingency table as follows: fisher.test(rbind(c(597, 131), c(8103, 1169))) which gives: p-value = 7.399e-05
{ "domain": "bioinformatics.stackexchange", "id": 842, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phylogenetics, phylogeny, statistics, genomics", "url": null }
quantum-mechanics, homework-and-exercises, schroedinger-equation, harmonic-oscillator, boundary-conditions L=-\sqrt{\frac{2mg^2}{\hbar\omega^3}} $$ This is Weber's Equation, which has solutions known as parabolic cylinder functions. The parabolic cylinder functions can be parameterized in several ways, but one way is to separate the series into two parts based on end behaviour: $U(-\frac{1}{2}-\nu,z)$ and $V(-\frac{1}{2}-\nu,z)$. $U(-\frac{1}{2}-\nu,z)$ always converges to $0$ as $x\rightarrow\infty$ regardless of $\nu$. However, unless $\nu$ is a non-negative integer, it will diverge as $x\rightarrow -\infty$. This means that $U(-\frac{1}{2}-\nu,z)$ is the general solution to this problem since it reproduces the expected behavior for half-integer values of the energy while also having the ability to satisfy other left-hand boundary conditions by tweaking $\nu$. I'll use $U(-\frac{1}{2}-\nu,z)=D_\nu(z)$ from now on since that is the usual terminology. Actually solving this problem for a given value of $g$ (or, equivalently, $L$) can be quite tricky. In fact, solutions which are simple, clean, and exact are impossible to come by. Instead, we must solve this problem numerically. For the sake of illustration, let's suppose $L=-\sqrt{2}$. In this case, we find that $E_\nu=\nu\hbar\omega$, the lowest energy solution is for $\nu\approx 0.234234$, and the normalization constant is $N=\frac{1}{\sqrt{1.66278}}$. Therefore, the groundstate wavefunction would be roughly $$
{ "domain": "physics.stackexchange", "id": 61795, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, homework-and-exercises, schroedinger-equation, harmonic-oscillator, boundary-conditions", "url": null }
newtonian-mechanics, mass, eigenvalue Example of construction of a non-diagonal mass matrix, as in finite-element method. Consider two bar elements with mass density $\bar m$ and unit length. I assume that for each element, the displacement between the two nodes is linear, which gives to basis function: $$ \varphi_1(x)=1-x \quad \varphi_2(x)=x $$ Then, it can be proven (using the principle of virtual work) that the mass matrix of each element is given by M_e, of entries $m_{ij}=\int_0^1 \varphi_i(x)\varphi_j(x)\text{d}x$. The calculation yields: $$M_e=\left( \begin{array}{cc} \frac{1}{3} & \frac{1}{6} \\ \frac{1}{6} & \frac{1}{3} \\ \end{array} \right)$$ Altogother, for my two elements, the mass matrix is: $$M=\left( \begin{array}{ccc} \frac{2}{3} & \frac{1}{6} & 0 \\ \frac{1}{6} & \frac{2}{3} & \frac{1}{6} \\ 0 & \frac{1}{6} & \frac{1}{3} \\ \end{array} \right) $$
{ "domain": "physics.stackexchange", "id": 25331, "lm_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, mass, eigenvalue", "url": null }
Hope this helps. :) • That makes sense, thank you! Jul 2 at 6:25 Your calculation is correct and complete if you write it like this: \begin{align} &\text{y is in the range of f} \\ \iff &x^2 + 3x + 2-y=0 \text{ for some } x \in \Bbb R \\ \iff &\text{the discriminant of x^2 + 3x + 2-y is non-negative} \\ \iff &y \ge -1/4 \, . \end{align} • Thank you! This clears my doubt Jul 2 at 6:28 I think the OP’s doubt is that “f(x)$$\geq\frac 14$$“ states that any values taken by f(x) are greater than or equal to $$\frac 14$$, but not that f(x) takes all values greater than or equal to $$\frac 14$$. Note that $$y=f(x)$$ is continuous and differentiable on all points in $$\mathbb R$$. The minimum value of a quadratic function $$ax^2+bx+c=a\left(x+\frac{b}{2a}\right)^2+\frac{4ac-b^2}{4a^2}$$ occurs at $$\displaystyle x=-\frac{b}{2a}$$ so there exists some x such that the minimum occurs.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676460637103, "lm_q1q2_score": 0.818496186106042, "lm_q2_score": 0.8354835330070839, "openwebmath_perplexity": 175.97661309596086, "openwebmath_score": 0.9558665156364441, "tags": null, "url": "https://math.stackexchange.com/questions/4484252/a-silly-question-on-range-of-a-quadratic-function" }
acoustics, air, displacement \end{align}$$ That is a Very Loud Pop - about 80 dB. Even if we argue that only a small fraction of this pressure ends up in the audible range there is no doubt in my mind you would hear "something". So yes, you can hear that parchment disappearing. No problem. Even if some of my approximations are off by a factor 10 or greater. We have about 5 orders of magnitude spare. AFTERTHOUGHT If you have ever played with a "naked" loudspeaker (I mean outside of the enclosure, so something like this one from greatplainsaudio.com):
{ "domain": "physics.stackexchange", "id": 17786, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acoustics, air, displacement", "url": null }
php, object-oriented, mysqli, authentication $password = UserData::hash($password); $query->bind_param('ssss', $username, $password, $rank, $name); if(strlen($username) < 3 || strlen($username) > 15) { $errors[] = "The length of the username can only range from 3 to 15 characters."; } if(strlen($password) < 3 || strlen($password) > 15) { $errors[] = "The length of the password can only range from 3 to 15 characters."; } if(strlen($name) < 3 || strlen($name) > 15) { $errors[] = "The length of the name can only range from 3 to 15 characters."; } $query->execute(); $query->close(); } } class UserData { protected $db; public $username; public $password; public $rank; public $name; public function __construct() { $this->db = new mysqli('localhost', 'root', 'php123', 'sms'); }
{ "domain": "codereview.stackexchange", "id": 8432, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, mysqli, authentication", "url": null }
field-theory, definition, supersymmetry, spinors \end{equation} is the same as the identity \begin{equation} \varepsilon^{\alpha\beta}\varepsilon^{\gamma\delta} - \varepsilon^{\alpha\gamma}\varepsilon^{\beta\delta} + \varepsilon^{\alpha\delta}\varepsilon^{\beta\gamma} = 0. \end{equation} To go between them, we just use $\sigma^2 = i\varepsilon$ and the fact that spinor fields anti-commute. When it comes to proving this identity, there are two possible answers. One is to learn about Fierz identities of which this is an example. However, sources on Fierz identities can often be misleading, giving readers the impression that the identities themselves should be learned rather than the algorithms for proving them. Memorizing identities is hopeless in invariant theory because if you want to build tensors with $N$ indices, the number of candidates built from the primitives will grow with $N$ much more quickly than the number of invariant tensors the group actually has. So I'll explain why $SU(2)$ only has two invariant tensors with four spinor indices in a way that hopefully makes the generalization to other situations clear. What we do is write \begin{equation} x_1 \varepsilon^{\alpha\beta}\varepsilon^{\gamma\delta} + x_2 \varepsilon^{\alpha\gamma}\varepsilon^{\beta\delta} + x_3 \varepsilon^{\alpha\delta}\varepsilon^{\beta\gamma} = 0 \end{equation}
{ "domain": "physics.stackexchange", "id": 80526, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "field-theory, definition, supersymmetry, spinors", "url": null }
$=1+(-\frac12+\frac12)+(-\frac13+\frac13)+...+(-\frac{1}{n-1}+\frac{1}{n-1})-\frac1n$ $=1-\frac{1}{n}$ $=\frac{n-1}{n}$ Hint: Most of the terms in $\sum_{i=2}^n 1/(i-1)$ and $\sum_{i=2}^n 1/i$ are the same. Write out a few examples for small $n$ and you'll see how it works.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9884918497491173, "lm_q1q2_score": 0.8215781329180384, "lm_q2_score": 0.8311430520409023, "openwebmath_perplexity": 95.30251462163825, "openwebmath_score": 0.7299743294715881, "tags": null, "url": "https://math.stackexchange.com/questions/995326/closed-form-of-a-sum" }
php, html, security } ?> <div class="content-wrapper"> <div class="content"> <div class="content-header"> Password Generator </div> <form method="post"> <table class="index-table"> <tr> <td width="30%">Password Lenght:</td> <td width="70%"><input type="number" name="p_length" value="15" required /></td> </tr> <tr> <td>Include Symbols:</td> <td><input type="checkbox" name="symbols" checked /> (e.g. @#$%)</td> </tr> <tr> <td>Include Numbers:</td> <td><input type="checkbox" name="numbers" checked /> (e.g. 123456)</td> </tr> <tr> <td>Include Lowercase Characters:</td> <td><input type="checkbox" name="lowercase_characters" checked /> (e.g. abcdefg)</td> </tr> <tr> <td>Include Uppercase Characters:</td> <td><input type="checkbox" name="uppercase_characters" checked /> (e.g. ABCDEFG)</td> </tr> <tr> <td></td> <td><input type="submit" value="Generate Password" name="generate_password" class="generate-button" style="border: none;" /></td> </tr> </table> </form> </div> </div>
{ "domain": "codereview.stackexchange", "id": 11533, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, html, security", "url": null }
electromagnetism, electrostatics, potential-energy Aside: there is a unit of energy which derives from the relationship between charge, potential and energy described above. It's called electronvolt: 1eV is the amount of electrostatic potential energy that a particle with electric charge equal to the charge of electron gains as it moves across electric potential difference of 1V. *The curious properties of static electric field alluded to above are formalized using mathematical notion of conservative vector field (of which electric field produced by a group of static charges is an example).
{ "domain": "physics.stackexchange", "id": 2155, "lm_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, electrostatics, potential-energy", "url": null }
quantum-field-theory, statistical-mechanics, correlation-functions, wick-rotation Title: What is the link between statistical and QFT correlation functions? I'm studying statistical mechanics in particular correlation function: https://en.wikipedia.org/wiki/Correlation_function_(statistical_mechanics) and I have understood it. Now searching on internet I found this: https://en.wikipedia.org/wiki/Correlation_function_(quantum_field_theory) I don't know quantum field theory and I was wondering which was the link between the two function? For example why the correlation function in quantum field theory is defined as $ \langle \phi_1,\phi_2,\dots,\phi_n \rangle $ and not $ \langle \phi_1,\phi_2,\dots,\phi_n \rangle - \langle \phi_1 \rangle \cdots \langle \phi_n \rangle $ as in statistical mechanics. The "link" comes from the path integral formulation of quantum mechanics. There's a certain dictionary that maps quantities from the canonical formulation to path integrals which closely resemble correlation functions from statistical mechanics. Specifically, suppose that $\varphi_1, \dots, \varphi_n$ are $n$ values of certain physical observables which correspond to quantities measured at times $t_1 > \dots > t_n$. A quantum transition amplitude is given by $$ \left< 0 \right| \hat{\varphi}_1 \dots \hat{\varphi}_n \left| 0 \right>, $$ where $\left| 0 \right>$ is the vacuum state of the quantum system, and quantities with "hats" represent quantizations of physical observables (linear operators acting on the Hilbert space). It encodes a certain probabilistic property of quantum systems. For example, for $n = 2$, its absolute value squared encodes the probability density of a transition between two quantum states. On the other side of the correspondence is the path integral $$ \int Dx e^{i \hbar^{-1} S[x]} \varphi_1[x] \dots \varphi_n[x], $$ where all quantities are just numbers. The expression
{ "domain": "physics.stackexchange", "id": 52334, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, statistical-mechanics, correlation-functions, wick-rotation", "url": null }
ros Title: Cannot find my own packages Dear ROS users, I don't have any experience with ROS but I want to learn to use it. I just installed it in Ubuntu 12.04 (fuerte), follow some steps in the tutorials, but I got stuck. In "Creating a ROS Package (rosbuild)" it says to create a new package: $ roscreate-pkg beginner_tutorials std_msgs rospy roscpp and check if ROS can find it. $ rospack find beginner_tutorials It can't. And I don't understand this: "If this fails, it means ROS can't find your new package, which may be an issue with your ROS_PACKAGE_PATH. Please consult the installation instructions for setup from SVN or from binaries, depending how you installed ROS. If you've created or added a package that's outside of the existing package paths, you will need to amend your ROS_PACKAGE_PATH environment variable to include that new location. Try re-sourcing your setup.sh in your fuerte_workspace." First I didn't have a ROS_WORKSPACE. So I made some research and used "export" to do it. Now root@to-vb:/opt/ros/fuerte_workspace# is my workspace. And it's where I created my new package (not in $ cd ~/fuerte_workspace/sandbox as it's said). Second, if it's an issue with ROS_PACKAGE_PATH, of course I created a package that's outside of the existing package paths, and $ cd ~/fuerte_workspace/sandbox is out of it! Then how do I amend it? My Ubuntu is in a virtual machine. I deleted and created a new one to install ROS again and it is still the same. So, I concluded that this tutorial steps are not coherent with my system. Could anyone help me, please? Nat0ne
{ "domain": "robotics.stackexchange", "id": 11774, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
where the last inequality follows from the convergence of $\int_0^\infty g$. • Does the fact that we can write $\int_T^\infty f_n$ depend on the fact that $\int_0^\infty g(x) dx < \infty$? – amarney Mar 23 '17 at 13:44 • @user5555: Yes. The existence (convergence) of $\int_T^\infty f_n = \lim_{c \to \infty} \int_T^c f_n$ follows from the Weierstrass test for improper integrals. – RRL Mar 23 '17 at 13:56 Hint: Prove that the upper and lower Riemann integrals converge to the upper and lower Riemann integrals of the limit function. The idea is that for sufficiently large $n$, the upper and lower sums are within $\epsilon I$ of the upper and lower limit sums respectively. The fact that closed real intervals are compact will play a role. • Do we not need an extra condition, namely that $f$ is integrable? – Mark Viola Mar 22 '17 at 20:54 • This isn't right -- this doesn't handle the unboundedness of the integral limits or use the fact that $g$ is a majorant – user369210 Mar 23 '17 at 0:35
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822877012965885, "lm_q1q2_score": 0.8269149760332091, "lm_q2_score": 0.8418256432832333, "openwebmath_perplexity": 306.9608676802585, "openwebmath_score": 0.9972292184829712, "tags": null, "url": "https://math.stackexchange.com/questions/2198754/prove-that-lim-n-rightarrow-infty-int-0-infty-f-nx-dx-int-0-infty/2199128" }
ros, navigation, nav-core, move-base, base-local-planner Title: Mechanism for calculating smooth trajectory? Hi, I have a wheelchair robot, and I have written by own path planner. My path planner gives a set of waypoints to reach the goal, each ~1m apart, and a path is re-planned every time there is something observed by Kinect. I have been sending these waypoints to move_base to get to these waypoints, treating them as a goal to move_base node. However, I realized that move_base is slow in adapting to a new goal when there is a goal already being pursued. I just need a mechanism that computes a smooth trajectory given a two points (current position and the goal), by taking account of the current robot's velocity and position. I do not need obstacle avoidance, costmap update, recovery method and etc, which I presume is slowing down the move_base node. Is there a such node in ROS? I think base_local_planner is somehow publishing the velocity (cmd_vel topic) with a given plan, however I do not really have a plan but only two points. Any help would be appreciated. Originally posted by bkim on ROS Answers with karma: 86 on 2012-08-28 Post score: 0 I know this is not quite what you are looking for, but you can try to use goal_passer as your local planner, which is available in the navigation_experimental stack or carrot_planner. Both are simpler planners that may speed up your navigation. If they do not suit you, you can look at their codes and create your own. cheers Originally posted by Procópio with karma: 4402 on 2012-08-28 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 10802, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, nav-core, move-base, base-local-planner", "url": null }
astrophysics, astronomy, exoplanets, transit Title: Is the transit technique for exoplanet detections part of the "Wide-Field Precision Photometry Revolution"? In a exoplanet focused lecture I was informed that the two main techniques for the detection of exoplanets were: radial velocity (VR) and transit. These were very briefly explained to us. When watching a presentation by Dr. Bender, it is stated that the RV technique was the most prominent technique up to the late 00's, but at around 2010 there was a "Wide-Field Precision Photometry Revolution", which was characterized by its fainter limiting magnitude. Is the transit technique categorised as one of the techniques in this wide-field precision photometry revolution? Yes. By “precision photometry” we mean “measuring just exactly how bright this star is.” The transit technique looks for variations in the brightness of the star. As your photometry becomes more precise, you are able to distinguish smaller variations in stellar brightness, which allows you to detect transits by smaller planets, more rapid transits, or both. The “wide field” part is because, rather than concentrating on a single star, the Kepler mission (and follow-ups) was able to rapidly and precisely measure the brightness of every star in its field of view. The transit technique has a fainter limiting magnitude than spectroscopic techniques because you need less light to say “there is some light here” than you do to analyze that light’s spectrum and identify a periodic Doppler shift.
{ "domain": "physics.stackexchange", "id": 86961, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics, astronomy, exoplanets, transit", "url": null }
at (10,0): $$J=\begin{bmatrix} 30 & 20\\ 0 & -16 \end{bmatrix}$$ diagonal matrix with eigenvalues 30 and -16 => saddle at (6,6): $$J=\begin{bmatrix} 18 & 12\\ -6 & 12 \end{bmatrix}$$ eigenvalues are $15+3i\sqrt{7}, 15-3i\sqrt{7}$ => unstable spiral Title: Re: FE-P5 Post by: Yvette Yu on December 14, 2018, 10:39:38 AM Here is diagram for (c) and (d) Title: Re: FE-P5 Post by: Jingze Wang on December 14, 2018, 10:42:58 AM This is the computer generated global phase portrait. We already know that Wolfram Alpha provides rather crappy pictures here. V.I. Title: Re: FE-P5 Post by: Jerry Qinghui Yu on December 14, 2018, 10:43:52 AM a clearer picture for d Title: Re: FE-P5 Post by: Doris Zhuomin Jia on December 14, 2018, 10:55:45 AM Sorry i don't know how to type math symbols, so I do part c. Title: Re: FE-P5 Post by: Victor Ivrii on December 15, 2018, 04:36:09 AM So far nobody explained 1) why rotation in the focal (spiral) point is clockwise 2) why stable node at $(0,0)$ and saddles at $(0,3)$ and $(10,0)$ look this way (actually Yvette did but it should be typed)
{ "domain": "toronto.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9867771770811146, "lm_q1q2_score": 0.8021189261840737, "lm_q2_score": 0.8128673269042767, "openwebmath_perplexity": 3197.5430796030864, "openwebmath_score": 0.6653000116348267, "tags": null, "url": "https://forum.math.toronto.edu/index.php?PHPSESSID=5sd8nokuindmf7f486pec3ir54&action=printpage;topic=1655.0" }
Since each moves flips over two adjacent coins the total number of flips of the odd- and even-flipped is equal to 6. For odd-flipped coins it means that the only possible combination of flips is $$1113$$. For even-flipped coins the sequences are $$0222$$, $$0024$$, and $$0006$$. The latter sequence is however excluded since no matter how one of its adjacent coins is chosen to flip over together two other "odd" coins remain unflipped. By similar argument in the sequence $$0024$$ the 2- and 4-coins should be opposite, the both neighbors of the 2-coin being flipped once. That means that the 4-coin is flipped 3 times in a pair with one adjacent coin and 1 time with the other one. Altogether there are $$8\cdot2=16$$ possible arrangements of the coins (8 ways to choose the 4-coin, and 2 ways to choose 3-coin among its neighbors). For the sequence $$0222$$ each of the neighbors of the 0-coin can be flipped only together with adjacent 2-coin. The other flip of the two 2-coins flips over once the odd coins adjacent to the remaining 2-coin (which is opposite to the 0-coin). This means that the latter coin have to be flipped over twice with the same neighbor. Altogether there are $$8\cdot2=16$$ possible arrangements (8 ways to choose 0-coin, and 2 ways to choose the 3-coin among the neighbors of the opposite 2-coin). It remains only to order the flips. In the case $$0024$$ we flip over one pair 3 times and 3 pairs 1 time. So we can permute them in $$\frac{6!}{3!1!1!1!}=120$$ ways. In the case $$0222$$ we flip over one pair 2 times and 4 pairs 1 time. So we can permute them in $$\frac{6!}{2!1!1!1!1!}=360$$ ways. Hence the overall number to arrange the flips is: $$16\cdot120+16\cdot360=7680.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232899814556, "lm_q1q2_score": 0.831411937004964, "lm_q2_score": 0.84594244507642, "openwebmath_perplexity": 587.0903309982863, "openwebmath_score": 0.7916698455810547, "tags": null, "url": "https://math.stackexchange.com/questions/3735732/number-of-sequences-of-6-moves-leaving-8-coins-alternating-heads-and-tails" }
ros, kinect, sensor-msgs, mit-ros-pkg Title: why no such directory "sensor_msgs" Hi, everyone! I am using mit-ros-pkg "hand detection". I met a problem and then I checked the directory and files. I found that there should be a directory "sensor_msgs" while I do not I have. Help! Thank you! Originally posted by tan on ROS Answers with karma: 1 on 2012-05-18 Post score: 0 Original comments Comment by tan on 2012-05-18: thank you very much. that works. Generally, you should always provide an exact error message and which ROS version you are using (see here for support guidelines). I assume that the error is not because a missing directory but because you are missing the ros package sensor_msgs. To get it, install the stack common_msgs. If you are using ROS Fuerte, do sudo apt-get install ros-fuerte-common-msgs If you are using ROS Electric, do sudo apt-get install ros-electric-common-msgs Originally posted by Lorenz with karma: 22731 on 2012-05-18 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 9443, "lm_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, sensor-msgs, mit-ros-pkg", "url": null }
rviz, ar-pose No Makefile in package message_runtime [rosmake-0] Starting >>> std_msgs [ make ] [rosmake-0] Finished <<< std_msgs ROS_NOBUILD in package std_msgs No Makefile in package std_msgs [rosmake-0] Starting >>> geometry_msgs [ make ] [rosmake-0] Finished <<< geometry_msgs ROS_NOBUILD in package geometry_msgs No Makefile in package geometry_msgs [rosmake-0] Starting >>> visualization_msgs [ make ] [rosmake-0] Finished <<< visualization_msgs ROS_NOBUILD in package visualization_msgs No Makefile in package visualization_msgs [rosmake-0] Starting >>> angles [ make ] [rosmake-0] Finished <<< angles ROS_NOBUILD in package angles No Makefile in package angles [rosmake-0] Starting >>> rospack [ make ] [rosmake-0] Finished <<< rospack ROS_NOBUILD in package rospack No Makefile in package rospack [rosmake-0] Starting >>> roslib [ make ] [rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib No Makefile in package roslib [rosmake-0] Starting >>> rosunit [ make ] [rosmake-0] Finished <<< rosunit ROS_NOBUILD in package rosunit No Makefile in package rosunit [rosmake-0] Starting >>> rosconsole [ make ] [rosmake-0] Finished <<< rosconsole ROS_NOBUILD in package rosconsole No Makefile in package rosconsole [rosmake-0] Starting >>> rosgraph_msgs [ make ] [rosmake-0] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
{ "domain": "robotics.stackexchange", "id": 13242, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, ar-pose", "url": null }
python, programming-challenge We always have prev_line defined, good. But some automated code analyzers will tend to make a false report that a .findall on prev_line[pos - 1:pos + 2] may use an uninitialized variable. So don't be surprised when code like OP is edited by some future maintenance engineer to start with a "useless" initialization assignment of, say, empty string. This is perhaps slightly tricky logic. It relies on an (easily proved) theorem from the problem domain: Pretending that gears in current line were also part of the previous line won't change the result. This is partly due to our neighborhood definition (currently the symmetric Moore neighborhood), and partly due to digit characters and gear characters forming disjoint sets. I continue to feel that random access to (x, y) locations would be a more natural fit to the business domain. We strive to write functions (or "blocks" of main code) that can be visually taken in as a single screenfull, with no scrolling, to facilitate Local Analysis. That (buried) final assignment line illustrates why writing "short" functions is so important. two techniques with same meaning # check number of adjacents before doing anything if curr_line[pos - 1].isdigit(): adjacents += 1 if curr_line[pos + 1].isdigit(): adjacents += 1 adjacents += len(re.findall(PATTERN, prev_line[pos - 1:pos + 2])) adjacents += len(re.findall(PATTERN, next_line[pos - 1:pos + 2])) Thank you for the helpful comment, and for vertically setting this code apart. As usual, when you feel the need to write a comment, that often suggests the need to write a helper function. Here, we might name it def get_number_of_adjacents.... The name PATTERN is not very helpful. Better to mention that it matches digits. I find it sad that we have two different approaches for accomplishing the same thing: test character .is_digit() regex digit pattern match
{ "domain": "codereview.stackexchange", "id": 45235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, programming-challenge", "url": null }
exoplanet, quake, star-evolution Title: Are planet-destroying quakes possible or observable? The Gutenberg-Richter-Law is a very-well studied relationship between the magnitude and total number of (earth)quakes. In theory, there is no upper bound for the size of a quake other than the size of the planet. In other words: There is a non-zero probability (which is rather low) that a quake can rip appart the whole planet. There are numerical evidences with toy models such as the Olami–Feder–Christensen model suggest, such things can really happen. Therefore my question: Are they any hints for (exo)planet-destroying quakes? And what about star-quakes which occur during stationary phases of star evolution? References
{ "domain": "astronomy.stackexchange", "id": 5079, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "exoplanet, quake, star-evolution", "url": null }
quantum-mechanics, hilbert-space, operators, momentum, commutator $$(\hat x \circ \hat p): f(x) \mapsto \hat x\big(\hat p(f(x))\big) = \hat x\big(-if'(x)\big) = -ixf'(x)$$ where $\hat p \circ \hat x$ is pronounced "$\hat p$ after $\hat x$". It is conventional to drop the $\circ$ notation, but this is what appears in the commutation relations.
{ "domain": "physics.stackexchange", "id": 66696, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, hilbert-space, operators, momentum, commutator", "url": null }
general-relativity, differential-geometry, tensor-calculus, curvature \begin{align} P_{x,[0,\epsilon]}&=\text{id}-\epsilon \Gamma_i(p)v^i+\frac{\epsilon^2}{2}\left(-\frac{\partial\Gamma_i}{\partial x^l}(p)v^lv^i-\Gamma_i(p)a^i+(\Gamma_i(p)v^i)^2\right)+O(\epsilon^3).\tag{$*$} \end{align} The equation $(*)$ is the key formula for us which gives us a second-order expression for parallel-transport along a curve $x$ and over the interval $[0,\epsilon]$.
{ "domain": "physics.stackexchange", "id": 98735, "lm_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, differential-geometry, tensor-calculus, curvature", "url": null }
Enable JavaScript if it is an outlier ” method with following parameters: 1. col String! Do is to take the data and sort it in ascending order to filter values that outside. Add the result to Q3 –13 to 27, 35 is the difference between ''. To fit '' any values that fall outside of Q1 and.! Below the threshold, 35 is the length of the numerical columns highlight outliers has worked well, so would... Some central value 1.5XIQR rule determine if you have outliers and extreme values, I will calculate IQR, just... Start text, I will calculate IQR, respectively or greater than Q3 1.5×IQR!, consectetur adipisicing elit for identifying outliers we next need to be taken directly to the third quartile observation. Method with following parameters: 1. col: String: the names the... Box in the box-and-whisker plot below Q1 and 15 points below Q1 and 15 points Q3! The interquartile range ( we ’ ll also be Explaining these a bit down... Lorem ipsum dolor sit amet, consectetur adipisicing elit I wo n't have a top whisker my! By default if any uses to identify outliers in filters and multiple visualizations than 18 books are outliers 12pt Paragraph... 105\ ) IQR ) is = Q3 – Q1 14.1, 14.4 Editora BI U a TEX CL... Subtract from our Q1 value: 35 + 6 = 41 and 80 value Q3. 14.9 + 3×0.5 = 12.9 and 14.9 + 3×0.5 = 12.9 and 14.9 + 3×0.5 =.... Subtract Q1, 529, from Q3, 676.5 bit further down ) q 1 the... 25 % books are outliers = 2\ ) upper fence: \ ( 90 + 15 = 105\ ) also! You identified outliers by default above or below the first quartile fence, so 10.2 would be an value... 16.4 as outliers a random sample of 20 sophomore college students being . Higher than the lower threshold
{ "domain": "fodershopen.se", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692291542525, "lm_q1q2_score": 0.8030068221982407, "lm_q2_score": 0.8221891283434876, "openwebmath_perplexity": 2326.3820189173066, "openwebmath_score": 0.48781871795654297, "tags": null, "url": "http://fodershopen.se/lucy-davis-urzittk/c33073-how-to-find-outliers-with-iqr" }
javascript, dom create: function (titleText, bodyText) { 'use strict'; var wrap, head, title, mini, close, body, foot; wrap = this.element('div', 'wrap', { border: '1px solid #43484A', boxShadow: '-1px -1px 5px #292929, 1px 1px 5px #292929', height: '185px', opacity: '.95', position: 'absolute', width: '300px', }); // etc.... this.identifier++; }, element: function(type, name, styles) { return element(type, name + this.identifier, styles)); } } window.Note = Note; // expose the local stuff to the window }); note = new Note(); note.create( 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu orci nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis posuere rutrum pellentesque.' ); Also have a look at JavaScript Design Patterns book by O'Reilly. PS: I'd further suggest that you move out your CSS into actually CSS class declarations and use those on your elements.
{ "domain": "codereview.stackexchange", "id": 635, "lm_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, dom", "url": null }
Note that \begin{align}U &= \bigl\{(x_1,x_2,x_3,x_4)^T\in\Bbb R^4:x_2+2x_3=0,x_2+x_4=0\bigr\}\\ &= \bigl\{(x_1,x_2,x_3,x_4)^T\in\Bbb R^4:x_2=-2x_3,x_4=-x_2\bigr\}\\ &= \bigl\{(x_1,-2x_3,x_3,2x_3)^T:x_1,x_3\in\Bbb R\bigr\}\\ &= \bigl\{x_1(1,0,0,0)^T+x_3(0,-2,1,2)^T:x_1,x_3\in\Bbb R\bigr\}.\end{align} Since $U$ is spanned by the linearly independent vectors $(1,0,0,0)^T$ and $(0,-2,1,2)^T$, then $U$ has dimension $2$. If we let $S:\Bbb R^4\to\Bbb R^4$ be the orthogonal projection onto $U$, then $U$ is the image (range) of $S$, and $U^\perp$ is the kernel (null space) of $S$. By Dimension Theorem, we have $$4=\dim(\Bbb R^4)=\dim(U)+\dim(U^\perp)=2+\dim(U^\perp),$$ so $\dim(U^\perp)=2$. That's how we know that there are $2$ vectors in any (orthonormal) basis for $U^\perp$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676490318649, "lm_q1q2_score": 0.8142439516069921, "lm_q2_score": 0.8311430436757312, "openwebmath_perplexity": 202.10827521943955, "openwebmath_score": 0.9985633492469788, "tags": null, "url": "http://math.stackexchange.com/questions/261607/orthonormal-basis-question" }
machine-learning, neural-network, deep-learning, gradient-descent, backpropagation What are we optimizing in backpropagation? Backpropagation allows you to update your weights as a gradient function of the resulting loss. This will tend towards the optimal loss (the highest accuracy). After each forward pass of your training stage, you get an output at the last layer. You then calculate the resulting loss $E$. The consequence of each of your weights on your final loss is computed using its partial derivative. In other words, this is how much loss is attributed to each weight. How much error can be attributed to that value. The larger this value is the more the weight will change to correct itself (training). $\frac{\partial E}{\partial w^k_{i, j}}$ How can we compute such a random partial derivative? Using the chain rule of derivatives, and putting together everything that led to our output during the forward pass. Let's look at what led to our output before getting into the backpropagation. The forward pass In the final layer of a 3-layer neural network ($k = 3$), the output ($o$), is a function ($\phi$) of the outputs of the previous layer ($o^2$) and the weights connecting the two layers ($w^2$). $y_0 = o^3_1 = \phi(a^3_1) = \phi(\sum_{l=1}^n w^2_{l,1}o^2_l)$ The function $\phi$ is the activation function for the current layer. Typically chosen to be something with an easy to calculate derivative. You can then see that the previous layers' outputs are calculated in the same way. $o^2_1 = \phi(a^2_1) = \phi(\sum_{l=1}^n w^1_{l,1}o^1_l)$ So the outputs of the third layer can also be written as a function of the outputs of layer 1 by substituting the outputs of layer 2. This point becomes important for how the backpropagation propagates the error along the network. Backpropagation The partial derivative of the error in terms of the weights is broken down using the chain rule into
{ "domain": "datascience.stackexchange", "id": 2451, "lm_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, neural-network, deep-learning, gradient-descent, backpropagation", "url": null }
algorithms, databases, counting Update Regarding size, assuming 8 categories of properties where each category has: 2, 6, 6, 6, 6, 8, 1140, 150 values respectively then estimated number of profiles: 2*6^4*8*1140*150 ~= 3.5 * 10^9. Number of nodes in graph: at least 7 * 10^9, number of edges in graph: at least 140 * 10^9. Update #2 Formula for number of nodes is: $\sum_{i<n}\prod_{k<i \atop j_1, j_2, ..., j_k < n} s_{j_{1}} ... s_{j_{n}}$ where $n$ is number of categories and $s_x$ is size of category $x$. So in my example there would be 11'169'108'657 nodes. Update #3 As per @Raphael advice - I have reduced number of nodes and now formula is: $\sum_{i<n-M}\prod_{k<i \atop j_1, j_2, ..., j_k < n} s_{j_{1}} ... s_{j_{n}}$ where $M<n$ and assumed that distribution of resources across smallest slices of universe is equal. At the same time removed lot of edges from graph. Example of sub-graph size reduction: So the data structure holding pointers for every possible combination of classifiers is huge. Sure, but why build it at all? Don't overengineer this! Just store the profiles in a database and do one (linear time) filtering sweep for each query, i.e. select/count on demand. For a few millions of records, that should require no further preprocessing. If the number of requests is large and/or you need really small response times, you can think about caching, or creating equivalence classes along some popular classifiers, or along classifiers with few large classes. Then, the linear sweep has to be done only on small lists. For example, you can divide your database along gender and age (assuming these are included in most customer queries)
{ "domain": "cs.stackexchange", "id": 1447, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, databases, counting", "url": null }
$$\sum_{k=0}^{n}\dbinom{n}{k}\left(k+1\right)^{n}\left(-1\right)^{n-k}=\color{red}{n!}$$ as wanted. Another variation of the theme. In the following we use the coefficient of operator $[z^k]$ to denote the coefficient of $z^k$ in a series. This way we can write e.g. \begin{align*} \binom{n}{k}=[z^k](1+z)^n\qquad\text{and}\qquad k^n=n![z^n]e^{kz} \end{align*} We obtain \begin{align*} \sum_{k=0}^n&\binom{n}{k}(n-k+1)^n(-1)^k\\ &=\sum_{k=0}^n\binom{n}{k}(k+1)^n(-1)^{n-k}\tag{1}\\ &=\sum_{k=0}^\infty[z^k](1+z)^nn![x^n]e^{(k+1)x}(-1)^{n-k}\tag{2}\\ &=(-1)^nn![x^n]e^x\sum_{k=0}^\infty(-e^x)^k[z^k](1+z)^n\tag{3}\\ &=(-1)^nn![x^n]e^x\left(1-e^x\right)^n\tag{4}\\ &=(-1)^nn![x^n]\left(-x\right)^n\tag{5}\\ &=n!\\ \end{align*} and the claim follows. Comment: • In (1) we exchange the order of summation $k\rightarrow n-k$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.982013790564298, "lm_q1q2_score": 0.8005695536722316, "lm_q2_score": 0.8152324960856175, "openwebmath_perplexity": 288.9576485837932, "openwebmath_score": 0.9559653997421265, "tags": null, "url": "https://math.stackexchange.com/questions/1861402/proof-of-the-summation-n-sum-k-0n-binomnkn-k1n-1k" }
image-processing, python, histogram You first need to understand morphological operators. This is a great resource and so is this one, particularly section 3.6 which is exactly what you are trying to do here. In brief, given a thresholded binary image where $1$ denotes a pixel in the Foreground and $0$ denotes a pixel in the Background, the perimeter of it is defined as the set of pixels that connect the Foreground with the Background regions. Obviously, here, Foreground, Background, 1,0 are interchangeable and depending on context. But for the purposes of this discussion we define Foreground as the pixels that the segmentation algorithm has determined to belong to some identifiable area, Background as the pixels that the segmentation algorithm has determined DO NOT belong to some identifiable area and 0,1 are just two numbers we use in place of Foreground and Background (It could be a different integer for each identifiable segmentation region). The brute-force way to do this is to scan through the "patch", examining the 4 or 8 connectivity of each pixel and looking for pixels that are not fully surrounded by Foreground pixels. THOSE PIXELS are the ones that exist in the perimeter of a region identified by the segmentation algorithm. OK, so the next question here is Where do i get these regions identified? and the answer is, from the dynamic texture modelling step that is described in section 3.1. What is dynamic texture modelling? It is a technique by which an image is modelled as a set of particles that tend to move in well defined patterns. From this perspective, a dynamic texture model is trying to discover the pattern of movement that these particles follow. Having discovered this, it is possible to "judge", if some particle's movement belongs or not to a specific model. In other words, when you observe scenes of cars moving on a motorway, birds flying in the sky, particles flowing in some liquid, or even...pedestrians moving along predetermined paths through a park, then these particles tend to follow well defined routes. For more information, please see this piece of work This is how the authors are discovering those grayscale blobs on Figure 3. Specifically: "We adopt the mixture of dynamic textures [18] to segment the crowds moving in different directions. The video is represented as collection of spatio-temporal patches (7 × 7 × 20 patches in all experiments reported in the paper), which are modeled as independent samples from a mixture
{ "domain": "dsp.stackexchange", "id": 4774, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, python, histogram", "url": null }
> $\left(a+1\right)\mathrm{hypergeom}\left(\left[-a,a+2\right],\left[\frac{3}{2}\right],\frac{1}{2}-\frac{1z}{2}\right)$ $\left({a}{+}{1}\right){}{\mathrm{hypergeom}}{}\left(\left[{-}{a}{,}{a}{+}{2}\right]{,}\left[\frac{{3}}{{2}}\right]{,}\frac{{1}}{{2}}{-}\frac{{1}}{{2}}{}{z}\right)$ (2) > $\mathrm{convert}\left(,\mathrm{Chebyshev}\right)$ ${\mathrm{ChebyshevU}}{}\left({a}{,}{z}\right)$ (3) > $\mathrm{JacobiP}\left(-a+b,-\frac{1}{2},-\frac{1}{2},\frac{1z}{2}\right)+\mathrm{JacobiP}\left(a-b,\frac{1}{2},\frac{1}{2},\frac{1z}{2}\right)$
{ "domain": "maplesoft.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97482115683641, "lm_q1q2_score": 0.8080670963135629, "lm_q2_score": 0.8289388167733099, "openwebmath_perplexity": 5825.320495465282, "openwebmath_score": 0.9402815699577332, "tags": null, "url": "http://www.maplesoft.com/support/help/Maple/view.aspx?path=convert/Chebyshev" }
ros2, rosbag Title: Is it possible in ROS2 to concurrently RW a bag file? Is it possible in ROS2 to concurrently write-to and read-from the same bag file using two different processes, kind of like using the bag file as a pipe? To my knowledge, this is not possible in ROS1, but I am curious if this is possible in ROS2. Originally posted by ajayvohra2005 on ROS Answers with karma: 32 on 2022-01-21 Post score: 0 I tried this and at least with the built-in storage plugin sqlite3, it is not possible. If one tries to open a ros2 bag that is already open, one gets the following error: [ERROR] [1642869934.723092322] [rosbag2_storage]: Could not open '/tmp/a.bag' with 'sqlite3'. Error: Failed to setup storage. Error: Could not read-only open database. SQLite error (10): disk I/O error [ERROR] [1642869934.723146073] [rosbag2_storage]: Could not load/open plugin with storage id 'sqlite3'. Originally posted by ajayvohra2005 with karma: 32 on 2022-01-22 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 37377, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, rosbag", "url": null }
newtonian-mechanics, thermodynamics, terminology, soft-question Title: Why do physicists comes up with special names for change in quantities? I only have a basic understanding of physics, so this may be a naive question. I've noticed in my self-study that when referring to the change in some quantity $Q$, instead of just calling it change in $Q$ and using the symbol $\Delta Q$, they'll come up with a different name and symbol. For example, a change in temperature $U$ is heat $Q$, a change in momentum $p$ is impulse $J$, a change in energy $E$ is work $W$, and so on. Why is this? Heat is actually a change in thermal energy, not temperature, but more broadly the answer to your question is that the things you've claimed are names for changes in quantities are really contributions to those changes. For example, if you can hear an object you move make a sound, the work you're doing on the object is a contribution to the change in its energy, but there's also a negative contribution coming from the sound production. Similarly, if a fast train collides with a slower one in front of it that's accelerating, the change in the front train's momentum over a period including the collision combines the impulse from the train behind with the change in momentum due to the front train's engine accelerating it.
{ "domain": "physics.stackexchange", "id": 43702, "lm_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, thermodynamics, terminology, soft-question", "url": null }
So $$g$$ does the job. For completeness, note $$g(z) = 3(f(z) +i).$$ • I simplified my answer and I think improved it. – zhw. Sep 21 '18 at 23:59 • Why your final answer does not match with the other given answers? – user486983 Sep 23 '18 at 16:39 • I showed that if $f:\mathbb D\to U$ is biholomorphic, and $f(0)=1-i,$ then $g(z)=3(f(z)+i)$ is a biholomorphic map from $\mathbb D$ to $U$ that sends $0$ to $3.$ Since you already found such an $f$ (your map $T_2$), I thought that using your $f$ would be a simple way to go. Continued below ... – zhw. Sep 23 '18 at 18:50 • But note that a map with these properties is not unique. In fact, if $g$ is one such map, then so is $g(cz),$ where $c$ is a constant with $|c|=1.$ Furthermore, all such maps are of the form $g(cz),|c|=1.$ For example, one of the other anwers has $g(z) = 3(1+z)/(1-z)$ as such a map. You can verify that the map I gave in my answer is $g(-iz)$ for this $g.$ – zhw. Sep 23 '18 at 18:50 • me? verify that the map you gave in your answer is $g(iz)$ for $g$? I am not the one receiving 100 bounty.. – user486983 Sep 24 '18 at 15:22
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575178175918, "lm_q1q2_score": 0.8144800579269627, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 240.54271678467157, "openwebmath_score": 0.9927870035171509, "tags": null, "url": "https://math.stackexchange.com/questions/2916099/from-the-unit-disk-to-the-right-half-plane-and-t0-3" }
c, hash-map ht_delete(ht, "Hel3"); ht_delete(ht, "Cau6"); ht_delete(ht, "1"); ht_print(ht); ht_free(ht); // end of tests // shakespeare demo FILE* fp = fopen("shakespeare.txt", "re"); if (!fp) { perror("fopen"); exit(EXIT_FAILURE); } ht = ht_create(32 * 1024); #define BUFSIZE 1024 #define WORDSIZE 50 char buf[BUFSIZE]; char word[WORDSIZE]; char* word_ptr = word; while (!ferror(fp) && !feof(fp)) { size_t bytes_read = fread(buf, 1, BUFSIZE, fp); char* buf_ptr = buf; while ((buf_ptr < buf + bytes_read)) { char c = *buf_ptr; if (ht_is_alpha(c)) { *(word_ptr++) = ht_tolower(c); if (word_ptr - word == WORDSIZE - 1) { // -1 for NULL terminator fputs("word too long. terminating\n", stderr); exit(EXIT_FAILURE); } } else if (word_ptr == word) { // ignore repeated terminators } else { *(word_ptr++) = '\0'; ht_inc(ht, word); // record word_ptr = word; // restart new word } ++buf_ptr; // next char from buf } } fclose(fp);
{ "domain": "codereview.stackexchange", "id": 40457, "lm_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, hash-map", "url": null }
What you generally find in references is that $$\xi_n = \mathrm{e}^{2\pi\mathrm{i}k/n}$$ for $$k = 0, 1, 2, \dots, n-1$$ is an $$n^\text{th}$$ root of unity and is a root of the polynomial $$x^n = 1$$. This says what we said above in many fewer words: an $$n^\text{th}$$ root of unity is a (complex) number whose $$n^\text{th}$$ power is unity ($$1$$), and those numbers have magnitude $$1$$ and proceed from $$1$$ anticlockwise by complex angle $$2\pi / n$$, meaning that their complex angles are evenly spaced. • What do you mean $\pi$ is $\pi/2$?! Did you mean $-\pi$? – J. W. Tanner Jun 14 at 3:33 • @J.W.Tanner : Guessing about which context-free $\pi$ you are referencing, ..., I think it's fixed now. If that's the only surviving "$\pi$" versus "$2\pi$" transposition here, I'll be surprised. – Eric Towers Jun 14 at 3:35 • thanks for fixing $\pi$ is $\color{red}2\pi/2$ – J. W. Tanner Jun 14 at 3:42
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462226131666, "lm_q1q2_score": 0.8030692006220346, "lm_q2_score": 0.8128673223709251, "openwebmath_perplexity": 394.90185322550167, "openwebmath_score": 0.9952365159988403, "tags": null, "url": "https://math.stackexchange.com/questions/3261726/what-is-the-meaning-of-nth-root-of-unity/3261739" }
navigation, move-base 'ROS_MASTER_URI': 'http://localhost:11311', 'PYTHONPATH': '/home/udoo/ros/devel/lib/python2.7/dist-packages:/opt/ros/hydro/lib/python2.7/dist-packages', 'ROS_ROOT': '/opt/ros/hydro/share/ros', 'PKG_CONFIG_PATH': '/home/udoo/ros/devel/lib/pkgconfig:/opt/ros/hydro/lib/pkgconfig', 'LC_ALL': 'C', 'ROS_TEST_RESULTS_DIR': '/home/udoo/ros/build/test_results', '_': '/opt/ros/hydro/bin/roslaunch', 'CATKIN_TEST_RESULTS_DIR': '/home/udoo/ros/build/test_results', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LC_MESSAGES': 'POSIX', 'OLDPWD': '/home/udoo', 'PWD': '/home/udoo/ros', 'ROS_ETC_DIR': '/opt/ros/hydro/etc/ros', 'MAIL': '/var/mail/udoo', 'LS_COLORS':
{ "domain": "robotics.stackexchange", "id": 19275, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, move-base", "url": null }
mechanical-engineering Title: How do I dimension the natural frequency formula? with masses declared as grams and static stiffness as N/mm, how do I dimension them for Hz ? Units of N, mm (for the stiffness k), and g (for the mass m) are not consistent. You need to convert these values to use in the basic equation for the frequency: $$f=\frac{1}{2*\pi} \sqrt \frac{k}{m}$$ Knowing that $1 \, N = 1 \, kg*m/s^2$, $1 \, m = 1000 \, mm$, and $1 \, kg = 1000 \, g$, you get the following: $$f=\frac{1}{2*\pi} \sqrt \frac{N/mm*((1 kg*m/s^2)/N)*(1000 mm/m)}{g*(1 kg/1000 g)}$$ All of the units cancel except for $\sqrt {1/s^2}$. Doing the math gives the following result: $$f = \frac{1000}{2*\pi} \sqrt \frac{k \; in \; N/mm}{m \; in \; g}$$ where f is in units of cycles/sec = Hz.
{ "domain": "engineering.stackexchange", "id": 3011, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering", "url": null }
javascript, sorting, node.js Title: Faster way to check for a string in a array of string I have a array of object, I need to sort them by time (hours, days or months) and separate the number of new IP. result is an array of object with property time (JavaScript timestamp), user IP (string). This code does work, but for request resulting in over 10k element, it is slow as hell. I think the problem is the comparison for new IP, but I can't find any faster way. Here the slow code: result.forEach(function (element) { if (ip.indexOf(element.get('user_ip')) < 0) { ip.push(element.get('user_ip')); visitors_u[get_time_index(element, type)] = visitors_u[get_time_index(element, type)] + 1; } visitors[get_time_index(element, type)] = visitors[get_time_index(element, type)] + 1; }); If you want to try the app, you ll need a mongoDB database: var mongoose = require('mongoose'), express = require('express'), app = express(), bots = [/bot/i, /crawler/i, /spider/i, /topsy/i, /search/i, /coccoc/i], db_web = 'player_web_log_xxx', db; function connect (callback) { console.log('Connecting to MongoDB...'); mongoose.connect('mongodb://xxx/stats'); //Creer la connexion a mongodb db = mongoose.connection; //Assigner la connexion console.log('Starting server'); app.listen(8080); //Lancer le serveur console.log('Listening'); db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function () { //Une fois connecte console.log('Connected');
{ "domain": "codereview.stackexchange", "id": 9449, "lm_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, sorting, node.js", "url": null }
java, security, hashcode Title: Securely hash passwords Since hashing algorithms isn't something to mess around with as a beginner. Several howto's explain that one should use already made solutions. Examples of such pages: https://crackstation.net/hashing-security.htm https://owasp.org/www-project-cheat-sheets/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2 So I opted for ready-made solutions from java.security and java.crypto library packages. But I feel there is still room for messing up, especially with regard to the parameters in PBEKeySpec(password, salt, iterations, keyLength). According to some HOWTOs, salt should be as long in bytes as the output from the hash function. So I chose 64, since SHA-512 outputs (64*8=512 bits) 64 bytes. (Although, it seems I can get larger output simply by increasing keyLength argument above 512, which makes me wonder). So basically. Do you guys/girls find this code reasonable? Especially in regards to the arguments passed? If not, please tell me what to change, how and why. package my.application; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.security.spec.InvalidKeySpecException; import java.util.Arrays; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import org.apache.commons.codec.binary.Hex; public class PasswordHasher { private int ammountOfBytes = 64; private int keyLength = 512; private int iterations = 100000; private byte[] salt; private byte[] hash; private char[] password; private String saltHex; private String hashHex;
{ "domain": "codereview.stackexchange", "id": 37336, "lm_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, security, hashcode", "url": null }
zoology, pathology, herpetology Title: How do pet gecko lizards pose a health risk? Does having gecko lizards living in your house pose any health risk? If you're referring to keeping geckos as pets, like all reptiles, amphibians and birds, they come with a small but finite risk of contracting salmonellosis. Having said this, the infection is easy to avoid if you maintain basic hygiene. On a personal note, I know dozens (perhaps hundreds) of people who keep or have kept reptiles as pets and have yet to meet anyone who contracted salmonellosis. Basically, if you wash your hands after touching the gecko, keep it away from food preparation areas and don't put the lizard in your mouth, you should be fine. If you're talking about geckos living free in your home, as is common in many tropical places, I have never heard of any health risks associated with them. If anything, I would think that the geckos would reduce health risks by eating insects such as cockroaches and mosquitoes that are prominent disease carriers.
{ "domain": "biology.stackexchange", "id": 1041, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "zoology, pathology, herpetology", "url": null }
ros, timestamp, transform Original comments Comment by alfa_80 on 2012-01-26: Looks good, I'll try it later..Thanks a lot. Comment by Lorenz on 2012-01-26: That's one way. Another one is to provide similar functionality in your publisher node. Click on the link :) You basically need to publish time on the /clock topic. I've never done that however. Comment by alfa_80 on 2012-01-26: "..you need to do something similar, i.e. provide simulation time (link on more information in my answer)", you mean, in this case I need to generate a rosbag first right in order to use the --clock parameter? Comment by alfa_80 on 2012-01-26: Nevermind, I'll stick to having those warnings/exceptions first, but later on when I need to use with other packages, I'll change the one that you suggested using ros::Time::now(). Thanks anyway. Comment by Lorenz on 2012-01-26: Sure. You lose something by setting the laser stamp time to current time. That's one reason why rosbag has the --clock parameter. If you need to use correct laser timestamps in your application , you need to do something similar, i.e. provide simulation time (link on more information in my answer). Comment by alfa_80 on 2012-01-26: Somebody told me, that way is also problematic. I think so too. Because if we set using ros::Time::now(), it's very different from the original timestamp as the original one has uneven step size, the sequence is not really like (23.3, 23.4, 23.5) but rather like (23.3, 24.0, 24.2)..somthg like that. Comment by Lorenz on 2012-01-26: Yes. that's exactly what I meant. Comment by alfa_80 on 2012-01-26:
{ "domain": "robotics.stackexchange", "id": 7996, "lm_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, timestamp, transform", "url": null }
deep-learning, overfitting, transfer-learning, vgg16 # Freeze the first four convolutional blocks for layer in base_model.layers[:19]: layer.trainable = False # Add custom layers to the pre-trained model x = base_model.output x = Flatten()(x) x = Dropout(0.75)(x) x = Dense(128, activation='relu', kernel_regularizer=l2(0.1))(x) output_layer = Dense(1, activation='sigmoid')(x) # Create the final model model = Model(inputs=base_model.input, outputs=output_layer) # Adadelta custom_adadelta_optimizer = Adadelta(learning_rate=0.0001) # compile the model model.compile(optimizer=custom_adadelta_optimizer, loss='binary_crossentropy', metrics=['accuracy']) # print summary model.summary() # early stop early_stopping = EarlyStopping(monitor='val_loss', patience=3, restore_best_weights=True) # train the model history = model.fit_generator( train_generator, steps_per_epoch=len(train_generator), epochs=18, validation_data=validation_generator, validation_steps=len(validation_generator), callbacks=[early_stopping] ) ``` I don't know where you took the VGG16 from (HuggingFace has no VGG16 class as far as I know), but it looks like you didn't remove the VGG softmax layer before adding your additional layers, which is one possible reason for the results you are getting. Also, since you didn't mention it - have you tried multiple train/test splits or are all your experiments performed on the same split/seed?
{ "domain": "datascience.stackexchange", "id": 12048, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "deep-learning, overfitting, transfer-learning, vgg16", "url": null }
gravity, rotation, mars def accelerations(rr): x, y, z = rr xsq, ysq, zsq = rr**2 rsq = (rr**2).sum() rabs = np.sqrt(rsq) nr = rr / rabs rxy = np.sqrt(xsq + ysq) rrxy = rr * np.array([1.0, 1.0, 0.0]) nxy = rrxy/rxy rm3 = rsq**-1.5 rm7 = rsq**-3.5 acc0 = -GM_mars * rr * rm3 # https://en.wikipedia.org/wiki/Geopotential_model#The_deviations_of_Earth.27s_gravitational_field_from_that_of_a_homogeneous_sphere acc2x = x * rm7 * (6*zsq - 1.5*(xsq + ysq)) acc2y = y * rm7 * (6*zsq - 1.5*(xsq + ysq)) acc2z = z * rm7 * (3*zsq - 4.5*(xsq + ysq)) acc2 = J2_mars * np.hstack((acc2x, acc2y, acc2z)) accc = nxy * omega**2 * rxy return acc0, acc2, accc import numpy as np halfpi, pi, twopi = [f*np.pi for f in [0.5, 1, 2]] degs, rads = 180./pi, pi/180. R_mars = 3396200.0 GM_mars = 4.282837E+13 # m^3/s^2 https://en.wikipedia.org/wiki/Standard_gravitational_parameter J2_mars = GM_mars * R_mars**2 * 1960.45E-06 # https://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html
{ "domain": "astronomy.stackexchange", "id": 4205, "lm_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, rotation, mars", "url": null }
experimental-chemistry, safety, equipment, distillation, desiccation Also, how do these answers change if I'm doing vacuum desiccation of the named solvents (i.e., where the only difference is I don't care to capture the evaporate)? E.g., can I just let the system exhaust through the pump? Don't bother with a powered pump: Get a water aspirator (I recommend the $20 Humboldt H-12020, which uses 10mm or 3/8" inner diameter tubing just like your glass), connect to faucet, and using utility water (1-2 gallons/minute) it can pull over 500 torr, which should be adequate for your applications. Sure, you're flushing away a lot of water, but you don't have to bother with traps or filters. (Actually, the H-12020 does have a check valve, but to ensure you don't get even a little water sucked into the apparatus when you shut off the aspirator you might want to add a separate valve or simple trap, but that's easy compared to a cold trap.) You should buy "thick-walled vacuum tubing" for all connections if you want to run full vacuum. Finally, for safety you do need some bump countermeasure. A "capillary bubbler" is just a tube that lets a tiny stream of bubbles into the boiling flask. Yes, that is reducing the vacuum, but a proper capillary tube admits a trivial amount of gas into the system. When possible, however, I prefer stirring. Running a magnetic stirrer in the boiling flask also prevents bumping, and is better than a bubbler because it doesn't introduce potentially contaminating gases into the mix (or require the supply of a neutral gas). A decent reference for practical distillation is Zubrick's Chapter 20 ("Distillation for Dummies") available online here.
{ "domain": "chemistry.stackexchange", "id": 4111, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-chemistry, safety, equipment, distillation, desiccation", "url": null }
electrostatics, electric-fields Title: Electric field of a point very far from uniformly charged rectangle sheet I was wondering what is the Electric field at a point which is very far from a rectangular sheet and it is also above the center of the rectangle. So form a mathematical perspective you get Electric field due to a finite rectangular sheet of charge on the surface $$ S = \left\{(x,y,z)\in \mathbb{R}^3 \mid -a/2< x < +a/2; -b/2< y < +b/2 ; z = 0 \right\} .$$ is $$ E(0,0,r) = \frac{\sigma r}{4\pi\epsilon_o} \int_{x=-a/2}^{x=+a/2}\int_{y=-b/2}^{y=+b/2} \frac{dx dy}{(x^2+y^2+r^2)^{3/2}} $$ so $$E(0,0,r) = \frac{\sigma}{\pi \epsilon_0} \arctan\left( \frac{ab}{4r\sqrt{(a/2)^2+(b/2)^2+r^2}} \right)$$. It seems very counter intutive that for $r>>a$ and $r>>b$ electric field is not $$E(0,0,r) = \frac{\sigma}{\pi \epsilon_0}\arctan\left( \frac{ab}{4r^2} \right)$$ but $E(0,0,r) =k_e\frac{q}{r^2}$ where $q=\sigma ab$. My question is shouldn't it behave like a point charge if it is very far away from the point where I am calculating electric field? Why is that not so? What am I doing wrong? $\arctan(\theta)\approx \theta-\frac{\theta^3}{3}$ near $\theta=0$ so \begin{align}
{ "domain": "physics.stackexchange", "id": 85978, "lm_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", "url": null }
# How to prove that $\sum_{k=1}^{n-1} \frac{1}{1-e^{2 \pi i k/n}} = \frac{n-1}{2}$? I came across the fact that $$\sum_{k=1}^{n-1} \frac{1}{1-e^{2 \pi i k/n}} = \frac{n-1}{2}.$$ How can we prove this identity? Note that if you add your sum with $k=1\ldots (n-1)$ with the same sum with $k=(n-1)\ldots 1$, you get $2\sum_1^{n-1} a_k = \sum_1^{n-1}a_k + \sum_1^{n-1}a_{n-k} = \sum_1^{n-1}(a_k+a_{n-k})$. Here $a_k = \frac1{1-b_k}$ with $b_k = e^{2i\pi k/n}$ and $b_{n-k} = e^{2i\pi(k-n)/n} = e^{2i\pi}e^{-2i\pi k/n} = e^{-2i\pi k/n} = 1/b_k = \bar{b_k}$. So $a_k + a_{n-k} = \frac1{1-b_k} + \frac1{1-b_{n-k}} = \frac{1-b_{n-k}+1-b_k}{(1-b_{n-k})(1-b_k)} = \frac{2-(b_k+\bar{b_k})}{1+|b_k|^2-(b_k+\bar{b_k})} = 1$ since $|b_k| = 1$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806484125338, "lm_q1q2_score": 0.8213539307434192, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 375.2951162981941, "openwebmath_score": 0.9912778735160828, "tags": null, "url": "https://math.stackexchange.com/questions/1222259/how-to-prove-that-sum-k-1n-1-frac11-e2-pi-i-k-n-fracn-12/1222274" }
using differentiation formulas and rules (sum rule; constant Example. Name: 2. In the last module we did learn a lot about how to Laplace transform derivatives and functions from the "t"-space (which is the "real" world) to the "s"-space. Boundary-value problems, like the one in the example, where the boundary condition consists of specifying the value of the solution at some point are also called initial-value problems (IVP). Common derivatives formulas - exercises. [f(x) ± g(x)] = f (x) ± g (x). These allow us to find an expression for the derivative of any function we can write down algebraically explicitly or implicitly. Principal author: Dr The following graph shows an example of a decreasing function. math. Please try again later. d. If given the cdf, we can differentiate to find the pdf. This INTEGRATION FORMULAS PDF is very useful for SSC and the upcoming competitive exams like SSC CGL, BANK, RAI INTEGRATION FORMULAS PDF. Proof. Formulas and examples of the derivatives of exponential functions, in calculus, are presented. 2 and 23. Alternate Notations for (Df)(x) For functions f in one variable, x, alternate notations LECTURE 2: COMPLEX DIFFERENTIATION AND CAUCHY RIEMANN EQUATIONS We have seen in the first lecture that the complex derivative of a function f at a point z 0 is defined as the limit f0(z 0) = lim h→0 f(z 0 +h)−f(z 0) h, whenever the limit exist. However, if f {\displaystyle f} is a holomorphic function , real-valued on the real line, which can be evaluated at points in the complex plane near x {\displaystyle x} , then there are stable methods. 18) and (4. org 3. Many problems in applied mathematics involve the integration of functions given by complicated formulae, and practi-tioners consult a Table of Integrals in order to complete the integration. 1,23. 1. ] In words: The derivative of a constant times a function is the constant  Basic Differentiation Formulas http://www. 1) 1. You can print it yourself at home or have it printed professionally at a local printing store. 0. 73 ,74. Suppose we differentiate the function y = x2. These books are
{ "domain": "brian229.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9891815503903562, "lm_q1q2_score": 0.8285582199824016, "lm_q2_score": 0.8376199694135333, "openwebmath_perplexity": 830.7896849780968, "openwebmath_score": 0.876122772693634, "tags": null, "url": "http://brian229.com/8vpu/differentiation-formulas-and-examples-pdf.php" }
homework-and-exercises, newtonian-mechanics, energy-conservation, work, projectile Title: Why would a rock thrown upwards, a rock thrown sideways and a rock thrown downwards have the same final speed? This is the full question: A girl throws a stone from a bridge. Consider the following ways she might throw the stone. The speed of the stone as it leaves her hand is the same in each case. Case A: Thrown straight up. Case B: Thrown straight down. Case C: Thrown out at an angle of 45° above horizontal. Case D: Thrown straight out horizontally. In which case will the speed of the stone be greatest when it hits the water below? Case A Case B Case C Case D The speed will be the same in all cases. It says that in all 4 cases, the rock arrives at the water below with the same speed. I can't wrap my mind around this idea. Conservation of energy. She starts off with the same kinetic energy $\mathrm{KE}_i$, and the work done by gravity is the same in each case, $W_\text{gravity}=mgh$, since each rock falls from the same height. Thus in each case, the same amount of gravitational potential energy is converted to kinetic energy, so the final kinetic energy is $\mathrm{KE}_f=\mathrm{KE}_i+mgh$. If she throws it straight up, the rock will go up, then fall to her level. When the rock is at the girl's level, it will have the same speed as it was launched, except now the rock is falling down. So it's equivalent to her throwing the rock directly down. Whether she throws it sideways or downwards, the change in potential energy will always be $-mgh$, which means that in each case, kinetic energy will increase by $mgh$.
{ "domain": "physics.stackexchange", "id": 79345, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, energy-conservation, work, projectile", "url": null }
electromagnetism, magnetic-fields I must admit I have never seen an integral written this way. By analogy with the writing $\int_\gamma \mathbf{F}\cdot d\boldsymbol{\ell}$ $:= \int_a^b\mathbf{F}(t)\cdot\boldsymbol{\ell}'(t)\,dt $ where $\boldsymbol{\ell}:[a,b]\to\mathbb{R}^3$ parametrises the pievewise smooth curve $\gamma$, I would suppose that $\int I\,d\boldsymbol{\ell}\times \mathbf{B}$ might be defined as $\int_a^b I(\boldsymbol{\ell}(t))\boldsymbol{\ell}'(t)\times \mathbf{B}(\boldsymbol{\ell}(t))\,dt$ (which belongs to $\mathbb{R}^3$, of course)... Am I right and, if I am not, what does $\int I\,d\boldsymbol{\ell}\times \mathbf{B}$ mathematically means? Yes you are correct. If the current $I$ flows into a wire described by the piecewise smooth curve $ \gamma $ and $ \mathbf{l} = \mathbf{l}(t)$ for $ t \in [a,b] $ parametrises $\gamma$, then the magnetic force acting on the wire due to the magnetic field $ \mathbf{B}$ is: $$ \mathbf{F} = \int_{\gamma}Id\mathbf{l} \times \mathbf{B} = \int_a^bI(\mathbf{l}(t))\mathbf{l}'(t) \times \mathbf{B}(\mathbf{l}(t))dt$$ where $ \mathbf{l}'(t) = \frac{d}{dt} \mathbf{l}(t) $.
{ "domain": "physics.stackexchange", "id": 26946, "lm_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, magnetic-fields", "url": null }
# Finding probability in the case of a biased coin A coin is biased so that the probability of falling head when tossed is $\frac14$. If the coin is tossed $5$ times, find the probability of obtaining $2$ heads and $3$ tails, with heads occurring in succession. I know that each toss is an independent event. And for independent events, $$P(A\cap B\cap C\cdots)=P(A).P(B).P(C)\cdots$$ Going by that, the answer to this question must be $$\frac14.\frac14.\frac34.\frac34.\frac34=\frac{3^3}{4^5}$$ However, the given answer is $$\frac{3^3}{4^4}$$ Where am I going wrong? Good outcomes are HHTTT, THHTT, TTHHT, and TTTHH. You computed only the first one so your answer is only $1/4$th of the final answer. Order is important here making those $4$ results different. • Think of it like this, based on your biased coin, what if someone asked you what is the probability of getting $2$ heads followed by $3$ tails. It would be your original answer. Then suppose they changed the question to your original question, the answer would increase to $4$ times that because the pair of adjacent heads can occur in $4$ different places in the $5$ coin tosses. – David Nov 22 '14 at 15:01
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9939964027806528, "lm_q1q2_score": 0.8325912284359716, "lm_q2_score": 0.8376199613065411, "openwebmath_perplexity": 174.56725371036126, "openwebmath_score": 0.8739550709724426, "tags": null, "url": "https://math.stackexchange.com/questions/1033694/finding-probability-in-the-case-of-a-biased-coin" }
javascript, html5 Title: Grid Overlay For Browser Using HTML5 Canvas I wanted to create a grid overlay for my browser that I can use when building websites. I decided on HTML5 canvas because it allows me to create lots of lines without adding loads of elements to the DOM. The code is below and you can demo it on GitHub pages here. I'd appreciate your guys feedback on the following areas: How can I make the code more efficient/faster/lighter? Do you think this grid is accurate, or will it be of any use? These are the outstanding issues I currently want to address: Need to add a max and min value (don't want grid squares of 1 pixel) Need a "clear grid" button (still deciding the best way to implement it, does the "show grid" button change text when grid is visible? Prevent non-numeric input CODE: window.onload = init; function init() { // grid controls var controls = getById('gridControls'); controls.style.position = 'absolute'; controls.style.right = "30px"; controls.style.padding = "10px"; controls.style.backgroundColor = "#ffffff"; controls.style.borderLeft = "1px solid #aaa"; controls.style.borderRight = "1px solid #aaa"; controls.style.borderBottom = "1px solid #aaa"; controls.style.zIndex = '100001'; // get our canvas var grid = getById('grid'); hide(grid); // get the button to show grid var button = getById('showGrid'); button.onclick = drawCanvas; } function drawCanvas() { var horizontalSpace = 0; var verticalSpace = 0; // input for setting the grid squares var input = getById('widthHeight'); var gridSize = parseInt(input.value); show(grid); var context = grid.getContext('2d'); // set the canvas style to positions absolute // and set z-index high to keep it on top grid.style.position = 'absolute'; grid.style.zIndex = '100000';
{ "domain": "codereview.stackexchange", "id": 22802, "lm_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, html5", "url": null }
quantum-field-theory, feynman-diagrams, path-integral, perturbation-theory, interactions \begin{align*} &-\lambda \int d^d z \int d^d w \Delta_F (0) \Delta_F (z-w) \\ &-\frac{1}{4}\int d^d x \int d^d y \int d^d z \int d^d w \Delta_F(x-y) \Delta_F(z-w) J_x J_y J_z J_w \end{align*} I didn't check my calculations, hope there is no sign problem.
{ "domain": "physics.stackexchange", "id": 76860, "lm_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, feynman-diagrams, path-integral, perturbation-theory, interactions", "url": null }
= Set of vowels in alphabet Infinite Set. In Example VFSAL we saw the solution set of a homogeneous system described as all possible linear combinations of two particular vectors. Remarks. Let I be a set. Which of the following sets are finite or infinite ? Definition. We form a new binary sequence A by declaring that the nth digit of A is the opposite of the nth digit of f−1(n). For e.g. Consider the following correspondence. If we use the term "infinite" in a restricted and precise way, then "transfinite" is just a synonym for it. A set of all positive integers; A set of all the planets in the solar system; A set of all the states in India ; A set of all the lowercase letters of the alphabet; Representation of a Set. 3. Describes a set which contains more elements than the set of integers.Formally, an uncountably infinite set is an infinite set that cannot have its elements put into one-to-one correspondence with the set of integers.. For example, the set of real numbers is uncountably infinite. Oracle Infinity Behavioral Intelligence. We first discuss cardinality for finite sets and then talk about infinite sets. One example of an infinite set is the set N of positive integers. 1. What I have so far is: I have an abstract base class, Set, which implements the interface ISet. Syllabus Schedule Office Hours MCS Book Resources Course Pledge Problem Set Omega Problem Set 9 Problem Set 8 Problem Set 7 More Problem Sets... Collab Site Posts Fall 2016 Course Class 17: Infinite Sets Not so. And if you really need infinity as an int, write a wrapper class that overloads the comparison operators and has a boolean variable named "is_infinity". infinite set. A set is countably infinite if its elements can be put in one-to-one correspondence with the set of natural numbers. We can start by writing out a pattern. For example, the positive even numbers are countably infinite, since we can find a one-to-one mapping of {2, 4, 6, 8, 10, …} onto the counting numbers. we need to find a way to match up each element of ℕ to a unique element of ℤ, and this function must cover each element in ℤ. List the elements in an uncountable set using Http methods, we need to import the
{ "domain": "freshface.net", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517456453798, "lm_q1q2_score": 0.82737548322316, "lm_q2_score": 0.8459424431344437, "openwebmath_perplexity": 417.22945825059145, "openwebmath_score": 0.7496109008789062, "tags": null, "url": "http://switcher.freshface.net/qr8m71xm/1788b5-infinite-set-example" }
\begin{aligned} x(t)&=x_1(t)+x_2(t)\\ &=c_1e^{i\sqrt{\frac{k}{m}} t}+c_2e^{-i\sqrt{\frac{k}{m}} t}\\ &=c_1\left[\cos\left(\sqrt{\frac{k}{m}}t\right)+i\sin\left(\sqrt{\frac{k}{m}}t\right)\right]+c_2\left[\cos\left(\sqrt{\frac{k}{m}}t\right)-i\sin\left(\sqrt{\frac{k}{m}}t\right)\right]\\ &=c_1\cos\left(\sqrt{\frac{k}{m}}t\right)+c_1i\sin\left(\sqrt{\frac{k}{m}}t\right)+c_2\cos\left(\sqrt{\frac{k}{m}}t\right)-c_2i\sin\left(\sqrt{\frac{k}{m}}t\right)\\ &=(c_1+c_2)\cos\left(\sqrt{\frac{k}{m}}t\right)+(c_1-c_2)i\sin\left(\sqrt{\frac{k}{m}}t\right)\\ &=C_1\cos\left(\sqrt{\frac{k}{m}}t\right)+C_2\sin\left(\sqrt{\frac{k}{m}}t\right)\\
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9888419703960399, "lm_q1q2_score": 0.8037973247238186, "lm_q2_score": 0.8128673223709251, "openwebmath_perplexity": 12623.161747504775, "openwebmath_score": 0.9895164370536804, "tags": null, "url": "https://brilliant.org/discussions/thread/equation-of-simple-harmonic-motion-of-spring/" }
double angle identities in trigonometry. Scribd is the world's largest social reading and publishing site. [email protected] Double angle formulas can also be applied when solving identities and are often used to create other equivalent expresssions. Establishing identities using the double-angle formulas is performed using the same steps we used to derive the sum and difference formulas. The double angles formulas can be derived from compound angle formulas, we can use these double angle formulae to simplify expressions as well as calculating exact values. The participant and the medical care provider will not know the identity of the placebo or study product. One is to convert trigonometric functions of (θ/2) into functions in terms of the more familiar (and. 1 - ( 2cos(2x) 2 - 1 )? This is driving me nuts. Using the double angle identities find each of the following given. The Double-Angle formulas express the cosine and sine of twice an angle in terms of the cosine and sine of the original angle. Primary Purpose: Supportive Care: Official Title: The Effects of Mirtogenol® With Bimatoprost on Intraocular Pressure in Hispanics With Open-Angle Glaucoma: A Double-Blind, Randomized Controlled Trial. Current time:0:00Total duration:10:31. 5 { Double Angle Formulas Double Angle FormulasMEMORIZE! sin(2x) = 2sinxcosx cos(2x) = cos2 x sin2 x tan(2x) = sin(2x) cos(2x) Note. We will check the first one. -cot q-cot q Double-angle identities for cosine and sine-cot q. We have Hence which implies. This youtube video shows a step to step process on using double identities to solve equations: Powered by Create your own unique website with customizable templates. , sin θ and cos θ. It is well worth practising the derivation so that you can do it quickly and easily. tan x = 2, 0 < x< π 2 31. double-angle-identities-formulas. Here we have provided you with a chart showing all the double-angle formulas of functions :. cos2 sin 2 Angle A 9. A summary of Addition and Subtraction Formulas in 's More Trigonometric Identities. The first two formulas are the standard
{ "domain": "giovannicobianchi.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9896718459575753, "lm_q1q2_score": 0.8044718922330983, "lm_q2_score": 0.8128673110375457, "openwebmath_perplexity": 1082.1077187513956, "openwebmath_score": 0.8661724328994751, "tags": null, "url": "http://giovannicobianchi.it/piag/double-angle-identities.html" }
ubuntu, ubuntu-xenial Title: IP camera image not showing up even though image status OK, but image is not found Running ROS Kinetic on Ubuntu 16.04 Virtual Machine. Need to run node nerian_sp1, RVIZ seems to be running correctly but no image shows up when connected via Ethernet from IP camera. See warning when I try to run node nerian_sp1, but still shows up when I run rosnode list. Verified Bridged adapter working correctly, can ping my Windows 7 host from Ubuntu guest. Browser in Ubuntu shows camera image so I know it's working Tried enabling 3D acceleration but caused system to become unstable enabled Virtualization so now the graphics adapter is listed as InnoTek Systemberatung GmbH: Virtual Box Graphics Adapter This device is not working Using x86 virtualization solution - x11 guest utilities from virtualbox-guest-x11 (proprietary) Do not use this device (checked) When I check the first bullet and hit Apply Changes, it just defaults back to "Do not use this device". I was thinking the issue might be the graphics adapter but I do not know how to fix it and otherwise browsing the internet, pictures show up fine and videos play. katie@katie-VirtualBox:~$ env | grep ROS ROS_ROOT=/opt/ros/kinetic/share/ros ROS_PACKAGE_PATH=/opt/ros/kinetic/share ROS_MASTER_URI=http://localhost:11311 ROSLISP_PACKAGE_DIRECTORIES= ROS_DISTRO=kinetic ROS_ETC_DIR=/opt/ros/kinetic/etc/ros katie@katie-VirtualBox:~$ rviz -l [ INFO] [1498674668.815815723]: rviz version 1.12.10 [ INFO] [1498674668.815964556]: compiled against Qt version 5.5.1 [ INFO] [1498674668.816015134]: compiled against OGRE version 1.9.0 (Ghadamon)
{ "domain": "robotics.stackexchange", "id": 28248, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ubuntu, ubuntu-xenial", "url": null }
machine-learning, training, sampling, data-leakage, validation Title: Is it right to maintain the train distribution in test set for unbalanced data? If the training set was unbalanced the chances are the model will be biased. But if the data distribution in the test set is the same distribution as the train set, this kind of bias is not going to affect validation accuracy. But my question is if this is the right thing to do? It's not cheating? What if we want to use the model for commercial business that we have no idea how the distribution of data would be? In this case, what is the right thing to do? If the training set was unbalanced the chances are the model will be biased. Not really. Depending on the loss function you use. Also, note that for data to be unbalanced at least it has to be in a proportion of 1/100. The rest of the questions: ML is based on the hypothesis that train and test look alike. Oversampling methods can help in training time, still in validation and test, you should not use the oversample and validate with the real data. Use your evaluation metrics on the real test, with test distribution and don't oversample there. we want to use the model for commercial business that we have no idea how the distribution of data would be? If you have no idea of how the distribution will be you have a problem. The hypothesis that people make is that the future distribution resembles something of the current real distribution (last week,last month, one year ago....)
{ "domain": "datascience.stackexchange", "id": 8737, "lm_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, training, sampling, data-leakage, validation", "url": null }
matlab, filters, resampling As you are aware, when interpolating, you want to filter after the zero-insert operation, since it creates images at multiples of the original sampling frequency. In our case, the filter should have a cut-off at $f_{s_1}/2 = 15 \,\texttt{Hz}$ When decimating, we need to filter before the down-sampling operation, since it introduces aliasing of the components above the resulting sampling rate Nyquist frequency. In our case, this filter should have a cut-off at $f_{s_2}/2 = 10 \texttt{Hz}$ Notice, both filters run on the data at $f_{s_3}= 60 \texttt{Hz}$ We can hence combine these two filters into one, specifically into the one with lower cut-off, i.e. our decimation filter with cut-off $f_{s_2}/2 = 10\texttt{Hz}$. The filtering will be done on the up-sampled data (not the interpolated data, since we haven't low-pass filtered it yet) with rate $f_{s_3}= 60\texttt{Hz}$, so if you really insist on specifying the filter yourself, you would want to design it with $f_{s_3}$ in mind. Also, a least-square design is probably better suited for this task: fs1 = 30; fs2 = 20; fs3 = 60; f = [0 fs2/2 fs2/2 fs3/2] / (fs3/2); a = [1 1 0 0]; n = 31; upsampFac = fs3/fs1; b = firls(n-1, f, a) .* hamming(n)'; % Matlab's resample uses a Kaiser window.
{ "domain": "dsp.stackexchange", "id": 11822, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, filters, resampling", "url": null }
actuator, manufacturing, soft-robotics Title: How can i make a compact soft robot I want to make a compact (actuators motors and sensors are all in one) soft robot. Actuators can be pneumatic or dielectric. I need suggestions about manufacturating. I'm open to new ideas. I think dielectric mechanism like piezo are suitable for compact designs. These might be usefull http://en.wikipedia.org/wiki/Piezoelectric_motor https://www.google.com/patents/US4812698
{ "domain": "robotics.stackexchange", "id": 692, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "actuator, manufacturing, soft-robotics", "url": null }
c#, graph, generics } } -- /// <summary> /// Implementation of a generic, unweighted, undirected graph /// </summary> class UndirectedGenericGraph<T> { // The list of vertices in the graph private List<Vertex<T>> vertices; // The number of vertices int size; public List<Vertex<T>> Vertices { get { return vertices; } } public int Size { get { return vertices.Count; } } public UndirectedGenericGraph(int initialSize) { if(size < 0) { throw new ArgumentException("Number of vertices cannot be negative"); } size = initialSize; vertices = new List<Vertex<T>>(initialSize); } public UndirectedGenericGraph(List<Vertex<T>> initialNodes) { vertices = initialNodes; size = vertices.Count; } public void AddVertex(Vertex<T> vertex) { vertices.Add(vertex); } public void RemoveVertex(Vertex<T> vertex) { vertices.Remove(vertex); } public bool HasVertex(Vertex<T> vertex) { return vertices.Contains(vertex); } public void DepthFirstSearch(Vertex<T> root) { if (!root.IsVisited) { Console.Write(root.Value + " "); root.Visit(); foreach(Vertex<T> neighbor in root.Neighbors) { DepthFirstSearch(neighbor); } } } public void BreadthFirstSearch(Vertex<T> root) { Queue<Vertex<T>> queue = new Queue<Vertex<T>>(); root.Visit(); queue.Enqueue(root); while(queue.Count > 0) { Vertex<T> current = queue.Dequeue(); foreach (Vertex<T> neighbor in current.Neighbors) { if (!neighbor.IsVisited) { Console.Write(neighbor.Value + " "); neighbor.Visit(); queue.Enqueue(neighbor); } } } } } -- class Program { static void Main(string[] args) {
{ "domain": "codereview.stackexchange", "id": 20382, "lm_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#, graph, generics", "url": null }
python, python-3.x, api return {"Pokemon": pokemon[0], "Types": [pokemon[1], pokemon[2]], "HP": pokemon[4], "Attack": pokemon[5], "Special Attack": pokemon[6], "Defense": pokemon[7], "Special Defense": pokemon[8], } @app.get("/poketype/{poke_type}") def get_pokemon_by_type(poke_type: str = Path(None, description="Primary type of " "the pokemons you " "want to query"), type2: Optional[str] = None): pokemons = get_poke_by_type(poke_type, type2) if not pokemons: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="No pokemon with this type") result = {} for idx, pokemon in enumerate(pokemons): result[idx] = {"Pokemon": pokemon[0], "Types": [pokemon[1], pokemon[2]], "HP": pokemon[4], "Attack": pokemon[5], "Special Attack": pokemon[6], "Defense": pokemon[7], "Special Defense": pokemon[8], } return result @app.post("/newPoke/{pokemon_name}") def create_pokemon(pokemon_name: str, pokemon: Pokemon): if get_poke_by_name(pokemon_name): raise HTTPException(status_code=status.HTTP_406_NOT_ACCEPTABLE, detail="Pokemon already exists") add_poke_to_db(pokemon.name, pokemon.primary_type, pokemon.secondary_type, pokemon.sum_stats, pokemon.hit_points, pokemon.attack_strength, pokemon.special_attack_strength, pokemon.defensive_strength, pokemon.special_defensive_strength) raise HTTPException(status_code=status.HTTP_201_CREATED, detail="Pokemon created successfully")
{ "domain": "codereview.stackexchange", "id": 42046, "lm_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, api", "url": null }
c++, template, iterator, c++17, interval //excludes max bool contains(const T &value) const { return contains_exclude_max(value); } class iterator { public: iterator(std::size_t step_index, std::size_t step_max, const T &min, const T &max) : m_step_index(step_index), m_step_max(step_max), m_min(min), m_max(max) { assert(step_index <= step_max+1); if constexpr (std::is_integral_v<T>) { //we need to make sure if we are doing int stuff //we can't have partial steps, logic gets hairy. assert((m_max - m_min) % step_max == 0); } } iterator &operator++() { m_step_index += 1; return *this; } iterator operator++(int) { iterator retval = *this; ++(*this); return retval; } bool operator==(iterator other) const { return m_step_index == other.m_step_index && m_step_max == other.m_step_max && m_min == other.m_min && m_max == other.m_max; } bool operator!=(iterator other) const { return !(*this == other); }
{ "domain": "codereview.stackexchange", "id": 37644, "lm_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++, template, iterator, c++17, interval", "url": null }
{{d_n}\cos\left( {nx + {\theta _n}} \right)} .} 1. {\displaystyle P=1.} Example 1: Special case, Duty Cycle = 50%. Contents. 0, & \text{if} & – \frac{\pi }{2} \lt x \le \frac{\pi }{2} \\ b n = 1 π π ∫ − π f ( x) sin n x d x = 1 π π ∫ − π x sin n x d x. {\left( { – \frac{{\cos nx}}{n}} \right)} \right|_0^\pi } \right] }= { – \frac{1}{{\pi n}} \cdot \left( {\cos n\pi – \cos 0} \right) }= {\frac{{1 – \cos n\pi }}{{\pi n}}.}$. The reader is also referred toCalculus 4b as well as toCalculus 3c-2. There is no discontinuity, so no Gibb's overshoot. The first zeros away from the origin occur when. Let’s go through the Fourier series notes and a few fourier series examples.. {f\left( x \right) = \frac{1}{2} }+{ \frac{{1 – \left( { – 1} \right)}}{\pi }\sin x } Using 20 sine waves we get sin(x)+sin(3x)/3+sin(5x)/5 + ... + sin(39x)/39: Using 100 sine waves we ge… Find b n in the expansion of x 2 as a Fourier series in (-p, p). \], Therefore, all the terms on the right of the summation sign are zero, so we obtain, ${\int\limits_{ – \pi }^\pi {f\left( x \right)dx} = \pi {a_0}\;\;\text{or}\;\;\;}\kern-0.3pt{{a_0}
{ "domain": "uc.pt", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540674530016, "lm_q1q2_score": 0.8455660953601432, "lm_q2_score": 0.8633916205190225, "openwebmath_perplexity": 930.844022799017, "openwebmath_score": 0.9143019318580627, "tags": null, "url": "https://ijc.fd.uc.pt/h5hmc/b3520f-fourier-series-examples" }
rosserial Title: rosserial_xbee Unable to sync with device I have been trying to connect to an arduino via rosserial_xbee using xbee s1 and I am receiving this error: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino I have seen similar posts in this forum but suggested solutions have not worked for me. These tutorials work for me: http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup http://wiki.ros.org/rosserial_arduino/Tutorials/Hello%20World I can reproduce the error following these steps: http://wiki.ros.org/rosserial_xbee/Tutorials/Example%20Network I have also tried various branches of rosserial such as the indigo branch etc. Rosserial works via usb and I have tested that the xbees work not using rosserial. System: Ubuntu 14.04, Arduino IDE 1.6.5, ROS Indigo. Hardware: Arduino Uno, XBee S1 (x2), XBee explorer, XBee shield. Originally posted by K7 on ROS Answers with karma: 94 on 2015-08-19 Post score: 0
{ "domain": "robotics.stackexchange", "id": 22487, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rosserial", "url": null }
java, security, cryptography import org.bouncycastle.asn1.ASN1EncodableVector; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.DERSequence; import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x509.BasicConstraints; import org.bouncycastle.asn1.x509.Extension; import org.bouncycastle.asn1.x509.KeyPurposeId; import org.bouncycastle.asn1.x509.KeyUsage; import org.bouncycastle.asn1.x509.SubjectKeyIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.cert.X509v3CertificateBuilder; import org.bouncycastle.cert.bc.BcX509ExtensionUtils; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.operator.ContentSigner; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; public class Client { private String host; private int port; private byte[] nonce; private byte[] keyData; private SSLSocket server; private DataOutputStream writer; private DataInputStream reader;
{ "domain": "codereview.stackexchange", "id": 18792, "lm_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, security, cryptography", "url": null }