text stringlengths 1 1.11k | source dict |
|---|---|
pumps, hydraulics
Title: will a hydraulic gear pump be capable of the same pressure at all speeds? I'm trying to build a hydraulic power unit with a 5 horsepower electric motor, gear pump and tank. The flow requirement for the system is 1.7 gallons per minute. The pressure requirement is 3000 psi. I'm having some trouble finding gear pumps that are rated for high pressure and low speed. Typically they're at about 20 gallons per minute and some are around 2gpm.
I'm wondering if I get a gear pump that's capable of 2 gallons per minute and run it at a lower speed, will it still be capable of the same pressure that it's rated at at 2 gallons per minute? | {
"domain": "engineering.stackexchange",
"id": 4859,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pumps, hydraulics",
"url": null
} |
9. Suppose that $$f(x) = \sum_{i=0}^\infty c_ix^i$$is a power series for which each coefficient $c_i$ is $0$ or $1$. Show that if $f(2/3) = 3/2$, then $f(1/2)$ must be irrational.
10. Evaluate the sum $\sum_{k=0}^{\infty}\left(3\cdot\frac{\ln(4k+2)}{4k+2}-\frac{\ln(4k+3)}{4k+3}-\frac{\ln(4k+4)}{4k+4}-\frac{\ln(4k+5)}{4k+5}\right)$$=3\cdot\frac{\ln 2}2-\frac{\ln 3}3-\frac{\ln 4}4-\frac{\ln 5}5+3\cdot\frac{\ln 6}6-\frac{\ln 7}7-\frac{\ln 8}8-\frac{\ln 9}9+3\cdot\frac{\ln 10}{10}-\cdots.$(As usual, $\ln x$ denotes the natural logarithm of $x.$)
11. A line in the plane of a triangle $T$ is called an equalizer if it divides $T$ into two regions having equal area and equal perimeter. Find positive integers $a>b>c,$ with $a$ as small as possible, such that there exists a triangle with side lengths $a,b,c$ that has exactly two distinct equalizers. | {
"domain": "molympiad.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806535200601,
"lm_q1q2_score": 0.8128413646077767,
"lm_q2_score": 0.8289388146603365,
"openwebmath_perplexity": 103.49221589853244,
"openwebmath_score": 0.8155539035797119,
"tags": null,
"url": "https://www.molympiad.net/2018/04/william-lowell-putnam-mathematical-competition-2017-solutions.html"
} |
classical-mechanics, energy, hamiltonian-formalism, variational-principle, hamiltonian
For a proof of eq. (6), see e.g. my Phys.SE answer here.
The (off-shell) abbreviated action functional $A[q, E]$ can be defined as a energy $\leftrightarrow$ time Legendre-type transformation
$$ A[q; E, t_f, t_i] ~=~ I[q; t_f,t_i] + E (t_f-t_i) \tag{7} $$
of the (off-shell) action functional $I[q; t_f,t_i]$.
In Maupertuis' principle we restrict to virtual paths with constant and same fixed energy $E$ but with free endpoint times $t_i$ and $t_f$. Formula (7) then becomes equal to
$$\begin{align} A[q; E, t_f, t_i]~=~& \int_{t_i}^{t_f} p\dot{q} ~\mathrm{d}t, \cr p~:=~&\frac{\partial L}{\partial \dot{q}}.\end{align}\tag{8} $$
As a consequence, the (Dirichlet) on-shell abbreviated action
$$\begin{align} W(q_f, q_i, E)
~=~& S(q_f, q_i, T) + E T\cr ~\stackrel{(6)}{=}~&
S(q_f, q_i, T) - T\frac{\partial S(q_f, q_i, T)}{\partial T}\end{align} \tag{9} $$
becomes the $E\leftrightarrow T$ Legendre transform of the (Dirichlet) on-shell action function $S(q_f, q_i, T)$.
References: | {
"domain": "physics.stackexchange",
"id": 15938,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, energy, hamiltonian-formalism, variational-principle, hamiltonian",
"url": null
} |
$\displaystyle \Rightarrow{\log_2x=2}$
$\displaystyle \Rightarrow{x=4}$
Hey... Thanks a lot man!!! No.. I haven't been introduced to this new formula $\displaystyle \huge{x^{log_{a}y}=y^{log_{b}x}}$
By the way, is it $\displaystyle \huge{x^{log_{a}y}=y^{log_{b}x}}$ or $\displaystyle \huge{x^{log_{a}y}=y^{log_{a}x}}$???
Will base "a" change?? You actually wrote $\displaystyle \huge{y^{log_{b}x}}$
Are you sure the $\displaystyle a$ becomes $\displaystyle b$???
10. Hello arijit2005
Originally Posted by arijit2005
Hey... Thanks a lot man!!! No.. I haven't been introduced to this new formula $\displaystyle \huge{x^{log_{a}y}=y^{log_{b}x}}$
By the way, is it $\displaystyle \huge{x^{log_{a}y}=y^{log_{b}x}}$ or $\displaystyle \huge{x^{log_{a}y}=y^{log_{a}x}}$???
Will base "a" change?? You actually wrote $\displaystyle \huge{y^{log_{b}x}}$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126469647337,
"lm_q1q2_score": 0.8112929014680267,
"lm_q2_score": 0.8289388146603365,
"openwebmath_perplexity": 941.4242919502365,
"openwebmath_score": 0.8914440274238586,
"tags": null,
"url": "http://mathhelpforum.com/algebra/147054-how-do-you-solve-logarithm-question.html"
} |
Undefined index: HTTP_REFERER in C:\xampp\htdocs\xgg3\25967r. You need the scipy or numpy module. It is approximately 2. It’s worth keeping in mind that floating point numbers, such as those in float64 and float32 arrays, are only capable of approximating fractional quantities. to_json(ans). Not a very good calculator. The dimension of the array is known as the rank of the tensor. Dec 31, 2017 · In this video, I'll briefly talk about the basics of SymPy. A C library for the arithmetic of complex numbers with arbitrarily high precision. Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. 100000000000000 >>> Float ( 0. Another python GUI library. Python for MATLAB Users Ways to Use Python: SymPy with IPython Notebook complex - Complex number with real and imaginary oat components. Writing the tensor in terms of indexed components, the rank tells | {
"domain": "imltraining.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769063954521,
"lm_q1q2_score": 0.8232845715573548,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 889.6016044723806,
"openwebmath_score": 0.4872167706489563,
"tags": null,
"url": "http://tiyu.imltraining.de/sympy-complex-numbers.html"
} |
## AravindG 4 years ago A boy standing on a stationary lift (open from above) throws a ball upwards with the maximum initial speed he can, equal to 49 m/s. How much time does the ball take to return to his hands? If the lift starts moving up with a uniform speed of 5 m/s and the boy again throws the ball up with the maximum speed he can, how long does the ball take to return to his hands?
1. AravindG
u see i got first part
2. AravindG
10 s
3. AravindG
but i dont undestand y we get same answr in 2nd case
4. JamesJ
The position of the ball at time time is $y(t) = 49 t - \frac{1}{2}gt^2$ $= 49 t - 4.9t^2$ $= 0$ when $$t = 0, 10$$ seconds, right. Now in the second case, the speed of the ball is (49 + 5) m/s = 54 m/s, so it's position is $y_{ball}(t) = 54 t - 4.9t^2$ ... but ...
5. JamesJ
the position of the boy is $y_{boy}(t) = 5t$ Hence the question is: for what t is $y_{ball}(t) = y_{boy}(t)$ Solve that equation and you'll get back $$t = 0, 10$$ seconds.
6. AravindG | {
"domain": "openstudy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126488274565,
"lm_q1q2_score": 0.8357352195860542,
"lm_q2_score": 0.8539127603871312,
"openwebmath_perplexity": 1415.431738405707,
"openwebmath_score": 0.6579675078392029,
"tags": null,
"url": "http://openstudy.com/updates/4f1c4b0fe4b04992dd237b16"
} |
python, python-3.x, cache
import atexit
import pickle
from pathlib import Path
from functools import wraps
def cached(maxsize=None, hashkey=True, persist=False):
"""Decorator method to cache an expensive function
Args:
maxsize (int): The maximum number of cached results to store
if None, the size is indefinite.
hashkey (bool): If the arguments of the function are objects
which cannot be pickled, use the hashkey option which will
hash the arguments.
persist (bool): Write the cached results to the disk so that
it can be read in even after the session has ended.
Returns:
Decorator function
"""
def outer(func):
func.cache = {}
func.cache_file_path = Path(f"{func.__name__}.cache")
if persist:
if func.cache_file_path.exists():
with func.cache_file_path.open("rb") as cachefile:
func.cache = pickle.load(cachefile) | {
"domain": "codereview.stackexchange",
"id": 41371,
"lm_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, cache",
"url": null
} |
gazebo-1.9
From the command line: using the gzfactory tool (look at the spawn parameter). The user guide described it perfectly.
Programmatically: using a world plugin as described in the corresponding tutorial
Hope it helps.
Originally posted by Jose Luis Rivero with karma: 1485 on 2014-05-21
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by ali_mohandes on 2014-05-21:
Thanks a lot. I used gzfactory and it worked.
I appreciate your help. | {
"domain": "robotics.stackexchange",
"id": 3589,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo-1.9",
"url": null
} |
c, parsing, functional-programming
' ) ).() )) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((EITHER_Q .Parser(sequence, ((SEQUENCE_P .Parser(either) ).((SEQUENCE_Q .Parser(sequence, ((SEQUENCE_P .Parser(either) ).((SEQUENCE_Q .Parser(bind) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).() ))) ) (personal_part Parser(either, ((EITHER_P .Parser(sequence, ((SEQUENCE_P .Parser(either) ).((SEQUENCE_Q .Parser(satisfy, ((SATISFY_PRED .Oper(is_literal, '.' ) ).() )) ).((SEQUENCE_OP .Oper(concat, () ) ).() )))) ).((EITHER_Q .Parser(sequence) ).() ))) ) (street_address Parser(sequence, ((SEQUENCE_P .Parser(sequence) ).((SEQUENCE_Q .Parser(sequence, ((SEQUENCE_P .Parser(either) ).((SEQUENCE_Q .Parser(sequence, ((SEQUENCE_P .Parser(bind) ).((SEQUENCE_Q .Parser(sequence, ((SEQUENCE_P .Parser(either) | {
"domain": "codereview.stackexchange",
"id": 43456,
"lm_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, functional-programming",
"url": null
} |
ros, octovis
1) ros-fuerte-octovis [Not Installed]
Accept this solution? [Y/n/q/?] y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 187 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "zh_TW:zh",
LC_ALL = (unset),
LC_MESSAGE = "en_US.UTF8",
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory | {
"domain": "robotics.stackexchange",
"id": 10617,
"lm_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, octovis",
"url": null
} |
python, performance, random, numpy, combinatorics
"""
return min((random.sample(words, n) for _ in range(r)), key=score)
4. Hill climbing
A useful search technique in this kind of global optimization problem is hill climbing. The idea is to pick a random sample to start with, explore its neighbourhood by examining "nearby" samples, pick the best of the neighbours, and continue until no further improvement can be made. For example:
def best_sample_2(words, score, n=100, r=100):
"""Return a sample of n (default 100) elements from words, found by
starting with a random sample and repeatedly hill climbing by
generating r (default 100) neighbours and picking the one with
smallest score, until no more progress is made.
"""
words = set(words)
current_sample = set(random.sample(words, n))
current_score = score(current_sample) | {
"domain": "codereview.stackexchange",
"id": 13535,
"lm_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, random, numpy, combinatorics",
"url": null
} |
Rather than the action on the $3$-Sylow, I think there is a more natural set on which $SL_2(\mathbb{Z}_3)/Z(SL_2(\mathbb{Z}_3))$ acts faithfully. Set $X:=\{\text{ vectorial lines in } \mathbb{F}_3\times \mathbb{F}_3\}$.
The cardinal of $X$ is easy to find, indeed, any vectorial line is given by a non-null vector and furthermore two colinear vectors give the same line hence :
$$X=\frac{\mathbb{F}_3\times \mathbb{F}_3\setminus \{0\}}{\mathbb{F}_3^*}$$
Hence $|X|=\frac{9-1}{2}=4$. It is clear that $SL_2(\mathbb{Z}_3)$ acts on $X$ furthermore a matrix $A$ will leave any line fixed if and only if it is in the center. This is easy to show (say $(e_1,e_2)$ is the canonical base of $\mathbb{F}_3\times \mathbb{F}_3$), take $A$ such a matrix then it leaves $\mathbb{F}_3e_1$, $\mathbb{F}_3e_2$ and $\mathbb{F}_3(e_1+e_2)$ invariant that is : $Ae_1=\lambda e_1$, $Ae_2=\mu e_2$ and $A(e_1+e_2)=\gamma (e_1+e_2)$, hence we have :
$$\gamma e_1+\gamma e_2=A(e_1+e_2)=Ae_1+Ae_2=\lambda e_1+\mu e_2$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464499040094,
"lm_q1q2_score": 0.8132801763726463,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 113.15228007972763,
"openwebmath_score": 0.9684637784957886,
"tags": null,
"url": "https://math.stackexchange.com/questions/1325327/sl-2-mathbb-z-3-zsl-2-mathbb-z-3-cong-mathbb-a-4"
} |
ros, kinect, roshydro, freenect
Bus 003 Device 004: ID 22b8:710f Motorola PCS
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 011: ID 045e:02be Microsoft Corp.
Bus 003 Device 012: ID 045e:02bf Microsoft Corp.
My guess is that the Microsoft Corp devices are the Kinect Audio, Camera and Aux (The ID 045e corresponds to it).
Any help, suggestion, recommendation with this? It's really driving me crazy. Let me know if I can give you any more information. Thank you!
Regards | {
"domain": "robotics.stackexchange",
"id": 17042,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, kinect, roshydro, freenect",
"url": null
} |
$$R^*=\widehat{H}^*_C(\text{point})=\mathbb{Z}/p[x,x^{-1}]\otimes E[a].$$ Because $C$ has prime order, it must act freely on $X\setminus X^C$, so $\widehat{H}^*_C(X,X^C)=0$, so $$\widehat{H}^*_C(X) \simeq \widehat{H}^*_C(X^C) \simeq H^*(X^C)\otimes R^*.$$ This is essentially what is called Smith theory. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.975576913496333,
"lm_q1q2_score": 0.8785360640436659,
"lm_q2_score": 0.9005297807787537,
"openwebmath_perplexity": 53.055303541385186,
"openwebmath_score": 0.9665765762329102,
"tags": null,
"url": "https://mathoverflow.net/questions/232179/is-the-action-of-g-on-h-1tn-mathbbz-mathbbzn-faithful/232204"
} |
quantum-field-theory, special-relativity, lie-algebra, poincare-symmetry
Title: Generators of Poincare Groups How can I determine the generators of the Poincare Group, $P(1,3)$ explicitly?
Here $P(1,3)$ means a matrix Lie group. The general idea.
Let's restrict the discussion to matrix Lie Groups for simplicity. Determining the generators of a given Lie group $G$ simply means (by definition) determining a basis for its Lie algebra $\mathfrak g$. Here's a standard method for finding such a basis:
Recall that the Lie algebra $\mathfrak g$ of a matrix Lie group $G$ is defined as the set of all matrices $X$ for which $e^{s X}$ is an element of $G$ for all real numbers $s$.
Use the properties of elements of $G$ to constrain the elements $X$; the resulting admissible elements $X$ are precisely the elements of the Lie algebra $\mathfrak g$ which is a vector space of matrices.
Determine a basis for this resulting vector space. | {
"domain": "physics.stackexchange",
"id": 11793,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, special-relativity, lie-algebra, poincare-symmetry",
"url": null
} |
resource-recommendations, particle-detectors, accelerator-physics, particle-accelerators
Particle Detectors and Their Applications edited by C.M. Bhat and J.T. Rouse:
This book is a collection of articles on the various types of particle detectors and their applications. The authors provide a comprehensive overview of the various types of detectors, including scintillation detectors, solid-state detectors, and gas detectors, and provide detailed descriptions of the design, construction, and operation of these detectors. The book also covers the performance and limitations of these detectors and their applications in particle physics, nuclear physics, and medical physics. The book is intended for advanced students and researchers in physics and requires some prior knowledge of particle physics and detector technology.
Calorimeter Systems for Particle Physics by P. Sievers: | {
"domain": "physics.stackexchange",
"id": 93117,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-recommendations, particle-detectors, accelerator-physics, particle-accelerators",
"url": null
} |
constant coefficient differential equations. The impressive array of existing exercises has been more than doubled in size and further enhanced in scope, providing mathematics, physical science and engineering graduate students with a thorough introduction to the theory and application of ordinary differential equations. We'll explore their applications in different engineering fields. Introduction. Prerequisite for the course is the basic calculus sequence. Get result from Laplace Transform tables. E as a distinct field in. Many things involving rates of change are described with differential equations. The content of this course includes all the topics of MAT 265 - Differential Equations: GT-MA1 with an additional emphasis on applications and problem solving. 6)) or partial differential equations, shortly PDE, (as in (1. {Occasional Summer, Fall, Spring}. All of those books use the Laplace transform only as a means to solve differential equations. Applications of Differential | {
"domain": "vievimilano.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105314577313,
"lm_q1q2_score": 0.8156913821326103,
"lm_q2_score": 0.8354835432479661,
"openwebmath_perplexity": 628.559223201776,
"openwebmath_score": 0.4513215720653534,
"tags": null,
"url": "http://jfbx.vievimilano.it/applications-of-differential-equations-in-engineering.html"
} |
# Math Help - A Question - Concentration Required
1. ## A Question - Concentration Required
There are two cups of different liquids. Both liquids are equal in volume. If I take a tea spoon of one liquid and put it in the other, then mix that until the entire liquid is equally concentrated, then take a tea spoon of that cups mixture and put it in the first cup, which cup has a greater concentration of its original liquid and why?
2. Originally Posted by Obsidantion
There are two cups of different liquids. Both liquids are equal in volume. If I take a tea spoon of one liquid and put it in the other, then mix that until the entire liquid is equally concentrated, then take a tea spoon of that cups mixture and put it in the first cup, which cup has a greater concentration of its original liquid and why?
You can solve this problem algebraically put just see what happens when both cups have 100 units and the teaspoon takes 1 unit.
Just do a numerical problem to see how it works out. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978051747564637,
"lm_q1q2_score": 0.819235662986357,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 1278.6443585008594,
"openwebmath_score": 0.568213939666748,
"tags": null,
"url": "http://mathhelpforum.com/math-challenge-problems/66269-question-concentration-required.html"
} |
Then, for $x\ne 1$
$$x+1=\frac{x^2-1}{x-1}<\frac{x^2-1}{\log x}<\frac{x^2-1}{\frac{x-1}{x}}=x(x+1)$$
By the squeeze theorem, we have
$$\lim_{x\to 1}\frac{x^2-1}{\log x}=2$$
as was to be shown!
• I love your "as was to be shown." It's very Euclid-esque. :D – Adam Hrankowski Sep 12 '15 at 23:27
• Very elegant proof, I might add. – Adam Hrankowski Sep 12 '15 at 23:36
• @AdamHrankowski Thank you!! I really appreciate the comment! – Mark Viola Sep 12 '15 at 23:52
• Those inequalities should be $\leq$ rather than $<$, since all three terms are equal at $x=1$. (or clarify that they were only meant to hold for $x \neq 1$) – user14972 Sep 13 '15 at 7:20
• Some links to post about the inequality used in your answer: math.stackexchange.com/questions/324345/… and math.stackexchange.com/questions/1161278/… – Martin Sleziak Sep 13 '15 at 9:17 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464450067471,
"lm_q1q2_score": 0.8235964214651019,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 619.5688227523599,
"openwebmath_score": 0.8259371519088745,
"tags": null,
"url": "https://math.stackexchange.com/questions/1432474/limit-with-natural-log-in-the-denominator-lim-x-to1-fracx2-1-ln-x/1432630"
} |
A radical equation is one in which the variable appears under a square root or other radical. We solve simple radical equations by raising both sides to the appropriate power. For example, to solve the equation
\begin{equation*} \sqrt{x+3}=4 \end{equation*}
we square both sides to find
\begin{align*} (\sqrt{x+3})^2 \amp = 4^2\\ x+3 \amp = 16 \end{align*}
You can check that $$x=13$$ is the solution for this equation.
Solve $$~4\sqrt[3]{x-9} = 12$$
Solution.
We first divide both sides of the equation by 4 to isolate the radical.
\begin{equation*} \sqrt[3]{x-9} = 3 \end{equation*}
Next, we cube both sides of the equation.
\begin{align*} (\sqrt[3]{x-9})^3 \amp = 3^3\\ x-9 \amp = 27\\ x \amp = 36 \end{align*}
The solution is 36. We can also solve the equation graphically by graphing $$y=4\sqrt[3]{x-9}\text{,}$$ as shown in the figure. The point $$(36,12)$$ lies on the graph, so $$x=36$$ is the solution of the equation $$~4\sqrt[3]{x-9} = 12$$
Solve $$~6+2\sqrt[4]{12-v} = 10$$ | {
"domain": "runestone.academy",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180669140008,
"lm_q1q2_score": 0.825657131065466,
"lm_q2_score": 0.8376199633332891,
"openwebmath_perplexity": 877.1037884370139,
"openwebmath_score": 0.8709487915039062,
"tags": null,
"url": "https://runestone.academy/ns/books/published/int-algebra/RadicalEquations.html"
} |
Lets, therefore, look at something more interesting. Take the RREF matrix below: Now we have two free variables! Now and where and can be any values we like. Now the general solution vector looks like this: How did we get here? We we know from the RREF matrix that: We replace and with our free variables and then solve for the pivots, thus getting the general solution vector.
The above can then be represented using the general solution vector: The solution set thus becomes:
We can find the reduced row echelon form of a matrix in python using the sympy package and the rref() function:
from sympy import Matrix, init_printing
init_printing(use_unicode=True)
system = Matrix(( (3, 6, -2, 11), (1, 2, 1, 32), (1, -1, 1, 1) ))
system
system.rref()[0]
Which outputs:
⎡1 0 0 -17/3⎤
⎢ ⎥
⎢0 1 0 31/3 ⎥
⎢ ⎥
⎣0 0 1 17 ⎦ | {
"domain": "jehtech.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474904166246,
"lm_q1q2_score": 0.8111594186493482,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 293.740094673211,
"openwebmath_score": 0.9159740209579468,
"tags": null,
"url": "https://jehtech.com/mathsy_stuff/linear_alg.html"
} |
matlab, python, power-spectral-density, stft
Title: Window Type Effect on Pwelch vs ShortTimeFFT PSD Result? I am trying to make sure I understand the output scaling of pwelch. I am using the PWelch function to compute the PSD of a signal and I have manually computed the PSD from an STFT output. The results are equivalent when I use a rectangular (boxcar) window, but if I use another window (Hann) the PSD outputs are no longer equivalent. Why is this? I’ve tried this in both Matlab and Python, so my lack of understanding must be on the theory of the pwelch method and not some programming bug.
I have attached code the demonstrates the effect in both Python and Matlab. Uncomment the hann window lines and comment the boxcar/rectwin lines to see the difference.
Much Thanks,
Michael
MATLAB Example
timeDur = 2;
Fs = 3750;
dt = 1/Fs;
nSamps = Fs * timeDur;
complexData = randn(nSamps,1) + 1j*randn(nSamps,1);
tWind = 0.02;
nWind = floor(tWind * Fs);
nOvlp = floor(tWind * Fs * 1/2); | {
"domain": "dsp.stackexchange",
"id": 12494,
"lm_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, python, power-spectral-density, stft",
"url": null
} |
lagrangian-formalism, action
Title: Given the action, derive the Lagrangian (Fields and non-fields) Let us denote $L$ the Lagrangian, and $\mathcal{L}$ the Lagrangian density, and the action $S$.
It is common to find the action based on the Lagrangian. Here, however, I am interested in the reverse problem.
Going from $S$ to $L$ my intuition is as follows: one derives $S$ with respect to $t$
$$
S=\int L dt \implies \frac{dS(t)}{dt}=L
$$
However, this does not appear correct to me because the relation is actually $S=\int_a^b Ldt$ (a definite integral).
Can someone chip in as to if this is valid for definite integrals? | {
"domain": "physics.stackexchange",
"id": 60540,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, action",
"url": null
} |
c#, object-oriented, dependency-injection, mvvm, uwp
private void ConfigureNavView()
{
AddNavItem<MainViewModel>("Home", Symbol.Home);
}
Also, the presence of logic for calculating the key and extracting it, again, in one place Navigation Config. Convenient to change. You don't need to edit different parts of the code.
public static string ConvertToKey<TViewModel>() => typeof(TViewModel).FullName;
public static string GetPageKey(NavigationViewItem item) => item.Tag.ToString(); | {
"domain": "codereview.stackexchange",
"id": 37473,
"lm_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, dependency-injection, mvvm, uwp",
"url": null
} |
_________________
Jeffrey Miller
Jeffrey Miller
Re: A club collected exactly $599 from its members. If each [#permalink] 21 Jun 2016, 09:34 Similar topics Replies Last post Similar Topics: 2 A local club has between 24 and 57 members. The members of the club ca 4 21 Oct 2016, 08:54 2 A charity collected$1,199 from donors during the last month. If each 4 29 Feb 2016, 09:34
To rent an office, each member of a club must pay n dollars. If two mo 1 07 Feb 2016, 09:40
26 A certain club has exactly 5 new members at the end of its 12 08 Dec 2012, 20:12
30 A certain established organization has exactly 4096 members. 17 08 Jan 2008, 11:23
Display posts from previous: Sort by | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995703612219,
"lm_q1q2_score": 0.8475544473884177,
"lm_q2_score": 0.8774767826757122,
"openwebmath_perplexity": 10713.094819188147,
"openwebmath_score": 0.34232771396636963,
"tags": null,
"url": "http://gmatclub.com/forum/a-club-collected-exactly-599-from-its-members-if-each-139646.html#p1125532"
} |
human-biology, microbiology, bacteriology, health, diet
Title: What are the most important factors influencing a person’s gut microbes?
You are your bacteria! The probiotics and the antibiotics...
There has been on going discussions about how our gut bacteria is important for a healthy lifestyle. | {
"domain": "biology.stackexchange",
"id": 4215,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, microbiology, bacteriology, health, diet",
"url": null
} |
quantum-mechanics, quantum-entanglement
Adding more coordinates is adding more commuting X operators, and more independent P operators, so that the wavefunction grows in dimension without bound, and there is no natural restriction you can choose. A measurement of the $X_i+X_j$ operator will prepare a state which is not entangled in the $X_i+X_j$ $X_i-X_j$ basis, but this state is entangled in the $X_i$ $X_j$ basis.
The sum of product wavefunctions of the form $\psi(x,y)=f(x)g(y)$ does not respect the product form, so if you restrict yourself to unentangled wavefunctions, the evolution operator cannot be a general linear map. The constraint which produces entangled wavefunctions is that
$$ \partial_x \partial_y \log(\psi(x,y)) = 0 $$ | {
"domain": "physics.stackexchange",
"id": 1951,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-entanglement",
"url": null
} |
java
if (hardpointType != HardPointType.NONE && globalFreeHardPoints <= 0) {
candidates.clear();
}
return candidates;
}
/**
* Changes the name of the loadout.
*
* @param aNewName
* The new name of the loadout.
*/
public void rename(String aNewName) {
name = aNewName;
} | {
"domain": "codereview.stackexchange",
"id": 16219,
"lm_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",
"url": null
} |
navigation, ekf, robot-localization
<rosparam param="initial_estimate_covariance">[1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, | {
"domain": "robotics.stackexchange",
"id": 22182,
"lm_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, ekf, robot-localization",
"url": null
} |
classification, time-series, tensorflow, rnn
Title: RNN unable to classify time series I have 400 time series of length 50.
200 of them have values between 1-10 and are considered of type A.
The rest 200 have values 1-10 with the exception that 3 from the total of 50 data points have value 20, and are considered of type B.
I am trying to use a RNN network to make it learn these differences using tensorflow.
I use GRU cell with input size is 50 (the whole time series), internal state is 100, 3 layers, feature length is 1 and dropout 0.8.
Batch size is 1 (1 whole time series of 50 values)
80% of the series are used for training and 20% for test, evenly distributed between type A and type B.
I use softmax as activation function and for gradient descent optimization i use RMSPropOptimizer. Also i am not changing the data at all before feeding it into the neural network, i tried normalizing them using (x-min()/max()-min()) but it didn't work. | {
"domain": "datascience.stackexchange",
"id": 2271,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, time-series, tensorflow, rnn",
"url": null
} |
robotic-arm, motion-planning, jacobian
they compute the $$\Delta x = T_e^t(q_s)$$ which is transformation matrix of the end effector with respect to the task frame.
What I don't get is why the end effector? and why the end effector with respect to the task frame?
Secondly.
Later in the paper they write down an expression that relates the task space to the joint space motion. They do it using the Jacobian, but seem to miss explaining (in my opinion) what $E(q_s)$ actually do.
$$J(q_s) = E(q_s)J^t(q_s)$$
What is said about it in the paper is that | {
"domain": "robotics.stackexchange",
"id": 1102,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robotic-arm, motion-planning, jacobian",
"url": null
} |
python, beginner, django, bioinformatics
def database(request):
"""
Filter the database according to the categories prefixes
"""
categories = ProteinDatabase.objects.order_by('name').values_list('name').distinct()
category_prefixes = []
for category in categories:
prefix = category[0][:3]
if prefix not in category_prefixes:
category_prefixes.append(prefix)
context = {
'category_prefixes': category_prefixes,
'descriptions': Description.objects.all()
}
return render(request, 'database/database.html', context)
def search(request):
"""
This will search according to the keywords. It will also filter and return the results
"""
context = {
'proteins': ProteinDatabase.objects.all()
}
if request.method =='POST':
search_term = request.POST['search_term']
search_term = search_term.strip()
searches = re.split(':|, ?|\s |\- |_ |. |; |\*|\n', search_term) | {
"domain": "codereview.stackexchange",
"id": 35919,
"lm_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, django, bioinformatics",
"url": null
} |
javascript, html5, canvas, snake-game
and really there has to be a better way than to subscribe to every browser event ;) I am assuming you are not simply providing snake.game.adjust because it is not yet initialized at that point. I would rather solve that problem then creating functions to deal with that problem. | {
"domain": "codereview.stackexchange",
"id": 8201,
"lm_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, canvas, snake-game",
"url": null
} |
a! Given spectrum data four dimensional antisymmetric square matrices that under the same conditions the also! Be a real symmetric matrix if transpose of a i i.e false: has... Matrix division using a polyalgorithm we shall study matrices with complex eigenvalues, we need to minus along... Is its own negative of Every one a zero matrix or null.. V, i.e a has no repeated eigenvalues but still a good.! Have antisymmetric matrix eigenvalues example of Every one since all off-diagonal elements are zero or Purely imaginary and the second even... Algebra, a real symmetric matrix this is the identity matrix, Av=v any. Square matrices follow so i 'll just have an example of Every one proof is to show that the... Video - 1 0 false – it could have an eigenvalue of,. ± a is the great family of real skew-symmetric matrix both are square.! A ) by examining the eigenvalues of a ( i.e x = randn ( 5.... Of −1, as in −1 matrix - Duration: 8:53 the eigenvectors are perpendicular to each other,. In fact, | {
"domain": "forret.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305307578324,
"lm_q1q2_score": 0.8088573876496202,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 660.5278213635348,
"openwebmath_score": 0.8692973256111145,
"tags": null,
"url": "https://web.forret.com/ruv2b6uq/67b03a-antisymmetric-matrix-eigenvalues"
} |
php, object-oriented, authentication
Redirects
You follow the general rule for 302 redirects: header and exit. Once you switch over to PHP 8.1 I highly recommend using the never type. Take a look at your Login::login() method. You have redirect() followed by else block. That's unnecessary. The code after redirect will never be executed.
Login::login() needs refactoring
It does what it was supposed to do, but the code is overly complex. Despite calling fetchAll() your foreach loop will never iterate more than one row. Either way the code exits due to redirects. password_verify() does not return hash, so you named the variable incorrectly. There's also no reason for the temporary variable. if($statement->rowCount() > 0 is generally considered an antipattern and is unnecessary in this code. SELECT * is also an antipattern you should avoid.
Consider how it could be simplified and still do the same:
public function login(UserAccount $user):void
{
$sql = "SELECT passwordHash, username FROM users WHERE email = ?"; | {
"domain": "codereview.stackexchange",
"id": 42379,
"lm_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, authentication",
"url": null
} |
forces, dirac-delta-distributions, molecular-dynamics
Title: How to deal with the force of the form $\delta (\mathbf{r}) u(\mathbf{r})$, $u(\mathbf{r})$is the interaction potential Now I have such an expression for potential energy:
$$
U_j(\mathbf{r}_j) = \int_{\mathbf{r}_j-\frac{\mathbf{L}^b}{2}}^{\mathbf{r}_j+\frac{\mathbf{L}^b}{2}} d\mathbf{r} \sum_{\mathbf{n}} \sum_{i\ne j}^{N} \delta(\mathbf{r}-\mathbf{r}_i + \mathbf{n} \mathbf{L}^B) u_{j}^b(\mathbf{r}-\mathbf{r}_j)
$$
$\mathbf{r}_j(x_j,y_j,z_j), \mathbf{L}^b(L_x^b,L_y^b,L_z^b), \mathbf{n}(n_x,n_y,n_z), \mathbf{L}^B(L_x^B,L_y^B,L_z^B)$ are all three dimensional vectors. $n_x,n_y,n_z \in \mathbb{Z}$. Also, $\mathbf{n L}^b = (n_x L_x^b,n_y L_y^b,n_z L_z^b)$. Note $\mathbf{L}^b \ne \mathbf{L}^B $, this is the heart of the problem. Find the expression for the force on this potential energy:
$$
\begin{align}
-F_j(\mathbf{r}_j) =& \dfrac{d U_j(\mathbf{r}_j)}{d\mathbf{r}_j} \notag \\ | {
"domain": "physics.stackexchange",
"id": 88780,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, dirac-delta-distributions, molecular-dynamics",
"url": null
} |
acceleration, astrophysics, plasma-physics, shock-waves
In summary, the evidence so far leans toward collisionless shock waves generating the highest energies of these possible acceleration mechanisms. However, note that DSA generally involves self-consistently generated waves by the particles that are undergoing DSA, i.e., the particles are reflected and stream against the incident flow generating instabilities that radiate electromagnetic fluctuations which then act as scattering centers for DSA. That is, none of the mechanisms are likely to act in isolation, e.g., reconnection regions are riddled with large amplitude electromagnetic fluctuations, collisionless shock ramps always have lots of large amplitude electromagnetic fluctuations, etc. | {
"domain": "physics.stackexchange",
"id": 76512,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acceleration, astrophysics, plasma-physics, shock-waves",
"url": null
} |
nuclear-physics, radiation, atoms, subatomic
Title: Can an alpha particle (or any charged particle) can penetrate through nucleus of gold atom? Can an alpha particle (or any charged particle) can penetrate through nucleus of gold (or any other) atom ?
Today I was watching a lecture on the "Estimation of Size of Nucleus" which was a subtopic of Rutherford's Atomic Model, where a respected teacher elaborated the calculations made by Rutherford to estimate the size of nucleus of gold atom. In short, Rutherford considered that the size of nucleus would be less than the closest distance that an alpha particle can reach near the nucleus and made calculations for it taking the maximum Kinetic Energy of a naturally occurring alpha particle, charge of alpha particle, charge of nucleus etc. There he (the teacher) said this statement "The alpha particle cannot get inside the nucleus."
Then I began wondering about it. Why an alpha particle cannot get inside a nucleus ? | {
"domain": "physics.stackexchange",
"id": 72456,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, radiation, atoms, subatomic",
"url": null
} |
# $\frac{c}{1+c}\leq\frac{a}{1+a}+\frac{b}{1+b}$ for $0\leq c\leq a+b$
When proving that if $d$ is a metric, then $d'(x,y)=\dfrac{d(x,y)}{1+d(x,y)}$ is also a metric, I have to prove the inequality:
$$\dfrac{c}{1+c}\leq\frac{a}{1+a}+\frac{b}{1+b}$$ for $0\leq c\leq a+b$. This is obvious by expanding, but is there a nicer way to see why it is true?
• You can also use the monotone increasing property of $\frac{x}{1+x}$ for proving $\frac{d(x,y)}{1+d(x,y)}$ is a metric. – mtm Jun 17 '13 at 17:50
$$\frac{a}{1+a}+\frac{b}{1+b}\ge\frac{a}{1+a+b}+\frac{b}{1+b+a}=\frac{a+b}{1+a+b}=\frac{1}{1+\frac{1}{a+b}}\ge\frac{1}{1+\frac1c}=\frac{c}{1+c}$$
• this comment was dumb, sorry, really need to get some sleep. cheers – mm-aops Jun 15 '13 at 13:23
• Very clear, thanks Maisam! – Paul S. Jun 15 '13 at 13:27
• @mm-aops:no problem care free – M.H Jun 15 '13 at 13:28
• @Paul S.:your welcome dear paul – M.H Jun 15 '13 at 13:29 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985718064816221,
"lm_q1q2_score": 0.837831942418753,
"lm_q2_score": 0.849971175657575,
"openwebmath_perplexity": 701.6799877231667,
"openwebmath_score": 0.793558657169342,
"tags": null,
"url": "https://math.stackexchange.com/questions/421099/fracc1c-leq-fraca1a-fracb1b-for-0-leq-c-leq-ab"
} |
homework-and-exercises, string-theory, physical-constants, absolute-units
Title: About Planck tension in strings theory as stated in "The Elegant Universe" In the book "The Elegant Universe" by Brian B. Greene, on chapter 6 it is stated that there's the so called "Planck tension" in string theory, and it is given a value of $10^{39}$ tons. This value is repeated some times.
But tension should be given in Newtons, not kilograms: is it saying $10^{42}$ kiloponds? so that'd be ~$10^{43}$ N ... But Planck force is ~$10^{44}$ N.
I think this is not a duplicate of the question What is tension in string theory?, or at least I need some clarification, because in that answer, it is stated:
"Because the string tension is not far from the Planck tension - one
Planck energy per one Planck length or $10^{52}$ Newtons or so" | {
"domain": "physics.stackexchange",
"id": 29348,
"lm_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, string-theory, physical-constants, absolute-units",
"url": null
} |
optics, visible-light, reflection, lenses
First, the small angle approximation assumes angles are so small that it doesn't matter which of those distances you use. It works for paraxial rays, which are very close the principal axis. These are the rays that define the focal length. So $1/f = 1/u + 1/v$ is correct as is.
For non-paraxial rays, you need to trace the path of the ray through the system. Whenever the ray hits the surface of a lens or mirror, you calculate the location of where it hits and the new direction of the ray.
Complex lenses have been designed for longer than computers have been available. If you are tracing rays through a system manually, you traces as few rays as possible, and you use the simplest approximation that is sufficiently accurate. | {
"domain": "physics.stackexchange",
"id": 56587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, visible-light, reflection, lenses",
"url": null
} |
# 10-digit numbers with constraints
How many 10-digit numbers can be made by using the digits {5,6,7} (all of them) and with the additional constraints that no two consecutive digits must be the same and also that the first and last digits of the number must be the same?
I am trying to find a solution by using combinatorics. I start from the 1st leftmost digit, which can have any value from {5,6,7} (3 possibilities). Then we move to the 2nd digit, which can have 2 values (since it can't be the same with the 1st) and so on, and for the last digit we only have 1 option. But this is not correct, because for the 9th digit we have the restriction that it must be different from the 8th and also different from the 10th, which, in turn, is equal to the 1st. I don't know how to express this.
I therefore tried to find a recursive relation. I found that the general relation is $$a(n) = 2*a(n-1)$$ if n odd and $$2*a(n-1) + 6$$ if n is even. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9895109071934599,
"lm_q1q2_score": 0.8245837721978564,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 171.0872731511633,
"openwebmath_score": 0.8659646511077881,
"tags": null,
"url": "https://math.stackexchange.com/questions/3326780/10-digit-numbers-with-constraints"
} |
physiology, respiration
The phase transition temperature of lipids increases upon dehydration (another reference), meaning that at the same ambient temperature, a dry lipid membrane is in the liquid ordered state and a wet lipid membrane is in the liquid disordered state.
Therefore, a dry cell membrane is less oxygen permeable than a wet one. | {
"domain": "biology.stackexchange",
"id": 8461,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physiology, respiration",
"url": null
} |
ros, kinect, pointcloud-to-laserscan
//Copy laserIn ranges to appropriate sector in laserOut
void ScanToWide::copyLaserInToOut(const sensor_msgs::LaserScan::ConstPtr& laserIn,
sensor_msgs::LaserScan& laserOut)
{
//Display incoming laser scan range values for testing
//ROS_INFO("copyLaserInToOut cameraPanStep: %d", cameraPanStep);
//ROS_INFO("laserIn ranges.size: %d", laserIn->ranges.size());
//for (unsigned int i = 0; i < laserIn->ranges.size(); i++) {
// ROS_INFO("index: %d, range: %f", i, laserIn->ranges[i]);
//}
//Copy input laserscan ranges to output laserscan
for (unsigned int i = 0; i < laserIn->ranges.size(); i++) {
if (laserIn->ranges.at(i) < laserIn->range_max)
laserOut.ranges.at(i) = laserIn->ranges.at(i);
}
}
//Send a camera pan position command message
void ScanToWide::sendCameraPanCmd(enum CameraPanStepType cameraPanStep)
{
std_msgs::Float32 panAngle; | {
"domain": "robotics.stackexchange",
"id": 5401,
"lm_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, pointcloud-to-laserscan",
"url": null
} |
rust
if prev_number.is_some() {
result.push(Token::NUMBER(prev_number.unwrap()));
}
result
}
I've slightly changed the binary operators here, by specifying what should happen in the case of overflow. To recover the behavior of your original code, which will panic on overflow in debug mode (since you haven't specified what you want to happen in that case), but wrap in release mode, do this:
/// Solves the multiplications and divisions in the given token vector. Returns a vector of tokens that were not solved, with the solved parts in-place.
/// e.g. 1+2*3 returns 1+6.
fn solve_multiply_divide(tokens: &Vec<Token>) -> Vec<Token> {
solve_bin_ops(tokens, ('*', <i64 as std::ops::Mul>::mul), ('/', <i64 as std::ops::Div>::div))
} | {
"domain": "codereview.stackexchange",
"id": 42653,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust",
"url": null
} |
php, validation
Title: Form validation for sporting events I am coding a site where users submit sporting events.
When submitting an event there are a lot of fields that need to be validated.
This is the method I wrote to valid the fields:
class event{
private $dbh;
private $post_data;
public function __construct($post_data, PDO $dbh){
$this->dbh = $dbh;
$this->post_data = array_map('trim', $post_data); | {
"domain": "codereview.stackexchange",
"id": 7193,
"lm_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, validation",
"url": null
} |
programming-languages, functional-programming, typing
I understand the type inference done here, but not the structure of the expression returned.
Can someone explain how this works ?
Thanks It seems that what you are confused about is the common practice of Curryfication: the function
$$ (\alpha\times \alpha\rightarrow \beta)\rightarrow \alpha\rightarrow \alpha\rightarrow \mathrm{bool} $$
Is parenthesized as:
$$ (\alpha\times \alpha\rightarrow \beta)\rightarrow (\alpha\rightarrow (\alpha\rightarrow \mathrm{bool})) $$
and is equivalent to a different function:
$$ (\alpha\times \alpha\rightarrow \beta)\times \alpha\times \alpha\rightarrow \mathrm{bool} $$
The reason for this is the following. Take a function:
$$f:A \rightarrow (B\rightarrow C)$$
This is a function that takes an element $a:A$ and returns a function
$$ f\ a: B\rightarrow C$$
Apply this to an element $b:B$ and you have
$$f\ a\ b:C$$ | {
"domain": "cs.stackexchange",
"id": 1062,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-languages, functional-programming, typing",
"url": null
} |
# Trapezoidal rule for a set of data
• Comp Sci
Gold Member
## Homework Statement:
> a) Read in the data and, using the trapezoidal rule, calculate from them the approximate distance traveled by the particle in the x direction as a function of time.
> b) Extend your program to make a graph that shows, on the same plot, both the original velocity curve and the distance traveled as a function of time.
## Homework Equations:
Tthe question taken from Mark Newman-Computational Physics Exc 5.1
the text file of the data. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9343951588871157,
"lm_q1q2_score": 0.8101540197515117,
"lm_q2_score": 0.8670357632379241,
"openwebmath_perplexity": 675.503323784955,
"openwebmath_score": 0.6231268644332886,
"tags": null,
"url": "https://www.physicsforums.com/threads/trapezoidal-rule-for-a-set-of-data.974776/"
} |
homework-and-exercises, forces, classical-mechanics, fluid-statics, buoyancy
c) If I place a ball and the ball completely sinks under the water and touches the base of the beaker, what will be scale reading be? I understand that Mg>>>Fb, but why does Fb play no effect in the scale reading in this case? Buoyant force has no effect on the interaction between the beaker and the scales it stands on.
The scales will register a weight which is the sum of the weights of the beaker, water and ball. | {
"domain": "physics.stackexchange",
"id": 25508,
"lm_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, forces, classical-mechanics, fluid-statics, buoyancy",
"url": null
} |
quantum-mechanics, probability, phase-space, wigner-transform
But recall that a WF for each pure state will have a unique *-genvalue E (identical to the eigenvalue of the Weyl-ordered correspondent operator on that state) so a δ-spike in your notional distribution w.r.t. energy: a sharp spectral line, not a probability distribution. The quasi-distribution in z that has resulted is not a probability distribution (Laguere polynomials for the oscillator take negative values!) and does not represent the distribution you are envisioning--- even though quantum tomography applications of WFs utilize such constructs.
If you used it to find the expectation of z you'd recover the above E, of course: one value, not a distribution. | {
"domain": "physics.stackexchange",
"id": 24751,
"lm_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, probability, phase-space, wigner-transform",
"url": null
} |
newtonian-mechanics, classical-mechanics, orbital-motion
so
$$Ct=A\eta+\sqrt{A^2+B^2}\sinh\eta$$
Thus $r(\eta)$ and $t(\eta)$ are simple formulas giving a nice parameterization of $r(t)$ in terms of a parameter $\eta$.
You can invert $r(\eta)$ to get
$$\eta=\cosh^{-1}{\frac{r-A}{\sqrt{A^2+B^2}}}$$
and then substitute this into $t(\eta)$ to get
$$t(r)=\frac{1}{C}\left(A\cosh^{-1}{\frac{r-A}{\sqrt{A^2+B^2}}}+\sqrt{A^2+B^2}\sinh\cosh^{-1}{\frac{r-A}{\sqrt{A^2+B^2}}}\right)$$
I think your best approach will be to use the parametric formulas. For a given $t$, you can numerically solve $t(\eta)$ to get $\eta$ to the precision you need, and then substitute it into $r(\eta)$. | {
"domain": "physics.stackexchange",
"id": 53273,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, classical-mechanics, orbital-motion",
"url": null
} |
equilibrium, solubility
Title: Solubility equilibrium | {
"domain": "chemistry.stackexchange",
"id": 9743,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "equilibrium, solubility",
"url": null
} |
deep-learning, feature-selection, feature-extraction, pooling
Title: Min Pooling vs Max Pooling If I train a simple CNN with an MNIST dataset for digit classification. Is it possible to get a similar performance if I replace the max-pooling layers with the min-pooling layers?
This problem may be trivial in MNIST due to the small image size of 28x28. What about applications with FG-BG segmentation? Essentially I can say that if max-pooling layers are supposed to look at the foreground class by focusing on the "important features" then min pooling is supposed to look at the background class by focusing on the "least important" features.
Is it possible that subsequent layers will learn to ignore "least important" features and to focus on the "most important" features by simply learning the inverse? Min pooling most likely result in zero activations (layer's activations will be equal to 0), with ReLU activations this is almost guaranteed to be the case, thus, there will be no learning as all gradients will be equal to 0. | {
"domain": "datascience.stackexchange",
"id": 11078,
"lm_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, feature-selection, feature-extraction, pooling",
"url": null
} |
c#, inheritance, reflection, polymorphism, json.net
var genericArguments = CreateGenericArguments(match.Groups["genericArguments"]);
var type = ResolveType($"{match.Groups["type"].Value}{genericArguments.Signature}");
return $"{type.FullName}{genericArguments.FullName}, {type.Assembly.GetName().Name}";
}
// Signature: "<, >"
// FullName: "[[T1],[T2]]" - the "`2" prefix is provided by type-full-name later
private (string Signature, string FullName) CreateGenericArguments(Group genericArguments)
{
if (genericArguments.Success)
{
// "<, >"
var commas = string.Join(string.Empty, genericArguments.Value.Where(c => c == ',').Select(c => $"{c} "));
var signature = $"<{commas}>"; | {
"domain": "codereview.stackexchange",
"id": 32751,
"lm_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#, inheritance, reflection, polymorphism, json.net",
"url": null
} |
newtonian-mechanics, forces, reference-frames, acceleration
Therefore, we can safely ignore in all practical problems. This correct? Darn it, should have kept my highschool physics book given all this remote learning. I think all of your practical considerations are correct. However, we can seriously simplify the situation. Let's imagine a perfectly rigid earth and ball (all parts move together). Then to throw a ball in the air requires a force, which will be applied equally to the earth, as in Newton's third law.
This force is capable of launching the ball a metre or so into the air because it has a low mass. The earth on the other hand has an incredibly large mass! Nevertheless the earth will move in the opposite direction but by a tiny amount because of the large mass and the small force. This movement would be imperceptible. Since $F = ma$, the relative difference in the acceleration felt by each is in the ratio of the masses. Assuming a 1kg ball, the relative acceleration of the earth will be ~$5\times 10^{24}$ times smaller!! | {
"domain": "physics.stackexchange",
"id": 70491,
"lm_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, forces, reference-frames, acceleration",
"url": null
} |
thermodynamics, water, vacuum, evaporation
So, to answer the question "does it take more energy to evaporate a liter of water in a vacuum, and if so why?", note that the heat of vaporization of water becomes zero at the critical point. As the pressure and temperature of the above referenced container are moved down from the critical point, the heat of vaporization of water increases. Because evaporation at low pressure conditions (i.e., vacuum conditions) occurs at low temperatures, it takes more energy to evaporate a given amount of water than it does at standard conditions (e.g., 1 atmosphere). As counter-intuitive as it sounds, evaporating (aka boiling) water at vacuum conditions occurs at a low temperature, but it requires more heat to evaporate a given amount of water under those conditions. However, note one caveat: this conclusion is based only on evaporating (aka boiling) the water at a constant temperature, meaning that the water is already at its boiling point and there is no heating to get it to its boiling point. If | {
"domain": "physics.stackexchange",
"id": 80899,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, water, vacuum, evaporation",
"url": null
} |
java, design-patterns
Title: Generating classes from enum I have a system that receives messages. Each message has a type defined. These types are declared in an enum:
enum MessageType {
TYPE1, TYPE2, ... , TYPE999
}
People can extend my system by implementing message processors. Each message type can only have one processor and most will have none. My current design has users writing their processors and I have one factory that they have to change:
public static Map<MessageType, MessageProcessor> getProcessors() {
Map<MessageType, MessageProcessor> processors = Maps.newHashMap();
processors.put(TYPE33, new Type33Processor());
processors.put(TYPE111, new Type111Processor());
processors.put(TYPE222, new Type222Processor());
processors.put(TYPE444, new Type444Processor());
return processors;
}
My problem with this is twofold:
Each new processor has to remember to add this boilerplate.
This factory has to know all processor types. | {
"domain": "codereview.stackexchange",
"id": 13643,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, design-patterns",
"url": null
} |
particle-physics, standard-model, pauli-exclusion-principle, pentaquarks
Title: Could a $uuuu\bar{u}$ pentaquark exist? Could a $uuuu\bar{u}$ pentaquark exist or is it forbidden due to Pauli exclusion principle? I don't think there's any obstruction due to Pauli Exclusion to writing down a local operator that looks like it may excite a $uuuu\overline{u}$-type pentaquark, for example you could write something like:
$$ \mathcal{O}^{\mu,i,j} = \epsilon_{abc} u_a^\mu (u_b^T C \gamma_i u_c) (\overline{u} \gamma_j u)$$
where an appropriate projection will give you something that lives in a spin-5/2 representation. This operator is not identically zero by Pauli exclusion, so it seems like a candidate. Even if you asked for a $uuuuuuuu\cdots uuuuu$ type hadron - you could still write down an operator that seemed to excite such a state; the operator would necessarily have to be nonlocal (to avoid Pauli Exclusion principle issues), but that's ok. | {
"domain": "physics.stackexchange",
"id": 92231,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, standard-model, pauli-exclusion-principle, pentaquarks",
"url": null
} |
simulation, hamiltonian-simulation
Classical simulation begins with the realization that in solving a simple differential equation such as $dy/dt = f(y)$, to first order, it is known that $y(t + \Delta t) \approx y(t) + f (y)\Delta t$. Similarly, the quantum case is concerned with the solution of $id|\psi \rangle/dt = H|\psi \rangle$, which, for a time-independent $H$, is just $$|\psi(t)\rangle = e^{-iHt}|\psi(0)\rangle.\ \ \ \ \ \ (4.96)$$
Since H is usually extremely difficult to exponentiate (it may be sparse, but it is also
exponentially large), a good beginning is the first order solution $|\psi(t + \Delta t)\rangle \approx (I − iH \Delta t)|\psi(t)\rangle$. This is tractable, because for many Hamiltonians $H$ it is straightforward to compose quantum gates to efficiently approximate $I − iH \Delta t$. However, such first order solutions are generally not very satisfactory. | {
"domain": "quantumcomputing.stackexchange",
"id": 1165,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "simulation, hamiltonian-simulation",
"url": null
} |
electromagnetism, energy, poynting-vector
Veritasium second video: Link Most of the energy is carried by the fields outside of the conductors. The fields don't have to be "extremely close" to the condcutors. 50/60 Hz high voltage transmission lines have their wires separted by multiple meters and the field exists in the space between.
When transmitting electric/electromagnetic energy using conductors to guide the fields you find that there is a current in the wires. For high power transmission the fields are large and the corresponding currents are large. Ohmic resistance in the wires converts this current into heat. For high power you need large cables to reduce the ohmic resistance and to handle the heat load. | {
"domain": "physics.stackexchange",
"id": 87786,
"lm_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, energy, poynting-vector",
"url": null
} |
quantum-mechanics, quantum-entanglement, locality, non-locality
The phenomenon of entanglement between quantum systems raised the non-locality problem first noted in the EPR paper: A projective measurement on a quantum system at one space location instantly collapses the state of an entangled counterpart at a distant location. Quantum mechanical non-locality refers to this apparent entanglement-mediated violation of Einstein locality. | {
"domain": "physics.stackexchange",
"id": 24158,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-entanglement, locality, non-locality",
"url": null
} |
javascript, programming-challenge, html, css
I see no usage of conventions and only a few comments within the
<head> element. Overall your code is freestyle and harder than
necessary to read.
The naming of your IDs and classes for large parts is not self-explaining. left-input is a poor name. Neither from the naming nor from the visual example I would understand what the classes are for.
You using Bootstap-5 but your class names indicate that for most parts you are not using it and rather rely on a long custom CSS file. While it is acceptable to mix both you rather should decide if you really need Bootstrap and if, then you should use it to the full extent and cut down your custom CSS to that part that can't be solved with Bootstrap.
As you already use Bootstrap and custom CSS you should stick to them. You should never mix them with inline-style!
1.2 Accessibility & Semantics
Your code is for most parts inaccessible. With the exception of <main> I see no specific semantic tag or attribute. | {
"domain": "codereview.stackexchange",
"id": 44573,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, programming-challenge, html, css",
"url": null
} |
predictive-modeling, computer-vision, object-detection, probability, self-driving
More precisely put, I would like to model that: given an object is detected with probability $p$ if it is seen 'once' (AKA during a moment in time), then what is the probability of it being detected if it is seen for a second time, a third time, etc... Each 'moment in time' may be characterized by a single video frame/image or some other unit of time. Each time the image is seen it may be in a similar but not identical orientation. An approach that is not specific to the image domain is to use a probabilistic data structure like a Count-Min Sketch. A Count-Min Sketch data structure can accumulate information to estimate the observed frequency of an input value based on the past set of input values by using multiple hashing functions over the input. | {
"domain": "datascience.stackexchange",
"id": 9314,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "predictive-modeling, computer-vision, object-detection, probability, self-driving",
"url": null
} |
homework-and-exercises, gravity, forces, orbital-motion
Title: A change in the mass of the moon Would a change in the mass or radius of the moon have any effect on its speed?
When asked this question in an assignment, I stated that it did not. My reasoning being that a change in the mass or radius of the moon would in no way change the acceleration or velocity of the moon. The moon would travel along the same path, the only difference being that the gravitational force being exerted by/on the Earth and Moon would be of a lesser magnitude. As the mass of the Moon decreases by ½, does the gravitational force.
F=ma
½F=½m*a
The original gravitational force being exerted is double that of the new gravitational force
2(G MiMii/r2)=G Mi(1/2Mii)/r2
I got this answer wrong and I am unsure why. Was I wrong in my approach? Are there other forces that I should have taken into account when coming to my conclusion? | {
"domain": "physics.stackexchange",
"id": 10632,
"lm_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, gravity, forces, orbital-motion",
"url": null
} |
• thank you! this is also very useful – LCFactorization Feb 4 '15 at 9:54
• This is very interesting! I wonder if this is true in more than 3 dimensions. – 6005 Feb 4 '15 at 15:23
• @Goos: No. If I'm not mistaken, in $n>1$ dimensions, the distribution of $x$ is proportional $(1-x^2)^{\frac{n-3}{2}}$. – Litho Feb 4 '15 at 15:36
• This follows from a classic calculus problem: The area of a sphere between two parallel planes only depends on the distance between the planes, and the diameter of the sphere. It doesn’t matter where these planes are in relation to the sphere. There are lots of proofs on the web, e.g. usrsb.in/blog/blog/2011/08/11/…. – Ethan Bolker Feb 4 '15 at 22:00
In 2D, using polar coordinates $x_1=\cos 2\pi u,x_2=\sin 2\pi u$, where $u$ is uniform in $[0,1]$.
In 3D, using spherical coordinates $y_1=2\sqrt{v-v^2}\cos 2\pi u, y_2=2\sqrt{v-v^2}\sin 2\pi u, y_3=2v-1$, where $v$ s uniform in $[0,1]$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105245649665,
"lm_q1q2_score": 0.8374480320877942,
"lm_q2_score": 0.857768108626046,
"openwebmath_perplexity": 197.17227972204248,
"openwebmath_score": 0.8261810541152954,
"tags": null,
"url": "https://math.stackexchange.com/questions/1133066/how-can-one-create-random-numbers-with-special-correlations/1133076"
} |
phase-transition, quantum-chromodynamics, chemical-potential, confinement, phase-diagram
The confinement-deconfinement phase transition for QCD is especially at non-zero $\mu$ not completely understood. Later I will discuss a simplified model but when it comes to QCD: closely related to the confinement-deconfinement transition is chiral symmetry breaking and restoration. Actually those phase diagram sketches at non-zero $\mu$ usually include information from model calculations of low-energy effective models for QCD. Those usually study the chiral condensate $\langle\bar{\psi}\psi\rangle$ which at low $T$ and $\mu$ acquires a nonzero expectation value $\langle\bar{\psi}\psi\rangle>0$ due to dynamic symmetry breaking: this is due to quantum fluctuations. Increasing the temperature "melts" this expectation value -- thermal fluctuations decease $\langle\bar{\psi}\psi\rangle$ and at $\mu=0$ we find a smooth crossover at $T_c$ to an approximately restored phase $\langle\bar{\psi}\psi\rangle\approx 0$. Chiral symmetry gets only approximately restored due to finite quark masses. | {
"domain": "physics.stackexchange",
"id": 87689,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phase-transition, quantum-chromodynamics, chemical-potential, confinement, phase-diagram",
"url": null
} |
quantum-field-theory, condensed-matter, lagrangian-formalism, path-integral, action
Quantum mechanically, there will also appear a multiplicative Van Vleck-Morette determinantal factor
$$\tag{3} ({\rm Det}^{\prime}(-\Delta))^{-\frac{1}{2}}$$
in front of the remaining path integral over $\theta$. Here $\Delta:=\partial_x^2$. The prime in eq. (3) indicates that a zeromode should be excluded.
References: | {
"domain": "physics.stackexchange",
"id": 13357,
"lm_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, condensed-matter, lagrangian-formalism, path-integral, action",
"url": null
} |
performance, beginner, algorithm, c
(In comments, you expressed uncertainty about using strlen() here - see footnote)
In a boolean context (dir = readdir(d)) != NULL can be written simply as (dir = readdir(d)) (I keep the redundant parens as an indicator that assignment is intended, rather than a typo; this is a convention that GCC understands, and possibly other compilers too).
The local variable i is modified in the for loop, but never used. We can simplify to while ((dir=readdir(d))) instead.
Naming: avoid names like readDir that are pronounced the same as standard functions (readdir).
Reduce scope. For example, by moving temp into the while loop in cleanup_queue, we can make it constant:
void cleanup_queue() {
while (head) {
Node *const temp = head;
head = head->next;
free(temp->path);
free(temp);
}
} | {
"domain": "codereview.stackexchange",
"id": 29059,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, beginner, algorithm, c",
"url": null
} |
kinect, openni, openni-kinect, ubuntu
Title: node doesn't send kinect data over network
I'm trying to run an openni node on one machine (Ubuntu 11.04) and publich the data to the master node, which is on another machine (also Ubuntu 11.04) to view it in rviz there. I believe to have my network set up correctly, as I can ping from one machine to the other, and "rostopic list" on the master node returns the topics published by the openni node on the other machine. My problem is that there is no data coming through - "rostopic echo ..." returns nothing on the master node, and rviz therefore obviously doesn't receive anything either. On the machine running openni (the one supposed to be sending the data) I can view the kinect data just fine. When I check my network traffic with system tools, I see that no data is being sent at all. I also have all firewalls disabled.
Originally posted by pdowling on ROS Answers with karma: 11 on 2011-08-18
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 6462,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinect, openni, openni-kinect, ubuntu",
"url": null
} |
algorithms, complexity-theory, graphs, turing-machines, np-complete
# for each clause in the list of clauses, add the variables in the clause to the list of variables
for clause in clauses:
for variable in clause:
if variable != 0:
variables.append(variable)
# create the boolean circuit using the list of variables and clauses and return the result
circuit = create_circuit(variables, clauses)
return circuit
# define the function for constructing a boolean circuit using the Cook-Levin reduction
def cook_levin(n, k):
# create an empty list to store the clauses in the boolean circuit
clauses = []
# for each value of i from 1 to n, create a clause that represents the value of x_i
for i in range(1, n+1):
clause = (i, i, 0)
clauses.append(clause)
# create a clause that represents the negation of the value of x_n+1 (the accept state)
clause = (n+1, 0, 0)
clauses.append(clause) | {
"domain": "cs.stackexchange",
"id": 20699,
"lm_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, complexity-theory, graphs, turing-machines, np-complete",
"url": null
} |
newtonian-mechanics, experimental-physics, conservation-laws, collision
Title: How do I investigate the effect of height of the fall of a marble on the size of a crater in sand? What do I need?
What would the most effective method be to reduce the uncertainty of my outcome?
Should I record the mass and diameter of the marble too or just the height?
If I change mass will it be more effective than height change?
How do I investigate the affect of height of the fall of a marble on
the size of a crater in sand? | {
"domain": "physics.stackexchange",
"id": 72726,
"lm_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, experimental-physics, conservation-laws, collision",
"url": null
} |
• I'm a little out of my comfort zone here, but if I recall correctly all the eigenfunctions of a Sturm-Liouville operator (en.wikipedia.org/wiki/Sturm%E2%80%93Liouville_theory) will yield orhtogonal eigenfunctions (wrt different products). In this regard sine and cosine are in equal footing as Legendre or Hermite polynomials among others. These are fundamental in quantum mechanics as well. I remember fondly the book "Fourier series and orthogonal functions" by H.F Davis, where at least part of this story is detailed. Apr 14, 2018 at 10:12 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668714863166,
"lm_q1q2_score": 0.8176304820534713,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 328.3058074404362,
"openwebmath_score": 0.8950873017311096,
"tags": null,
"url": "https://math.stackexchange.com/questions/2733613/why-do-we-use-trig-functions-in-fourier-transforms-and-not-other-periodic-funct/2733639"
} |
c++, algorithm, image, matrix, c++20
// Enable this function if ElementT = RGB
void print(std::string separator = "\t", std::ostream& os = std::cout) const
requires(std::same_as<ElementT, RGB>)
{
for (std::size_t y = 0; y < size[1]; ++y)
{
for (std::size_t x = 0; x < size[0]; ++x)
{
os << "( ";
for (std::size_t channel_index = 0; channel_index < 3; ++channel_index)
{
// Ref: https://isocpp.org/wiki/faq/input-output#print-char-or-ptr-as-number
os << +at(x, y).channels[channel_index] << separator;
}
os << ")" << separator;
}
os << "\n";
}
os << "\n";
return;
} | {
"domain": "codereview.stackexchange",
"id": 45545,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, image, matrix, c++20",
"url": null
} |
#### Examples¶
If $$A$$ contains only one vector $$a_1 \in \mathbb R ^2$$, then its span is just the scalar multiples of $$a_1$$, which is the unique line passing through both $$a_1$$ and the origin
If $$A = \{e_1, e_2, e_3\}$$ consists of the canonical basis vectors of $$\mathbb R ^3$$, that is
$\begin{split}e_1 := \left[ \begin{array}{c} 1 \\ 0 \\ 0 \end{array} \right] , \quad e_2 := \left[ \begin{array}{c} 0 \\ 1 \\ 0 \end{array} \right] , \quad e_3 := \left[ \begin{array}{c} 0 \\ 0 \\ 1 \end{array} \right]\end{split}$
then the span of $$A$$ is all of $$\mathbb R ^3$$, because, for any $$x = (x_1, x_2, x_3) \in \mathbb R ^3$$, we can write
$x = x_1 e_1 + x_2 e_2 + x_3 e_3$
Now consider $$A_0 = \{e_1, e_2, e_1 + e_2\}$$
If $$y = (y_1, y_2, y_3)$$ is any linear combination of these vectors, then $$y_3 = 0$$ (check it)
Hence $$A_0$$ fails to span all of $$\mathbb R ^3$$
### Linear Independence¶ | {
"domain": "quantecon.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9937100989807552,
"lm_q1q2_score": 0.8876905691374989,
"lm_q2_score": 0.8933093968230773,
"openwebmath_perplexity": 430.0254335697078,
"openwebmath_score": 0.9785626530647278,
"tags": null,
"url": "https://lectures.quantecon.org/jl/linear_algebra.html"
} |
Partial Fractions: Undetermined Coefficients 1. Introduction we apply the method of partial fractions decomposition to a rational func Partial Fractions: Get the free "Partial Fraction Calculator" widget for your website, blog, Wordpress, Blogger, or iGoogle. Find more Mathematics widgets in Wolfram|Alpha.
GUIDELINES FOR PARTIAL FRACTION DECOMPOSITION Given two polynomials, P and Q, the problem of computing the integral Z P(x) Q(x) dx can be simplified provided it is Chapter 10: Techniques Of Integration – Section partial-fractions method as in the above example, up-the-partial-fractions method. Go To Problems | {
"domain": "junkiesnacks.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995762509217,
"lm_q1q2_score": 0.8049078754904693,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 585.2213736276245,
"openwebmath_score": 0.8196485042572021,
"tags": null,
"url": "https://junkiesnacks.com/gatineau/partial-fraction-decomposition-example-problems.php"
} |
aerospace-engineering, aerodynamics
It is worth reiterating that it is the pitch of the blades which provides the direct control over thrust and lift and engine power is adjusted to keep their rotational speed withing an optimum range.
In a conventional helicopter the tail rotor and main rotor are directly coupled together via the gearbox and only their blade pitch rather than speed can be adjusted independently ie the tail rotor speed is proportional to the main rotor speed.
There are designs which deviate from the conventional layout though for example there are tail designs which use ducted airflow rather then an external rotor and also various configurations of twin rotor which dispense with tail thrust altogether eg the Chinook which has fore and aft rotors and various
Russian military helicopters which have coaxial rotors. | {
"domain": "engineering.stackexchange",
"id": 1223,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "aerospace-engineering, aerodynamics",
"url": null
} |
c#, .net, security, sql-server, authentication
Bottom line: the client computer is always compromised in your eyes. You can do no more to secure it at this point, with an instance of Visual Studio (which this can be done more effectively with a separate programme that hides on the client computer) I can view your connection string and extract it with little to no effort required. (This whole process takes ~10 seconds once you have used the 'Break All' on the programme.)
My advice to you: don't take unnecessary security precautions to ensure your work is 'safe in memory' -- there's no such thing. All memory can be dumped, and even if it's only in memory for ~0.00001ms, an attacker can still find it. Just worry about building your application, let the memory security be handled by the user. :)
On to the code review: | {
"domain": "codereview.stackexchange",
"id": 23719,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, security, sql-server, authentication",
"url": null
} |
def getPermutations(array):
res = []
getPermutationsHelper(res, array, 0)
return res
• Combination Sum III
"""
216. Combination Sum III
Find all valid combinations of k numbers that sum up to n such that the following conditions are true:
Only numbers 1 through 9 are used.
Each number is used at most once.
Return a list of all possible valid combinations. The list must not contain the same combination twice, and the combinations may be returned in any order. | {
"domain": "paulonteri.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813501370535,
"lm_q1q2_score": 0.8218225111577803,
"lm_q2_score": 0.8596637487122111,
"openwebmath_perplexity": 6090.381773024074,
"openwebmath_score": 0.30743175745010376,
"tags": null,
"url": "https://dsa.paulonteri.com/Data%20Structures%20and%20Algorithms%2016913c6fbd244de481b6b1705cbfa6be/Recursion%2C%20DP%20%26%20Backtracking%20525dddcdd0874ed98372518724fc8753.html"
} |
c#, wpf, active-directory
var parent = this;
var lastLevel = levels.Length - 1;
foreach (var level in levels)
{
if (parent.Children.Contains(new ActiveDirectoryScope
{
Name = level
}))
{
parent = parent.Children.Find(
item => item.Name.Equals(level));
}
else if (level == levels[lastLevel])
{
parent.Children.Add(new ActiveDirectoryScope
{
Name = level,
Path = organizationalUnit.Path
});
}
}
} | {
"domain": "codereview.stackexchange",
"id": 20538,
"lm_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#, wpf, active-directory",
"url": null
} |
is a function still a curve... To one and onto or bijective function ah!... the beautiful invertable functions... Today we present... ta! Read injective, surjective and bijective or bijective function or bijection is a function f a! Is a bijection be inverted surjective, thus it is a function is both an injection and a surjection at... Output value is connected to only one input value set, and each value. Input value below represents a one to one and onto or bijective function or bijection is a bijection bijective!... Be inverted more you can read injective, surjective and bijective, the what is bijective function is not true Today we...! An injection and a surjection like that to what is bijective function input set, and each output value connected!, and each output value is connected to only one input value have just few! Not true definition: a function is invertible if and only if it crosses more than once is. Read injective, surjective and bijective and can be inverted that is both | {
"domain": "lyaart.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731105140616,
"lm_q1q2_score": 0.8311638749216445,
"lm_q2_score": 0.8633915976709976,
"openwebmath_perplexity": 565.8390496117695,
"openwebmath_score": 0.8533709645271301,
"tags": null,
"url": "http://lyaart.com/lendingtree-email-khutddb/5e29e2-what-is-bijective-function"
} |
homework-and-exercises, electromagnetism
$$\mathbf J (\mathbf x ,t) = \sigma \mathbf E (\mathbf x ,t)$$
Where $\mathbf J$ is the volume charge density. Now for a PEC, as $\sigma \rightarrow \infty$ , you can see that if we had a non-zero electric field inside the conductor, the current density would also go to infinity, which is clearly nonphysical. Thus, the only way to satisfy the above equation is for $\mathbf E (\mathbf x ,t)$ to be zero everywhere inside the conductor, at all times .
Thus, for a perfect electrical conductor, the electric field is zero inside the conductor even in time-varying cases. | {
"domain": "physics.stackexchange",
"id": 45743,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, electromagnetism",
"url": null
} |
c++, object-oriented
map.display_map(snake, wall, food);
}
if (snake.change_dir() == 4)
{
snake.dir = 2;
continue;
}
break;
case 3:
while (!_kbhit())
{
for (int i = snake.coor.size() - 1; i >= 0; i--)
{
if (i - 1 >= 0)
snake.coor[i] = snake.coor[i - 1];
else if (i == 0)
snake.coor[i][1]++;
}
for (int j = 0; j < snake.body.size(); j++)
{
snake.body[j].pos = snake.coor[j];
} | {
"domain": "codereview.stackexchange",
"id": 41044,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented",
"url": null
} |
electromagnetism
EDIT
The electromagnetic field vectors $\:\mathbf{E},\mathbf{B}\:$ given by equations (04) and (09) respectively satisfy the four Maxwell equations without charge and charge current densities
\begin{align}
\rho\left(\mathbf{r},t\right) & = 0
\tag{14a}\\
\boldsymbol{\jmath}\left(\mathbf{r},t\right) & = \boldsymbol{0}
\tag{14b}
\end{align}
at all field points except at the singular point
\begin{equation}
\mathbf{r}_{\bf o}=\mathbf{r}-\mathbf{x}=\boldsymbol{0}
\tag{15}
\end{equation}
that is at the point where the charge is on.
In order to include this singularity in our equations we must use the following equations
\begin{equation}
\dfrac{\mathbf{r}_{\bf o}}{\:\:\Vert\mathbf{r}_{\bf o}\Vert^{3}}=\dfrac{\mathbf{r}-\mathbf{x}}{\:\:\Vert\mathbf{r}-\mathbf{x}\Vert^{3}}=-\boldsymbol{\nabla}\left(\!\dfrac{1}{\Vert\mathbf{r}-\mathbf{x}\Vert}\right)
\tag{16}
\end{equation}
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 45414,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism",
"url": null
} |
python, optimization, array, numpy, cython
trues = countlower(dist_within, dist_between, n1, n2)
s_plus += trues
s_minus += n1 * n2 - trues
n_ = s_plus + s_minus
return (<double>s_plus - <double>s_minus) / <double>n_ if n_ != 0 else 0
Edit1: Passing just the pointers, instead of the arrays to the time-critical function (>99% of time is spent there) made a ~ 10% speed-up. I guess some things just cannot be made faster
@cython.profile(False)
@cython.boundscheck(False)
@cython.nonecheck(False)
cdef unsigned int countlower(double* v1, double* v2, int n1, int n2):
''' Function output corresponds to np.bincount(v1 < v2)[1]'''
''' The upper is not correct. It rather corresponds to
sum([np.bincount(v1[i] < v2)[1] for i in range(len(v1))])'''
cdef unsigned int trues = 0 | {
"domain": "codereview.stackexchange",
"id": 5843,
"lm_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, optimization, array, numpy, cython",
"url": null
} |
c#, .net, playing-cards, .net-5
public static readonly Rank Seven = new(RankName.Seven, "7");
public static readonly Rank Eight = new(RankName.Eight, "8");
public static readonly Rank Nine = new(RankName.Nine, "9");
public static readonly Rank Ten = new(RankName.Ten, "10");
public static readonly Rank Jack = new(RankName.Jack, "J");
public static readonly Rank Queen = new(RankName.Queen, "Q");
public static readonly Rank King = new(RankName.King, "K");
public static readonly Rank Joker = new(RankName.Joker, "¡J!");
} | {
"domain": "codereview.stackexchange",
"id": 41507,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, playing-cards, .net-5",
"url": null
} |
ai-design, training, game-ai, dqn, open-ai
If the aim here is to try and get the agent to speed up and finish an episode, a simpler trick might be to reduce the discount factor (e.g. from $0.999$ to $0.99$). This will cause the agent to focus on getting more short-term rewards, at the expense of long-term planning. In some environments this could be a problem of a different kind, but when the rewards are not sparse and there are not any special high-reward states that need extended setup, it should be OK. | {
"domain": "ai.stackexchange",
"id": 827,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ai-design, training, game-ai, dqn, open-ai",
"url": null
} |
python, animation, pygame, python-2.x
def transform_point_basis((x, y), (e1x, e1y), (e2x, e2y)):
return transform_point((x, y), e1x, e2x, e1y, e2y)
def twod_map(f, xss):
return [[f(item) for item in xs] for xs in xss]
def color_bases((x, y)):
"""
Colors the 1-st canonical base (0,1) red,
The 2-nd canonical base (1,0) green
"""
if (distance_from_o((x, y)) < UNIT and y == 0 and x > 0):
return (255, 0, 0)
if (distance_from_o((x, y)) < UNIT and x == 0 and y > 0):
return (0, 255, 0)
return (255, 255, 255)
def bright_by_distance((x, y)):
return (255 - distance_from_o((x, y)) // 3 % 256,
255 - distance_from_o((x, y)) // 3 % 256,
255 - distance_from_o((x, y)) // 3 % 256) | {
"domain": "codereview.stackexchange",
"id": 31537,
"lm_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, animation, pygame, python-2.x",
"url": null
} |
python, python-3.x, console
else:
print(self.cmds[args[0]].__doc__)
def set_message(self, message):
"""Sets the initialization message"""
self.init_message = message
def add_function(self, name, function):
"""Adds a function to the command dictionary"""
self.cmds[name] = function
def cli(self, a):
global cont
args = a.split(' ')
if args[0] not in self.cmds.keys():
print('Command "', args[0], '" Not Found.')
self.help()
else:
if len(args) == 1:
self.cmds[args[0]]()
else:
self.cmds[args[0]](args[1:])
cont=True
def loop(self):
global cont
global text
print(self.init_message)
th.Thread(target=InputThread, args=(), name='user_input_thread', daemon=True).start()
while True:
if not cont:
self.cli(text)
if __name__ in '__main__':
x = CLI().loop() | {
"domain": "codereview.stackexchange",
"id": 38050,
"lm_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, console",
"url": null
} |
php, beginner, wordpress
The function contains an echo, and so output will be sent once a call is made. It might seem like an obvious thing to fix, but in larger projects, things like this can really trip you up, and you'll find yourself wasting hours trying to work out why the cookie isn't being set properly.
Bottom line: Functions return, they don't echo, so change the echo in your function with return, and echo in the template.
PHP stands for PHP: Hypertext Preprocessor
The important bit in this case is Preprocessor. You can use PHP to return/echo strings of markup, but why would you do that? You can embed PHP in HTML just as easily, so why not use that? If needs must, you can always use PHP to include bits and pieces of markup.
Markup isn't static | {
"domain": "codereview.stackexchange",
"id": 12467,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, beginner, wordpress",
"url": null
} |
java, enum, helper
While the mere existence of that Enum instead of just using Double instances directly is a whole different matter, I would be interested if there are any known best practices regarding that boolean expression.
Which of the both is easier to understand? The readability can be improved by using explanatory variables, (of course changing the variable names as they make sense to you).
public static boolean isDummy(TriState a, TriState b) {
boolean oneOfTheInputsIsZero = a.is(ZERO) || b.is(ZERO);
boolean oneOfTheInputsIsNull = a.is(NULL) || b.is(NULL);
return oneOfTheInputsIsZero && oneOfTheInputsIsNull;
} | {
"domain": "codereview.stackexchange",
"id": 33436,
"lm_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, enum, helper",
"url": null
} |
filters, signal-detection, matched-filter
In practice, you never know in advance the amplitude of the pulse you're looking for. There is attenuation in the channel that can change over time, even on very short time scales. Sometimes you don't know how much power the transmitter is using.
There are at least two solutions to this problem. One is to use automatic gain control in the receiver, so that you know in advance the power or the peak amplitude of the pulse going into the matched filter. The second is to use a training sequence or a pilot signal, so that the receiver can calibrate the thresholds appropriately. | {
"domain": "dsp.stackexchange",
"id": 2709,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, signal-detection, matched-filter",
"url": null
} |
fluid-dynamics, acoustics, kinetic-theory, buoyancy
Since this movement “ripples” through the object as it snakes upwards to get a new position in the medium, there is a limit as to how fast this type of slinky movement can happen, right?
I am wondering what happens to the movement of the object as it approaches or exceeds this limit and if some aspects of buoyancy (perhaps dynamic friction) would make this construction impossible.
Also wondering if this happens commonly in nature.
I was explaining buoyancy to my daughter and got confused thinking about this aspect.
Thanks for any insights! High buoyancy and low speed of sound have conflicting requirements.
A low molecular weight increases buoyancy but it also increases the speed of sound at a given temperature. | {
"domain": "physics.stackexchange",
"id": 67710,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, acoustics, kinetic-theory, buoyancy",
"url": null
} |
• They can be rotated about $v_3$ so there is some rotation invariance. I would suggest rotating the whole system to point $v_3$ along the $z$-axis. – Angina Seng Dec 27 '17 at 16:11
• You can use Cholesky decomposition to get some vectors matching the inner products, but then you need to rotate to get $v_3$ – Dap Dec 27 '17 at 16:14
• You are right, there is a full degree of freedom. rotating $v_3$ to be the z axis would give me the $z$ value of both vectors, which makes it a $2D$ unconstrained "square root" problem. – Amir Vaxman Dec 27 '17 at 16:14
Assuming the vectors are in general position, i.e. no two are parallel:
Select an arbitrary unit vector $t$ perpendicular to $v_3$ (the usual trick for doing so robustly is to take $t = (e\times v_3)/\|e\times v_3\|$, where $e$ is the vector with a 1 in the entry corresponding to the least-magnitude entry of $v_3$, and a 0 elsewhere.) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407199191508,
"lm_q1q2_score": 0.8089022663947506,
"lm_q2_score": 0.8311430562234878,
"openwebmath_perplexity": 254.42059798893297,
"openwebmath_score": 0.9346209764480591,
"tags": null,
"url": "https://math.stackexchange.com/questions/2581970/reconstructing-vectors-from-inner-products"
} |
fourier-transform, python
The other thing to consider is that if you take a larger chunk and remove a part of it form the middle, then there will again be a click. If the two chunks are moved next to each other, then the phases from the two chunks probably won't align very well and the measured magnitudes will be lower in a frequency dependent way (probably unwanted, since this is generally "unpredictable").
That said, the phase-problems at least can be avoided if rather than removing a chunk, you simply set it to all zero instead so the time-alignment is maintained (ie. temporarily mute the signal; I apologize if you are already doing this, my Python is rusty). The muted part obviously won't contribute, but otherwise the only remaining impact I can think of should be the extra envelope transients. | {
"domain": "dsp.stackexchange",
"id": 9666,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, python",
"url": null
} |
ros, ros2, colcon, ros-crystal
test_async_execute_process_with_emulation_shell_true (tests.unit.test_process_utils.test_async_execute_process.TestProcessUtilsAsyncExecuteProcess) ... ok
test_async_execute_process_with_emulation_shell_true_combined (tests.unit.test_process_utils.test_async_execute_process.TestProcessUtilsAsyncExecuteProcess) ... /usr/lib/python3.6/asyncio/base_subprocess.py:131: ResourceWarning: unclosed transport <_UnixSubprocessTransport pid=5571 returncode=0 stdin=<_UnixWritePipeTransport closed fd=11 closed>>
source=self)
/usr/lib/python3.6/asyncio/base_subprocess.py:131: ResourceWarning: unclosed transport <_UnixSubprocessTransport pid=5572 returncode=0 stdin=<_UnixWritePipeTransport closed fd=9 closed>>
source=self)
/usr/lib/python3.6/asyncio/base_subprocess.py:131: ResourceWarning: unclosed transport <_UnixSubprocessTransport pid=5575 returncode=0 stdin=<_UnixWritePipeTransport closed fd=11 closed>>
source=self)
ok | {
"domain": "robotics.stackexchange",
"id": 32336,
"lm_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, ros2, colcon, ros-crystal",
"url": null
} |
signal-analysis, continuous-signals
With this filter, it will be impossible to study the signal.
What I would suggest is to take the signal from the accelerometer, remove the gravity vector, obtain its magnitude and integrate it (i.e. pass it through a low pass filter). The time constant of the integrator should be comparable to the walk cycle length you want to study. This will get rid of the noise and provide a relatively smooth envelope approximating the movement of the center of mass. Alternatively, just before the integrator you can take the absolute of the magnitude (i.e rectify it). This will turn your output into a square pulse the length of which will correspond to the duration of each step.
Hope this helps. | {
"domain": "dsp.stackexchange",
"id": 4056,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, continuous-signals",
"url": null
} |
electric-fields, gauss-law, conductors
$$
where $r$ is the distance from $+q$ to a point inside the cavity.
Is my reasoning right? I mean, the electric field is always zero inside the conductor, but there can be a non-zero electric field inside the cavity? Let the inner and outer radii of a spherical conductor with a cavity be $R_1$ and $R_2$ respectively. The electric scalar potential distribution is given by the following equation.
\begin{equation}
\frac{4\pi\epsilon_0}{q}\phi(r) =
\begin{cases}
\frac{1}{r}+\left(-\frac{1}{R_1}+\frac{1}{R_2}\right)\;\;\;\text{(for }r<R_1 \text{)} \\
\frac{1}{R_2} \;\;\;\text{(for } R_1\leq r<R_2 \text{)} \\
\frac{1}{r} \;\;\;\text{(for } R_2\leq r \text{)}.
\end{cases}
\end{equation}
Note that $\phi(r)$ is continuos at $r=R_1$ and $r=R_2$.
Electric field for this case is given as
\begin{equation}
\vec{E}=-\nabla\phi=
\begin{cases}
\frac{q}{4\pi\epsilon_0}\frac{1}{r^2}\vec{e}_r\;\;\;\text{(for }r<R_1 \text{)} \\
0\vec{e}_r \;\;\;\text{(for } R_1\leq r<R_2 \text{)} \\ | {
"domain": "physics.stackexchange",
"id": 94413,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-fields, gauss-law, conductors",
"url": null
} |
lewis-structure
[I]nteratomic distances [...] are individually always substantially greater than for the corresponding diatomic interhalogen. | {
"domain": "chemistry.stackexchange",
"id": 1513,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lewis-structure",
"url": null
} |
orbit, planet, orbital-mechanics, orbital-elements, kepler
If we plotted the orbit of Jupiter, the biggest "gravitational bully" in the solar system (it messes with everything!) it would be closer to an ellipse with the Sun-Jupiter barycenter at one focus.
It gets a little complicated out there because the next three planets (Saturn, Uranus and Neptune) also push the Sun around a lot. We might think that lightweight Neptune wouldn't do much, but it's larger distance makes up somewhat for its smaller mass, since the center of mass is weighted by the distance*mass product. | {
"domain": "astronomy.stackexchange",
"id": 5672,
"lm_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, planet, orbital-mechanics, orbital-elements, kepler",
"url": null
} |
cytoskeleton
Title: Why do sperm have centrioles and do female eggs cells even have centrioles? I was just wondering why it is that sperm have centrioles underneath the acrosome, but that also prompted a thought as to whether eggs have them too? Oocytes do not have centrioles. During fertilization, the centrioles of the sperm become the centrioles of the zygote. Only one pair is needed, as there is only one cell (i.e. zygote) right after fertilization. | {
"domain": "biology.stackexchange",
"id": 9610,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cytoskeleton",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.