text stringlengths 1 1.11k | source dict |
|---|---|
particle-physics, neutrinos
$$ T_{1/2}^{2\nu\beta\beta} = \left( 2.172 \pm 0.017\text{(stat)}\pm 0.060\text{(sys)} \right) \times 10^{21} \text{ years}\,,$$
but they do not update their limit for neutrino-less double beta decay, so still no definitive answer on Majorana/Dirac.
August 2013: GERDA has published a report on a low significance null result in the July 17 issue of Phys. Rev. Lett. (also as arXive:1307.4720). Like the EXO and KamnLAND-ZEN results this isn't a strong result by itself, but the combination of all three is starting to look pretty significant. | {
"domain": "physics.stackexchange",
"id": 3468,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, neutrinos",
"url": null
} |
superconductivity, topology, vortex
Title: What is the relation between vortex and quantized magnetic flux in superconductor? A vortex is a topological defect of the order parameter. As far as I am concerned, I think a vortex is a phase singularity point and a vortex always has a quantized flux. And we know that the magnetic flux is also quantized in superconductor. So what is the relation between them? I read from a book that the quantization of a magnetic flux is not due to topological, but energetic considerations. What does that mean? Is it saying that in type II superconductors, the magnetic flux is quantized so that the energy of the system is minimized and then this phenomenon just has a topological property? Think of the superconducting order parameter as given by the minimum of the Ginzburg-Landau functional: | {
"domain": "physics.stackexchange",
"id": 10618,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "superconductivity, topology, vortex",
"url": null
} |
graphs
Title: How to prove that a minimum edge cover is a forest? How can it be proved that any minimum edge cover is a forest? As far as I understand an edge cover could be one connected component therefore a spanning tree). If it's the case then it wouldn't be a forest. A forest is a graph in which every component is a tree. If there is only one component, and that component is a tree, the graph is a forest.
So why is every minimum edge cover a forest? Suppose you have a graph $G=(V,E)$ and an edge cover $C\subseteq E$. Suppose some component of the graph $(V,C)$ contains a cycle, say $x_1x_2\dots x_kx_1$. Then $C\setminus\{x_1x_2\}$ is a smaller edge cover than $C$: $x_1$ is covered by the edge $x_kx_1$, $x_2$ is covered by $x_2x_3$ and every other vertex in $V$ is still covered by whatever covered it in $C$. Therefore, every minimum edge cover must contain no cycles, and an undirected graph that contains no cycles is a forest. | {
"domain": "cs.stackexchange",
"id": 10651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs",
"url": null
} |
engineers. Infinite True/False: One of the advantages of a recursive algorithm is that it does not matter how many recursive calls are made to a module; only one instance of the parameters are needed. Using the original recursive. Then calculate the factorial of that number, using recursion. com - View the original, and get the already-completed solution here!. That is, show all the steps used by Algorithm 3 to find gcd(8,13). Recursive algorithm used for merge sort comes under the category of divide and conquer technique. Recursion is used in this algorithm because with each pass a new array is created by cutting the old one in half. Q ; Known Bugs / Feature Requests ; Java Version ; Flash Version. Chapter 17 Recursion Pseudocode is a way to describe algorithms without completely coding them in C. Why? n Same goes for recursive algorithms. (Mathematics) logic maths a. This is not the case with my factorial solution above. However, recursive algorithms are not that intuitive. • Sample | {
"domain": "nauticalsas.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812327313546,
"lm_q1q2_score": 0.8287901922951566,
"lm_q2_score": 0.8558511506439708,
"openwebmath_perplexity": 815.3644135434384,
"openwebmath_score": 0.4492177963256836,
"tags": null,
"url": "http://kcgv.nauticalsas.it/recursion-pseudocode.html"
} |
newtonian-mechanics, classical-mechanics, acceleration, rotation
Title: Acceleration of a rotated point using rotation matrices I am trying to calculate the acceleration of a point using rotation matrices and struggle to get my head around them.
Imagine an inverted pendulum which can rotate about its x-axis but not any other axis. Lets say the y-axis points to the right, the z-axis down (towards gravity) and the x-axis into the monitor.
To calculate the acceleration of a point on that pendulum my idea was to define two frames $\mathbf{x_B}$ and $\mathbf{x_I}$ for the body and inertial frames respectively. The inertial frame is supposed to be stationary and since the body frame can rotate about the (common) x-axis the relationship is as follows:
$$\mathbf{x_I=R_xx_B}$$
where $\mathbf{R_x}$ is the rotation matrix defined by
$$\mathbf{R_x}=\begin{pmatrix}1&0&0\\0&\cos(\theta)&-\sin(\theta)\\0&\sin(\theta)&\cos(\theta)\end{pmatrix}$$
Multiplying with $\mathbf{R_x^T}$ and differentiating with respect to time gives us | {
"domain": "physics.stackexchange",
"id": 81827,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, classical-mechanics, acceleration, rotation",
"url": null
} |
For example:
$\displaystyle y = \frac{1}{3}x^3 + \frac{1}{2}x^2 - 12x + 6$
$\displaystyle y' = x^2 + x - 12$
$\displaystyle x^2 + x - 12 = 0$
$\displaystyle (x - 3)(x + 4) = 0$
$\displaystyle y' = 0$ at $\displaystyle x = 3$ and $\displaystyle x = -4$
To determine which they are, find y'' and plug in the zero values for x...
$\displaystyle y'' = 2x + 1$
$\displaystyle y''(3) = 2(3) + 1 = 7 > 0$ so minimum
$\displaystyle y''(-4) = 2(-4) + 1 = -7 < 0$ so maximum
Scott
I believe the poster was talking about functions of two variables. it is a slightly different.
Originally Posted by MarianaA
Hi, can some one help with this please.
How I can fine all of the potential maxima and minima for f(x,y).
Thanks ^_^
this is the kind of question for which you should consult your text for the answer.
We suppose the second partial derivatives of the function $\displaystyle f(x,y)$ is continuous on some disk centered at the point $\displaystyle (a,b)$. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.973240714486111,
"lm_q1q2_score": 0.8384840573137605,
"lm_q2_score": 0.8615382040983515,
"openwebmath_perplexity": 1508.7434372331666,
"openwebmath_score": 0.7285802364349365,
"tags": null,
"url": "http://mathhelpforum.com/calculus/21090-maxima-mininima.html"
} |
electromagnetism
Title: why do electromagnetic waves have no charge? i would have thought that because the electric and magnetic fields oscillate, the charge could be positive or negative between 0 and 1 inclusive at any one point in time. i cannot see any explanation for the charge being 0 unless they cancel each other out.
what is the reason for this? The oscillation is not an oscillating charge but an oscillating dipole, and a dipole has zero net charge.
NB this doesn't mean a light wave is actually a pair of equal and opposite charges. It just the electromagnetic field that is produced from a pair of oscillating charges. | {
"domain": "physics.stackexchange",
"id": 21157,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism",
"url": null
} |
java, performance, game, graphics
AffineTransform normal = g2d.getTransform();
// g2d.drawImage(background, 0, 0, this);
// rest of code
In this way, we move the expensive operation of rendering the image to another thread. Note that that other thread will still be getting around 30 fps instead of 60 fps, but the game itself will be running at a better framerate. In other words, the background image will be updating at closer to 30 fps, while everything else will be faster. | {
"domain": "codereview.stackexchange",
"id": 20683,
"lm_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, game, graphics",
"url": null
} |
quantum-mechanics, harmonic-oscillator, hamiltonian, education
$$ \partial_t \hat{a}^\dagger_t = i\hat{a}^\dagger_t \implies \hat{a}^\dagger_t = \hat{a}^\dagger_0 e^{it}.$$
One can then interpret the $\hat{X}_t$ and $\hat{P}_t$ as the real an imaginary parts of the complex amplitude $\hat{a}^\dagger_t$ and this is in perfect analogy with the classical simple harmonic oscillator. Now we can rewrite our Hamiltonian using these operators in the Schrödinger picture and naturally motivate the factorization.
Personally, I think this is a wonderful way to have students gain some insight into what these ladder operators represent before delving into why they are called ladder operators when we go into the properties. It would be particularly helpful for any student who wishes to take up QFT to be introduced to the objects in this way. | {
"domain": "physics.stackexchange",
"id": 98337,
"lm_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, harmonic-oscillator, hamiltonian, education",
"url": null
} |
ros, python, message-filter
Title: Problem with Subscriber class from message_filter in Python
I am currently facing a problem, that the Subscriber() is expecting 3 arguments, while in the docs it is always being done with 2:
http://docs.ros.org/en/api/message_filters/html/python/
Therefore I am getting an IndexError: tuple index out of range. Looking at the source code of Subscriber:
class Subscriber(SimpleFilter):
"""
ROS2 subscription filter,Identical arguments as :class:`rclpy.Subscriber`.
This class acts as a highest-level filter, simply passing messages
from a ROS2 subscription through to the filters which have connected
to it.
"""
def __init__(self, *args, **kwargs):
SimpleFilter.__init__(self)
self.node = args[0]
self.topic = args[2]
kwargs.setdefault('qos_profile', 10)
self.sub = self.node.create_subscription(*args[1:], self.callback, **kwargs)
def callback(self, msg):
self.signalMessage(msg)
def getTopic(self):
return self.topic | {
"domain": "robotics.stackexchange",
"id": 36529,
"lm_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, python, message-filter",
"url": null
} |
java, complexity
Title: Local variable lookup table I'm currently in the process of writing my own programming language and the Virtual Machine for the language is responsible for handing all of the local variable scopes.
I need to support the following operations as fast as possible:
putLocal - puts an object into the stack
getLocal - retrieves an object from the stack
upScope - enters a new scope
downScope - leaves a single scope (in practice we can fall back multiple but I'll leave the operation elementary)
Originally I had a naive stack based system where the variables were stored in levels of a stack which had the following time complexities for the key operations, with \$n\$ the total levels in the stack:
putLocal - \$O(n)\$
getLocal - \$O(n)\$
upScope - \$O(1)\$
downScope - \$O(1)\$ | {
"domain": "codereview.stackexchange",
"id": 19108,
"lm_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, complexity",
"url": null
} |
$$g(x) = \begin{cases} 0 &\text{if}\;\;\; x \neq x_2 \\ 1 &\text{if}\;\;\; x = x_2 \end{cases}$$
Then it is clear that $g$ is non-zero and $fg=0$. Thus, $f$ is a zero-divisor.
I claim, further, that such $f$ are the only zero divisors. To see this, suppose that there does not exist an $x_2 \in \mathbb{R}$ such that $f(x_2) = 0$. Then $f(x) \neq 0$ for every $x \in \mathbb{R}$. But then for any $x \in \mathbb{R}$, we can divide though by $f(x)$ in $f(x)g(x) = 0$ to obtain
$$g(x) = \frac{0}{f(x)} = 0.$$
Which means that all $g$ that satisfy $fg=0$ must have $g(x) = 0$ for all $x \in \mathbb{R}$ contradicting the requirement that $g$ is non-zero.
I'm trying to learn this on my own, and am having some trouble understanding and gaining intuition regarding zero-divisors. So even though this may seem simple, I would like some help and criticism :)
-
Yes, that's a fine argument. For a slightly different approach, note that if $f$ has no zeros, then we can define an inverse for it via | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534316905263,
"lm_q1q2_score": 0.8024112753228361,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 72.01690087797739,
"openwebmath_score": 0.9406259655952454,
"tags": null,
"url": "http://math.stackexchange.com/questions/827448/zero-divisors-in-ring-of-real-valued-functions"
} |
c#, performance, algorithm
private Node GetOrAddChild(string value)
{
var child = Children.FirstOrDefault(c => c.Value == value);
if (child == null)
{
child = new Node { Value = value };
Children.Add(child);
}
return child;
}
public void AddPath(string path) => AddPath(this, path);
public static void AddPath(Node n, string path)
{
if (string.IsNullOrEmpty(path))
return;
var idx = path.IndexOf(".");
if (idx == -1)
{
var child = n.GetOrAddChild(path);
child.Ends = true;
}
else
{
var part = path.Substring(0, idx);
var child = n.GetOrAddChild(part);
AddPath(child, path.Substring(idx + 1));
}
}
} | {
"domain": "codereview.stackexchange",
"id": 40452,
"lm_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, algorithm",
"url": null
} |
notation
2.10.1 Other symbols and conventions in chemistry
[...]
(iv) Equations for chemical reactions
(a) On a microscopic level the reaction equation represents an
elementary reaction [...] A single arrow is used to connect reactants
and products in an elementary reaction. An equal sign is used for the
"net" reaction, the result of a set of elementary reactions. [...]
$\ce{H + Br2 -> HBr + Br} \quad$ one elementary step in HBr formation
$\ce{H2 + Br2 = 2 HBr} \quad$ the sum of several such elementary steps
(b) On a macroscopic level, different
symbols are used connecting the reactants and products in the reaction
equation, with the following meanings:
$\ce{H2 + Br2 = 2 HBr}\quad$ stoichiometric equation
$\ce{H2 + Br2 -> 2 HBr}\quad$ net forward reaction
$\ce{H2 + Br2 <--> 2 HBr}\quad$ reaction, both directions
$\ce{H2 + Br2 <=> 2 HBr}\quad$ equilibrium
The two-sided arrow $\ce{<->}$ should not be used
for reactions to avoid confusion with resonance structures [...] | {
"domain": "chemistry.stackexchange",
"id": 9248,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "notation",
"url": null
} |
quantum-field-theory, statistical-mechanics, fermions, commutator, bosons
a state $|\psi\rangle$ that satisfies
$$
N_k|\psi\rangle=n_k|\psi\rangle
\tag{5}
$$
has $n_k$ particles in the $k$-th mode.
To see this, use equations (2) to deduce
\begin{align}
N_k a_j^\dagger &= a_j^\dagger (N_k+\delta_{jk}) \hskip1cm\text{(boson)} \\
\\
N_k c_j^\dagger &= c_j^\dagger (N_k+\delta_{jk}) \hskip1cm\text{(fermion)}.
\tag{5b}
\end{align}
A state that satisfies
$$
H|\psi\rangle=E_\psi|\psi\rangle
\tag{6}
$$
has total energy $E_\psi$.
The adjoint of the lower-left equation
in (2) implies $(c_k^\dagger)^2=0$, so
$n_k\in\{0,1\}$ for fermions.
The boson version of equation (2) does
not impose any such restriction,
so $n_k\in\{0,1,2,3,...\}$ for bosons.
Here's how this is used in statistical mechanics.
If the boson/fermion system is in thermal
equilibrium with some other (unmodelled) system, then
the expectation value of any observable $X$ associated
with the boson/fermion system is
$$
\rho(X) = \frac{1}{Z}\sum_\psi e^{-\beta E_\psi} | {
"domain": "physics.stackexchange",
"id": 53587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, statistical-mechanics, fermions, commutator, bosons",
"url": null
} |
performance, google-apps-script, google-sheets
var cell2 = tempSheet.getRange(6,4);
cell2.setValue(function2(cell2.getValue()));
var cell3 = tempSheet.getRange(7,4);
cell3.setValue(function3(cell3.getValue()));
//continue for several cells like this on specific i,j indexes. No pattern.
//Table
for (var p = 9; p <= 30; p++) {
var tCell1 = tempSheet.getRange(p,2);
tCell1.setValue(function5(tCell1.getValue()));
var tCell2 = tempSheet.getRange(p,3);
tCell2.setValue(function6(tCell2.getValue()));
//continue for several cells like this with dynamic p and several columns
}
fileName = sheetID + ".csv";
var csvFile = convertRangeToCsvFile_(fileName, tempSheet);
folder.createFile(fileName, csvFile);
}
Browser.msgBox('Files are waiting in a folder named ' + folder.getName());
}
function createTempSheet() {
var activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var tempSheet = activeSpreadsheet.getSheetByName("temp"); | {
"domain": "codereview.stackexchange",
"id": 43686,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, google-apps-script, google-sheets",
"url": null
} |
quantum-mechanics, quantum-information, quantum-entanglement, quantum-measurements, quantum-teleportation
Perhaps a concrete example would be: Let's say Alice and Bob share the state $|\psi_{A, B_1, B_2}\rangle = \alpha|n_1\rangle + \beta |n_2\rangle$. Is it possible, using only LOCC, to end up in the joint state $|n_1\rangle$ with probability $|\alpha|^2$, and in $|n_2\rangle$ with probability $|\beta|^2$, so that afterwards both parties know what the shared state is?
I assume that the precise implementation of such a measurement will depend on the states $|n_1\rangle$ and $|n_2\rangle$, but is there a general rule for when such a joint measurement is possible? | {
"domain": "physics.stackexchange",
"id": 97377,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information, quantum-entanglement, quantum-measurements, quantum-teleportation",
"url": null
} |
optimization, perl
Title: Building a Simple Menu With Perl I wrote a Perl script to implement a simple menu where you can call subroutines for each menu option. I created a Menu class that can be used to create new menus and a print method that will start the menu.
Is there any way I could simplify this?
# Menu.pm
#!/usr/bin/perl
package Menu;
use strict;
use warnings;
# Menu constructor
sub new {
# Unpack input arguments
my $class = shift;
my (%args) = @_;
my $title = $args{title};
my $choices_ref = $args{choices};
my $noexit = $args{noexit};
# Bless the menu object
my $self = bless {
title => $title,
choices => $choices_ref,
noexit => $noexit,
}, $class;
return $self;
}
# Print the menu
sub print {
# Unpack input arguments
my $self = shift;
my $title = $self->{title };
my @choices = @{$self->{choices}};
my $noexit = $self->{noexit };
# Print menu
for (;;) { | {
"domain": "codereview.stackexchange",
"id": 12219,
"lm_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, perl",
"url": null
} |
-
You have to know that $N(p_i)$ is divisible by $p_i$, but otherwise this looks fine. Michalis's answer is very similar, in that his $|a_0|$ can be made to be equal to $|N(p_1\dots p_n)|$... – Thomas Andrews Jun 27 '13 at 17:08
@Thomas Andrews: I have shown at the end that $N(p_i)=p\lambda =p_i\lambda$ – pritam Jun 27 '13 at 17:13
I don't see you proving that $p_i|N(p_i)$, only asserting it. "Now if $p=p_i$, then $\left<p\right>|\left<N(p_i)\right>...$. – Thomas Andrews Jun 27 '13 at 17:17
@Thomas Andrews: I have used a theorem which says every ideal divides it's norm. – pritam Jun 27 '13 at 17:22
@pritam: For "$\beta$ has an irreducible factor", you need the Noetherianness of this ring (which Dedekind domains in fact have), am I right? – Tomas Jun 28 '13 at 16:40
If the extension over $\mathbb Q$ is galois, then we can show that there are in fact infinitely many irreducible integers in $\mathbb Z$. Of course this does not answer the question, hence is in community wiki. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985936373783223,
"lm_q1q2_score": 0.8216050215239673,
"lm_q2_score": 0.8333245870332531,
"openwebmath_perplexity": 149.67532872485847,
"openwebmath_score": 0.9555509686470032,
"tags": null,
"url": "http://math.stackexchange.com/questions/430921/is-the-number-of-irreducibles-in-any-number-field-infinite"
} |
statistical-mechanics, temperature, entropy, definition
Then define temperature as the derivative of "maximum entropy" w.r.t. energy:
$$\frac 1 T = \frac {\partial H(V)}{\partial E}$$
Is this a correct general way to define temperature? If you use the average energy $E = \sum p_i E_i$ of the canonical ensemble as independent variable, yes, your final formula is a correct way to get the temperature of that state, although your notation and description may hide the important fact that the maximum is a constrained maximum, equivalent to the unconstrained maximization of a function differing from $H$ by the sum of the constraint equations multiplied by Lagrange multipliers.
The equation $\frac 1 T = \frac {\partial H(V)}{\partial E}$ is simply the thermodynamic definition of temperature in term of entropy and energy and it follows directly from the identification of $H$ as the thermodynamic entropy (true in the thermodynamic limit). | {
"domain": "physics.stackexchange",
"id": 66284,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, temperature, entropy, definition",
"url": null
} |
algorithm, sorting, salesforce-apex
It feels a little verbose considering the task. Perhaps I'm too used to using mordern manipulation/querying technologies like LINQ.
Is there a less verbose way of doing this in Apex?
Some useful syntax would be something like the following, though I'm sure it doesn't exist (ignoring the lambda, it's there for readability):
emailTemplates.OrderBy((x,y) => AreTemplatesInOrder(x,y)); For a less verbose way to achieve this in Apex you need to create a wrapper class for EmailTemplate that implements Comparable interface. The advantage is that elements don't need to be manually moved in the array.
public static EmailTemplate[] orderEmailTemplates(List<EmailTemplate> emailTemplates) {
EmailTemplateWrapper[] wrappers = new List<EmailTemplateWrapper>();
for(EmailTemplate template : emailTemplates) {
wrappers.add(new EmailTemplateWrapper(template));
}
wrappers.sort(); | {
"domain": "codereview.stackexchange",
"id": 43630,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, sorting, salesforce-apex",
"url": null
} |
beginner, haskell, music
instance PitchClass a => Num (PitchWrapper a) where
(PitchWrapper a) + (PitchWrapper b) = a +: b
... and do on
deriving via (PitchWrapper NoteName) instance Num NoteName
deriving via (PitchWrapper Solfege) instance Num Solfege
deriving via (PitchWrapper Interval) instance Num Interval
That said, even though this is possible, I must warn you that it is not a good idea.
This is a very common pattern that I see in newcomers (including myself): overload all the things, declare operators for everything, make everything as short as possible. The language makes it possible, so let's run wild with it.
Never works out well in practice. If you follow this pattern, you usually end up with spaghetti code that nobody can understand without looking up every single character.
I would even argue that in this case it doesn't make sense. Look: notes do not actually constitute a ring. You don't add two notes together to get another note. You add intervals to notes, but not notes to each other. | {
"domain": "codereview.stackexchange",
"id": 35510,
"lm_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, music",
"url": null
} |
the rise by the symbol % '' or simply as percent '' or as. Characteristics under instrumentation Calculating percentages can be an easy task grade of a slope provide two. The gradient 1 represents the decimal value of the percentages together to get the value. You calculate the percentage slope Engineering News Engineering Videos Engineering Calculators How to calculate CGPA '' or .... Engineering Videos Engineering Calculators How to calculate Engineering progress, percentage 1 represents the decimal value the... Calculate CGPA per meter square by the symbol % '' or pct. and... In all by the symbol % '' or pct. 1... Together to get the third value to get one value the SGPI is the weighted average the! Sgpi is the weighted average of the grade points obtained in all \ ) percentage Elongation.! Elongation Example as a percentage is a number or ratio that represents a fraction of 100 to calculate?... Following procedure to calculate Engineering progress, percentage Change Calculator add | {
"domain": "raimokoski.fi",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9591542852576265,
"lm_q1q2_score": 0.8227319588897162,
"lm_q2_score": 0.8577681104440172,
"openwebmath_perplexity": 1717.7497795570532,
"openwebmath_score": 0.8258670568466187,
"tags": null,
"url": "http://raimokoski.fi/501351q/2cef99-how-to-calculate-percentage-in-engineering"
} |
or is the apparent purpose an illusion?. Distance Formula - Displaying top 8 worksheets found for this concept. We refer the reader to the TIMES module Proportion (Years 9-10). Travelmath provides an online travel distance calculator to help you measure both flying distances and driving distances. 152 – 147 million km. If you go 30 miles per hour for 1 hour, you will go 30 miles. You can measure the length of a vertical or horizontal line on a coordinate plane by simply counting coordinates; however, measuring the length of a diagonal line is trickier. Vincenty’s formula is accurate to within 0. Mathematics Instructional Plan - Geometry Virginia Department of Education ©2018 3 Deriving the Distance Formula Name Date 1. Which implies → Speed = Distance / Time and. Equation of the y-axis is x=0 5. Using Calculus To Derive The Freefall Formula. A metric is a function that behaves according to a specific set of rules, and is a way of describing what it means for elements of some space to | {
"domain": "ecbu.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743647666859,
"lm_q1q2_score": 0.8169381918464674,
"lm_q2_score": 0.8244619306896955,
"openwebmath_perplexity": 582.4466964757214,
"openwebmath_score": 0.719685971736908,
"tags": null,
"url": "http://oayd.ecbu.pw/distance-formula-maths.html"
} |
ros, synchronization, ros-kinetic, time
}
Not Working code.
ros::Publisher data1_pub;
ros::Publisher data2_pub;
void callback(const sensor_msgs::PointCloud2::ConstPtr& data1, const sensor_msgs::PointCloud2::ConstPtr& data2)
{
ROS_INFO("Sync_Callback");
data1_pub.publish(data1);
data2_pub.publish(data2);
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "TimeSynchronizer");
std::string data1_topic = "/velodyne_points";
std::string data2_topic = "/chatter";
ros::NodeHandle nh;
message_filters::Subscriber<sensor_msgs::PointCloud2> data1_sub(nh, data1_topic, 1000);
message_filters::Subscriber<sensor_msgs::PointCloud2> data2_sub(nh, data2_topic, 1000);
data1_pub = nh.advertise<sensor_msgs::PointCloud2>("/synchronized" + data1_topic, 1000);
data2_pub = nh.advertise<sensor_msgs::PointCloud2>("/synchronized" + data2_topic, 1000);
TimeSynchronizer<PointCloud2, PointCloud2> sync(data1_sub, data2_sub,10);
sync.registerCallback(boost::bind(&callback, _1, _2)); | {
"domain": "robotics.stackexchange",
"id": 31855,
"lm_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, synchronization, ros-kinetic, time",
"url": null
} |
tiny-tim
Hi stripes!
Looks ok to me.
As a double-check, using standard trigonometric identities …
sinx/(1 + cosx) = tan(x/2), so dy/dx = 1/2 sec2(x/2) = 1/(1 + cosx).
4. Feb 1, 2010
stripes
basically, on my graphing calculator i put y1 as my original function, then y2 as the derivative that I found. I then used the calculator to find dy/dx of y1 for me at various points (maybe 1, 2, and 3), then I used the calculator to find the values of x = 1, 2, and 3 for y2 and the respective values should be the same...but they weren't!
I'm almost certain i was error free inputting the functions...I did it over and over and over!
5. Feb 1, 2010
Staff: Mentor
Might be a dumb question, but was your calculator in radian mode? | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754508600391,
"lm_q1q2_score": 0.8288408642346944,
"lm_q2_score": 0.8418256452674008,
"openwebmath_perplexity": 878.1822084216243,
"openwebmath_score": 0.892973005771637,
"tags": null,
"url": "https://www.physicsforums.com/threads/differentiation-of-a-trig-function-using-quotient-rule.374327/"
} |
python, file
Title: Find out all the different files from two different paths efficiently in Windows (with Python) Well, recently I'm working on a program which is able to sync files between different folders.
However, as a fresh man, the algorithm I worte seems feasible, but looks really disgusting, and inefficient as well (bruh~)
The following lines are the related things I wrote,
I really hope there would be experts who can help me improve my code
def scan_items(folder_path): # 扫描路径下所有文件夹
def scan_folders_in(f_path): # 扫描目录下所有的文件夹,并返回路径列表
surf_items = os.scandir(f_path)
folders = [f_path]
for item_data in surf_items:
if item_data.is_dir():
folders.extend(scan_folders_in(item_data.path)) # 继续遍历文件夹内文件夹,直到记下全部文件夹路径
folders = sorted(set(folders)) # 排序 + 排除重复项
surf_items.close()
return folders | {
"domain": "codereview.stackexchange",
"id": 44858,
"lm_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, file",
"url": null
} |
ros, openni, ubuntu, ros-fuerte, ubuntu-precise
Title: openni ros-fuerte ubuntu 12.04 anyone?
Hi all.
I have posted a couple of questions already considering execution of
roslaunch openni_launch openni.launch
in ubuntu 12.04 under ros fuerte. It produces plenty of errors, that you may find in threads: this and this
Though, now I'm not asking to dig into anything.
I would really like to know if there actually are any people who are able to use the command provided above in ros fuerte under ubuntu 12.04 or alike?
Thanks. Waiting for your responses.
Originally posted by niosus on ROS Answers with karma: 386 on 2012-06-23
Post score: 3
Em, as far as I know this bug was fixed. I am able to get the ASUS Kinect to work on my laptop with Ubuntu 12.04 and fuerte on it.
Originally posted by niosus with karma: 386 on 2012-07-01
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 9917,
"lm_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, openni, ubuntu, ros-fuerte, ubuntu-precise",
"url": null
} |
c#, design-patterns, collections, repository
interface IQuestionAnswerRepository
{
IEnumerable<QuestionAnswer> GetCorrectAnswers(IEnumerable<Question> questions);
}
interface IQuestionRepository
{
IEnumerable<Question> GetQuestions();
} | {
"domain": "codereview.stackexchange",
"id": 33265,
"lm_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, collections, repository",
"url": null
} |
algorithms, graphs, randomness, software-testing
The model of Watts and Strogatz is somewhat popular, but does have certain drawbacks. Walsh [2] investigates the effects of randomization and restart strategies in graphs generated using the model. There's also a paper by Virtanen [3], which covers other models motivated by the need of realistic modeling of complex systems.
Random simple planar graphs
Generating random simple planar graphs on $n$ vertices uniformly at random can be done efficiently. The number of planar graphs with $n$ vertices, $g_n$, can be determined using generating functions. The value of $g_n$ for $1 \leq n \leq 9$ is $1,2,8,64,1023,32071,1823707,163947848$ and $20402420291$, respectively. Since the numbers are too complicated, one is not expected to find a closed formula for them. Giménez and Noy [4] give a precise asymptotic estimate for the growth of $g_n$:
$$g_n \sim g \cdot n^{-7/2} \gamma^n n!,$$ | {
"domain": "cs.stackexchange",
"id": 388,
"lm_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, randomness, software-testing",
"url": null
} |
ros
twist:
twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
--- | {
"domain": "robotics.stackexchange",
"id": 10981,
"lm_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
} |
time-complexity, data-structures, asymptotics
(Assume the usual model, e.g. comparing two individual items for equality is $O(1)$.)
The completely naive approach would be to check the entire stack for any repeated subsequences after each push, and undo the push and fail if one is found. Each check, and thus push, appears to be $O(n^3)$ in the current size of the stack, worst-case.
We can do somewhat better by instead noting that the stack can never actually include any repeated substrings (as you cannot introduce a repeated substring by popping from a stack, and pushes that would introduce a repeated substring instead fail), and so a push only needs to check potential repeats that include the top of stack. This gets us down to $O(n^2)$ in the size of the stack per push.
Some (terrible) Python pseudocode for this approach, to illustrate (again: this code is just to illustrate. Please don't focus on the exact code.)
def push(s, x):
s.append(x)
for i in range(1, len(s)//2 + 1):
# this comparison is _not_ O(1) time. | {
"domain": "cs.stackexchange",
"id": 20433,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "time-complexity, data-structures, asymptotics",
"url": null
} |
visible-light, electromagnetic-radiation, astrophysics, thermal-radiation, sun
past some missiles communicated to ground via radio frequencies. It was determined to be important that antenna was not facing the sun due to interference from suns radio waves. So at least above the atmosphere the small intensifies of radio waves was enough to cause interference. I can't disclose the applicable wave bands. | {
"domain": "physics.stackexchange",
"id": 41276,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, electromagnetic-radiation, astrophysics, thermal-radiation, sun",
"url": null
} |
json, f#
becomes
sprintf "{\"X\": \"%i\", \"Y\": \"%i\", \"values\":[%s]}" (bitmap.Width.ToString() ) (bitmap.Width.ToString() ) results | {
"domain": "codereview.stackexchange",
"id": 18682,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "json, f#",
"url": null
} |
optimization, sets
I've implemented this approach and it works well on small cases, but as each $|A_i|$ increases, $|R|$ increases exponentially and won't fit in machine memory. The issue is that I am generating the entire set $R$ whereas I only need a single element of $R$. A followup would be finding the elements $x_k$ that result in the top $k$ values of $f(x_k)$, in which case generating the entire set $R$ allows it to be ranked for any value $k$.
The most recent research I found on sparse polynomial multiplication is Roche's What Can (and Can’t) we Do with Sparse Polynomials? (2018) [2], which continues from Johnson's work and notes that there hasn't been any significant change in this problem since the idea of using a heap.
[1]: http://www.cecm.sfu.ca/~mmonagan/teaching/TopicsinCA11/johnson.pdf
[2]: https://arxiv.org/pdf/1807.08289.pdf Unless you have some further structure to the problem (i.e., the function) you can't do better than checking all. | {
"domain": "cs.stackexchange",
"id": 18359,
"lm_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, sets",
"url": null
} |
• You seem to be asking for a (not necessarily irreducible) character of $S_{n}$ of degree $(n-1)!$ which vanishes on all non-identity permutations ( in the natural permutation action) which have a fixed point. This character won't be irreducible for $n > 3$. You have demonstrated the existence for $n =4$ and there is such a character (irreducible of degree $2$) when $n = 3$. It seems tricky when $n >4$, but $n=5$ should be easy to check with a computer. – Geoff Robinson Jan 2 '16 at 23:32
• @GeoffRobinson: Just to rephrase your comment, you have observed that my question is equivalent to asking for a representation $V$ of $S_n$ with the property that the restriction of $V$ to $S_{n-1}$ is isomorphic to the regular representation of $S_{n-1}$. – Nicholas Proudfoot Jan 3 '16 at 0:23 | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795118010988,
"lm_q1q2_score": 0.8137270295937412,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 160.42683495143734,
"openwebmath_score": 0.9513641595840454,
"tags": null,
"url": "https://mathoverflow.net/questions/227515/factorization-of-the-regular-representation-of-the-symmetric-group"
} |
performance, algorithm, kotlin
fun symRadius(center: Int, checkedRadius: Int): Int {
var radius = checkedRadius + 1
while (newS.getOrNull(center - radius)?.equals(newS.getOrNull(center + radius)) == true) radius += 1
return radius - 1
}
newS.indices.forEach { center ->
val space = limitInfo.rightMost - center
val checkedRadius = when {
space < 0 -> 0
else -> minOf(radii[limitInfo.center * 2 - center], space)
}
val radius = symRadius(center, checkedRadius)
radii[center] = radius
if (center + radius > limitInfo.rightMost) {
limitInfo.rightMost = center + radius
limitInfo.center = center
}
} | {
"domain": "codereview.stackexchange",
"id": 42020,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, algorithm, kotlin",
"url": null
} |
rospy
def diffDrive(t, y, u):
# Assign some variables for convenience of notation
X = y[0]
Y = y[1]
T = y[2]
V = u[0]
W = u[1]
# Output from ODE function must be a COLUMN vector, with n rows
n = len(y) # 3: implies we have three ODEs
dydt = np.zeros((n,1))
dydt[0] = V * cos(T)
dydt[1] = V * sin(T)
dydt[2] = W
return dydt
def callback(data):
# Start by specifying the integrator:
# use ``vode`` with "backward differentiation formula"
r = integrate.ode(diffDrive).set_integrator('vode', method='bdf')
# Set the time range
t_start = 0.0
delta_t = 0.01
# Set initial condition(s): for integrating variable and time!
X_t_zero = float(rospy.get_param('/x', '0.0'))
Y_t_zero = float(rospy.get_param('/y', '0.0'))
T_t_zero = float(rospy.get_param('/theta', '0.0'))
r.set_initial_value([X_t_zero, Y_t_zero, T_t_zero], t_start)
# Integrate the ODE
r.set_f_params(data.data) | {
"domain": "robotics.stackexchange",
"id": 20727,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rospy",
"url": null
} |
algorithm, c, heap, priority-queue
if (NULL != (heap->minimum_node = first_child))
{
consolidate(heap);
}
unordered_map_t_remove(heap->node_map, min_element);
return min_element;
}
(Open coded tree operations - tell me.) | {
"domain": "codereview.stackexchange",
"id": 18235,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, c, heap, priority-queue",
"url": null
} |
electromagnetism, field-theory, polarization, topological-field-theory, topological-phase
Title: Magnetization and Polarization in an electromagnetic field theory I am currently reading through a paper by Hughes and Ramamurthy (ref: https://arxiv.org/abs/1508.01205), which describes the electromagnetic response of a line-node semimetal by the action
$$S[A,B] = \frac{e}{16 \pi^2}\int d^4x \; \epsilon^{\mu \nu \rho \sigma} B_{\mu \nu} F_{\rho \sigma},$$ where $F_{\rho \sigma} = \partial_\sigma A_\rho - \partial_\rho A_\sigma$ is the usual electromagnetic field, and $B_{\mu \nu}$ is a two-form. At the top of the second page of this paper, the authors go on to say that from the form of the action, you can see that $B_{\mu\nu}$ is related to the magnetization and polarization as
$$e B_{0 i} = 4 \pi^2 M_i$$
and $$e B_{ij} = 4 \pi^2 \epsilon^{ijk} P_k.$$ | {
"domain": "physics.stackexchange",
"id": 75490,
"lm_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, field-theory, polarization, topological-field-theory, topological-phase",
"url": null
} |
which shows that $$f(x, y)$$ is Lipschitz on $$B((x_0, y_0), \epsilon)$$; thus we may invoke the Picard-Lindeloef theorem to affirm that there exists precisely one solution passing through any point in $$B((x_0, y_0), \epsilon)$$; in particular, there is exactly one integral curve $$y(x)$$ of
$$y' = f(x, y) \tag 4$$
with
$$y(x_0) = y_0. \tag 5$$
Thus, "two integral curves could not be tangent to each other at $$(x0,y0)$$" since there is in fact only one integral curve through this point!
Our colleague Christian Blatter has, in his answer, provided some good examples of how uniqueness may fail in the absence of Lipschitz continuity. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109534209826,
"lm_q1q2_score": 0.8227933347082372,
"lm_q2_score": 0.8354835330070839,
"openwebmath_perplexity": 100.332701657481,
"openwebmath_score": 0.9647152423858643,
"tags": null,
"url": "https://math.stackexchange.com/questions/3001543/why-integral-curves-cannot-be-tangent-to-each-other"
} |
quantum-mechanics, hilbert-space, quantum-information, bloch-sphere
The orthogonal directions of space are not Hilbert-orthogonal in the QM treatment, because that’s just not how the physics of this system works. Hilbert-orthogonal states are incommensurate: if you’re in this state, you’re definitely not in that one. But this system has a spin with a definite total magnitude of $\sqrt{\langle L^2 \rangle} = \sqrt{3/4} \hbar$, but only $\hbar/2$ of it points in the direction that it is “most pointed along,” meaning that it must be distributed on some sort of “ring” around that direction. Accordingly, when you measure that it’s in the +z-direction it turns out that it’s also sort-of half in the +x, half in the –x direction. (Here “sort-of” means: it is, if you follow up with an x-measurement, which will “collapse” the system to point → or ← with angular momentum $\hbar/2$ and then it will be in the corresponding “rings” around the x-axis.)
Spherical coordinates from complex numbers | {
"domain": "physics.stackexchange",
"id": 73696,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space, quantum-information, bloch-sphere",
"url": null
} |
signal-detection
This corresponds to a temp of 21.0.
I tried to read each pulse after the first 4 big pulses - that gives 37 bits:
1000111110010010110001100011111111000
Then I tried searching just for the 21 part. So I tried searching for 21, 61, 71 (in case the designer was adding 40 or 50 degrees to avoid negative numbers). I tried searching for the 2 and then the 1 bit shifted by 4. I tried negating all the bits. I tried searching in reverse.
Is it possible this is not pulse width modulation? Is it possible there are not 37 bits here? It is impossible to extract the correct data from this string with only one sample (as is mentioned by Laurent Duval in the comments). Here is something that caught my eye:
Markers
You have these four blocks at the beginning and the end of the signal that are some kind of start/end markers, I suppose. Are you sure that you caught the whole markers?
1000111110010010110001100011111111000 could be split up in the following way:
1000
1111
100100101100011000111 | {
"domain": "dsp.stackexchange",
"id": 3595,
"lm_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-detection",
"url": null
} |
(a) it is just $$\frac{1}{2}\frac{Q^2}{C}$$, so it is 1.944* 10^-4J
(b) The total capacitance in the circut is 6.7uF, so we can find the total voltage by using Q= CV where Q is the total charge from $$C_2$$ or 2.7*10-6 * 12 = 3.24 * 10 ^-5, so the total voltage is $$3.24 * 10^{-5} / 6.7 * 10^-6 = 4.8358 V$$
Then we setup the equation :
$$(2.7{\mu}F)(V_1)+(4{\mu}F)(V_2) = 3.24*10^-5$$ and $$V_1+V_2 = 4.8358$$,
then we calculate the electric energy on each capacitance individually by using $$\frac{1}{2}CV^2$$, and add them together
(c) it is just the difference of (a)-(b)
I am not quite sure if i am right on part (b)
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9372107931567177,
"lm_q1q2_score": 0.815933150151776,
"lm_q2_score": 0.8705972616934406,
"openwebmath_perplexity": 986.915988761446,
"openwebmath_score": 0.6692290902137756,
"tags": null,
"url": "https://www.physicsforums.com/threads/question-about-capacitor.64456/"
} |
c, assembly, virtual-machine
static int32_t GetProgramCounter(TOYVM* vm)
{
return vm->cpu.program_counter;
}
static bool ExecuteAdd(TOYVM* vm)
{
uint8_t source_register_index;
uint8_t target_register_index;
if (!InstructionFitsInMemory(vm, ADD))
{
vm->cpu.status.BAD_ACCESS = 1;
return true;
}
source_register_index = ReadByte(vm, GetProgramCounter(vm) + 1);
target_register_index = ReadByte(vm, GetProgramCounter(vm) + 2);
if (!IsValidRegisterIndex(source_register_index) ||
!IsValidRegisterIndex(target_register_index))
{
vm->cpu.status.INVALID_REGISTER_INDEX = 1;
return true;
}
vm->cpu.registers[target_register_index]
+= vm->cpu.registers[source_register_index];
/* Advance the program counter past this instruction. */
vm->cpu.program_counter += GetInstructionLength(vm, ADD);
return false;
} | {
"domain": "codereview.stackexchange",
"id": 18947,
"lm_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, assembly, virtual-machine",
"url": null
} |
beginner, c, parsing
void myputchar(int a[], int c) {
int i = 0;
while (a[i] != '\0') {
i++;
}
a[i] = c;
} Bugs
When processing an expression like 10/2 or 10*2, the 2 gets discarded from the output.
It looks like you attempted to implement a circular buffer for the output, but it actually fails miserably if the output exceeds 1000 bytes. One problem is performance: myputchar() performs a linear scan of the buffer to find the end of the string, where it can write the next character. A second problem is buffer overflow: myputchar() makes no attempt to ensure that the location where it stores the next character lies within the buffer. The third problem is that when you do if (i > MAXCHAR)i = 0, you haven't made any attempt to print the buffer contents before trying to reuse the buffer.
C grammar
In C, a /* or // that appears within a "string literal" should be treated literally. It should not be interpreted as a start-of-comment marker. | {
"domain": "codereview.stackexchange",
"id": 22202,
"lm_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, c, parsing",
"url": null
} |
hilbert-space, geometry, representation-theory, quantization, observables
Any responses or references are highly appreciated. This answer is a bit late give how long ago the question was asked! However: The Hilbert space has an inner product that is preserved by the operators. Therefore reducibility (existance of an invariant subspace) implies complete reducibility: a reducible space is the orthogonal direct sum of two invariant component subspaces. We can't get from one subspace to the other by using the complete set of operators, and no measurments can (using only the given operators) detect interference between states in the irreducible components. So we may as well keep only one of them. Thus the basic answer is ``convenience''. | {
"domain": "physics.stackexchange",
"id": 37767,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hilbert-space, geometry, representation-theory, quantization, observables",
"url": null
} |
slam, navigation, hector-slam, amcl, hector-mapping
Originally posted by Procópio with karma: 4402 on 2013-08-16
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by gautam2410 on 2013-08-18:
Thank you for your answer...just wanted to confirm if I should exclude the odom frame while setting the frames for this?
Comment by Procópio on 2013-08-18:
you should exclude the odometry frame created by your robot, and use the one provided by hector_slam. you need to make sure the name of the frames match the one expected by other nodes.
Comment by burf2000 on 2017-01-19:
Did you get it working?
Comment by GuillaumeHauss on 2017-04-18:
I would be really happy to discuss your implementation with you, as I'm facing the same challenge right now
Comment by KennyxD on 2020-11-05:
HI! I have been going around the ROS Answers forum trying to figure out how to have my robot car autonomously drive using hector slam. I was wondering if any of you have accomplished this already?
Thanks! | {
"domain": "robotics.stackexchange",
"id": 15278,
"lm_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, hector-slam, amcl, hector-mapping",
"url": null
} |
thermodynamics, entropy, phase-transition
So, in a phase transition of a gas at temperature $T_c$, where $L = \Delta Q_r = T_c(S_f - S_i)$ implies that (1) $\Delta S = \Delta U_{pot} / T_c$.
However, according to the above quote and equation for $S$, I don't understand formula (1). Furthermore, is it right?
Could someone explain me what is missing in my reasoning?
Thanks in advance. Applying the VDW approximation to this phase change at constant temperature, the entropy change would be $$\Delta S=R\ln{\left(\frac{V_V-b}{V_L-b}\right)}$$and the latent heat of vaporization would be $$L=T_c\Delta S=T_c R\ln{\left(\frac{V_V-b}{V_L-b}\right)}$$where $V_V$ and $V_L$ are the specific volumes of the saturated liquid and saturated vapor, respectively, at temperature Tc. The parameter b captures the effects of molecular interactions, just as the parameter a does. | {
"domain": "physics.stackexchange",
"id": 74363,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, entropy, phase-transition",
"url": null
} |
php, random, security
$tests = [
[5, 6, 7],
['a' => 1, 'b' => 2, 'c' => 3],
['zero', 4 => 'four', 9 => 'nine']
];
foreach ($tests as $test) {
echo array_rand_cryptographically_secure($test) . "\n";
}
Alternatively, you can slice and preserve the original keys to avoid doubling the memory cost. (Demo)
function array_rand_cryptographically_secure(array $array): int|string {
$max = count($array) - 1;
if ($max < 0) {
throw new ValueError('Argument #1 ($array) cannot be empty');
}
return key(array_slice($array, random_int(0, $max), 1, true));
}
And finally, the most compact and perhaps hardest to read because of all of the nested function calls: (Demo)
function array_rand_cryptographically_secure(array $array): int|string {
if (!$array) {
throw new ValueError ('Argument #1 ($array) cannot be empty');
}
return key(array_slice($array, random_int(0, count($array) - 1), 1, true));
} | {
"domain": "codereview.stackexchange",
"id": 45357,
"lm_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, random, security",
"url": null
} |
expressions. Trigonometric Limits (17 minutes, SV3 » 45 MB, H. This makes sense because if we are taking the derivative of the integrand with respect to x, it needs to be in either (or both) the limits of integration. The formula that will help us is the tangent: Using a calculator, the value of tan(12) is 0. Although we have considered only transformations of sine and cosine, the same rules apply to all the trigonometric functions. Report Abuse. In this guide, I’ll let you know everything you need to know about trigonometry and radians for the SAT Math test and guide you through some practice problems. Worksheets for MA 113 Algebraic Evaluation of Limits, Trigonometric Limits Worksheet # 7: The Intermediate Value Theorem The Fundamental Theorems of Calculus. Inverse Trigonometric Functions - Trigonometric Equations Dr. This can be viewed as a version of the Pythagorean theorem, and follows from the equation x2 + y2 = 1 for the unit circle. We encourage teachers and other education | {
"domain": "oeey.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419700672151,
"lm_q1q2_score": 0.8344789015634632,
"lm_q2_score": 0.8438951084436077,
"openwebmath_perplexity": 749.2805916628034,
"openwebmath_score": 0.8569939732551575,
"tags": null,
"url": "http://tlpd.oeey.pw/fundamental-trigonometric-limit.html"
} |
java, performance, stream, lambda, fractals
image.setRGB(0, 0, width, height, pixels, 0, width);
return image;
}
/**
* Produce an increasingly bright sequence of colors that spiral out through the colour wheel.
*
* @param maxIndex the number of colors to produce (inclusive)
* @return an array of aRGB values that represent the unique colors.
*/
public static final int[] buildColors(final int maxIndex) {
final float root = (float) Math.sqrt(maxIndex);
return IntStream
.rangeClosed(0, maxIndex)
.map(c -> maxIndex - c)
.mapToObj(
c -> Color
.getHSBColor((c % root) / root, 1.0f, (c / root) / root))
.mapToInt(c -> c.getRGB()).toArray();
} | {
"domain": "codereview.stackexchange",
"id": 15624,
"lm_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, stream, lambda, fractals",
"url": null
} |
navigation, ekf, pioneer-3dx, rosaria, robot-localization
Title: Jiggling tf Tree After fusing Odometry with IMU
I am using ROS NOETIC and Pioneer3DX as the mobile robot which publishes Odometry info into /RosAria/pose topic as nav_msgs/Odometry message.
Phidgets Spatial IMU is being used which published the IMU data to /imu/data_raw and /imu/data (this uses imu_madgwick filter to get the orientation data) topics as sensor_msgs/imu.
This is my launch file:
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_odom_node" output="screen" >
<param name="frequency" value="10"/>
<param name="sensor_timeout" value="0.1"/>
<param name="publish_tf" value="true"/>
<param name="two_d_mode" value="true"/>
<remap from="odometry/filtered" to="odom/ekf/enc_imu"/>
<!-- <param name="map_frame" value="map"/> -->
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<param name="world_frame" value="odom"/>
<param name="transform_time_offset" value="0.0"/> | {
"domain": "robotics.stackexchange",
"id": 38131,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ekf, pioneer-3dx, rosaria, robot-localization",
"url": null
} |
You can build several "essentially" different cantor sets, some have Lebesgue measure 0, some have positive measure. For instance, take the unit interval, remove the "middle fifth" (take a linear function to the interval $[0, 5]$ and remove the preimage of the open $(2,3)$). On step 2, remove the "middle twenty-fifth" of each of the two remaining intervals, etc. At the end you will get a nowhere dense closed set with no isolated points (so, a Cantor set), but its measure will be strictly positive.
The standard Cantor is cbuild by removing one third of each interval at each step, and yes, it relates to the '1' digit in the ternary expansion of the number.
First question: typically the Cantor set is the middle third Cantor set, while a Cantor set can be any of a number of similar sets, including variants that have positive measure. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446502128796,
"lm_q1q2_score": 0.8459285509134113,
"lm_q2_score": 0.8688267847293731,
"openwebmath_perplexity": 206.13464532535045,
"openwebmath_score": 0.8491752743721008,
"tags": null,
"url": "https://math.stackexchange.com/questions/1033173/why-is-the-middle-third-cantor-set-written-as-this"
} |
# The series $\sum_{n=1}^\infty a_n$ converges absolutely, does the series $\sum_{n=1}^\infty a_{n_k}$ converge?
If the series $\sum_{n=1}^\infty a_n$ converges absolutely
and $a_{n_k}$ is sub sequence of $a_n$
does the series $\sum_{n=1}^\infty a_{n_k}$ also always converge ?
Since I failed to found any counter-example, and the only connection between absolutely convergence of $\sum_{n=1}^\infty a_n$ and convergence of $\sum_{n=1}^\infty a_{n_k}$ in my textbook is this theorem: the series $\sum_{n=1}^\infty a_n$ converges absolutely iif the series of positive and negative members of $a_n$ converges, I concluded that my proof must be somehow connected to this theorem.
In this stage I arrived to the dead-end.
Could you please give me some hint how to deal with this question ?
Thanks. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777179025415,
"lm_q1q2_score": 0.8113174686921516,
"lm_q2_score": 0.8221891283434877,
"openwebmath_perplexity": 157.0236497361564,
"openwebmath_score": 0.940181314945221,
"tags": null,
"url": "https://math.stackexchange.com/questions/587873/the-series-sum-n-1-infty-a-n-converges-absolutely-does-the-series-sum"
} |
@MaX It is not quite so simple, and to elaborate would be a whole answer unto itself. In your original problem, there was only one way a student could get too many prizes (namely, he received all the prizes). In your new version, there are many ways a student can receive too many gifts and also many students can simultaneously receive too many gifts. If you are interested, you might post your new version as it's own question. – Austin Mohr Nov 7 '11 at 0:43 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357597935574,
"lm_q1q2_score": 0.8158545844048744,
"lm_q2_score": 0.8333246015211008,
"openwebmath_perplexity": 493.8370155467521,
"openwebmath_score": 0.7199772000312805,
"tags": null,
"url": "http://math.stackexchange.com/questions/79672/how-to-distribute-k-prizes-in-p-student-with-each-student-would-receive-k"
} |
You're right, in general $$f$$ is not determined by its derivatives at one single point. Functions satisfying this condition are called analytic. But not all smooth functions are analytic, for example
$$x\mapsto\left\{\begin{array}{c}e^{-\frac{1}{x^2}}, x>0\\0, x\leq 0\end{array}\right.$$ is a smooth function and the derivatives at zero are all zero, hence the Taylor series developed at zero does not determine the function.
Furthermore the exact statement of Taylor's theorem is quite different from what you said. It is as follows:
If $$f\in C^{k+1}(\mathbb{R})$$, then $$f(x)=\sum_{n=0}^k f^{(n)}(a)(x-a)^n\frac{1}{n!} + f^{(k+1)}(\xi)\frac{1}{(k+1)!}(x-a)^{k+1}$$
If you now take $$k\rightarrow\infty$$ it is in general not clear, that this error term converges to zero. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138170582865,
"lm_q1q2_score": 0.8038656774062762,
"lm_q2_score": 0.822189134878876,
"openwebmath_perplexity": 261.77182920690467,
"openwebmath_score": 0.8931723833084106,
"tags": null,
"url": "https://math.stackexchange.com/questions/3435144/doubt-about-taylor-series-do-successive-derivatives-on-a-point-determine-the-wh/3435157"
} |
c++, serialization, constrained-templates, c++23
And if all the above doesn’t scare you out of this idea, this next point should: IF there is something… anything… any incompatibility introduced by a difference in platform, compiler, settings, the phase of the moon, whatever… NOTHING will save you. There is no practical way to guarantee that any data serialized out can be de-serialized back in correctly. You will not be saved by the type system. You will not be saved by any clever programming; even the best-designed and -written types are vulnerable. You will not be given any warnings or errors or any indication of trouble. Your program will simply do something unexpected. THAT should terrify you. | {
"domain": "codereview.stackexchange",
"id": 45477,
"lm_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++, serialization, constrained-templates, c++23",
"url": null
} |
measurements, yield-point, strength
The problem is, to achieve any real accuracy, both 1 and 2 above would involve 10's of manual iterations per assessment.
Besides buying or hiring a rheometer, are there any practical alternatives? Determining the yield point for aluminium alloys can be difficult as it is not as well defined as steel and the stress/strain curve tends to gradually peel away from the straight elastic line rather than there being a distinct cut-off.
For a low tech experiment ultimate tensile strength is easier to measure as you are more likely to observe an obvious failure rather than interpolating from a graph.
Similarly using a cantilever loading setup (i.e. bending it with a mass hung off one end) is a bit easier to arrange and should make the failure point a bit more obvious. This makes it more difficult to derive actual numbers for stress but it will certainly make direct comparison easier, especially if you have a known 'good' sample to compare it to. | {
"domain": "engineering.stackexchange",
"id": 830,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "measurements, yield-point, strength",
"url": null
} |
algorithms, optimization, combinatorics, assignment-problem
For a layman's example, consider this -
A restaurant serves n customers (agents), and has on it's menu m
possible dishes (tasks), with m > n. Each customer gives his
preference for each of the m dishes, which is the cost for this
particular assignment problem. Find a solution which minimizes cost
i.e. which gives each customer a dish that is as high on their
preference as possible.
Additionally, each dish belong to a certain cuisine (category). The
restaurant can only make a certain number of dishes per cuisine.
Enforce this constraint on the problem above.
I understand that this is a very specific problem, but any help would be appreciated.
I am currently solving the first part of the problem using the Hungarian Algorithm for assignment. Introduce dummy variables with zero cost so that it becomes a balanced assignment, which can be solved with Hungarian Algorithm. | {
"domain": "cs.stackexchange",
"id": 16806,
"lm_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, optimization, combinatorics, assignment-problem",
"url": null
} |
python, python-3.x, reinventing-the-wheel, computational-geometry
wrapper.__wrapped__ = func
return wrapper
if __name__ == "__main__":
import doctest
logging.setLevel(logging.INFO)
logging.info("Running doctests")
doctest.testmod(report=True) doctests
Kudos for the doctests, they are very helpful.
Doctests are documentation I can believe!
They do not bit rot (since failing tests are quickly noticed).
doctest.testmod(optionflags=doctest.ELLIPSIS)
Example::
>>> class A(int, metaclass=TypeEnforcerMetaclass, enforce_all=True, exclude={"real"}):
... def __repr__(self):
... return f"A({super().real})"
I do worry a little about unintended ... matching.
The doctests are very nice, but they're no substitute for a
test suite.
The two tools have different audiences.
Doctests are short, non-comprehensive, and must be understood by newbies.
A test suite can be long, boring, and explore a tediously large number
of odd corner cases. | {
"domain": "codereview.stackexchange",
"id": 44966,
"lm_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, reinventing-the-wheel, computational-geometry",
"url": null
} |
ros, gazebo7, ros-kinetic
setting /run_id to edc35106-14e8-11e9-85ef-f816547d9e84
process[rosout-1]: started with pid [24704]
started core service [/rosout]
process[gazebo-2]: started with pid [24728]
process[gazebo_gui-3]: started with pid [24733]
process[spawn_sdf-4]: started with pid [24738]
process[spawn_objects-5]: started with pid [24739]
process[urdf_spawner-6]: started with pid [24740]
process[camera_link_broadcaster-7]: started with pid [24741]
process[base_footprint_broadcaster-8]: started with pid [24742]
process[joint_state_publisher-9]: started with pid [24761]
process[robot_state_publisher-10]: started with pid [24769]
process[lucrezio_controller_spawner-11]: started with pid [24774]
[ INFO] [1547132627.937226771]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1547132627.939418337]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1547132627.982693599]: Finished loading Gazebo ROS API Plugin. | {
"domain": "robotics.stackexchange",
"id": 32253,
"lm_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, gazebo7, ros-kinetic",
"url": null
} |
c#, asp.net, asp.net-web-api, xamarin
// todo
}
else
{
var responseMessage = JsonConvert.DeserializeAnonymousType(response.Content, new { Message = "" });
if (responseMessage.Message == "InvalidUsernameAndPasswordPair")
{
// todo: show "invalid user/password" error
}
else
{
// todo: show other nicely worded error
}
}
}); Handling exceptions within the action is a cross-cutting concern that can be extracted and placed into one of the available extensiblity points. This will greatly reduce the repeated exception handling in all controller actions.
Reference Global Error Handling in ASP.NET Web API 2
Exception handlers are the solution for customizing all possible responses to unhandled exceptions caught by Web API. | {
"domain": "codereview.stackexchange",
"id": 30657,
"lm_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#, asp.net, asp.net-web-api, xamarin",
"url": null
} |
As $$n$$ gets bigger, $$\ln(n+1)$$ goes to infinity, so the sequence of partial sums $$s_n$$ must also go to infinity, so the harmonic series diverges.
The important fact that clinches this example is that $$\lim_{n\to\infty} \int_1^{n+1} {1\over x}\,dx = \infty,$$ which we can rewrite as $$\int_1^\infty {1\over x}\,dx = \infty.$$ So these two examples taken together indicate that we can prove that a series converges or prove that it diverges with a single calculation of an improper integral. This is known as the integral test, which we state as a theorem.
Theorem 11.3.3: The Integral Test
Suppose that $$f(x)>0$$ and is decreasing on the infinite interval $$[k,\infty)$$ (for some $$k\ge1$$) and that $$a_n=f(n)$$. Then the series
$\sum_{n=1}^\infty a_n$
converges if and only if the improper integral
$\int_{1}^\infty f(x)\,dx$
converges. | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474894743615,
"lm_q1q2_score": 0.8018452735649039,
"lm_q2_score": 0.8104789086703225,
"openwebmath_perplexity": 142.5877800567257,
"openwebmath_score": 0.9697608947753906,
"tags": null,
"url": "https://math.libretexts.org/Bookshelves/Calculus/Book%3A_Calculus_(Guichard)/11%3A_Sequences_and_Series/11.04%3A_The_Integral_Test"
} |
neural-network
[Another example, since that might have been too wordy. Say the output in the third row is
$$\vec{x}=\langle 0, 0.01, 0.99, 0.01, 0, 0.01, 0.01, 0.01, 0, 0.01\rangle.$$
Then
$$W\vec{x} = \langle 0.05, 1.02, 0.03, 0.01\rangle.$$
You can see how I've cooked up $\vec{x}$ to get the largest possible first entry in $W\vec{x}$ given the constraints on $\vec{x}$.] | {
"domain": "datascience.stackexchange",
"id": 5504,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network",
"url": null
} |
be attributed to the fact that the biomedical signals like ECG can be generated by the nonlinear dynamical systems [12]. 7, the number of points in the phase portrait when a = 2. MATLAB offers several plotting routines. The state of a system can be described by its state variables$x^1(t), x^2(t), ,x^d(t)$, for example the both state variables temperature and pressure for a thermodynamic system. Concept of phase plane analysis. Use powerfull linear and nonlinear least squares curve fitting methods to find a least squares fit to your data. Consider the following planar dynamical system: x0 = −y −x(x2 +y2) y0 = 2x−y(x2 +y2). To draw a phase portrait you will need more than just one solution. The phase portrait with some trajectories is drawn in Figure 8. Introduction to singular perturbation methods Nonlinear oscillations. Non‐linear systems can have multiple equilibrium points. Introduction Phase Plane Qualitative Behavior of Linear Systems Local Behavior of Nonlinear Systems How to | {
"domain": "colagrossijeans.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713891776498,
"lm_q1q2_score": 0.8273658508922132,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 567.4945903919495,
"openwebmath_score": 0.6094440817832947,
"tags": null,
"url": "http://colagrossijeans.it/kzgz/phase-portrait-nonlinear-system.html"
} |
quantum-mechanics, operators, wavefunction, eigenvalue
Title: Finding eigenfunctions using ladder operators Using $L_1\pm iL_2$ as raising and lowering operators I need to obtain an expression for $Y_{l,l}(\theta,\phi)$ and after this I need to find $Y_{l,m}(\theta,\phi)$ for $(l,m)=(1,1),(1,0),(1,-1),(2,2),(2,1)$ and $(2,0)$ The hint says that $Y_{l,l}(\theta,\phi)$, $Y_{1,1}(\theta,\phi)$, $Y_{2,2}(\theta,\phi)$ should be easy to find as they are in the kernel of $L_+$ and are eigenfunctions of $L_3$. I think I know how to 'lower' these to find the rest but I am struggling to find these. I got the stage where I have $Y_{l,m}(\theta,\phi) = P_{l,m}(\theta)e^{im\phi}$ and I'm not sure where to go from here, or if this is even correct! Any help will be appreciated! Let $\langle \theta ,\varphi \vert lm\rangle =Y_{l}^{m}(\theta ,\varphi )$, and consider
\begin{eqnarray}
\hat{L}_{-} &=&\hat{L}_{x}-i\hat{L}_{y} \\
&=&i\hbar \left( \sin \varphi \frac{\partial }{\partial \theta }+\cos | {
"domain": "physics.stackexchange",
"id": 45318,
"lm_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, operators, wavefunction, eigenvalue",
"url": null
} |
c, interpreter, brainfuck
==2965== total heap usage: 556 allocs, 554 frees, 18,328 bytes allocated
==2965==
==2965== 32 bytes in 1 blocks are definitely lost in loss record 1 of 2
==2965== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2965== by 0x4007C6: newnode (list.c:6)
==2965== by 0x400820: append (list.c:14)
==2965== by 0x400A6A: main (main.c:27)
==2965==
==2965== 32 bytes in 1 blocks are definitely lost in loss record 2 of 2
==2965== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2965== by 0x4007C6: newnode (list.c:6)
==2965== by 0x400D3A: link (op.c:67)
==2965== by 0x400A92: main (main.c:32)
==2965==
==2965== LEAK SUMMARY:
==2965== definitely lost: 64 bytes in 2 blocks
==2965== indirectly lost: 0 bytes in 0 blocks
==2965== possibly lost: 0 bytes in 0 blocks
==2965== still reachable: 0 bytes in 0 blocks
==2965== suppressed: 0 bytes in 0 blocks
==2965== | {
"domain": "codereview.stackexchange",
"id": 14223,
"lm_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, interpreter, brainfuck",
"url": null
} |
safety, elements
However since my research suggests that PTFE alone is capable of storing Iodine, is this a viable option? I would love to know from past experiences, because no-one seems to recommend PTFE on its own on any site I checked. Of course however I will also be storing said PTFE container inside of another non-reactive material container.
I understand that I'm probably better off just storing it in glass containers but I have PTFE bottles lying around and would like to use them if at all possible.
Since this question revolves around the Halogens themselves, could the same be potentially done for Bromine and Chlorine? Though PTFE is not attacked by the halogens, they may discolor PTFE (particularly iodine, and at elevated temperature), since the plastic is somewhat permeable to halogens (end even to water). | {
"domain": "chemistry.stackexchange",
"id": 7167,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "safety, elements",
"url": null
} |
Thanks @feersum for 1 byte saved
### Bonus: Trees!
I wrote a quick-and-dirty program to see what these trees look like. Here's some of the results:
6:
5 4
| |
1 2 3
\|/
0
8:
5
|
7 3 6
| \ /
1 2 4
'--\|/--'
0
13:
08
|
11 05 10 09 07
| \ / | |
02 03 04 06 12
'-----\ /---'--'
01
|
00
19:
12
|
07 14
\ /
05 15 11
\ / |
17 04 08 16 13 10
| '-\ /--' | |
02 03 06 09 18
'---------\ |/-----'--'--'
01
|
00
49: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.974042642048694,
"lm_q1q2_score": 0.8219898153041802,
"lm_q2_score": 0.8438951025545426,
"openwebmath_perplexity": 1918.9092626203023,
"openwebmath_score": 0.3173518180847168,
"tags": null,
"url": "https://codegolf.stackexchange.com/questions/90437/score-tarzans-olympic-vine-swinging-routine/220227"
} |
PARTS, that allows us to integrate many products of functions of x. If that's the case, you won't be able to take the integral of the natural log on. x x loga 2. (In the next Lesson, we will see that e is approximately 2. log (z) is multivalued, but a holomorphic principal branch Log(z) can be chosen for complex numbers expcept the negative reals. Introduction One of the main differences between differentiation and integration is that, in differentiation the rules are clear-cut. For example general formulae are. What we need to do is add together the formulas for the derivatives of the secant and tangent functions. Logarithmic differentiation. Γ (z): gamma function, π: the ratio of the circumference of a circle to its diameter, d x: differential of x, e: base of natural logarithm, ∫: integral, arctan z: arctangent function, Ln z: general logarithm function, ln z: principal branch of logarithm function and z: complex variable A&S Ref: 6. The Area Under a Curve. The notation is | {
"domain": "rafbis.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992988205448513,
"lm_q1q2_score": 0.8047959925287891,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 868.1644793955845,
"openwebmath_score": 0.8654050230979919,
"tags": null,
"url": "http://rafbis.it/mzkl/integration-of-logarithmic-functions-pdf.html"
} |
python, object-oriented, design-patterns, flask, strategy-pattern
Here's Entity_posgres.py
from .Model_postgres import PostgresModel
class Entity(db.Model):
__tablename__ = 'entities'
id = db.Column(db.Integer, primary_key=True)
label = db.Column(db.String(), nullable=False)
Since there are a number of methods that should all be handled "the postgres way" for any object, I'm bundling these into a class called PostgresModel. (A mimilar class would be defined for Mongo, doing this "the mongo way", but for sake of brevity I'll only show postgres).
# from .ModelABC import ModelABC
from ..extensions import postgres_db as db | {
"domain": "codereview.stackexchange",
"id": 40596,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented, design-patterns, flask, strategy-pattern",
"url": null
} |
5
You could view it as a form of One-Time-Pad encryption. In this view one of the two "messages" is the key and the other is the ciphertext (it does not matter which you think of as which as their roles are symmetric). It may, however, be more natural to think of as a simple secret sharing scheme. Roughly speaking a secret sharing scheme is a scheme where a ...
4
Is the Kurihara algorithm really what it purports to be (dramatically faster but equally secure replacement for Shamir Secret Sharing)? The algorithm being referred to is in this paper, and I believe that the speed benefits are at best marginal, if not nonexistent. As for the speed benefits being marginal, well, normally we use secret sharing as a part of ...
4 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147153749275,
"lm_q1q2_score": 0.8103371052030661,
"lm_q2_score": 0.8333246015211008,
"openwebmath_perplexity": 496.5863624196404,
"openwebmath_score": 0.6547276973724365,
"tags": null,
"url": "http://crypto.stackexchange.com/tags/secret-sharing/hot?filter=year"
} |
localization, computer-vision, kalman-filter
1) Start in area with bad measurements (high R), get P1
2) Move to area with good measurements (low R)
3) Move back to first area (high R), get P2
And you expect P2 < P1, correct?
Generally speaking, yes, at some level you can think P2 should be less than P1. But the devil is in the details: over time the filter will reach a steady state so given the same state, Q, and R it will converge to the same value regardless of how you got there. If are able to instantaneously jump between the bad and good measurement regions you should initially see P2 | {
"domain": "robotics.stackexchange",
"id": 1510,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "localization, computer-vision, kalman-filter",
"url": null
} |
transform, hilbert-transform
Title: Hilbert transform of sinusoid -- apparent contradiction The arrow "$\xrightarrow{\mathcal H}$" denotes a Hilbert transform:
$$\cos(\omega t)\xrightarrow{\mathcal H} \sin(\omega t)$$
happiness.
But
$$\cos(\omega t) = \cos(-\omega t) \xrightarrow{\mathcal H} \sin(-\omega t) = -\sin(\omega t)$$ | {
"domain": "dsp.stackexchange",
"id": 5828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "transform, hilbert-transform",
"url": null
} |
The point on circle $A$ closest to the center of circle $B$ is $(\frac{11}{2},0)$. The point on circle B closest to the center of circle $A$ is $(\frac{11}{2},0)$.
Taking a look back at the 3-dimensional coordinate grid with the spheres, we can see that their intersection appears to be a circle with congruent "dome" shapes on either end. Because the tops of the "domes" are at $(0,0,\frac{9}{2})$ and $(0,0,\frac{11}{2})$, respectively, the lattice points inside the area of intersection must have z-value $5$ (because $5$ is the only integer between $\frac{9}{2}$ and $\frac{11}{2}$). Thus, the lattice points in the area of intersection must all be on the 2-dimensional circle. The radius of the circle will be the distance from the z-axis. | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526430876969,
"lm_q1q2_score": 0.8103411118115389,
"lm_q2_score": 0.8175744850834648,
"openwebmath_perplexity": 150.6808483736082,
"openwebmath_score": 0.9333610534667969,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php/1996_AHSME_Problems/Problem_27"
} |
$$(2k+1)^4-1 = 2k(2k+2)(4k^2+4k+2) = 2^4 \binom{k+1}{2}(2k^2+2k+1) \in 16\mathbb{Z}.$$
Here's a stupid way to do this question. $G = (\mathbb{Z}/16\mathbb{Z})^{\ast}$ is a group with $\varphi(16) = 2^4 - 2^3 = 8$ elements. The order of any element of $G$ is either $1, 2, 4$ or $8$ by Lagrange's theorem. So the only way the thing you are trying to prove could be false is if $G$ were cyclic.
If $G$ were cyclic, there would exist elements of order $8$. By a standard result about cyclic groups, number of such elements would be $\varphi(8) = 2^3 - 2^2 = 4$. This should leave exactly four elements with order $1, 2$ or $4$. You get a contradiction by checking that what you want to prove is true for at least five elements:
$$1^1 \equiv 1 \pmod{16}$$
$$3^4 = 81 \equiv 1$$
$$5^4 = 625 = 39\cdot 16 + 1 \equiv 1$$
$$13^4 \equiv (-3)^4 \equiv 1$$
$$15^2 \equiv (-1)^2 \equiv 1$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147193720649,
"lm_q1q2_score": 0.8103371045087802,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 143.17814997712466,
"openwebmath_score": 0.7755591869354248,
"tags": null,
"url": "https://math.stackexchange.com/questions/1854662/show-that-the-fourth-power-of-every-odd-integer-is-of-the-form-16k1"
} |
than a dual Taylor series, a Taylor series and an The Taylor expansion can serve as the basic for your initial approximation, and the final terms should be pretty close to the Taylor coefficients. But it's just that, a curve. , Kmenta’s original result). Expand f(x) = 1. 1} 3 8. However, if you try step size h = 0. such as [4], a rational approximation was used for tangent, but more recently in the design for the Intel IA-64 [5], the cheap hardware multiply and add instructions were preferred . Rather than stop at a linear function as an approximation, we let the degree of our approximation increase (provided the necessary derivatives exist), until we have an approximation of the form Example: Given the function!"= 1 (20"−10) Write the Taylor approximation of degree 2 about point "*=0 found Given the function: FG) = 120 X-LO write the Taylor approximation of degree 2 about to = o Feb 06, 2013 · Homework Statement obtain the number r = √15 -3 as an approximation to the nonzero root of | {
"domain": "immoplus24.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.988841966778967,
"lm_q1q2_score": 0.8385061097586799,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 649.3671631794019,
"openwebmath_score": 0.8625760078430176,
"tags": null,
"url": "http://immoplus24.de/tcl-roku/taylor-cubic-approximation-formula.html"
} |
slam, navigation, ros-fuerte, slam-gmapping, gmapping
==7329==
==7329==
==7329== Process terminating with default action of signal 11 (SIGSEGV)
==7329== Access not within mapped region at address 0xBDFFBC98
==7329== at 0x8062AC8: main (main.cpp:26)
==7329== If you believe this happened as a result of a stack
==7329== overflow in your program's main thread (unlikely but
==7329== possible), you can try to increase the size of the
==7329== main thread stack using the --main-stacksize= flag.
==7329== The main thread stack size used in this run was 8388608.
==7329==
==7329== Process terminating with default action of signal 11 (SIGSEGV)
==7329== Access not within mapped region at address 0xBDFFBC8C
==7329== at 0x402242C: _vgnU_freeres (vg_preloaded.c:58)
==7329== If you believe this happened as a result of a stack
==7329== overflow in your program's main thread (unlikely but
==7329== possible), you can try to increase the size of the
==7329== main thread stack using the --main-stacksize= flag. | {
"domain": "robotics.stackexchange",
"id": 12225,
"lm_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, ros-fuerte, slam-gmapping, gmapping",
"url": null
} |
c, primes
//Function prototypes
void initial_marking(long int[]);
void marking(long int[]);
void make_prime_list(long int[],long int[]);
void print_prime(long int[]);
int main()
{
//Half of the numbers from 1 to target will be even so the number of primes will never exceed target/2.
//The algorithm only worries about the first half of the range. That's why list also goes till target/2.
long list[target/2], primes[target/2];
//Sieve of Sundaram
initial_marking(list);
//Crossing out all numbers of the form i + j + 2ij
marking(list);
//Making the list of primes
make_prime_list(primes, list);
//Displaying the list
print_primes(primes);
return 0;
}
//Initially, everything is marked 1
void initial_marking(long int list[])
{
int i;
for(i = 1; i <= target/2; i++)
{
list[i] = 1;
}
}
//Crossing out numbers of the form i + j + 2ij
void marking(long int list[])
{
int i, j, crossed_out_num; | {
"domain": "codereview.stackexchange",
"id": 24250,
"lm_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, primes",
"url": null
} |
cosmology, beyond-the-standard-model, fine-tuning, baryogenesis, leptogenesis
Note: I know there are other arguments for it and I understand them. But I'm particularly interested in understanding these numbers as mentioned in this review (second paragraph, page 4). The calculation is actually reasonably simple. Most of the photons in the Universe are CMB photons, and the number density of CMB photons has been measured to exquisite accuracy. There are about $N_\gamma = 4.11\times10^8\,{\rm m}^{-3}$. The mass density of baryons has also been measured, both "directly" via elemental abundances and the Big Bang nucleosynthesis model, and "indirectly" from CMB analysis. It is $\Omega_{\rm b}\approx0.02$, where $\Omega_{\rm b}$ is the density in units of the critical density for closure $\rho_{\rm crit}=137.6\,{\rm M}_\odot\,{\rm kpc}^3$. I'll spare you all the unit conversion; under sensible assumptions for the composition of the baryons in the Universe, you get an average number density of about $N_{\rm bar} = 0.11\,{\rm m}^{-3}$. Taking the ratio of the two number | {
"domain": "physics.stackexchange",
"id": 36830,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, beyond-the-standard-model, fine-tuning, baryogenesis, leptogenesis",
"url": null
} |
quantum-field-theory, experimental-physics, renormalization, quantum-chromodynamics
fix $\mu_F$ and $\mu_R$ all at a supposedly physically meaningful value, for example the one in your question for a particle of transverse momentum $p_T$;
find the values of $\mu_F$ and $\mu_R$ which minimise the observable.
The idea behind the last point is that such a minimum is the point where the observable will vary the least with those scales, and since we know theoretically that they should not vary with them, this is a good as it gets.
Eventually, there is no ideal solution but at least the following three prescriptions shall be strictly followed: | {
"domain": "physics.stackexchange",
"id": 44079,
"lm_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, experimental-physics, renormalization, quantum-chromodynamics",
"url": null
} |
to add, subtract, multiply and divide complex numbers in polar form is presented. Another way of writing the polar form of the number is using it’s exponential form: me^(ia) . But however youset your calculator to display results, you can alwaysenter expressions inrectangular form,polar formor amixture. Calculator The polar form of complex numbers - calculation: 10L60. Where: 2. Calculation Complex Numbers Calculator evaluates expressions with complex numbers and presents the result in rectangular and polar forms. This calculator extracts the square root, calculate the modulus, finds inverse, finds conjugate and transform complex number to polar form. The idea is to find the modulus r and the argument θ of the complex number such that, z = a + i b = r ( cos(θ) + i sin(θ) ) , Polar formz = a + ib = r eiθ , Exponential formwith r = √ (a2 + b2) and tan(θ) = b / a , such that -π < θ ≤ π or -180° < θ ≤ 180°. Get the free "Convert Complex Numbers to Polar Form" widget for your website, blog, | {
"domain": "com.br",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813463747181,
"lm_q1q2_score": 0.8305821848206507,
"lm_q2_score": 0.8688267694452331,
"openwebmath_perplexity": 776.9305106613202,
"openwebmath_score": 0.8601990342140198,
"tags": null,
"url": "http://diagramma.com.br/amish-oak-vlnacm/ec2dee-complex-number-to-polar-form-calculator"
} |
python, console, iteration
Using yield, as you've shown, is one approach. Ensure you are familiar with Python's implementation of yield and iterables and generators, since several languages share the yield keyword superficially but have subtle implementation differences that might surprise you if, for example, you're used to C#'s yield. Here's a reference on that -- it's subtle but worth reading. Essentially, in Python when your function yields, it returns a generator which can be usefully assigned to a variable, capturing iteration to that point, but you may or may not want to do that.
So there is fundamentally nothing wrong with using yield for this job. It carries the big advantage of separating pure computing from progress IO. | {
"domain": "codereview.stackexchange",
"id": 21920,
"lm_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, console, iteration",
"url": null
} |
machine-learning, deep-learning, recommender-system
Title: How is the cross-product transformation defined for binary features? I am reading the paper on Wide & Deep learning and for the wide component, it states that one of the most important transformations is the cross-product transformation. This is defined as follows:
$$\phi_{k}(\mathbf{x})=\prod_{i=1}^{d} x_{i}^{c_{k i}} \quad c_{k i} \in\{0,1\}$$
Then, the authors argue that for binary features, a cross-product transformation (e.g., “AND(gender=female, language=en)”) is 1 if and only if the constituent features (“gender=female” and “language=en”) are all 1, and 0 otherwise.
But how does this relate to the given formula? And how can I think of the cross-product transformation in general? Let's do this in the opposite order of how you asked. i.e. first:
How can I think of the cross-product transformation in general? | {
"domain": "datascience.stackexchange",
"id": 5830,
"lm_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, recommender-system",
"url": null
} |
-
Thanks for the help. Really appreciated – First Feb 17 '13 at 15:20
@First: You’re welcome. – Brian M. Scott Feb 18 '13 at 2:59
Really not an interesting question - also seems that you haven't tried much on it. Is this homework? Anyway:
Part a is obvious.
Part b means that $a_{3,2} = 0$ or $a_{2,1} = 0$ (i.e. person $3$ cannot send a message to $1$ in two steps through person $2$).
Part c is clear: just multiply to get $(A^2)_{3,1} = a_{3,1}a_{1,1} + \ldots + a_{3,6} a_{6,1}.$ Use part b.
Part d - again, just multiply. Part e is an easy generalization.
Part f - $a_{i,j} = 0$ means $j$ cannot receive a message from $i$ in one step. Simply look for a column of all $0$'s.
Part g, use part e. Part h, it tells you how to do. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.990440601781584,
"lm_q1q2_score": 0.8188089310479402,
"lm_q2_score": 0.8267117983401363,
"openwebmath_perplexity": 237.8507156448271,
"openwebmath_score": 0.6853565573692322,
"tags": null,
"url": "http://math.stackexchange.com/questions/305869/a-multiple-part-question-about-interpreting-powers-of-the-adjacency-matrix-of-a"
} |
ros, catkin, ros-hydro, rosbuild, tutorials
Title: Cannot build rosbuild workspace on top of catkin workspace in Hydro
Hi everyone,
I don't know why, but I cannot get my catkin/rosbuild workspace setup to work in ROS Hydro. I have done everything the same way as I have done in Groovy, but when I source setup.bash from my Hydro rosbuild_ws I find that my $ROS_PACKAGE_PATH contains only the native ROS folders.
I appreciate any attempts to help me debug this issue, as I have gone as far as looking deeply into the auto-generated files that are sourced to find any differences that might lead to this behavior... The workspace files are essentially the same, so I am led to believe that the issue is with the native setup files.
As a reference, I am following these ROS tutorials:
Creating a catkin workspace
Using rosbuild with catkin
ROS Groovy
georgebrindeiro@r2d2:~$ echo $ROS_PACKAGE_PATH
/home/georgebrindeiro/workspaces/groovy/catkin_ws/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks | {
"domain": "robotics.stackexchange",
"id": 15550,
"lm_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, catkin, ros-hydro, rosbuild, tutorials",
"url": null
} |
mechanical-engineering, finite-element-method, dynamics, experimental-physics, unit
Third part
kg and kgf units are not consistent units on the paper, but looks equal on non scientific conversations. For example someone can say this chair mass is 10kg or it's weight is 10kgf, both refers to same chair with same mass and weight. so if we conventionally assume: 1 kgf = 1 kg, eq1 and eq2 can be combined like this:
$$
kgf/mm^3 = 0.01 \ kN / mm^3 = 93.53 \ lbf \ sec^2 / in^4
$$
(Note: base on comments, 1 kgf equals 9.8 N, but we assumed 1 kgf = 10 N
Final part
so
$$
1.0 \ kN / mm^3 = 9353.0 \ lbf \ sec^2 / in^4
$$
or
$$
1.0 \ lbf \ sec^2 / in^4 = (0.00010691) \ kN / mm^3
$$
Which are the answers
Notes
I am not sure about the assumption of 1 kgf = 1 kg in third part, but the rest should not have problem. Anyways this answer could be considered as a suggestion. | {
"domain": "engineering.stackexchange",
"id": 3221,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, finite-element-method, dynamics, experimental-physics, unit",
"url": null
} |
homework-and-exercises, thermodynamics
Title: Why is $C = C_v + \frac{P}{n}\left(\frac{dV}{dT}\right)$? I found this equation for the molar heat capacity of a process as $C = C_v + \frac{P}{n}\left(\frac{dV}{dT}\right)$. I cannot find such an equation anywhere else. What sort of process is this equation applicable for? I know that for a polytropic process $C = \frac{R}{γ-1} + \frac{R}{1-n}$. Is there some sort of relation between these two equations? For an arbitrary reversible process on a closed system (involving only P-V work), you have (from the first law of thermodynamics) $dU=nC_vdT=dQ-PdV$. So, solving for dQ, you have | {
"domain": "physics.stackexchange",
"id": 47852,
"lm_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, thermodynamics",
"url": null
} |
/180+2 25! Rounding with significant figures and decimals a ) write down, in terms of r and,... Little tricky like a slice of pizza or pie uses notesheets and examples explain. The above given data in the previous function ; ( i.e. subtended at the center the. Called the central angle regions known as a Major sector and a Minor sector question. Two radii and an arc is 16 cm π / 360 ) the length the! Circle 's circumference bounded by the arc is called a sector of circle for following... Further divided into two regions known as a Major sector and a by substituting the above given data the. Problem 6: Find the radius and angle of the rectangle if area! 5-A-Day and much more area of the sector is this fraction multiplied by the area! Calculate the area of the sector is 30 and length of arc, if the perimeter of sector a! In metric units or imperial units substituting the above given data in the previous function ; (.! Is enclosed between its two radii and an arc is called a sector a | {
"domain": "com.sg",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232924970204,
"lm_q1q2_score": 0.803531232001321,
"lm_q2_score": 0.8175744695262777,
"openwebmath_perplexity": 668.6882350224975,
"openwebmath_score": 0.8849388957023621,
"tags": null,
"url": "http://www.ibase.com.sg/h6c214y/perimeter-of-sector-984510"
} |
mechanical-engineering, fluid-mechanics, thermodynamics
I'm assuming I should use a positive-displacement pump. Please let me know if this is a bad idea for some reason. You can use a water pump to evaporate water. But you shouldn't.
The evaporation chamber needs to be closed, except for the suction pipe. Otherwise when you lower pressure water (or air) will flow in, raising pressure again. So you can create small batches of vapor.
The water will evaporate where pressure is lowest, this is likely to be your pump inlet. Not what you want. You need to make sure that the ambient pressure in the evaporation chamber is lower than vapor pressure at whatever temeprature your water has. At the same time, ambient pressure + hydraulic head between level in chamber and pump inlet needs to be higher by a margin, else you have evaporation in your pump. Not good. | {
"domain": "engineering.stackexchange",
"id": 807,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, fluid-mechanics, thermodynamics",
"url": null
} |
It turns out to be conceptually more natural to replace sets by functions, and to consider the more general the task of estimating sifted sums
$\displaystyle \sum_{n \in {\bf Z}} a_n 1_{n \not \in \bigcup_{p | P} E_p} \ \ \ \ \ (1)$
for some finitely supported sequence ${(a_n)_{n \in {\bf Z}}}$ of non-negative numbers; the previous combinatorial sifting problem then corresponds to the indicator function case ${a_n=1_{n \in A}}$. (One could also use other index sets here than the integers ${{\bf Z}}$ if desired; for much of sieve theory the index set and its subsets ${E_p}$ are treated as abstract sets, so the exact arithmetic structure of these sets is not of primary importance.)
Continuing with twin primes as a running example, we thus have the following sample sieving problem: | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9905874104123901,
"lm_q1q2_score": 0.8075590360644194,
"lm_q2_score": 0.8152324848629214,
"openwebmath_perplexity": 4622.61496713103,
"openwebmath_score": 1.0000090599060059,
"tags": null,
"url": "https://terrytao.wordpress.com/category/mathematics/mathnt/page/2/"
} |
# Math Help - Complex numbers
1. ## Complex numbers
I am trying to solve this set of problems, any ideas:
Let 1, omega, omega squared, ....., omega^n-1 be nth rooots of unity
then
(a) Show the conjugate of any nth root of unity is another root of unity, by expressing omega(bar)^j in the form omega^k for appropriate k.
(b) Find the product of the nth roots of unity
(c) Find the sum Summation (n-1), k=0 for omega^k of nth roots of unity. (this is a geometric series).
2. Originally Posted by PacManisAlive
I am trying to solve this set of problems, any ideas: | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754449762781,
"lm_q1q2_score": 0.802657899802537,
"lm_q2_score": 0.8152324983301568,
"openwebmath_perplexity": 1451.5474598577289,
"openwebmath_score": 0.9241009950637817,
"tags": null,
"url": "http://mathhelpforum.com/advanced-algebra/16478-complex-numbers.html"
} |
mechanical-engineering, turbomachinery, jet
Title: What gives gas turbine/turbojet engines such high energy density? What is the cause of turbojets'/gas turbines' high power to weight ratio compared to piston engines? They certainly use a generally less efficient thermodynamic cycle. Turbojets and turbofans support extremely large mass flow rates of air & fuel through them, relative to their weight. (The majority of the work performed by burning that fuel is taken up by running the compressor stage of the engine and what's left over generates thrust.) In comparison, piston engines cannot support similar fuel burn rates relative to their weight. | {
"domain": "engineering.stackexchange",
"id": 3229,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, turbomachinery, jet",
"url": null
} |
We derive the formula for surface area in much the same way that we derived the formula for arc length. So, take a curve in the plane $y=f(x)$, and for simplicity assume that the curve exists in the first quadrant over the interval $[a,b]$. Begin by slicing the interval into subinterval of length $\Delta{x}$ and on each subinterval we will approximate the lentgh of the function by summing the straight lines. Then Rotate! That's it. The rotation genterates a bunch of surface areas of frustrums and the formula for the surface of a frustrum is $A_f=2\pi{r}l$ where $r$ is the average radius of the left hand radius and the right hand radius, or $r=\frac{1}{2}(r_1+r_2)$.
For the frustrum on the interval $[x_{i-1},x_i]$ we have $r_1=f(x_i)$ and $r_2=f(x_{i-1})$.
Now the length of the ith line segment is given by $\sqrt{1+[f'(x)]^2}\Delta{x}$. This can be derived and I can do it if you like. So, we have | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474875898352,
"lm_q1q2_score": 0.8265835322768792,
"lm_q2_score": 0.8354835309589073,
"openwebmath_perplexity": 162.30447663136638,
"openwebmath_score": 0.9409863948822021,
"tags": null,
"url": "http://mathhelpforum.com/calculus/170660-relationship-between-surface-area-curve-circle-s-circumference.html"
} |
differential-geometry, metric-tensor, differentiation
When people "derive" metric compatibility from parallel transport, they are taking as an axiom "parallel transport [which depends only on the covariant derivative] is compatible with inner products [which depend only on the metric]." It is the same as just saying $\nabla_\rho g_{\mu\nu} = 0$, but more complicated. Better would be to assume $\nabla_\rho g_{\mu\nu} = 0$ from the start and prove that this means parallel transport preserves inner products. | {
"domain": "physics.stackexchange",
"id": 22739,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differential-geometry, metric-tensor, differentiation",
"url": null
} |
quantum-mechanics, waves, particle-physics, wave-particle-duality
Can someone do something similarly clear and specific with wave and particle? The concepts "particle" and "wave" started from classical physics and from the everyday use of the terms, to begin with. A particle of dust got into one's eye, and the sea had huge waves.
Physics came into its reign when mathematics was seriously used to model observations.
For classical physics "particle" means an entity with small mass and a center of mass tracked at coordinates (x,y,z) at time t. Solutions of kinematic differential equations described the trajectory with accuracy determined by experimental errors. | {
"domain": "physics.stackexchange",
"id": 93651,
"lm_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, waves, particle-physics, wave-particle-duality",
"url": null
} |
c, linux, device-driver
/* MTU range: 46 - 1500 */
dev->min_mtu = STMFRM_MIN_MTU;
dev->max_mtu = STMFRM_MAX_MTU;
}
static const struct of_device_id stm32_match[] = {
{
.compatible = "st,stm32_usart_net",
},
{}
};
MODULE_DEVICE_TABLE(of, stm32_match);
static int stm_uart_probe(struct serdev_device *serdev)
{
struct net_device *stmuart_dev = alloc_etherdev(sizeof(struct stmuart));
struct stmuart *stm;
const char *mac;
//u32 speed = 10000000u;
u32 speed = 3000000u;
int ret;
if (!stmuart_dev)
return -ENOMEM;
stmuart_netdev_setup(stmuart_dev);
SET_NETDEV_DEV(stmuart_dev, &serdev->dev);
stm = netdev_priv(stmuart_dev);
if (!stm) {
pr_err("qca_uart: Fail to retrieve private structure\n");
ret = -ENOMEM;
goto free;
}
stm->net_dev = stmuart_dev;
stm->serdev = serdev;
qcafrm_fsm_init_uart(&stm->frm_handle);
spin_lock_init(&stm->lock);
INIT_WORK(&stm->tx_work, stmuart_transmit); | {
"domain": "codereview.stackexchange",
"id": 41657,
"lm_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, linux, device-driver",
"url": null
} |
attemptmg to compl ete the square x + using the k from the right hand Side. Mathai and others published Quadratic Forms in Random Variables: Theory and Applications | Find, read and cite all the research you need on ResearchGate. An integer mis represented by quadratic form fif. It should be included in the collection of any. Example 1 : Write the following quadratic function in factored form. VERTEX FORM OF A QUADRATIC FUNCTION f(x) = a(x – h)2 + k where h and k are real numbers and (h, k) is the vertex Example: 2Convert y = x + 12x + 32 into vertex form, and state the vertex. edu/math/documents/BiCoMathColloquiumJonathanHanke091514. January 24, 2020 I. Standard Form: f x ax bx c( )= ++2. Quadratic Formula noob quad form: quadform2003. y x The graph of a quadratic function is a parabola. 1 Quadratic forms on the unit sphere In this section we deduce some properties of quadratic forms restricted to subsets of the unit sphere. quadratic (not comparable) square-shaped (mathematics) of a | {
"domain": "movieartstudio.pl",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303413461358,
"lm_q1q2_score": 0.8373394857135875,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 772.4601184543953,
"openwebmath_score": 0.5368044376373291,
"tags": null,
"url": "http://miy.movieartstudio.pl/"
} |
geology, sedimentology, geoengineering
Laboratory measurements of permeability involve passing a gas or fluid through a sample and measuring the pressure drop across the sample and the rate of flow. The characteristics of the gas or fluid are used to back calculate permeability from the measured hydraulic conductivity. Gas or fluid characteristics do influence testing - and a range of empirical corrections would be applied to account for these) (https://petrowiki.spe.org/Corrections_to_core_measurements_of_permeability) | {
"domain": "earthscience.stackexchange",
"id": 2222,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geology, sedimentology, geoengineering",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.