text stringlengths 1 1.11k | source dict |
|---|---|
c++, performance, multithreading, playing-cards
std::cout << content << std::endl;
}
// Compute and store into results the number of HCP of the hand given in parameter
void compute(std::vector<int>& hand)
{
loop++;
int value = 0;
for(auto it = hand.begin(); it != hand.end(); it++)
{
// A card is a value between 0 and 51
// To get the number of the card, we use its value % 13
// It gives a number between 0 and 12:
// - Ace: 12
// - King: 11
// - Queen: 10
// - Jack: 9
// - Every other cards: value-2
// Only cards with a value above 9 are useful
// We substract 8 to get the HCP of the cards
value += (*it) % 13 >= 9 ? (*it) % 13 - 8 : 0;
}
results[value]++;
} | {
"domain": "codereview.stackexchange",
"id": 37642,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, multithreading, playing-cards",
"url": null
} |
quantum-field-theory, special-relativity, group-theory, lie-algebra
Title: Which is the correct way to write a Lorentz group component in exponential form? I have this issue with the Lorentz transformations. I learned at some lectures that any Lorentz group component can be written as:
$$\Lambda = e^{\frac{1}{2}w_{ij}M^{ij}}$$
where the different components of $M$ indicate boosts or rotations in the Minkowski space-time.
However, this brings me some problems. For example, if someone wanted to perform two rotations, it is not the same to do first a rotation around the $x$-axis and then a rotation around the $y$-axis as the rotation matrices of $SO(3)$ don't commute. The same happens with performing a boost and then a rotation. So, wouldn't Lorentz transformations have the form:
$$\Lambda=e^Ae^Be^C... $$
which contains the order of the transformations. Both formulations are not the same as you can not separate the exponents in the first formula. You are writing the same thing in different ways. | {
"domain": "physics.stackexchange",
"id": 89562,
"lm_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, group-theory, lie-algebra",
"url": null
} |
waves
Title: A particular solution for the wave equation in 1+1D I am dealing with the one-dimensional spatial wave equation $$\frac{\partial^2 \phi}{\partial z^2}-\frac{1}{v^2}\frac{\partial^2\phi}{\partial t^2}=0,$$ where $\phi=\phi(z,t)$ is required to solve.
According to the algebraic approach on Wikipedia (essentially change of variables), we obtain the general solution should be in the form: $$F(z-vt)+G(z+vt)\tag{1}$$
Looking back to the wave equation, there is a trivial solution: $$\phi(z,t)=(a+bz)(c+dt)\tag{2}$$ where $\{a,b,c,d\}$ are arbitrary constants. But it seems that this solution (2) is not compatible with $F(z-vt)+G(z+vt)$.
Looking back to the wave equation, there is a trivial solution: $$\phi(z,t)=(a+bz)(c+dt)\tag{2}$$ where $\{a,b,c,d\}$ are arbitrary constants. But it seems that this solution is not compatible with $F(z-vt)+G(z+vt)$? | {
"domain": "physics.stackexchange",
"id": 86872,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves",
"url": null
} |
electromagnetism, electromagnetic-induction
If you tried to relate this mathematical result about 1d mathematical curves to the real world you'd essentially have two options. The first option would be to model your wire as a 1d loop, in which case you have to deal with a diverging magnetic field as you get close to the wire. The second option is to have a thick wire and realize there are many possible 1d curves through that wire, each having a different line integral of the electric field (modelled by a vector field) along one of the many 1d curves through the wire.
Experimentally you might try to relate the line integral of the electric field to an EMF or even a current through a wire. But if different parts of the wire have different electric fields, and there are many curves that loop through the wire. No single one of them has a direct and obvious correspondence to an EMF. And the current might not be as simple as a cross section all having a $\vec J$ piercing through it orthogonally. | {
"domain": "physics.stackexchange",
"id": 27622,
"lm_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, electromagnetic-induction",
"url": null
} |
This is an additive analogue of the standard multiplicative argument (=starting point of Kummer theory) telling us that a cyclic extension of degree $m$ is a root extension, when the smaller field has a primitive root of unity of order $m$.
• Thank you! I really appreciated this solution, now if I understand correctly this proof classifies all the abelian Galois extensions of degree $p$ (prime degree + abelian = cyclic). And if I want study extensions of degree a power of $p$ I need Witt vectors, am I right? I've still a doubt, what about non-abelian Galois extension? They does exist? How are they classified? Thank you again! Including the excellent reference you suggested the answer is exactly what I was looking for! – Giovanni De Gaetano Jul 7 '11 at 10:24 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180669140005,
"lm_q1q2_score": 0.8298027438199539,
"lm_q2_score": 0.8418256412990657,
"openwebmath_perplexity": 237.48664554542185,
"openwebmath_score": 0.8723489046096802,
"tags": null,
"url": "https://math.stackexchange.com/questions/50041/reference-book-for-artin-schreier-theory/50062"
} |
turing-machines, formal-grammars, semi-decidability
Title: Are decidable set/languages EQUIVALENT to type 1 grammars (non-contracting)? Suppose a Turing Machine (TM_G) that generates natural numbers following < or, equivalently, it generates words in lexicographical order.
Then, that language/set is decidable. Because it is trivial to devise a (halting) TM_R, using TM_G, that recognize/accepts the words/numbers of that language/set.
It is also clear (really?), that there must be a non-contracting grammar for the language of TM_G.
Now, let's suppose a we have a TM_G' that generates a decidable language not in lexicographical order. Because the language is decidable, there must exist a TM_R' that completely recognizes it. Now, it is not clear how to build TM_R' using TM_G' (probably this is a unsolvable problem (is it?). At least, it is easy how to have a semi-deciding TM_R' based on TM_G'). | {
"domain": "cs.stackexchange",
"id": 18261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines, formal-grammars, semi-decidability",
"url": null
} |
We can do the same with $\sqrt{\lambda}$ complex numbers, no?
10. Aug 24, 2012
### IniquiTrance
But since A is symmetric, it must have real eigenvalues, no?
11. Aug 24, 2012
### micromass
Yes, sure. So what we do is we argue the same argument where $\lambda$ might be negative and where $\sqrt{\lambda}$ might be complex. Then we can deduce that either $\sqrt{\lambda}$ or $-\sqrt{\lambda}$ are eigenvalues of A. Since A is symmetric, we have that $\sqrt{\lambda}$ must be real, so $\lambda$ was positive to begin with.
12. Aug 24, 2012
### IniquiTrance
Ah ok, thanks again!
13. Aug 24, 2012
### Ray Vickson
No, you can have both. The matrix
$$A = \pmatrix{2 & 0 \\0 & -2}$$ has
$$B = A^2 = \pmatrix{4 & 0 \\0 & 4},$$
and so both $\sqrt{4}$ and $-\sqrt{4}$ are eigenvalues of $A.$
RGV | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.966914019704466,
"lm_q1q2_score": 0.8218490460879966,
"lm_q2_score": 0.849971175657575,
"openwebmath_perplexity": 643.7562012350194,
"openwebmath_score": 0.7159313559532166,
"tags": null,
"url": "https://www.physicsforums.com/threads/eigenvalues-of-the-power-of-a-matrix.630940/"
} |
c++, game-of-life, sdl2
SDL_assert(m_Window != NULL);
if (!m_Board)
{
Coord<int, int> ScreenSize = {m_ScreenWidth, m_ScreenHeight};
m_Board = std::make_unique<Board>(ScreenSize);
}
SDL_assert(m_Board != nullptr);
m_Renderer = SDL_CreateRenderer(m_Window, -1, SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC);
SDL_assert(m_Renderer != NULL);
// Show lines
SDL_RenderClear(m_Renderer);
DrawLines();
}
Conway::Engine::~Engine()
{
SDL_DestroyWindow(m_Window);
SDL_DestroyRenderer(m_Renderer);
m_Window = NULL;
m_Renderer = NULL;
SDL_Quit();
}
void Conway::Engine::HandleEvents()
{
SDL_Event Event;
while(SDL_PollEvent(&Event))
{
switch(Event.type)
{
case SDL_QUIT:
m_Running = false;
break; | {
"domain": "codereview.stackexchange",
"id": 37802,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, game-of-life, sdl2",
"url": null
} |
electromagnetism, forces
The Maxwell's equations are well consistent with time varying fields and hence you can use the Lorentz force equation
$$\vec{F}=q(\vec{E}+\vec{v}\times\vec{B})$$
with $\vec{E}$ and $\vec{B}$ showing time dependence: $\vec{E}=\vec{E}(t)$ and $\vec{B}=\vec{B}(t)$, consistent with the Maxwell's equations. | {
"domain": "physics.stackexchange",
"id": 33714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, forces",
"url": null
} |
c#, linked-list, reinventing-the-wheel
private Node<T> MergeSortSub(Node<T> nHead)
{
if (nHead == null || nHead.next == null) { return nHead; }
Node<T> nSeeker = nHead;
Node<T> nMiddle = nSeeker;
while (nSeeker.next != null && nSeeker.next.next != null)
{
nMiddle = nMiddle.next;
nSeeker = nSeeker.next.next;
}
Node<T> sHalf = nMiddle.next;
nMiddle.next = null;
Node<T> nFirst = MergeSortSub(nHead);
Node<T> nSecond = MergeSortSub(sHalf);
Node<T> nResult = new Node<T>();
Node<T> nCurrent = nResult;
while (nFirst != null && nSecond != null)
{
IComparer<T> comparer = Comparer<T>.Default;
if (comparer.Compare(nFirst.data, nSecond.data) < 1)
{
nCurrent.next = nFirst;
nFirst = nFirst.next;
}
else
{
nCurrent.next = nSecond;
nSecond = nSecond.next; | {
"domain": "codereview.stackexchange",
"id": 21403,
"lm_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#, linked-list, reinventing-the-wheel",
"url": null
} |
demodulation, radio
1Hesper et al. A Sideband-Separating Mixer Upgrade for ALMA Band 9 from the 20th International Symposium on Space Terahertz Technology, Charlottesville, 20-22 April 2009
2A calibrated digital sideband separating spectrometer for radio astronomy applications
2Finger et al. A Calibrated Digital Sideband Separating Spectrometer for Radio Astronomy Applications also available at Pub. Ast. Soc. Pac.
Is the separation of the two SBs to two outputs the functional difference between 2SB and DSB? If not, what would it be?
Almost certainly yes, although it seems that the only hits that "2SB mixer" gets is for astronomy sites. See the figure, from the first paper you cite. It clearly shows two sidebands being received independently.
Basically, you're getting two SSB channels out of this, which, presumably, can be selected downstream. | {
"domain": "dsp.stackexchange",
"id": 9255,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "demodulation, radio",
"url": null
} |
$\frac{1}{R} = L = \lim_{n \to \infty}|\frac{a_{n + 1}}{a_n}| = \lim_{n \to \infty}\frac{2^{n + 1}(4^n + 1)}{2^n(4^{n + 1} + 1)} = \lim_{n \to \infty}\frac{2*4^n}{4*4^n + 1} + \lim_{n \to \infty}\frac{2}{4*4^n + 1} = \frac{2}{4} \Rightarrow R = 2$. So I concluded the series converges (absolutely) for $x \in (-2, 2)$ which actually makes sense when I look at it, as $x = 2$ would make the numerator $4^n$ and the series would diverge like $\sum_{n=0}^{\infty}1$. Again I do not see any way to make the series converge conditionally and thus diverges everywhere else but $x \in (-2, 2)$
### Summary
I need advice how I can use the information about whether a series converges or diverges to decide for which values of the same series multiplied by $x^n$ converges absolutely, converges conditionally or diverges. Any help appreciated, sorry if the math things are a little bit tiny. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668745151689,
"lm_q1q2_score": 0.8378309050984186,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 104.71514122538503,
"openwebmath_score": 0.9739940762519836,
"tags": null,
"url": "https://math.stackexchange.com/questions/2658728/for-which-values-of-x-does-these-series-converge-absolutely-converge-conditio"
} |
If $P(A)=P(B)=1$, then $P(A\cap B)=1$. To check this notice that $P((A\cap B)^c)=P(A^c\cup B^c)\le P(A^c)+P(B^c)$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9715639669551474,
"lm_q1q2_score": 0.8053670728700489,
"lm_q2_score": 0.8289388040954683,
"openwebmath_perplexity": 523.964078105301,
"openwebmath_score": 0.7992470264434814,
"tags": null,
"url": "https://math.stackexchange.com/questions/1460355/explain-why-p-liminf-x-n-leq-x-1-p-limsup-x-n-geq-y-implies-p-limin"
} |
My answer in 'Conceptual/Graphical understanding of the Fourier Series' could help.
You are computing the derivative of a function given by $y=x$ in $(-\pi,\pi]$. From the distributions' point of view the derivative will be $1$ except at $x=\pi$ where you'll get $-2\pi \delta(x-\pi)$ (from a jump discontinuity of $-2\pi$ because of the transition from $\pi$ to $-\pi$).
Of course we have to repeat this for every period $2\pi$ so that the full result will be : $$1 -2\pi \sum_{n\in \mathbb{Z}} \delta(x-\pi -2n\pi)$$ (it seems that you found a nice explication in Pete Olver's 'Fourier Series' pdf)
This is a 'Dirac comb' (note that the Fourier series in this link corresponds nearly to your result).
More exactly you got : $$\sum_{n=-\infty}^\infty \delta(x-a-2\pi n)=\frac 1{2\pi}+\frac 1{\pi}\sum_{n=1}^\infty \cos\left(n(x-a)\right)$$ in the special case $a=\pi$ producing $(-1)^n\cos(nx)$ at the right | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241956308277,
"lm_q1q2_score": 0.8013517406675802,
"lm_q2_score": 0.8267117898012104,
"openwebmath_perplexity": 319.14160113499815,
"openwebmath_score": 0.9580826163291931,
"tags": null,
"url": "https://math.stackexchange.com/questions/103097/performing-a-differentiation-on-a-fourier-series"
} |
ros, master, multiple-machines
Title: Problems with communication between multiple machines
So, i have this setup in my ros network:
My PC (172.16.49.9) as a publisher of the topic /controlInfo
Robot's PC (172.16.49.1 aka 172.17.1.1) as the ROS Master
Raspberry Pi hardware module (172.17.1.10) as subscriber of the topic /controlInfo
Pi is connected to Robot's PC through ethernet on the 172.17.x.x network. In both Pi and Robot's PC i can list all the nodes, see that /controlInfo is subscribed by 172.17.1.10 and published by 172.16.49.9, and whenever i publish data, i can echo-it in Robot's PC (so, the data reaches the master), but i can't echo-it in Pi.
What's the problem here ? Since i can successfuly communicate between the Robot's PC and the Pi, i can list and everything seems to be correctly setup, why u no work ???
--- EDIT | {
"domain": "robotics.stackexchange",
"id": 27192,
"lm_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, master, multiple-machines",
"url": null
} |
You can use the chain rule and product rule when you compute the derivative of two differentiable functions. So you can safely use that rule when $x\neq 0$ and you find the correct derivative. For $x=0$, however, the function is not a product: it is a function defined by cases. When $x\neq 0$ you can restrict your function to $x\neq 0$ so that it becomes a product of differentiable functions. When $x=0$ you cannot. So your last resort is apply the very definition of limit.
Once that you have found the derivative in every point you can observe that the derivative in $x=0$ is not the limit of the derivative for $x\to 0$. In other words: this is (the most famous example of) a differentiable function whose derivative is not continuous. The only possibility for this to happen is when the derivative $f'(x)$ has no limit when $x\to 0$, and this is exactly the case. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692264378963,
"lm_q1q2_score": 0.8468071414643852,
"lm_q2_score": 0.8670357563664174,
"openwebmath_perplexity": 192.7435907962689,
"openwebmath_score": 0.967206597328186,
"tags": null,
"url": "http://math.stackexchange.com/questions/865028/is-it-differentiable"
} |
homework-and-exercises, condensed-matter, superconductivity, anticommutator
define $\xi_{\alpha\beta}\equiv\boldsymbol{\xi}\cdot\boldsymbol{\sigma}=\xi_{0}+\xi_{x}\sigma_{x}+\xi_{y}\sigma_{y}+\xi_{z}\sigma_{z}$
to have the most generic one-body Hamiltonian written in a compact
form. The one body Hamiltonian then reads, in matrix notation
$$
H\sim\left(\begin{array}{cc}
\psi_{\uparrow}^{\dagger} & \psi{}_{\downarrow}^{\dagger}\end{array}\right)\left(\begin{array}{cc}
\xi_{0}+\xi_{z} & \xi_{x}-\mathbf{i}\xi_{y}\\
\xi_{x}+\mathbf{i}\xi_{y} & \xi_{0}-\xi_{z}
\end{array}\right)\left(\begin{array}{c}
\psi_{\uparrow}\\
\psi_{\downarrow}
\end{array}\right)
$$
as can be easily check.
One now wants to add the particle-hole double space (Nambu space).
One uses that (the anti-commutation relation)
$$
\psi_{\alpha}^{\dagger}\xi_{\alpha\beta}\psi_{\beta}=-\xi_{\alpha\beta}\psi_{\beta}\psi{}_{\alpha}^{\dagger}+\delta_{\alpha\beta}\xi_{\alpha\beta}=-\psi_{\beta}\left(\xi_{\alpha\beta}\right)^{T}\psi{}_{\alpha}^{\dagger}+\delta_{\alpha\beta}\xi_{\alpha\beta}
$$ | {
"domain": "physics.stackexchange",
"id": 9488,
"lm_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, condensed-matter, superconductivity, anticommutator",
"url": null
} |
c#, design-patterns, stored-procedure
public StoredProcedureExecuter<TResultSetType> WithCommandTimeoutOverride(int commandTimeoutOverride)
{
_commandTimeoutOverride = commandTimeoutOverride;
return this;
}
public StoredProcedureExecuter<TResultSetType> WithTransaction(SqlTransaction transaction)
{
_transaction = transaction;
return this;
}
#endregion
#region Public Factory Methods | {
"domain": "codereview.stackexchange",
"id": 17370,
"lm_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#, design-patterns, stored-procedure",
"url": null
} |
quantum-mechanics, condensed-matter, quantum-information, quantum-entanglement, topological-order
Title: Topological Order and Entanglement I have a question about entanglement in condensed matter physics. It seems that topological order origins from long range entanglement, but what is long range entanglement? It is the same as long range correlation? I am interested in this issue and I am happy to have any discussion. Long range entanglements are defined through local unitary transformations
which is discussed in
arXiv:1004.3835
Local unitary transformation, long-range quantum entanglement, wave function renormalization, and topological order by Chen, Gu, and Wen.
Basically,
long range entangled states are states which are very different from product states
and cannot be changed to product states through local unitary transformations. | {
"domain": "physics.stackexchange",
"id": 18676,
"lm_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, condensed-matter, quantum-information, quantum-entanglement, topological-order",
"url": null
} |
organic-chemistry, nomenclature
Therefore, the preferred IUPAC name (PIN) of the unmodified carboxylic acid is ‘propanoic acid’. (Note that the retained name ‘propionic acid’ may be used in general nomenclature.)
Aldehydes can be systematically named in various ways. Monoaldehydes derived from alkanes are preferably named substitutively using the suffix ‘al’. In this case, however, this method cannot be used since the carboxylic acid group has priority to be cited as a suffix. Therefore, the aldehyde group has to be expressed by a prefix as follows:
P-66.6.1.3 In the presence of a characteristic group having priority to be cited as a suffix or when present on a side chain, a $\ce{-CHO}$ group is expressed by the preferred prefix ‘oxo’ if located at an end of a carbon chain, or, otherwise, by the preferred prefix ‘formyl’. | {
"domain": "chemistry.stackexchange",
"id": 4800,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature",
"url": null
} |
signal-analysis, digital-communications, fading-channel
The real question here is what would it help the TX to know the channel? Does that improve capacity? As I'm sure you read it does help in the MIMO case as this allows the TX to send data in the "proper directions", i.e., excite the strong eigenmodes of the channel and thus get more power across. There are other cases where it helps, e.g., when dealing with multiple users, interference, and other things. | {
"domain": "dsp.stackexchange",
"id": 8324,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, digital-communications, fading-channel",
"url": null
} |
complexity-theory, computability, recursion, order-theory
More generally, similar arguments should show that if $k(n) = o(n)$ then the recurrence $$T(n) = T(k(n)) + T(n-k(n)) + \Theta(n)$$ should have the solution $$T(n) = \Theta\left(\int \frac{n\,dn}{k(n)}\right). $$ | {
"domain": "cs.stackexchange",
"id": 17130,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, computability, recursion, order-theory",
"url": null
} |
Vertical Velocity final (with displacem…. high fence located 320 ft from home plate. The horizontal and vertical components of initial velocity are determined from: v xo = v o ·cos θ v yo = v o ·sin θ Incidentally, the above analysis implies that air resistance only starts to have an appreciable effect on the trajectory after the projectile has been in the air a time of order . Therefore in a projectile motion the Horizontal Range is given by (R): Maximum Height: It is the highest point of the trajectory (point A). 66 m/s. (c) The velocity in the vertical direction begins to decrease as the object rises; at its highest point, the vertical velocity is zero. therefore y=xtan#-(g/2u^2cos^2#)x^2 is the equation of the projectile paths that is called trajectory of the projectile. (ii) a - bx = 0 → x = a/b. 8. 8 m t AB = 3. • For vertical projectile. Trajectory of a projectile is a parabolic trajectory. The two velocity components are vxand vy, where V = vx +vy. So, vertical height gained by | {
"domain": "ferall-racks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474904166247,
"lm_q1q2_score": 0.8179052450976197,
"lm_q2_score": 0.8267118004748677,
"openwebmath_perplexity": 455.15972771554755,
"openwebmath_score": 0.7767765522003174,
"tags": null,
"url": "http://www.ferall-racks.com/syzysci/equation-of-trajectory-for-horizontal-projectile.html"
} |
physical-chemistry, kinetics
Say reactant $\ce{C}$ is in excess. Assume that $\ce{[X]}$ is constant. Then the law of mass action $v = k_2\ce{[X][C]}$ would reduce to some $v = k'\ce{[C]} \overset{\mathrm{excess}}{\approx} k\in\Bbb{R}$. In other words, production of $\ce{D}$ could continue at a constant rate even after $\ce{A}$
has run out.
The document concludes that $\ce{[X]}$ cannot possibly be constant in steady-state conditions.
How I would resolve the apparent contradiction
I do not see a way around $\ce{[X]}$ being constant. Indeed, for any reasonable function[a] $\ce{[X]}:t'\to \Bbb{R^{0+}}$ equation $(2)$ implies
$$\int_0^t \frac{\d\ce{[X]}(t')}{\d (t')}\d(t')= \ce{[X]}(t) = r \in \Bbb{R^{0+}}\tag3$$
where $t'$ was simply a dummy variable. | {
"domain": "chemistry.stackexchange",
"id": 9228,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, kinetics",
"url": null
} |
ho.history-overview
Title: Lambda: The Ultimate Imperative - who is Jensen? One of the notes in the classical paper LAMBDA: The Ultimate Imperative says:
{Jensensdevice}
The technique of repeatedly modifying a variable passed call-by-name in order to produce side effects on another call-by-name parameter is commonly known as Jensen's device, particularly in the case where call-by-name parameters are j and a[j]. We cannot find any reference to Jensen or who he was, and offer a reward for any information leading to the identification, arrest, and conviction of said Jensen.
Today, after almost 40 years since the memo was published, do we know the identity of Jensen? I'm not hoping for the reward, just curious. Jensen's device was developed by Jørn Jensen, who worked on one of the earliest ALGOL 60 compilers (this answer is based on comment by Kristoffer Arnsfelt Hansen). | {
"domain": "cstheory.stackexchange",
"id": 1870,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ho.history-overview",
"url": null
} |
gauge-theory, field-theory, vector-fields, gauge-invariance, sigma-models
where we can take $\partial_j \Lambda^B = 0$ because $\Lambda^B$ (as a Lie-algebra valued parameter) is not a function of $\phi^i$'s.
In the book by Cecotti, the transformation law for $K_A^i$ is not given. However, in a book by Tomás Ortín entitled "Gravity and Strings" (for an excerpt, click here), the transformation law for $K_A^i$ is (see Appendix J, equation J.8 if you wish to refer to the book)
$$\delta K_A{}^i = \Lambda^B K_B{}^j \partial_j K_A{}^i$$
which is just the first term (the ``transport term'') of what I wrote above.
My first question is: why doesn't the transformation law for $K_A{}^i$ contain a derivative of the transformation parameter, given that the transformation parameter is local (in target space) since $K_A{}^i$ depends in general on the fields $\phi^1, \ldots, \phi^N$?
My second question is is related to the actual derivation of equation (#): I did the naive thing of writing
$$\delta D_\mu\phi^i = \delta(\partial_\mu \phi^i - A_\mu^A K_A{}^i)$$ | {
"domain": "physics.stackexchange",
"id": 43583,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gauge-theory, field-theory, vector-fields, gauge-invariance, sigma-models",
"url": null
} |
spectroscopy, chromatography
Key problems
(i) Weight. It costs an enormous amount (in millions) of money per kg to send anything in space. Routine HPLCs are very heavy. We need two heavy duty persons to lift the stack of standard equipment.
(ii) Latest HPLCs can now be reduced to the size of a small brief case. Check capillary chromatography. Also check HPLC on a chip. It is the size of a hand palm.
(iii) Elecric power consumption: Think how much power is consumed by the motors in the pump (huge) and other analytical equipment including the mass spec. You don't have lot electrical power in space. This the biggest problem besides weight issues.
(iv) Think of excessive radiation. Can the plastics and equipment tolerate huge amount of radiation from the Sun and elsewhere.
(v) Temperatures: Think of temperature extremes with liquid as solvents. | {
"domain": "chemistry.stackexchange",
"id": 12222,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spectroscopy, chromatography",
"url": null
} |
# Secant Method to find root of any function
#### algorithm mathematical algorithm
Reading time: 35 minutes | Coding time: 10 minutes
Secant Method is a numerical method for solving an equation in one unknown. It is quite similar to Regula falsi method algorithm. One drawback of Newton’s method is that it is necessary to evaluate f´(x) at various points, which may not be practical for some choices of f(x). The secant method avoids this issue by using a finite difference to approximate the derivative. As a result, root of f(x) is approximated by a secant line through two points on the graph of f(x), rather than a tangent line through one point on the graph.
Secant Method Animation. Source.
## Theory
As stated above, in Secant method root of f(x) is approximated by a secant line through two points on the graph of f(x), rather than a tangent line through one point on the graph. | {
"domain": "opengenus.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474891602738,
"lm_q1q2_score": 0.840916846615471,
"lm_q2_score": 0.8499711737573762,
"openwebmath_perplexity": 1536.466678691866,
"openwebmath_score": 0.6443819403648376,
"tags": null,
"url": "https://iq.opengenus.org/secant-method/"
} |
quantum-field-theory
to make the divergence of the vertex renormalization logarithmic, you need the vertex renormalization integral to be
$$ \int {1\over |q|^{2\alpha}} $$
So that $\alpha=1.5$ is the log-diverent choice. This choice produces a log-running renormalizable theory in 3d. The renormalization running has the same exact form to one loop order as the usual $\phi^4$ theory, so it should have a Landau pole (otherwise, it could be asymptotically safe, but it is similar enough to $\phi^4_4$ that no way).
The lattice version of this theory provides a non-perturbative statistical model to define the long-distance theory, and it is an Ising model with a nonlocal coupling $J(x-y)$ which falls off as the appropriate powerlaw.
The scalar field correlations from a nonlocal J coupling are determined from the Fourier transform of J, so that to get the power-law ${1\over |q|^{1.5}}$ you want the correlation function:
$$ G(x-y) \approx {1\over|x-y|^{1.5}} $$ | {
"domain": "physics.stackexchange",
"id": 2876,
"lm_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",
"url": null
} |
navigation
Original comments
Comment by Charles on 2011-05-03:
It seems that AMCL didn't work, but the /map frame to /odom frame transformation was OK.
Comment by Charles on 2011-05-03:
I have set the initialpose. I can use rviz to set the initialpose and send a goal to the robot. The robot move to the goal, when i give it a goal. But the laser scan line don't try to match the walls and the corners automatically.
Comment by Eric Perko on 2011-05-03:
What does it actually do when you give it a goal? Does it attempt to move at all? Does it just sit? Does move_base throw any errors to the terminal window or rxconsole? Did you write your own drivers for the physical robot or are you using existing drivers such as p2os?
Comment by eitan on 2011-05-03:
Have you set the initialpose for your robot manually for AMCL? | {
"domain": "robotics.stackexchange",
"id": 5497,
"lm_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",
"url": null
} |
condensed-matter, hilbert-space, many-body, coherent-states
Another way of rewriting the whole thing, making explicit that each mode is independent because one should learn about the single-mode case before the multimode version, is
$$I=\bigotimes_x\int \frac{d\Re{\phi_x} d\Im{\phi_x}}{\pi}e^{-|\phi_x|^2}e^{\phi_x \hat{a}_a^\dagger}|\mathrm{vac}\rangle\langle \mathrm{vac}|e^{\phi_x \hat{a}_a}=\bigotimes_x\int \frac{d\Re{\phi_x} d\Im{\phi_x}}{\pi}e^{-|\phi_x|^2}|\phi_x\rangle\langle \phi_x|,$$ where the symbol $\bigotimes_x$ implies a tensor product over multiple modes (the single-mode case just removes that symbol and selects one $x$). | {
"domain": "physics.stackexchange",
"id": 98333,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, hilbert-space, many-body, coherent-states",
"url": null
} |
To commence a game, a player selects 6 tiles from the set of 56.
i. In how many ways can the player select 6 tiles?
ii. In how many ways can the player select 6 tiles with no blue on them?
iii. In how many ways can the player select 6 tiles, each with a blue line?
This is a game, please explain to me how to do it?
i. 56 ways to chose the first tile * 55 (since we already chose 1) ways to choose the 2nd. etc. to get:
56*55*54*53*52*51 = answer, or 56P6 if you know nPr notation and meaning.
ii. There are only 14 with no blue, therefore same method as i. except now we only have a total of 14 to choose from. Do you understand how to do this one?
iii. Same method as i. and ii. except the total now is 56 - 14 = 42. 42 tiles have a blue line, since 14 out of 56 don't. So no our total is 42, so how many ways to choose 6 from 42? Follow the same method I outlined in i. except in i. the total we started with was 56. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936078216783,
"lm_q1q2_score": 0.8242964477110987,
"lm_q2_score": 0.8376199592797929,
"openwebmath_perplexity": 587.4670240137688,
"openwebmath_score": 0.5003268718719482,
"tags": null,
"url": "http://mathhelpforum.com/discrete-math/107856-counting-problems.html"
} |
A disadvantage of separation is that it requires an extra ram memory to store the intermediate image, which can be a concern in certain applications.
• Thank you so much for your answers. Quick question, is your filter same size of the image? h[n,m] and image is x[n,m]? – OmegaD Aug 26 '18 at 17:40
• No it's not assumed to be so. You can take any size you want, assuming you follow the proper steps in performing the algorithm. – Fat32 Aug 26 '18 at 18:21 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676496254957,
"lm_q1q2_score": 0.8142439521003844,
"lm_q2_score": 0.8311430436757312,
"openwebmath_perplexity": 464.225550939214,
"openwebmath_score": 0.7734864950180054,
"tags": null,
"url": "https://dsp.stackexchange.com/questions/51527/what-are-the-advantages-and-disadvantages-separability-of-gaussian-2d-filter"
} |
java, performance, pdf
+" \n"
+" After filling a form, the form fields remain interactive unless flatten is used.\n"
+" flatten merges the form fields with the PDF pages. You can also use flatten alone, as shown:\n"
+" \n"
+" ./pdf_form.py form.pdf fill_form data.fdf output out.pdf flatten\n"
+" \n"
+" or:\n"
+" \n"
+" ./pdf_form.py form.filled.pdf output out.pdf flatten\n"
+"\n"
+" dump_data\n"
+" Reads a single, input PDF file and reports various statistics, metadata, bookmarks\n"
+" (a/k/a outlines), and page labels to the given output filename or (if no output is given)\n"
+" to stdout. Does not create a new PDF.\n"
+"\n"
+" dump_data_fields\n"
+" Reads a single, input PDF file and reports form field statistics to the given output filename\n" | {
"domain": "codereview.stackexchange",
"id": 21353,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, pdf",
"url": null
} |
java, lambda, column, inner-class
public Column(Function<String, Function<String, UnaryOperator<String>>> align){
this.align = align;
}
public Columns.Column addWord(String word){
maxLength = Math.max(maxLength, word.length());
words.add(word);
return this;
}
public String getCell(int row){
return padCell( words.get(row), maxLength );
}
private String padCell(String word, int newLength){
int padCount = newLength - word.length();
int leftCount = padCount / 2;
int rightCount = padCount - leftCount;
String left = pad.repeat(leftCount);
String right = pad.repeat(rightCount);
return align.apply(left).apply(word).apply(right);
}
public int size(){
return words.size();
}
public String toString(){
return words.toString();
} | {
"domain": "codereview.stackexchange",
"id": 44551,
"lm_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, lambda, column, inner-class",
"url": null
} |
ros, camera1394
Originally posted by joq with karma: 25443 on 2011-11-08
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by Kai Bublitz on 2011-11-08:
I can not change the iso_speed, 400 seems to be correct, however I can use different video modes with smaller resolution and it works, thanks. | {
"domain": "robotics.stackexchange",
"id": 7224,
"lm_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, camera1394",
"url": null
} |
java, datetime, reinventing-the-wheel
A Month has more meaning when it is a YearMonth:
public class YearMonth {
private final Month month;
private final boolean isLeapYear;
private final int yearValue;
public YearMonth(final int yearValue, final Month month) {
this.yearValue = yearValue;
this.month = month;
if (yearValue % 4 == 0) {
isLeapYear = true;
} else {
isLeapYear = false;
}
}
public final int numberOfDays() {
if (isLeapYear) {
return month.getNumberOfDaysInLeapYear();
}
return month.getNumberOfDaysInNonLeapYear();
}
public final int dayOfYear(final int dayOfMonth) {
int dayOfYear = 0;
int monthIndex = month.getMonthIndex() - 1; | {
"domain": "codereview.stackexchange",
"id": 22402,
"lm_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, datetime, reinventing-the-wheel",
"url": null
} |
python, python-3.x, numpy
img2 = rhombize(img1, h_angle=0, v_angle=-15)
img2.show()
if __name__ == '__main__':
test()
Strict equivalence
I still don't pretend to understand the geometric interpretation of what you're doing, but mathematically it's pretty easy to make an affine transformation to represent it. Note that due to a quirk in Pillow, the final affine transformation needs to be an inverse of the size transform. You still need to clip for the negative cases.
import numpy as np
from numpy.linalg import inv
from PIL import Image
def rhombize(
img: Image,
x_angle: float = 0,
y_angle: float = 0,
):
w0, h0 = img.size
angles = np.radians((x_angle, y_angle))
tanx, tany = np.tan(angles)
cosx, cosy = np.cos(angles) | {
"domain": "codereview.stackexchange",
"id": 43311,
"lm_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, numpy",
"url": null
} |
algorithms, graphs, scheduling
Perform the topological sort of the dependency graph to obtain the sequence $T$.
Visit each vertex according to their order in $T$:
Let $t_i$ be the current vertex. If $f[t_i] > F$, then $F= f[t_i]$.
If $(t_i,t_j)$ is an edge (meaning $t_j$ is dependent to $t_i$) and $f[t_j] \lt f[t_i] + d[t_j]$ then update $f[t_j] = f[t_i] + d[t_j]$.
Finally, return $F$.
The idea for step 2.2 is to compute the finishing time of a task with respect to the finishing time of its dependency. When a task has multiple dependencies, its finish time will be based on the time of the dependency that will finish late.
Note:
I think that this solution is the iterative, bottom-up version of John L.'s solution. | {
"domain": "cs.stackexchange",
"id": 20057,
"lm_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, graphs, scheduling",
"url": null
} |
python, performance, gui, pyqt
ncalls tottime percall cumtime percall filename:lineno(function)
1 4.468 4.468 10.158 10.158 {built-in method exec_}
1731 3.882 0.002 3.882 0.002 {method 'reduce' of 'numpy.ufunc' objects}
1724 0.548 0.000 4.451 0.003 /usr/lib64/python3.3/site-packages/numpy/core/_methods.py:53(_mean)
865 0.425 0.000 0.540 0.001 ./ajsutil.py:39(bytescale)
4353 0.357 0.000 0.370 0.000 {built-in method array}
287 0.193 0.001 5.678 0.020 qt.py:292(updateView)
288 0.064 0.000 0.064 0.000 {built-in method showMessage}
866 0.058 0.000 0.058 0.000 {method 'astype' of 'numpy.ndarray' objects}
26/23 0.053 0.002 0.057 0.002 {built-in method load_dynamic}
862 0.045 0.000 4.810 0.006 ./ajsutil.py:53(downsamp)
1 0.035 0.035 0.035 0.035 {built-in method create} | {
"domain": "codereview.stackexchange",
"id": 15064,
"lm_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, gui, pyqt",
"url": null
} |
object in order to perform work on, or to heat, the object. 2. Define Impulse. Momentum (Linear momentum) for moving body is defined as the product of mass and velocity. Advertisement Remove all ads. Define the term momentum, and state its SI unit. 2 ; View Full Answer It is defined as product of mass and velocity of any object. 8. State and define its SI unit? Want to see the step-by-step answer? 3/Define instantaneous angular acceleration and write its SI Unit.? NCERT P Bahadur IIT-JEE Previous Year Narendra Awasthi MS Chauhan. Textbook ... Concept Notes & Videos 286. (CBSE 2010, 2011, 2013) Answer: A force is said to be unit force if it produces unit acceleration in a body of unit mass. State whether the moment of force is a scalar or vector quantity? unit. Define the term impulse, and state its SI unit. Its SI units are: P=mv =kg*m/s. Check out a sample Q&A here. what is momentum what is its si unit - Physics - TopperLearning.com | giemys. Momentum as a Vector Quantity. Question By | {
"domain": "lomco.ca",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9372107896491796,
"lm_q1q2_score": 0.8223807143961331,
"lm_q2_score": 0.8774767890838836,
"openwebmath_perplexity": 1568.941211268454,
"openwebmath_score": 0.7047728300094604,
"tags": null,
"url": "http://lomco.ca/xugqy/95bc64-define-momentum-and-its-si-unit"
} |
java, interview-questions, complexity, simulation
private void printMap(Map<Integer, List<String>> map) {
Set<Integer> set = map.keySet();
Iterator<Integer> iter = set.iterator();
while (iter.hasNext()) {
Integer key = iter.next();
List<String> value = map.get(key);
System.out.println(key + " " + value);
}
System.out.println();
}
private Map<Integer, List<String>> createMap(
int[] time, String[] direction) {
Map<Integer, List<String>> map = new TreeMap<>();
for (int i = 0; i < time.length; i++) {
Integer key = time[i];
List<String> value = map.get(key);
if (value == null) {
value = new ArrayList<>();
}
value.add(direction[i]);
map.put(key, value);
}
return map;
} | {
"domain": "codereview.stackexchange",
"id": 43589,
"lm_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, interview-questions, complexity, simulation",
"url": null
} |
evolution, speciation
Speciation, the process by which two species form from one,
involves the development of reproductive isolation of two divergent
lineages. Here, we report the establishment and persistence
of a reproductively isolated population of Darwin’s finches on the
small Gala´pagos Island of Daphne Major in the secondary contact
phase of speciation. In 1981, an immigrant medium ground finch
(Geospiza fortis) arrived on the island. It was unusually large,
especially in beak width, sang an unusual song, and carried some
Geospiza scandens alleles. We followed the fate of this individual
and its descendants for seven generations over a period of 28
years. In the fourth generation, after a severe drought, the lineage
was reduced to a single brother and sister, who bred with each
other. From then on this lineage, inheriting unusual song, morphology,
and a uniquely homozygous marker allele, was reproductively
isolated, because their own descendants bred with each | {
"domain": "biology.stackexchange",
"id": 8539,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolution, speciation",
"url": null
} |
java, array
/**
* Uses a 1-D array where each cell stores the number of elements that needs
* to be stored there.
*/
public class SimpleTest {
/**
* The structure used to store the data.
*/
private int[] array;
/**
* The amount of cells that are excluded from an array because VMs reserve
* some header words in an array which reduces the <em>true</em> maximum
* value. It could be at least 8 but 16 is used for extra precaution.
*/
private static byte offset = 16;
/**
* The number of cells in the array.
*/
private long size;
/**
* The number of 1-D arrays required.
*/
private int segments;
/**
* The maximum size of each 1-D array.
*/
private static int maxSegmentLength = Integer.MAX_VALUE - offset;
/**
* The size of last segment which is between {@code 1} and {@code
* maxSegmentLength} (both inclusive).
*/
private int ancillarySegmentLength; | {
"domain": "codereview.stackexchange",
"id": 43158,
"lm_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, array",
"url": null
} |
newtonian-mechanics, energy, work
Title: What information does kinetic energy and work give us about a body? When I studied momentum I learned that momentum says about a body how hard is it to stop it. In addition, I learned that impulse tells us in some way how much time would I need to stop the object.
If you can understand what I mean by the paragraph above can you answer my question in the same way? | {
"domain": "physics.stackexchange",
"id": 28321,
"lm_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, energy, work",
"url": null
} |
c, unit-testing, utf-8
Title: UTF-8 encoding/decoding I have two functions, a collection of possible error codes, and a unit-testing framework.
The parsing of a character into its unary prefix and payload is handled by a few named functions and macros nlz, nlo, lsb and msb for counting leading zeros or ones and generating masks of ones on the right or left. The nlz function could be re-written for speed or (maybe) for clarity; the current version is optimized for size to help abstract it away from the code that uses it.
I want to make these conversion functions really nice so I can use them as the basis of a language interpreter that's Unicode-capable.
It isn't factored into a library/header yet, but that's the obvious next step (and would complicate the presentation, I think).
minunit.h:
/* file: minunit.h
cf.http://www.jera.com/techinfo/jtns/jtn002.html */
#define mu_assert(message, test) do { if (!(test)) return message; } while (0) | {
"domain": "codereview.stackexchange",
"id": 15028,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, unit-testing, utf-8",
"url": null
} |
optics
Title: What causes this fluorescence-like effect? I have a New Year's garland that emits blue light:
When I turn it on and turn off all other lights in the room, almost all objects in the room would be colored in different shades of blue - as I would expect. However, some objects would have very bright, fluorescent-like colors, like this Rubik's cube:
Here is the same Rubik's cube in normal light: | {
"domain": "physics.stackexchange",
"id": 98485,
"lm_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",
"url": null
} |
$f(x) = \sqrt{x + c} - x = 0$ (2)
... that is, in the case we consider the positive value of the 'square root' ...
$x_{+} = \frac{1 + \sqrt{1+4c}}{2}$ (3)
From (3) we deduce that $x_{+}$ exists only if is $c > -\frac{1}{4}$ and from (2) that in that case any $x_{0} > -c$ will produce a sequence converging at $x_{+}$. The function $f(x)$ is represented in the figure for $c=2\rightarrow x_{+}=2$...
The point $x_{+}$ is an 'actratting fixed point' and, because the 'slope' of $f(x)$ is negative and in absolute value less than 1 [see red line...] for any $x_{0}> -2$ the generated sequence will converge to $x_{+}$ without oscillations...
Kind regards
$\chi$ $\sigma$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363750229257,
"lm_q1q2_score": 0.8216050307193828,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 417.18191889217263,
"openwebmath_score": 0.9163365960121155,
"tags": null,
"url": "http://mathhelpforum.com/differential-geometry/133031-convergence-sequence.html"
} |
pressure, gas, volume
Title: How is a helium tank volume measured? I'm comparing different helium tank offers and I found an interesting one which seems to be what I want, but I'm unsure regarding the volume.
It states:
The content of gas of this tank is greater than the content of gas of an ordinary tank because the pressure is 300 bar: 20l / 5.2 m3 | {
"domain": "physics.stackexchange",
"id": 54993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pressure, gas, volume",
"url": null
} |
energy, power, earthquake
Title: Is the brick-concrete connection the 'weakest link' in brick made buildings? When an earthquake strikes,do buildings made of bricks and concrete break mostly on concrete-brick connection spots?If Yes does the brick on the picture prevents this from occuring? Brick structures fail in tension at the brick-to-mortar interface. The older the brick building is, the weaker becomes that interface, and 100 year old brick buildings are mostly held together by gravity. Earthquakes cause old brick buildings to easily collapse into low mounds of loose bricks, crushing the contents of the building.
The tongue-and-groove feature you propose makes the strength of the joint dependent on the tensile strength of the brick, which will fail readily when subjected to a suddenly-applied shock load. | {
"domain": "physics.stackexchange",
"id": 74536,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, power, earthquake",
"url": null
} |
decade) and linear vertical axis on letter-sized paper Log-log paper with logarithmic horizontal axis (one decade) and logarithmic vertical axis (one decade) with equal scales on letter-sized paper Log-log paper with logarithmic horizontal axis (one decade). The drawing functionality is pretty basic — lines, circles, boxes and the like — but perfect for most simple diagrams. 3 We find the shaded area in the first graph of figure 10. In general, we have 3 types of symmetr y for polar graphs. The prefix arc used for inverse circular trigonometric functions is the abbreviation for arcus. It is capable of graphing standard and parametric functions. 10 manual: “5. Transformations of exponential graphs behave similarly to those of other functions. Super einfach zu bedienen!. Photon is a fully functional graphing calculator capable of numeric calculations as well as graphing functions, including parametric and polar graphs. 1 Predict the shape of the graph of r = 3sin(3 ) then verify your | {
"domain": "aoly.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9688561721629776,
"lm_q1q2_score": 0.8234998196964638,
"lm_q2_score": 0.8499711756575749,
"openwebmath_perplexity": 1323.852582847336,
"openwebmath_score": 0.6930344104766846,
"tags": null,
"url": "http://mnmv.aoly.pw/polar-graphs-latex.html"
} |
ros-kinetic, rospack
What am I doing wrong?
I am using Ubuntu 16.04
Originally posted by lr_k123 on ROS Answers with karma: 3 on 2019-05-06
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 32973,
"lm_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-kinetic, rospack",
"url": null
} |
nomenclature, gene
Did you suggest to name genes based on their sequence? Would be quite painful! One cannot name a gene based on its sequence as the sequence is way too long. The median gene length in humans is 24,000 base pairs (Fuchs G et al. 2014). You just need to refer to a database to match a sequence to a gene name (see BLAST for example).
How could we improve this system?
Do you have any suggestion on how we should name genes? Should they be named in relation to the phenotype they affect or to the biological pathway that are involved in or maybe something else? The issue is that we often annotate and name a gene before knowing much about its effect.
Note that some genes have several names which is indeed confusing. Would be good to solve this a little bit. | {
"domain": "biology.stackexchange",
"id": 5011,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nomenclature, gene",
"url": null
} |
and the mechanism to get the inverse from the final resultant. Inverse of a. Inverting 1500x1500 matrix depends on too much to give a general answer. In Linear Algebra, an identity matrix (or unit matrix) of size n is an n × n square matrix with 1 's along the main diagonal and 0 's elsewhere. 3 With List and without transpose. I1 = [1], I2 = [1 0 0 1], I3 = [1 0. If the algorithm provides an inverse for the original matrix, it is always possible to check your answer. More specifically, we unroll a robust version of the inverse compositional algorithm and replace multiple. Eigenvalues and eigenvectors of a real square matrix by Rutishauser's method and inverse iteration method Find Eigenvalues and Eigenvectors of a symmetric real matrix using Householder reduction and QL method Module used by program below Eigenvalues of a non symmetric real matrix by HQR algorithm. The multiplicative inverse of 11 modulo 26 is 19. For finding the matrix inverse in general, you can use Gauss-Jordan | {
"domain": "adelebianco.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363729567544,
"lm_q1q2_score": 0.8172809262460258,
"lm_q2_score": 0.8289388125473628,
"openwebmath_perplexity": 447.32852840730374,
"openwebmath_score": 0.7671352624893188,
"tags": null,
"url": "http://adelebianco.it/jqxe/inverse-matrix-algorithm.html"
} |
structural-engineering, civil-engineering
Title: Why are truss bridges the way they are?
Just by taking a train ride across my home city I can see truss bridges like the one in above picture everywhere. There are numerous variations, but the most common design seems to be this. But why are they built specifically this way?
I can intuitively kind-of see why such a design probably is strong, but is there any kind of in-depth reason? I would be interested to know the answer as much from the physics side of things as possible. Googling didn't help much; I could find information on the different variations and many examples, but none really covered what is it about this design specifically that makes it so popular. That looks like a Pratt truss. | {
"domain": "engineering.stackexchange",
"id": 5149,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "structural-engineering, civil-engineering",
"url": null
} |
beginner, haskell, memory-management, server, web-services
-- Start webserver.
scotty port $ do
let readTVarIOAtom = readTVar >>> atomically >>> liftIO
let getState = currentState |> readTVarIOAtom
let getMessages = messages |> readTVarIOAtom
let getHistory s = extractHistory s <$> readTVarIOAtom allEntries
get "/" $
redirect "/index.html"
get "/laststatemodtimeutc" $
getState >>= (lastModTimeUTC >>> show >>> pack >>> text)
get "/currenttimeutc" $
liftIO getNowUTC >>= (show >>> pack >>> text)
get "/state" $
getState >>= (toJSON >>> json)
get "/history" $ do
getHistory "" >>= (pack >>> text)
get "/history/:site" $ do
s <- param "site"
getHistory (unpack s) >>= (pack >>> text)
get "/messages" $
getMessages >>= (pack >>> text) | {
"domain": "codereview.stackexchange",
"id": 14562,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, haskell, memory-management, server, web-services",
"url": null
} |
John L. Kelley: General Topology provides a list of several different styles: $\tuple {f, x}$, $\tuple {x, f}$, $f x$, $x f$ and $\cdot f x$, and discusses the advantages and disadvantages of each.
The notation $\cdot f x$ is attributed to Anthony Perry Morse, and can be used to express complicated expressions without the need of parenthesis to avoid ambiguity. However, it appears not to have caught on.
Warning
The notation:
Let $\map f x$ be a mapping (or function) ...
is an abuse of notation.
If $f: S \to T$ is a mapping, then $\map f x \in T$ for all $x \in S$.
Thus $\map f x$ is a mapping if and only if $\Img f$ is a set of mappings.
The point is that, as used here, $\map f x$ is not a mapping, but it is the image of $x$ under $f$.
Hence it is preferable not to talk about:
the function $\cos x$
the function $\cos$
or:
the function $x \mapsto \cos x$
although for the latter it would be better to also specify the domain and codomain.
Also defined as | {
"domain": "proofwiki.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211582993982,
"lm_q1q2_score": 0.8058961549186916,
"lm_q2_score": 0.8267118004748678,
"openwebmath_perplexity": 420.4729024561619,
"openwebmath_score": 0.9532347917556763,
"tags": null,
"url": "https://proofwiki.org/wiki/Definition:Mapping/Definition_1"
} |
graph-theory, graph-colouring, perfect-graph, cograph
Question 2:
If the proposition in question 1 is false. Is it easy to determine $\chi(G+v)$, where $G$ is a cograph.
Update: Jim showed than cograph+v is a subset of the class of perfect graph. Also he actually proved another more general theorem.
For any perfect graph $G$, $\chi(G)=\chi(G-v)+1$ if and only if $\chi(\langle N(v)\rangle) = \chi(G-v)$. I think Artem is on the right track with perfection:
As cographs are $P_4$-free, cograph+v is $C_5$-free (and $C_{2k+1}$-free and $\overline{C}_{2k+1}$-free, $k>1$) and so they are perfect graphs.
This means the only thing that is pushing the chromatic number up is clique size. So if $\chi(G+v) = \chi(G) + 1$, it is because v has increased the maximum clique size, which means that $N(v)$ must have had a clique of size $\chi(G)$ and so $\langle N(v)\rangle_G$ had the same chromatic number as $G$.
So it seems the statement in question 1 is true. | {
"domain": "cstheory.stackexchange",
"id": 2532,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graph-theory, graph-colouring, perfect-graph, cograph",
"url": null
} |
automata, finite-automata
We can get from $A$ to $B$ directly, on input $1$, or we can go from $A$ to $B$ through $C$ on input $01$. In either case, once we're in state $B$, we can get back to there on input $01$. In other words, the input strings that take you from the start to state $B$ are
$$
1, 101, 10101, 1010101, \dotsc \qquad\text{or}\qquad 01, 0101, 011010, 01101010, \dotsc
$$
Reversing these strings, we have
$$
1, 101, 10101, 1010101, \dotsc \qquad\text{or}\qquad 10, 1010, 101010, 10101010, \dotsc
$$
For the odd-length strings, the values in this Fibonacci base representation will be
$$
\begin{array}{lccccl}
\text{value} & F_1 & F_1 + F_3 & F_1+F_3+F_5 & F_1+F_3+F_5+F_7 & \dotsc\\ \hline
\text{length} & 1 & 3 & 5 & 7 &
\end{array}
$$
and we can get a similar result for the even-length input strings, only in this case we'll have values like $F_2+F_4+F_6$ for the length 6 input string. In simple terms, the value for length $k$ inputs, $v(k)$, will be
$$ | {
"domain": "cs.stackexchange",
"id": 3380,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "automata, finite-automata",
"url": null
} |
space-complexity, integers, python
what complexity is it then?
Is saying constant space complexity for these algorithms wrong then? It depends on the model of computation. In the transdichotomous model, which is the standard model in the analysis of algorithms, we assume that the word size is $w=O(\log n)$ bits, where $n$ is the size of input in bits. In this assumption, the sum of the input can be represented with 1 word, so the space complexity is $O(1)$ words. Measured in bits, the space complexity is $O(\log N + \log M)$, where $N$ is the number of integers in input and $M$ is maximum value in input. However note that normally we don't measure space complexity in bits: if we did, then the space complexity of most linear time algorithms, like DFS and BFS would have an extra $O(\log n)$ factor. | {
"domain": "cs.stackexchange",
"id": 14950,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "space-complexity, integers, python",
"url": null
} |
A|b looks like: $\left[\begin{matrix}1&0&0&-79&|9\\0&1&0&72&|\neg9\\0&0&1&\neg14&|2\end{matrix}\right]$ And, you can simply read the solutions to x-particular off of b. Finally, setting the free variable, z, to 1, the N(A) is also easily discerned from R. z = 1, y = 14, x=-72, w=79. So the full solution would look something like this in vector form: $\left[\begin{matrix}0\\2\\-9\\9\end{matrix}\right] + c\left[\begin{matrix}79\\-72\\14\\1\end{matrix}\right]$ | {
"domain": "openstudy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.962673109443157,
"lm_q1q2_score": 0.8104029134486654,
"lm_q2_score": 0.8418256472515683,
"openwebmath_perplexity": 570.5544015385217,
"openwebmath_score": 0.7604113221168518,
"tags": null,
"url": "http://openstudy.com/updates/50198148e4b02742c0b12c2b"
} |
algorithms, strings, enumeration
Build one list L1 of dictionary words where each word is mapped to a two-letter key, by extracting the first and seventh letter of the word.
Build a second list L2 of dictionary words where each word is mapped to a two-letter key, by extracting the second and fourth letter of the word; with the additional restriction that you only include words where the 2nd and 6th letter are the same, and where the 4th and 7th letter are the same.
Now compute the "join" of L1 and L2, i.e., where you look for all pairs of a word from L1 and a word from L2 that have the same key. This can be done by any of the standard join algorithm, e.g., a hash join or a sort-merge join. | {
"domain": "cs.stackexchange",
"id": 9260,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, strings, enumeration",
"url": null
} |
For example: 1+2 = 2+1 and 2 x 3 = 3 x 2. Math Glossary: Mathematics Terms and Definitions, A Kindergarten Lesson Plan for Teaching Addition and Subtraction, IEP Math Goals for Operations in the Primary Grades, Definition and Usage of Union in Mathematics, Parentheses, Braces, and Brackets in Math. Essentially, the order does not matter when adding or multiplying. Yes. As per commutative property of addition, 827 + 389 = 389 + 827. Similarly, we can rearrange the addends and write: Example 4: Ben bought 3 packets of 6 pens each. As we already discussed in the introduction, as per the commutative property or commutative law, when two numbers are added or multiplied together, then a change in their positions does not change the result. Neither of these properties are applicable to division. Take, for example, the arithmetic problem (6 3) 2 = 3 2 = 1; if we change the grouping of the parentheses, we have 6 (3 2) = 6 1 = 5, which changes the final result of the equation. Whereas | {
"domain": "poliklinika-galaxy.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877033706601,
"lm_q1q2_score": 0.8585953231208028,
"lm_q2_score": 0.8740772384450967,
"openwebmath_perplexity": 543.4621189292722,
"openwebmath_score": 0.47175082564353943,
"tags": null,
"url": "http://poliklinika-galaxy.com/food709f/retaliation1ad5/12018124b7576f9592e0a80d330"
} |
general-relativity, gravity, reference-frames, acceleration, equivalence-principle
Title: Gravitational acceleration in GR What is the meaning of gravitational acceleration $g$ in the General Theory of Relativity, given that objects in free fall experience weightlessness?
Can gravitational acceleration be thought as a measure of how much the spacetime is curved? g is the acceleration with which objects move through space-time, from the point of view of an inertial reference frame. Gravity is just the curvature of space-time created from any mass (according to GR it's not a "real force", but a fictitious force).
Sure, from the reference frame of the object in free-fall, it's not accelerating. From the point of view from an inertial reference frame, it is accelerating through space-time due to how gravity curves space-time in "valleys".
Here's a link to a good question for more on this:
Does GR imply a fundamental difference between gravitational and non-gravitational acceleration? | {
"domain": "physics.stackexchange",
"id": 49717,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity, reference-frames, acceleration, equivalence-principle",
"url": null
} |
## (May 2016, 5)
Let $$f_n(x) = n^\beta x(1-x^2)^n$$, $$x \in [0,1]$$, $$n \in \mathbb{N}$$.
• Prove that $$\{f_n\}_{n=1}^\infty$$ converges pointwise on $$[0,1]$$ for every $$\beta \in \mathbb{R}$$.
• Show that the convergence in part (a) is uniform for all $$\beta < \frac{1}{2}$$, but not uniform for any $$\beta \geq \frac{1}{2}$$.
## (May 2016, 6)
• Suppose $$f \colon [-1,1] \to \mathbb{R}$$ is a bounded function that is continuous at $$0$$. Let $$\alpha(x) = -1$$ for $$x \in [-1,0]$$ and $$\alpha(x)=1$$ for $$x \in (0,1]$$. Prove that $$f \in \mathcal{R}(\alpha)[-1,1]$$, i.e., $$f$$ is Riemann integrable with respect to $$\alpha$$ on $$[-1,1]$$, and $$\int_{-1}^1 f d\alpha = 2f(0)$$.
• Let $$g \colon [0,1] \to \mathbb{R}$$ be a continuous function such that $$\int_0^1 g(x)x^{3k+2} dx = 0$$ for all $$k = 0, 1, 2, \ldots$$. Prove that $$g(x) =0$$ for all $$x \in [0,1]$$. | {
"domain": "dzackgarza.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850837598123,
"lm_q1q2_score": 0.8316333975648048,
"lm_q2_score": 0.8459424431344437,
"openwebmath_perplexity": 163.71005775591013,
"openwebmath_score": 0.9992544651031494,
"tags": null,
"url": "https://quals.dzackgarza.com/20_Real%20Analysis/600_Qual_Questions_UGA/Extra_Questions.html"
} |
image-processing, noise, denoising, gradient, total-variation
Update:
Intuitively I would assume something like the following (since the phase has no influence on $obj_2$, leave the phase "untouched"):
$$
\text{TV}'\left(TV(|f|)\right)* e^{i \arg(f)}
$$
However, my knowledge in complex analysis is very limited and I am not sure if this makes sense. The problem with $\left|f\right|$ is that since is not analytic the standard definition of complex derivative does not apply. A solution is to use Wirtinger derivatives:
http://en.wikipedia.org/wiki/Wirtinger_derivatives
A detailed account of Wirtinger calculus for signal processing problems is
http://arxiv.org/abs/0906.4835
Another (probably simpler) option is to treat the complex image as a two-channel (real,imag) image and use the definition of derivative for vector fields. This paper has a very clear explanation on how to do this:
Lee, H.-C.; Cok, D.R.; "Detecting boundaries in a vector field" (IEEE Transactions on Signal Processing, vol.39, no.5, pp.1181-1194, May 1991) | {
"domain": "dsp.stackexchange",
"id": 544,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, noise, denoising, gradient, total-variation",
"url": null
} |
materials, optics
The problem is, all of this research is fairly recent and doesn't seem to have found its way to industry yet. I can't find many coating houses who sell super-hydrophobic optical coatings. Aculon's website says that they sell one, but they don't publish the contact angle, and the picture they show makes it appear to only be ~90$^\circ$.
Aculon also claims to sell an oleophobic (oil repelling) coating. This may work for you, but you would need to test a sample with the materials you plan to use. The video on their website shows someone trying to write on it with a Sharpie and it just won't take to the surface. | {
"domain": "engineering.stackexchange",
"id": 179,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "materials, optics",
"url": null
} |
monte-carlo-tree-search, alphago-zero
Title: How does Alpha Go Zero MCTS work in parallel? I am trying to better understand the article "Mastering the Game of Go without Human Knowledge" (link) and I'm confused about the parallel implementation of Monte-Carlo-Tree-Search.
On page 25 under "Search Algorithm", the authors say (emphasis mine)
AlphaGo Zero uses a much simpler variant of the asynchronous policy and
value MCTS algorithm (APV-MCTS)
Multiple simulations are executed in parallel on separate search threads.
On page 26 under "Select",
an action is selected according to the statistics in the search tree | {
"domain": "ai.stackexchange",
"id": 3970,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "monte-carlo-tree-search, alphago-zero",
"url": null
} |
# Difference between revisions of "2012 AIME II Problems/Problem 1"
## Problem 1
Find the number of ordered pairs of positive integer solutions $(m, n)$ to the equation $20m + 12n = 2012$.
## Solution 1
Solving for $m$ gives us $m = \frac{503-3n}{5},$ so in order for $m$ to be an integer, we must have $3n \equiv 503 \mod 5 \longrightarrow n \equiv 1 \mod 5.$ The smallest possible value of $n$ is obviously $1,$ and the greatest is $\frac{503 - 5}{3} = 166,$ so the total number of solutions is $\frac{166-1}{5}+1 = \boxed{34}$
## Solution 2
Dividing by $4$ gives us $5m + 3n = 503$. Thus, we have $503-5m\equiv 0 \pmod 3$ since $n$ is an integer. Rearranging then gives $m\equiv 1\pmod 3.$ Since $503-5m>0,$ we know that $m<503/5.$ Because $m$ is an integer, we can rewrite this as $m\le 100.$ Therefore, $m$ ranges from $$0\cdot 3+1\quad \text{to} \quad 33\cdot 3+1,$$ giving $\boxed{034}$ values. ~vaporwave
## Solution 3 | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526441330527,
"lm_q1q2_score": 0.825951876064618,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 352.3082866165687,
"openwebmath_score": 0.6702089905738831,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2012_AIME_II_Problems/Problem_1&diff=cur&oldid=45847"
} |
beginner, android, kotlin
// Entry containing the name and the value
data class Entry(var name: String, var value: Double)
}
ITEMADAPTER.KT
package com.hooni.nbun1kotlin
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.listview_item.view.*
class ItemAdapter (private val items: MutableList<MainActivity.Entry>) :
RecyclerView.Adapter<ItemAdapter.ItemViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder {
return ItemViewHolder(LayoutInflater.from(parent.context)
.inflate(R.layout.listview_item,parent,false))
}
override fun getItemCount(): Int {
return items.size
} | {
"domain": "codereview.stackexchange",
"id": 36145,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, android, kotlin",
"url": null
} |
>>> powerset([1, 2, 3])
[[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
>>> powerset([2, 3])
[[], [2], [3], [2, 3]]
Here, we see that the list passed in the first case and the list passed in the second case only differ by the element 1, and that the second list is actually the "rest" of the first list. This suspiciously sounds like what usually happened for linked lists... Let's try to see how a recursive call to power([1, 2, 3][1:]) might help us. In other words, does powerset([1, 2, 3][1:]) help us find an answer to powerset([1, 2, 3])?
Since we want to see if we can build the result of powerset([1, 2, 3]) with the result of powerset([1, 2, 3][1:]) let's see what the outputs differ by, as well as whether or not they share common elements. Here's the list of everything in powerset([1, 2, 3]) that isn't in powerset([1, 2, 3][1:]), a list of everything in both powerset([1, 2, 3]) and powerset([1, 2, 3][1:]), and just the output of powerset([1, 2, 3][1:]) | {
"domain": "berkeley.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815494335755,
"lm_q1q2_score": 0.8199709789812285,
"lm_q2_score": 0.8289388125473628,
"openwebmath_perplexity": 1301.2112371097796,
"openwebmath_score": 0.5314792990684509,
"tags": null,
"url": "https://www.ocf.berkeley.edu/~shidi/cs61a/w/index.php?title=Power_set&diff=759&oldid=757"
} |
c#, performance
Title: Product and Factor Overview
I was challenged recently to write some code that could find the smallest integer that when multiplied and divided by 2 or 3, retained all of its digits and gained no extras. For example:
With 2
285714
When multiplied: 571428.
When divided: 142857.
With 3
31046895
When multiplied: 93140685.
When divided: 10348965.
Code
You'll need the following using statements:
using System;
using System.Collections.Generic;
using static System.Console;
The Main method contents:
int variant = 2;
for (int i = 0; i < int.MaxValue; i++)
if (ProductAndFactor(i, variant)) {
WriteLine(i);
break;
}
WriteLine("Done");
ReadKey();
The backbone code:
static bool ProductAndFactor(int i, int v) {
Dictionary<char, int> oChars = GetValueChars(i);
Dictionary<char, int> dChars = GetValueChars(i / v);
Dictionary<char, int> mChars = GetValueChars(i * v); | {
"domain": "codereview.stackexchange",
"id": 32261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance",
"url": null
} |
astrophysics, black-holes, stars
Title: Why can't a stable star have radius 1 < r < 9/8 its Schwarzschild radius? From http://www.spacetimetravel.org/ssm/ssm.html :
A mass of 1.78 [in geometric units] corresponds to a ratio of radius to Schwarzschild radius of 9/8. Theory predicts that a smaller ratio is not possible for a stable star. | {
"domain": "physics.stackexchange",
"id": 2020,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, black-holes, stars",
"url": null
} |
php, object-oriented
Ok, but how do we get a value in that class, and use it as a property? Enter the __construct method:
class MyText
{
public $string = null;//no value (yet)
public function __construct($value)
{
$this->string = $value;
}
public function scream()
{
return strtoupper($this->string);
}
}
You then create an instance like so:
$instance = new MyText('This is the value');
echo $instance->scream();//THIS IS THE VALUE
$another = new MyText('And now for something completely different');
echo $another->scream();//AND NOW FOR SOMETHING...
Each instance has its own property, and can do the same thing without this affecting the other instances of the same class. They are all self-contained units.
Now, the property here isn't neatly tucked away, of course, it's public, so other code can simply change the value of the string property:
$instance->string = 'foobar';
echo $instance->scream();//FOOBAR | {
"domain": "codereview.stackexchange",
"id": 7076,
"lm_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",
"url": null
} |
gene, public-databases, conversion
Title: Missing data mappings in mygene.info while trying to convert Genes Ensembl Ids to Entrez Ids I need to convert a lot of Ensembl Ids to the relative counterpart in Entrez (e.g., ENSG00000157764 > 673).
I found mygene.info and it seems what I needed. Let's see the query about ENSG00000157764 in action. We can easily find the key-value "entrezgene": 673
Unfortunately, the mapping seems not complete in some cases or, maybe, I'm missing something...
Example:
Gene: NDUFV2P1 (NADH:ubiquinone oxidoreductase core subunit V2
pseudogene 1)
Expected Mapping
ENSG00000267809 > 4730 | {
"domain": "bioinformatics.stackexchange",
"id": 235,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gene, public-databases, conversion",
"url": null
} |
oceanography, temperature, climatology
Figure 1 from Gebbie and Huybers (2019), https://doi.org/10.1126/science.aar8413 - reproduced here for non-commercial use. | {
"domain": "earthscience.stackexchange",
"id": 1627,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "oceanography, temperature, climatology",
"url": null
} |
nmr-spectroscopy
For an exposition of basic NMR theory see either Keeler, Understanding NMR Spectroscopy, 2nd ed. (Wiley) or Hore, Nuclear Magnetic Resonance, 2nd ed. (OUP).
A necessarily mathematical, but still fairly accessible, introduction to the topic is provided in: Gerothanassis, I. P.; Tsanaktsidis, C. G. Nuclear electric quadrupole relaxation. Concepts Magn. Reson. 1996, 8 (1), 63–74. DOI: 10.1002/(SICI)1099-0534(1996)8:1<63::AID-CMR5>3.0.CO;2-N.
The full Hamiltonian is provided in Appendix A.7 of Levitt, Spin Dynamics, 2nd ed. (Wiley).
Abragam (ref 5) writes that this is best understood in terms of "a fluctuating electric field gradient acting on the quadrupole moment of the nucleus", and refers to: Bloembergen, N.; Purcell, E. M.; Pound, R. V. Relaxation Effects in Nuclear Magnetic Resonance Absorption. Phys. Rev. 1948, 73 (7), 679–712. DOI: 10.1103/PhysRev.73.679. (Non-paywall version from Harvard available here.) | {
"domain": "chemistry.stackexchange",
"id": 8722,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nmr-spectroscopy",
"url": null
} |
electrical-resistance, superconductivity, dissipation
The ability of a wire to carry an electrical current with no apparent dissipation is doubtless the most dramatic property of the superconducting state. Under favorable conditions, the electrical resistance of a superconducting wire can be very low indeed. Mathematical models predict lifetimes that far exceed the age of the universe for sufficiently thick wires under appropriate conditions.
In one experiment,a superconducting ring was observed to carry a persistent current for more than ayear without measurable decay, with an upper bound for the decay rate of a part in 10^5 in the course of a year.
However, in other circumstances, as for sufficiently
thin wires or films, or in the presence of penetrating strong magnetic fields, non-zero resistances are observed.
Some experimental plots are included. | {
"domain": "physics.stackexchange",
"id": 89950,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrical-resistance, superconductivity, dissipation",
"url": null
} |
module we will examine solutions to a simple second-order linear partial differential equation -- the one-dimensional heat equation. We begin by reminding the reader of a theorem. There is no relation between the two equations and dimensionality. The circulation of gas within the loop is caused by the thermal convection due to the heat generated by the copper bed. This method provides an accurate and efficient technique in comparison with other classical methods. Exact Solutions > Linear Partial Differential Equations > Second-Order Parabolic Partial Differential Equations > Nonhomogeneous Heat (Diffusion) Equation 1. Numerical Solution of 1D Heat Equation R. HEAT DIFFUSION EQUATION Consider a differential control volume V. INTRODUCTION THE MASS transfer phenomena in physics and engineering can often be described by the diffusion equations. Binary diffusion of O 2 and other gases, such as N 2, He and CO 2 were used. ! Before attempting to solve the equation, it is useful to understand | {
"domain": "open-cube.fr",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795091201804,
"lm_q1q2_score": 0.8246051252638175,
"lm_q2_score": 0.8354835309589074,
"openwebmath_perplexity": 604.947876856448,
"openwebmath_score": 0.7840031385421753,
"tags": null,
"url": "http://erpe.open-cube.fr/heat-diffusion-equation.html"
} |
Example 1 A crucial application of least squares is fitting a straight line to m points. Weighted Least Squares in Simple Regression The weighted least squares estimates are then given as ^ 0 = yw ^ 1xw ^ 1 = P wi(xi xw)(yi yw) P wi(xi xw)2 where xw and yw are the weighted means xw = P wixi P wi yw = P wiyi P wi: Some algebra shows that the weighted least squares … Video transcript - [Instructor] Let's say we're trying to understand the relationship between people's height and their weight. Least Square is the method for finding the best fit of a set of data points. The Method of Least Squares Steven J. Miller⁄ Mathematics Department Brown University Providence, RI 02912 Abstract The Method of Least Squares is a procedure to determine the best fit line to data; the proof uses simple calculus and linear algebra. The "least squares" method is a form of mathematical regression analysis used to determine the line of best fit for a set of data, providing a visual … This is because the | {
"domain": "mailigniter.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137931962462,
"lm_q1q2_score": 0.8051465669776268,
"lm_q2_score": 0.8198933381139646,
"openwebmath_perplexity": 337.46152239111694,
"openwebmath_score": 0.5033019781112671,
"tags": null,
"url": "https://mailigniter.com/benzoic-acid-sedtgz/page.php?tag=b3b2bb-least-squares-regression-method-formula"
} |
slam, navigation, stereo-camera, occupancy-grid, rtabmap-ros
</launch>
Originally posted by shoemakerlevy9 on ROS Answers with karma: 545 on 2016-10-28
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 26078,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, stereo-camera, occupancy-grid, rtabmap-ros",
"url": null
} |
homework-and-exercises, optics
I inserted my solution and the worksheet's solution into the differential equation and both solve the differential equation.
I don't understand how they got the $S_\lambda e^{-\kappa_\lambda \rho s}$ into their solution. Did they make assumptions I didn't make? I would really like some help. When solving differential equations like this, you must either put a constant of integration or state the limits of the integrals. If you do so you get
$$\int_{I_{\lambda,0}}^{I_{\lambda}}\frac{{\rm d}I_{\lambda}}{I_{\lambda}+S_{\lambda}}=-\int_{0}^{s}{\rm d}s\kappa_{\lambda}\rho$$
$$\ln\left(\frac{I_{\lambda}-S_{\lambda}}{I_{\lambda,0}-S_{\lambda}}\right)=-\kappa_{\lambda}\rho s$$
which I am sure you can take from here. In other words your solution doesn't satisfy the boundary conditions. | {
"domain": "physics.stackexchange",
"id": 45678,
"lm_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, optics",
"url": null
} |
acid-base, redox, metal, oxides
On the topic of zinc and HCl per an educational site:
Let’s examine the example of the interaction between zinc and hydrochloric acid. Zinc also reacts with HCl, releasing small bubbles of hydrogen and forming zinc chloride ZnCl₂.
But why small bubbles? My answer, there is also hydrogen embrittlement occurring on the zinc surface, as highlighted in recent research, "The Effects of Zinc Alloy Electroplating on the Hydrogen Embrittlement of High Strength Steels", to quote:
Hydrogen permeation measurements were performed and indicated that the quantity of hydrogen absorbed by the steel substrates is critically dependent on the composition of the initial deposit. Large quantities of hydrogen were trapped in the coatings and continued to diffuse into the steel over extended times after the plating process was completed.
I trust this helps. | {
"domain": "chemistry.stackexchange",
"id": 16873,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, redox, metal, oxides",
"url": null
} |
rosbag, pointcloud
visualization_msgs::Marker points, line_strip, line_list;
points.header.frame_id = line_strip.header.frame_id = line_list.header.frame_id = "/camera_depth_frame";
points.header.stamp = line_strip.header.stamp = line_list.header.stamp = ros::Time::now();
points.ns = line_strip.ns = line_list.ns = "lines";
points.action =line_strip.action = line_list.action = visualization_msgs::Marker::ADD;
points.pose.orientation.w = line_strip.pose.orientation.w = line_list.pose.orientation.w = 1.0;
points.id = 0;
line_strip.id = 1;
line_list.id = 2;
points.type = visualization_msgs::Marker::POINTS;
line_strip.type = visualization_msgs::Marker::LINE_STRIP;
line_list.type = visualization_msgs::Marker::LINE_LIST;
points.scale.x = 0.01;
points.scale.y = 0.01;
line_strip.scale.x = 0.005;
line_strip.color.b = 1.0;
line_strip.color.a = 1.0;
points.color.r = 1.0f;
points.color.a = 1.0;
line_list.scale.x = 0.005;
line_list.color.a = 1.0;
geometry_msgs::Point p; | {
"domain": "robotics.stackexchange",
"id": 25463,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosbag, pointcloud",
"url": null
} |
ros, transform, tf2
Originally posted by Mehdi. on ROS Answers with karma: 3339 on 2018-06-20
Post score: 0
It's completely find for frames to come and go from the system. It's designed to support that without incurring any overhead.
Attaching at a leaf is trivial, as you say you can just attach and detach something from the gripper by publishing the transform and then stopping.
If you want to join two different subtrees it's a little bit more complicated. Because you must join the root of one subtree to the other tree often you'll want to write a script that does this with the right semantic for your application. In your case of joining two subtrains.
There's a discussion of how to do that in #q293004
Originally posted by tfoote with karma: 58457 on 2018-06-20
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 31040,
"lm_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, transform, tf2",
"url": null
} |
electromagnetism, optics, electric-fields, classical-electrodynamics, maxwell-equations
Title: Relation between $\textbf{E}$ and $\textbf{H}$ field for TM wave My book (Nanoscale Energy Transport & Conversion by Gang Chen, pg. 173) considers the following scenario of a TE wave reflecting at an interface: | {
"domain": "physics.stackexchange",
"id": 62099,
"lm_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, optics, electric-fields, classical-electrodynamics, maxwell-equations",
"url": null
} |
field-theory
Title: Do different fields interact with each other directly? There are many different types of fields such as electron field, magnetic field, higgs field, electric field, quarks field etc, my question is do these fields interact directly with each other? Particle can form when the field becomes excited and different particles may interact with each other directly. Electric field and magnetic field are interacting with one another to become photon right? Or photon is the excitation of electromagnetic field which is a standalone field from others? You are mixing up two different types of field.
The electron, Higgs and quark fields are quantum fields. The excitations of these fields appear as (real) particles.
The electric and magnetic fields are different aspects of the electromagnetic field, and this is a gauge field. It describes the interaction between charged particles as the exchange of virtual photons. Gauge fields don't have fundamental excitations with corresponding particles. | {
"domain": "physics.stackexchange",
"id": 23236,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "field-theory",
"url": null
} |
regular-languages, automata, finite-automata, nondeterminism
Title: Build an automaton from a given automaton to prove regularity of more complex strings let $L$ be a regular language, and let $A=\{\Sigma, Q, q_0, F, \delta\}$ be a DFA such that $L = L(A)$.
I need to prove that $$L_p=\{xy\in\Sigma^*\mid\delta(q_0, y)=p\text{ and } \delta(p, x)\in F\}$$ is regular for every $p\in Q$ by defining an automaton $A_p$.
I tried to define it like so $$A_p=\{\Sigma, Q\times Q, (p, q_0), F\times \{p\}, \delta_p\}$$ where $\delta_p$ is defined like so
$$
\delta_p((q_1, q_2), \sigma) = (\delta(q_1, \sigma), q_2)\text{ if }q_1 \not\in F,
\\
\delta_p((q_1, q_2), \sigma) = (q_1, \delta(q_2, \sigma))\text{ if }q_1 \in F.
$$
But then I have a problem where $x=uv$, $\delta(p, u)\in F$ and $\delta(p, x)\in F$. | {
"domain": "cs.stackexchange",
"id": 19856,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages, automata, finite-automata, nondeterminism",
"url": null
} |
ros
my catkin workspace name catkin_ws, so i guess the paths are correct in this. So I am not sure what to do to make the roslaunch rviz looks at the right path to launch the right husky_custom_description/meshes/wisu01_husky_arch.dae instead of /husky_custom_description/meshes/red_bowler.dae
Originally posted by kimnguyen on ROS Answers with karma: 21 on 2017-11-01
Post score: 0
That CAD file is probably added in the URDF. Have you looked at husky_custom_description/urdf/husky.urdf.xacro and the other urdf's there?
Try:
roscd husky_custom_description
grep -r 'red_bowler.dae'
Originally posted by AndyZe with karma: 2331 on 2017-11-03
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 29254,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
design-patterns, delegates, swift
init(media:PlayableMedia){
self.media = media
}
func didStartPlaying() {
media.play()
}
func didStopPlaying() {
media.stop()
}
}
Then I try to use it like this:
var dvdPlayer:DVDPlayer = DVDPlayer(media: BlueRayMedia())
dvdPlayer.didStartPlaying() | {
"domain": "codereview.stackexchange",
"id": 8289,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "design-patterns, delegates, swift",
"url": null
} |
# $CLT$ and $LLN$ give different results
I tried to solve a problem two different ways and I got different results.
Let $( X_i )_{i \in \mathbb{N}}$ be a series of independent, identically distributed random variables, with $\mathbb{E}[X_i] = 1$ and $\mathbb{V}[X_i] = 1$
Determine
$$\lim_{n \to \infty} \mathbb{P}\left(\frac{1}{\sqrt{n}} \sum_{i=1}^n X_i \leq \sqrt{n}\right)$$
Here are the two approaches that I tried.
Central limit theorem \begin{align*} & \lim_{n \to \infty} \mathbb{P}\left(\frac{1}{\sqrt{n}} \sum_{i=1}^n X_i \leq \sqrt{n}\right) \\ = {} & \lim_{n \to \infty} \mathbb{P}\left(\frac{1}{\sqrt{n}} \sum_{i=1}^n (X_i - 1) \leq \sqrt{n} - \frac{n}{\sqrt{n}}\right) \\ = {} & \lim_{n \to \infty} \mathbb{P}\left(\frac{1}{\sqrt{n}} \sum_{i=1}^n (X_i - 1) \leq 0\right) \\ = {} & \Phi_{0,1}(0) = \frac{1}{2} \end{align*}
Law of large numbers | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471635202024,
"lm_q1q2_score": 0.8177177239424035,
"lm_q2_score": 0.8311430415844385,
"openwebmath_perplexity": 126.75915512253623,
"openwebmath_score": 1.0000100135803223,
"tags": null,
"url": "https://math.stackexchange.com/questions/2830304/clt-and-lln-give-different-results/2830357"
} |
sequence-alignment, bowtie2
What would be the right way of achieving this using bowtie, or a different tool? This is not something mappers will be good at, because you're going to hit most of the genome. Bowtie won't do it, and I don't think LAST will either. The majority of fast mapping programs rely on seed-based mapping where the seed is essentially free of errors.
Doing only mismatches makes it much easier to determine, but it's still too relaxed. Consider that the example sequence you have provided is 10 mismatches away from GGGGGGGGGGGGGGGGAGAGAGG, and also 10 mismatches away from AAAAAAAAAAAAAAAGAGAGAGG (with the last 3 bp matching exactly)
Depending on how many reads you have it may be better to work in reverse, iterating over all the kmers in the genome and working out whether or not they are fewer than 7 mismatches (plus indels) away from any reads:
for gp in genomePositions
genomeKmer = genome[gp:(gp+23-1)]
for read in reads
errors = 0
for rp in 1..23 | {
"domain": "bioinformatics.stackexchange",
"id": 903,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sequence-alignment, bowtie2",
"url": null
} |
ros, kinect, rxbag
Title: bag a kinect for more than 30 seconds
When I use openni_camera to broadcast and then bag the kinect, at ~ 30 seconds the recording chokes for seconds, and large gaps are present in rxbag inspection.
I am running Ubuntu 10.04 with 16G of RAM and a quad core. This behavior was also seen on a machine running 10.10, with SSD hard drive, an i7 processor, and 16G RAM.
Have others experienced this phenomenon? I am wondering if it isn't a Linux issue...
Originally posted by phil0stine on ROS Answers with karma: 682 on 2011-07-13
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 6122,
"lm_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, rxbag",
"url": null
} |
• Far more elegant than my approach. – Doug M Jan 6 '17 at 21:51
• This is probably what was intended in this exercise. OP would do well to remember that elementary transformations on rows/columns correspond to multiplication by elementary matrices. This is essential for matrix equivalence (rank), finding matrix inverse and solving linear systems. – Ennar Jan 6 '17 at 21:57
• @DougM The OP is really computing the changes of basis that put the matrix in Smith normal form. – Viktor Vaughn Jan 6 '17 at 22:02
$B,C$ are not unique.
$\begin {bmatrix} 1&2\\4&8 \end{bmatrix} = B^{-1} \begin {bmatrix} 1&0\\0&0 \end{bmatrix}C^{-1}$
Suppose $B^{-1} = \begin {bmatrix} b_{11}&b_{12}\\b_{21}&b_{22} \end{bmatrix}$ and $C^{-1} = \begin {bmatrix} c_{11}&c_{12}\\c_{21}&c_{22} \end{bmatrix}$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290955604489,
"lm_q1q2_score": 0.8311419538592487,
"lm_q2_score": 0.8558511506439707,
"openwebmath_perplexity": 1051.540042414644,
"openwebmath_score": 0.9690225720405579,
"tags": null,
"url": "https://math.stackexchange.com/questions/2086746/finding-b-c-such-that-b-left-beginsmallmatrix12-48-endsmallmatrix-rig"
} |
optics, heisenberg-uncertainty-principle, mathematics, interferometry
1the proper quantum mechanical uncertainty principle for energy and time is written $\sigma_E \sigma_t \ge \frac{h}{2\pi}$ The Finesse of the LIGO Fabry Perot resonators is (or was when I last updated my lecture notes) about $Q=450$. I call it $Q$ because this is effectively the Q-factor of the resonator.
The relationship between this and the power amplification gain - which is often hand-wavingly used to describe how many time the light travels up and down the arms - is $2Q/\pi = n = 286$ for LIGO.
The Q-factor is the ratio of the frequency of the resonance to the FWHM of the resonance. The relevant frequency is the free spectral range of the interferometer arms, which is $c/2L$. Thus
$$\Delta \nu = \frac{c}{2LQ} = \frac{c}{\pi nL}\ .$$
The "round trip time" for the photons would be $\Delta t = 2nL/c$, and so
$$\Delta \nu \Delta t = \frac{2}{\pi}$$ | {
"domain": "physics.stackexchange",
"id": 98390,
"lm_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, heisenberg-uncertainty-principle, mathematics, interferometry",
"url": null
} |
beginner, haskell, functional-programming
indicatorListCreator :: Int -> Int -> [[String]]
{- Build the indicators of
[["O", "X", "X"],["O", "O", "X"] ... and so forth.
Recursively determines how many iterations we've been through,
and determines how many "X"s and "O"s we should have
per each line. -}
indicatorListCreator gridLen iterNum
| iterNum > gridLen = []
| otherwise =
let itersRemaining = gridLen - iterNum
indicator = replicate iterNum "O" ++
replicate itersRemaining "X"
in
indicator: indicatorListCreator gridLen (iterNum + 1)
linePrinter :: [String] -> IO ()
{- Takes the indicators and prints each line accordingly. -}
linePrinter [indicator1, indicator2, indicator3] =
let between = " --- "
outString = indicator1 ++ between ++
indicator2 ++ between ++
indicator3
in putStrLn outString
linePrinter _ = error"Stupidly hardcoded to only show 3x3" | {
"domain": "codereview.stackexchange",
"id": 38364,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, haskell, functional-programming",
"url": null
} |
optimization, python-3.x, mse
Title: How to Minimize mean square error using Python I want to minimise mean square error function to find best alpha value (decay rate) for my model.
Here is the description of my model:
time: 1st_month 2nd_month 3rd_month 4th_month 5th_month
Product_shipped 500 600 453 200 789
If there is delay in products installed after shipping , we multiply by alpha
Suppose alpha=-0.01
We create a lower traingular matrix
month p1 p2 p3 p4 p5
1 495.0249169
2 490.0993367 588.119204
3 485.2227668 582.2673201 439.6118267
4 480.3947196 576.4736635 435.2376159 192.1578878
5 475.6147123 570.7376547 430.9069293 190.2458849 750.5200159 | {
"domain": "datascience.stackexchange",
"id": 7065,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, python-3.x, mse",
"url": null
} |
machine-learning, deep-learning, time-series, prediction, lstm
I'm been working with LSTMs in Keras/Python, following lots of examples from machinelearningmastery.com, from which my example code (below) is based on. I'm considering reframing the problem as classification into discrete bins, as that produces a confidence per class, but that seems a poor solution.
There are a couple of similar topics (such as the below), but nothing seems to directly address the issue of prediction intervals from LSTM (or indeed other) neural networks:
https://stats.stackexchange.com/questions/25055/how-to-calculate-the-confidence-interval-for-time-series-prediction
Time series prediction using ARIMA vs LSTM
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from math import sin
from matplotlib import pyplot
import numpy as np | {
"domain": "datascience.stackexchange",
"id": 11904,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, time-series, prediction, lstm",
"url": null
} |
c++, design-patterns, c++14, type-safety
{
struct S {};
volatile Nop_t< S, false > n1( S{} ); // volatile to supress warning
volatile Nop_t< S, false > n2;
volatile Nop_t< int, false > n3( S{} );
volatile Nop_t< int, false > n4( "asd" );
MAYBE_UNUSED( n1 );
MAYBE_UNUSED( n2 );
MAYBE_UNUSED( n3 );
MAYBE_UNUSED( n4 );
}
{
struct S {};
volatile Nop_t< S, true > n1( S{} );
volatile Nop_t< S, true > n2;
Nop_t< int, true > n3a( 1 );
// Nop_t<int,true> n3b( S{} );
// Nop_t<int,true> n3c( "asd" );
Nop_t< std::string, true > n4;
assert( n3a == 1 );
assert( n4.empty() );
MAYBE_UNUSED( n1 );
MAYBE_UNUSED( n2 );
}
{
Nop_t< float, true > t = 10;
Nop_t< float, false > f = 10;
(void) atan( t );
(void) atan( f );
}
{
Nop_t< std::vector<int>, true > vec1{1,2,3}; | {
"domain": "codereview.stackexchange",
"id": 42735,
"lm_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++, design-patterns, c++14, type-safety",
"url": null
} |
haskell
$(makeLenses ''QuantityHolder)
-------------------------------
data Fighter = TeamPlayer
| LoneWolf
| Polymorph
deriving (Show, Eq, Ord)
-------------------------------
data World = World {
_quantities :: QuantityHolder
} deriving (Show)
$(makeLenses ''World)
incrementQuantity (Quantity q) = Quantity (q + 1) | {
"domain": "codereview.stackexchange",
"id": 4749,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.