text stringlengths 1 1.11k | source dict |
|---|---|
ros, eigen, eigen3
Title: Eigen3 Error When Installing ROS on Raspi3 Jessie
Hello,
I keep running into this issue when trying to install ROS Kinetic on my Raspberry Pi 3. Followed a few forums with this as the problem but the CMakeLists.txt was already updated with the answers that I found and still I am running into this error. Any help would be greatly appreciated. Pretty new with ROS and coding in general so some detailed steps on how to solve this would be great!
CMake Error at CMakeLists.txt:8 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake | {
"domain": "robotics.stackexchange",
"id": 26940,
"lm_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, eigen, eigen3",
"url": null
} |
# Kinetic energy question
1. Dec 10, 2013
### hey123a
1. The problem statement, all variables and given/known data
A sled of mass m is coasting on the icy surface of a frozen river. While it is passing under a bridge, a package of equal mass m is dropped straight down and lands on the sled (without causing any damage). The sled plus the added load then continue along the original line of motion. How does the kinetic energy of the (sled + load) compare with the original kinetic energy of the sled? A) It is 1/4 the original kinetic energy of the sled. B) It is 1/2 the original kinetic energy of the sled. C) It is 3/4 the original kinetic energy of the sled. D) It is the same as the original kinetic energy of the sled. E) It is twice the original kinetic energy of the sled.
2. Relevant equations
3. The attempt at a solution
kinetic energy intial = 1/2mv^2
kinetic energy after = 1/2(2m)v^2 = mv^2 | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347886752162,
"lm_q1q2_score": 0.8533973200288125,
"lm_q2_score": 0.8757869997529962,
"openwebmath_perplexity": 1554.7669742616115,
"openwebmath_score": 0.5071092844009399,
"tags": null,
"url": "https://www.physicsforums.com/threads/kinetic-energy-question.727741/"
} |
Your approach appears to be that of applying definitions and equations.
That's not how I would construct an integral - but you know your course.
The bounded region is the positive part of the parabola with a wedge-thing cut out of it.
For 1 - shell method check.
$x=y$ intersects $x=2-y^2$ at (x,y)=(1,1)
$x=2-y^2$ intersects $y=0$ at (x,y)=(2,0)
so 0<y<1 and 0<x<2.
a shell radius $y$, thickness $dy$ and height $h(y)$ has volume $dV=2\pi y h(y) dy$
$h=x_2-x_1$ is bounded above by $x_2=2-y^2$ and below by $x_1=y$
$\Rightarrow h(y) = 2-y^2 - y$
so the volume is $$V=2\pi \int_0^1 y(2-y^2-y)\; dy$$
Looks like what you have ... notice how I have more detail about how I got things. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126522424477,
"lm_q1q2_score": 0.8218582606412921,
"lm_q2_score": 0.83973396967765,
"openwebmath_perplexity": 747.7210790194716,
"openwebmath_score": 0.7224465012550354,
"tags": null,
"url": "https://www.physicsforums.com/threads/volume-integral.694272/"
} |
causality, complex-numbers, dispersion, analyticity
Title: Analyticity in the upper half plane and causality Can you, please, help me to understand the following
How is the analyticity of a complex-valued function in the upper half plane related to causality and Kramers-Kronig relations? Namely, why is it not the lower half-plane?
Does it imply that the poles of the response function have to be in the lower half plane or at the real axis to fulfill causality? | {
"domain": "physics.stackexchange",
"id": 95983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "causality, complex-numbers, dispersion, analyticity",
"url": null
} |
c#, object-oriented
}
private void kill(int x, int y)
{
myArray[x, y].age = 0;
myArray[x, y].fishType = fishTypeEnum.empty;
myArray[x, y].cellColor = Color.Blue;
myArray[x, y].moved = false;
}
private void hunt(int x, int y)
{
Random rnd = new Random();
int direction = 0;
int newX = x;
int newY = y;
bool moved = false;
//Check for Fish nearby
direction = fishNearBy(x, y, sharkScent);
Debug.WriteLine("direction: " + direction); | {
"domain": "codereview.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": "c#, object-oriented",
"url": null
} |
python, python-3.x
Title: Checking unique words and their abbreviations In an attempt to solve a problem on Leetcode, I used dictionary and sets to have O(1) time complexity.
However, my speed is too slow, better than just the 5% of Python submissions.
Here is my code:
from typing import List
class ValidWordAbbr:
def __init__(self, dictionary: List[str]):
self.dictionary = dictionary
self.dictionary_abbn = {}
self.abbn_set = set()
for key in self.dictionary:
if len(key) <= 2:
self.dictionary_abbn[key] = key
continue
abbn = '{}{}{}'.format(key[0], len(key)-2, key[-1])
self.dictionary_abbn[key] = abbn
self.abbn_set.add(abbn) | {
"domain": "codereview.stackexchange",
"id": 38837,
"lm_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",
"url": null
} |
newtonian-mechanics, statistical-mechanics, virial-theorem, fluctuation-dissipation
To add more context, my interest is in finding estimations of the fluctuations of center of mass momentum in systems such as classic particles forming liquid or gas and confined between walls (i.e exchanging momentum with the boundaries). This is asked in more detail here Fluctuations of the center of mass of a confined fluid? I will only consider the initial question about formula (3). Let $w_N(x_1,\ldots,x_N)$ be the $N$-particle probability density function of the Gibbs distribution. The explicit form of this function is not relevant for this discussion. We only need to use its symmetry property: the function $w_N$ does not change under any permutations of the coordinates of pairs of particles $x_i \leftrightarrow x_j$. Let us also define the number density $\rho(x_1)$ and the pair density $\rho(x_1,x_2)$ as follows
$$
\rho(x_1) = N\int dx_2\ldots dx_N\ w_N(x_1,x_2,\ldots,x_N),
$$
$$
\rho(x_1,x_2) = N(N-1)\int dx_3\ldots dx_N\ w_N(x_1,x_2,\ldots,x_N).
$$ | {
"domain": "physics.stackexchange",
"id": 98203,
"lm_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, statistical-mechanics, virial-theorem, fluctuation-dissipation",
"url": null
} |
ros, compressed-image-transport
Title: compressed_image_transport segmentation fault
On Ubuntu, I wrote a simple subscriber and display with cv::imshow. It works with raw image, but if I set the image_transport param to "compressed" it immediately gives segmentation fault. I am guessing that it has something to do with cvbridge::toCvShare not decoding the compressed image correctly or somehow not compatible with opencv. Is there a fix? Thank you.
gbd response:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff79a036c in cv::imdecode(cv::_InputArray const&, int) ()
from /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4
(gdb) | {
"domain": "robotics.stackexchange",
"id": 24012,
"lm_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, compressed-image-transport",
"url": null
} |
electromagnetism, special-relativity, charge
In the unprimed inertial frame $\,S\,$ let a finite 3-volume $\,V$. We find the charge $\,Q_{_V}(t)\,$ contained in $\,V\,$ at a given instant $\,t\,$ by integration of the lhs of equation \eqref{eq01}
\begin{equation}
Q_{_V}(t)=\iiint\limits_{V}\rho\left(\mathbf{x},t\right)\mathrm dx_1\mathrm dx_2\mathrm dx_3\,, \quad \mathbf{x}=\left(x_1,x_2,x_3\right)
\tag{02}\label{eq02}
\end{equation}
On a same way in the primed inertial frame $\,S'\,$ let a finite 3-volume $\,V'$. We find the charge $\,Q'_{_{V'}}(t')\,$ contained in $\,V'\,$ at a given instant $\,t'\,$ by integration of the rhs of equation \eqref{eq01}
\begin{equation}
Q'_{_{V'}}(t')=\iiint\limits_{V'}\rho'\left(\mathbf{x}',t'\right)\mathrm dx'_1\mathrm dx'_2\mathrm dx'_3\,, \quad \mathbf{x}'=\left(x'_1,x'_2,x'_3\right)
\tag{03}\label{eq03}
\end{equation}
Now let the inertial system $\:\mathrm S'\:$ be translated with respect to the inertial system $\:\mathrm S\:$ with constant velocity
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 52313,
"lm_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, special-relativity, charge",
"url": null
} |
atomic-physics, gauge-theory, synthetic-gauge-fields
For example, the number of particles on each site
\begin{equation}
n_{m,n} = a_{m,n}^\dagger a_{m,n}
\end{equation}
The number of particles is gauge invariant (as you can check from the rules and physically has to be the case since the number of particles is observable).
Both Powell et al and Kennedy et all find it convenient to work in a gauge where the phases only depend on one lattice direction, so
\begin{equation}
\phi_{(m,n),(m',n')} \rightarrow \phi_{m,m'}
\end{equation}
This is a very nice gauge for what they want to do. In particular, the translations in the $y$ direction commute with the Wilson line operators, but translations in $x$ do not. Their basic point is that all gauge fixings will force translation invariance to be broken somehow, so full translation invariance is not a real symmetry of the system. | {
"domain": "physics.stackexchange",
"id": 43933,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "atomic-physics, gauge-theory, synthetic-gauge-fields",
"url": null
} |
fluid-mechanics
Title: The differential height of the manometer and the force needed to hold the container in place are to be determined A cylindrical container equipped with a manometer is inverted and pressed into water. The differential height of the manometer and the force needed to hold the container in place are to be determined
Since pression in $A$ is the same as pression in $B$ i got
But since i cant find the value of $d$ i am unable to solve the rest of the exercice. Any suggestions? Assume the tank is weightless, then
$F = 20\gamma_w A$
$20\gamma_w = \gamma_{mf}h$,
$SG = \dfrac{\gamma_{mf}}{\gamma_w} = 2.1$
Note the tank is pressurized internally by the floating bottom lid "A". | {
"domain": "engineering.stackexchange",
"id": 4318,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-mechanics",
"url": null
} |
-
You were faster (+1) – Ron Gordon Apr 11 '13 at 15:38
@RonGordon: Yeah, typing latex can be a pain :-) It is so much easier to write it out by hand. – Aryabhata Apr 11 '13 at 15:39
@Aryabhata Nicely done, +1. I was writing a proof with the monotone convergence theorem instead (the sequence of integrands is nondecreasing). But we don't need an almost duplicate answer. – julien Apr 11 '13 at 15:45
@julien: Thanks! Yes, that works too. – Aryabhata Apr 11 '13 at 15:48
@Aryabhata, Nice answer. Dominated Convergence theorem is a new idea for me. I will learn it. +1. – boywholived Apr 11 '13 at 15:50 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308768564867,
"lm_q1q2_score": 0.8255670780933116,
"lm_q2_score": 0.8354835350552603,
"openwebmath_perplexity": 383.78605656306274,
"openwebmath_score": 0.9886910915374756,
"tags": null,
"url": "http://math.stackexchange.com/questions/358405/evaluating-lim-limits-n-to-infty-left-n-int-0-frac-pi-2-1-sqrt"
} |
homework-and-exercises, quantum-field-theory, harmonic-oscillator
Now, you can find $\langle\alpha |X| \alpha \rangle$, $\langle\alpha |P| \alpha \rangle$, $\langle\alpha |X^2| \alpha \rangle$, $\langle\alpha |P^2| \alpha \rangle$. (you have already written expressions of $X$ and $P$ in terms of $a$ and $a^\dagger$).
What are the expectation values of $\Delta X$ and $\Delta P$ in terms of these quantities? | {
"domain": "physics.stackexchange",
"id": 69323,
"lm_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, quantum-field-theory, harmonic-oscillator",
"url": null
} |
botany, pigmentation, light
Mølgaard P. 1989. Temperature Relations of Yellow and White Flowered Papaver radicatum in North Greenland. Arctic and Alpine Research 21: 83–90.
Tsukaya H. 2002. Optical and anatomical characteristics of bracts from the Chinese “glasshouse” plant, Rheum alexandrae Batalin (Polygonaceae), in Yunnan, China. J Plant Res 115: 59–63. | {
"domain": "biology.stackexchange",
"id": 1152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "botany, pigmentation, light",
"url": null
} |
But you were interested in very short distances:
Here we can see the effect of small height changes. In particular, for your 6 foot scenario, you can see
$$S(6 \text{ feet}) = 50.04 \%$$ of the sky from purely geometric considerations. Hardly an improvement over the $50\%$ visible if you were against a wall, and we can't expect this to contribute anything appreciable in light of optical effects like refraction or the effect of a nonuniform horizon. But, given the nature of the square root dependence, this sky viewing function grows rather rapidly over modest height differences:
Here I've plotted the semilog plot against the $x$ axis. For instance, at the cruising altitude of a commercial plane (~ 38,000 ft), you can see 53% of the sky, a whole 3% more than on the ground from purely geometric considerations. This we could hope to notice over optical effects. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9884918499186287,
"lm_q1q2_score": 0.8058506670759098,
"lm_q2_score": 0.8152324848629215,
"openwebmath_perplexity": 360.9634743612383,
"openwebmath_score": 0.7526221871376038,
"tags": null,
"url": "https://physics.stackexchange.com/questions/129317/how-much-of-the-sky-is-visible-from-a-particular-location"
} |
python, calculator
def __eq__(self, op):
return self._prec == op._prec
def __repr__(self):
return repr(self._op)
def __str__(self):
return str(self._op)
class Calculator(object):
operators = {
'+' : Operator(operator.add, 1),
'-' : Operator(operator.sub, 1),
'*' : Operator(operator.mul, 2),
'/' : Operator(operator.div, 2),
'^' : Operator(operator.pow, 3),
}
def __init__(self):
pass
def calculate(self, expr):
"""Parse and evaluate the expression."""
tokens = self.parse(expr)
result = self.evaluate(tokens)
return result
def evaluate(self, tokens, trace=False):
"""Walk the list of tokens and evaluate the result."""
stack = []
for item in tokens:
if isinstance(item, Operator):
if trace:
print stack | {
"domain": "codereview.stackexchange",
"id": 6991,
"lm_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, calculator",
"url": null
} |
quantum-mechanics, homework-and-exercises, hilbert-space, operators, harmonic-oscillator
\sqrt{1} & 0 & \sqrt{2} \\
0 & \sqrt{2} & 0
\end{bmatrix}\begin{bmatrix} 0 & \sqrt{1} & 0 \\
\sqrt{1} & 0 & \sqrt{2} \\
0 & \sqrt{2} & 0
\end{bmatrix}$$
so
$$\hat{x}^2 = \frac{\hbar}{2m\omega}\begin{bmatrix} 1 & 0 & \sqrt{2} \\
0 & 3 & 0 \\
\sqrt{2} & 0 & 2
\end{bmatrix}$$
and similarly
$$\hat{p}^2 = \frac{\hbar m\omega}{2}\begin{bmatrix} 1 & 0 & -\sqrt{2} \\
0 & 3 & 0 \\
-\sqrt{2} & 0 & 2
\end{bmatrix}$$
But this feels somewhat wrong, and when I do the same procedures for ($4\times4$) $\hat{x}$ and $\hat{p}$ matrices, I obtain wrong results.
I have also tried to perform the same operations by using
$$\hat{x}^2 = a_{+}a_{+} + a_{+}a_{-} + a_{-}a_{+} + a_{-}a_{-}$$ but I got the same result. | {
"domain": "physics.stackexchange",
"id": 92558,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, hilbert-space, operators, harmonic-oscillator",
"url": null
} |
particle-physics, mass, electrons, standard-model, protons
$$\begin{array}{|c|c|c|}
\hline \text{Measurement} & \text{Unit} & \text{SI value of unit}\\
\hline \text{Energy} & \mathrm{eV} & 1.602176565(35) \times 10^{−19} \, \mathrm{J}\\
\hline \text{Mass} & \mathrm{eV}/c^2 & 1.782662 \times 10^{−36} \, \mathrm{kg}\\
\hline \text{Momentum} & \mathrm{eV}/c & 5.344286 \times 10^{−28} \, \mathrm{kg \cdot m/s}\\
\hline \text{Temperature} & \mathrm{eV}/k_B & 1.1604505(20) \times 10^4 \, \mathrm{K}\\
\hline \text{Time} & ħ/\mathrm{eV} & 6.582119 \times 10^{−16} \, \mathrm{s}\\
\hline \text{Distance} & ħc/\mathrm{eV} & 1.97327 \times 10^{−7} \, \mathrm{m}\\
\hline
\end{array}$$
Now then, what's the rest energies of a proton and electron?
$$\text{electron} = 0.511 \, \frac{\mathrm{MeV}}{c^2}$$
$$\text{proton} = 938.272 \, \frac{\mathrm{MeV}}{c^2}$$
As we did with the experimentally determined masses,
$$\frac{m_p}{m_e} = \frac{938.272 \, \frac{\mathrm{MeV}}{c^2}}{0.511 \, \frac{\mathrm{MeV}}{c^2}} = 1836$$
which matches the previously determined value. | {
"domain": "physics.stackexchange",
"id": 51164,
"lm_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, mass, electrons, standard-model, protons",
"url": null
} |
python, python-3.x, sql, json, sql-server
Here's the function:
def clean_sql_json(x):
"""Cleans up JSON produced by SQL Server by reducing this pattern:
[{"Key": [{"Key": "Value"}]}]
to this:
[{'Key': ['Value']}]
Also removes duplicates (and ordering) from the reduced list.
"""
data = json.loads(x)
for k in data:
for kk, vv in k.items():
if type(vv) == list and type(vv[0] == dict) and len(vv[0]) == 1:
newlist = [kkk[list(vv[0].keys())[0]] for kkk in vv]
data[data.index(k)][kk] = list(set(newlist))
return data | {
"domain": "codereview.stackexchange",
"id": 34786,
"lm_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, sql, json, sql-server",
"url": null
} |
2020 at 21:34): Or like this? structure pointed_partition' (a b : ℝ) (P : partition a b) := (y : fin P.n → ℝ) (mem_block : ∀ m : fin P.n, y m ∈ Icc (P.x m.cast_succ) (P.x m.succ)) #### Mario Carneiro (Nov 01 2020 at 21:34): you could do that, yes #### Patrick Thomas (Nov 01 2020 at 21:35): Any foreseeable issues? #### Mario Carneiro (Nov 01 2020 at 21:40): well it's two things instead of one thing #### Patrick Thomas (Nov 01 2020 at 22:18): import data.real.basic data.set.intervals algebra.big_operators noncomputable theory structure partition (a : ℝ) (b : ℝ) := (n : ℕ) (x : fin (n + 1) → ℝ) (x_zero : x 0 = a) (x_last : x (fin.last n) = b) (mono : ∀ m : fin n, x m.cast_succ ≤ x m.succ) structure pointed_partition (a b : ℝ) (P : partition a b) := (y : fin P.n → ℝ) (mem_block : ∀ m : fin P.n, y m ∈ set.Icc (P.x m.cast_succ) (P.x m.succ)) open_locale big_operators def riemann_sum (a b : ℝ) (P : partition a b) (P' : pointed_partition a b P) (f : ℝ → ℝ) : ℝ := ∑ n, f (P'.y n) * (P.x n.succ | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812345563902,
"lm_q1q2_score": 0.8306465399943904,
"lm_q2_score": 0.8577681086260461,
"openwebmath_perplexity": 3348.954673009072,
"openwebmath_score": 0.3846169710159302,
"tags": null,
"url": "https://leanprover-community.github.io/archive/stream/113489-new-members/topic/formalizing.20definitions.20for.20real.20analysis.html"
} |
exoplanet, ephemeris
Title: Finding the Phase of an Exoplanet using the ephemeries So I'm currently researching Star-planet Interactions for HD 156279, I'm taking the flux of the Ca II H&K lines and trying to plot them against the phase of the planet, looking for evidence of magnetic or tidal interactions.
Now I have my flux as show below:
And I know the Phase=(time-ephem)/period. Now my professor said I can find the ephemeris from this site:
http://exoplanet.eu/ephemeris/hd_156279_b/ | {
"domain": "astronomy.stackexchange",
"id": 6825,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "exoplanet, ephemeris",
"url": null
} |
c#
Random Notes: It would be great if I could restrict access from getting to the static properties of Host, so that I can totally avoid anyone trying to set the Host.Environment static property and throwing an exception -- note how the HostBuilder shields that from happening as it is a readonly field. Disclaimer: I am biased towards singletons. I think it is an anti-pattern, that has no place in modern C#.
First, here is a great article on how singletons become a disaster when you try to unit test a code, that heavily relies on them. Your case is even more complex, because you also have to initialize additional parameters. And you can't change those. So you can't test Host with different "environments" unless you try to bypass your own exception with reflection.
I would just register non-static Host class as singleton inside IoC container, and be done with it. It will solve all your problems: | {
"domain": "codereview.stackexchange",
"id": 25774,
"lm_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#",
"url": null
} |
lo.logic, soft-question, type-theory, pl.programming-languages
By the way, all this (long!) digression was only to drive my point home: denotational semantics is to programming languages what model theory is to first-order theories (with all the necessary caveats). You do not need to know categorical logic in order to understand or study denotational semantics! | {
"domain": "cstheory.stackexchange",
"id": 5625,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lo.logic, soft-question, type-theory, pl.programming-languages",
"url": null
} |
type-theory, dependent-types, type-checking, coq
Here is an example:
(* Dependent type of vectors. *)
Inductive Vector {A : Type} : nat -> Type :=
| nil : Vector 0
| cons : forall n, A -> Vector n -> Vector (S n). | {
"domain": "cs.stackexchange",
"id": 21780,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "type-theory, dependent-types, type-checking, coq",
"url": null
} |
In the example originally posted, the cosine method needs to be applied first, as no angle is known initially. Having found that angle A, say, is arccos(203/220), which is approximately 22.672 degrees, one can choose to find sin(B), which turns out to be 0.8479976415..., and arcsin of that is 57.994545... degrees. If angle B had that value, angle C would be obtuse, which is impossible, as AB isn't the longest side of the triangle (if a triangle has an obtuse angle, the side opposite that angle must be longer than each of the other two sides, because the obtuse angle must be greater than each of the other two angles). Hence angle B = 180° - 57.994545... degrees = 122.00545... degrees. If that explanation is considered too cumbersome, one can use the cosine method instead to show that cos(B) = -0.53 exactly, etc.
Similar threads | {
"domain": "mymathforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138141360855,
"lm_q1q2_score": 0.8348822928104258,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 685.6160609721503,
"openwebmath_score": 0.8832516074180603,
"tags": null,
"url": "https://mymathforum.com/threads/a-trigonometric-problem-with-the-laws-of-sine-and-cosine.347727/"
} |
ros
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
roscpp
rospy
std_msgs
)
catkin_package()
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
add_executable(testcode src/testcode.cpp)
target_link_libraries(testcode
${catkin_LIBRARIES}
)
Make sure the c_cpp_properties.json file has the correct include path then edit/add the launch.json and tasks.json so they look like this:
launch.json (this code will only be correct if your CMakeFiles.txt is correct):
{
"version": "0.2.0",
"configurations": [
{
"name": "Run My ROS Node",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/devel/lib/package_name/testcode",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"MIMode": "gdb",
"cwd": "${workspaceFolder}",
"serverLaunchTimeout": 5000
}
]
} | {
"domain": "robotics.stackexchange",
"id": 38499,
"lm_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
} |
newtonian-gravity, acceleration, centrifugal-force, equivalence-principle, orbital-motion
$ \mathbf{g} = {- 3.986 \cdot 10^{14} \over (6371 + 420) \cdot 10^3 m} = - 8.6 \, \mathrm{m}/\mathrm{s}^2$
So, an astronaut on-board the ISS is in a reference frame that is constantly accelerating at an acceleration of $8.6 \, \mathrm{g}/\mathrm{m}^2$. Yet unlike the astronauts featured in this related question, they do in fact feel no gravitational acceleration at all; at most they may feel some centrifugal pseudoforce, but this is considerably less than the gravitational acceleration, and at most at microgravity levels.
Is acceleration only perceived when it changes the magnitude of the velocity, as opposed to the direction? What is the fundamental reason for this? Or am I misunderstanding something? The important difference is not the direction of the acceleration, it is the cause. When a rocket ship accelerates the engine pushes the hull, the hull pushes the floor and the floor pushes the astronaut's feet. He feels this force through his feet (and spine) and says he has weight. | {
"domain": "physics.stackexchange",
"id": 6376,
"lm_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-gravity, acceleration, centrifugal-force, equivalence-principle, orbital-motion",
"url": null
} |
Because the eigenvalues are distinct, eigenvectors are distinct, and there is a eigen-space spanned by them. The resulting matrix is $$\begin{bmatrix} 0 &0 &0 \\ 0 &1 &0 \\ 0 &0 &2 \\ \end{bmatrix}$$ And the rank is 2. A rank is the dimension of space spanned by all image in current space.
• Thanks for answering! I'm not sure what is 'image' or 'current space', but it looks like you are talking about the dimension and rank of the span of eigen vectors, and not the matrix itself? (please check the edit to my question) – jumpmonkey Jun 29 '17 at 11:51 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566341962906709,
"lm_q1q2_score": 0.8394243074866864,
"lm_q2_score": 0.8774767938900121,
"openwebmath_perplexity": 231.10892733739473,
"openwebmath_score": 0.8241724371910095,
"tags": null,
"url": "https://math.stackexchange.com/questions/2340541/relation-between-rank-and-number-of-distinct-eigen-values?noredirect=1"
} |
cc.complexity-theory, ds.algorithms, matrices, matching, permanent
Concluding remarks and questions
Some observations about how UW-NP relates to existing complexity classes:
Observation 1. UW-NP contains NP.
(For Unique-Weight SAT, the special case when all weights are distinct powers of two is equivalent to regular SAT, because every assignment has a distinct total weight.)
Observation 2. UW-NP contains the complexity class US.
(US contains languages defined as follows: given any non-deterministic poly-time TM, its language contains the inputs for which exactly one execution path accepts. The restriction of Unique-Weight SAT to instances where all weights are zero is equivalent to the classical Unique SAT problem ("Given a Boolean formula, does it have exactly one satisfying assignment?" --- not to be confused with Unambiguous SAT, which is the promise problem obtained by restricting SAT to instances where there is at most one satisfying assignment). | {
"domain": "cstheory.stackexchange",
"id": 4851,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, ds.algorithms, matrices, matching, permanent",
"url": null
} |
5. Mrs. Smith has been given film vouchers. Each voucher allows the holder to see a film without charge. She decides to distribute them among her four nephews so that each nephew gets at least two vouchers. How many vouchers has Mrs. Smith been given if there are 120 ways that she could distribute the vouchers?
(A) 13
(B) 14
(C) 15
(D) 16
(E) more than 16
: No idea. | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.8198933425148213,
"lm_q2_score": 0.8198933425148213,
"openwebmath_perplexity": 1341.3597371252881,
"openwebmath_score": 0.6643107533454895,
"tags": null,
"url": "https://gmatclub.com/forum/new-set-of-good-ps-85440.html"
} |
c#, wpf, collections
rather than in the code (ViewModel) the way I did it
this.AllPartsCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(this.AllParts);
which helps me apply the filtering and all in a much easier way. However, if switching to the method above is the fix I have no problem doing so.
Limitation
I am also limited to the .NET 4.0 which prevents me from using LiveFiltering & LiveSortingProperties tags such as below:
<Window.Resources>
<CollectionViewSource x:Key="cvsActors" Source="{Binding ActorList}"
IsLiveSortingRequested="True">
<CollectionViewSource.LiveSortingProperties>
<clr:String>LastName</clr:String>
</CollectionViewSource.LiveSortingProperties>
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="LastName" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Window.Resources> | {
"domain": "codereview.stackexchange",
"id": 11756,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, wpf, collections",
"url": null
} |
the distance between two points on a coordinate system we are applying Pythagoras' Theorem. Standard measurement equipment (rulers, protractors, planimeters, dot grids, etc. As homework we were assigned to enter the following code to calculate the distance between two points on the x and y plane. 42 (rounded to the nearest 100th) How to use the Distance Formula Calculator. This means of location is used in polar coordinates and bearings. For example, in a button you can have the following formula on its OnSelect property:. In the attached file "Circle2", the coordinates of the circles are located under column B & C, the coordinates of the points are located under column F & calculate the minimum distance between two sets of coordinates. Enter 2 sets of coordinates in the 3 dimensional Cartesian coordinate system, (X 1, Y 1, Z 1) and (X 2, Y 2, Z 2), to get the distance formula calculation for the 2 points and calculate distance between the 2 points. Time and Date Duration – Calculate | {
"domain": "ciiz.pw",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226300899743,
"lm_q1q2_score": 0.8637263751995081,
"lm_q2_score": 0.8840392725805822,
"openwebmath_perplexity": 449.43494686701194,
"openwebmath_score": 0.6425132751464844,
"tags": null,
"url": "http://sbwt.ciiz.pw/distance-between-two-coordinates-calculator.html"
} |
lagrangian-formalism, field-theory, noethers-theorem, klein-gordon-equation, scale-invariance
To every differentiable symmetry of the Action of a system, there corresponds a conserved current. | {
"domain": "physics.stackexchange",
"id": 32518,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, field-theory, noethers-theorem, klein-gordon-equation, scale-invariance",
"url": null
} |
# Show that a certain set of positive real numbers must be finite or countable
Let $B$ be a set of positive real numbers with the property that adding together any finite subset of elements from $B$ always gives a sum of $2$ or less. Show that $B$ must be finite or at most countable.
$B$ = {$x \in R:x>0\}$, $x_1,x_2...x_n \in B$ such that $x_1+x_2+...+x_n \le 2$.
Question: for any $a,b$ $(a,b)$~$R$, but $B$ is $(0,+\infty)$ so why $B$ is not uncountable (taking as $a = 0$, and letting $b$->$\infty$)?
And why for $B$ being countable doesn't contradict: for any $a,b$ $(a,b)$~$R$?
P.S. I read Showing a set is finite or countable and understood it. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137858267907,
"lm_q1q2_score": 0.8514410706175163,
"lm_q2_score": 0.8670357615200475,
"openwebmath_perplexity": 120.9273635766722,
"openwebmath_score": 0.7738478779792786,
"tags": null,
"url": "https://math.stackexchange.com/questions/2876327/show-that-a-certain-set-of-positive-real-numbers-must-be-finite-or-countable"
} |
homework-and-exercises, newtonian-mechanics, forces, fluid-dynamics, fluid-statics
2 forces in the top-to-down direction (the gravitational force and the force caused by the water pressure)
1 force in the down-to-top (the force caused by the water pressure).
So the first two forces are added together and the last force is subtracted from their sum.
The resulting force must be a zero force, because the cylinder is not moving. | {
"domain": "physics.stackexchange",
"id": 74377,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, forces, fluid-dynamics, fluid-statics",
"url": null
} |
the flux of through S where S is a piece of a sphere of radius R centered at the origin. acceleration vector: a = a t u t + a n u n •The normal or centripetal component is always directed toward the center of curvature of the curve. Frequently it is necessary to calculate the normal and the shear stress on an arbitrary plane (with unit normal vector $$n$$) that crosses a rigid body in equilibrium. Find the norm of the vector. (1,2, −1) has the value. Universal Unit Calculator provides converting units for more than 50 different metric measurement categories. In mathematical terms, this process is written as: Definition: A unit vector is a vector of magnitude 1. (See Figure 7. They are shown with an arrow $$\vec{a}$$. Moreover, we use a lowercase letter with a circumflex, or 'hat' (Pronunciation "i-hat"). Vector Algebra Vector Operation Addition, Subtraction Scalar Multiplication Dot Product Cross Product Magnitude(length) Unit Direction Cosines Component form of a vector Angle between | {
"domain": "ariellafiori.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986151391819461,
"lm_q1q2_score": 0.8039426562443741,
"lm_q2_score": 0.8152324915965391,
"openwebmath_perplexity": 417.6234340594931,
"openwebmath_score": 0.8306130170822144,
"tags": null,
"url": "http://ariellafiori.it/unit-normal-vector-calculator.html"
} |
observatory
The intensity of such scattering increases when these beams are viewed from angles near the beam axis. (That's the reason, if you are standing close to the person pointing stars in astronomy club, you can see the beam bright and clearly whereas the people standing away can barely see it. So always stand near the presenter But avoid contact with your eye. :-) )
The apparent brightness of a spot from a laser beam depends on the optical power of the laser, the reflectivity of the surface, and the chromatic response of the human eye. For the same optical power, Green Laser light will seem brighter than other colours because the human eye is most sensitive at low light levels in the green region of the spectrum (wavelength 520–570 nm). The most sensitive pigment, rhodopsin, has a peak response at 500 nm. Sensitivity decreases for redder or bluer wavelengths. | {
"domain": "astronomy.stackexchange",
"id": 479,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observatory",
"url": null
} |
c++, queue
I've a doubt since struct Data doesn't implement neither move constructor nor move assignment operator. Does std::move make any sense?
Yes, the compiler can generate implicit constructors, including implicit move constructors. Whether this is done depends on whether you did not declare or delete any copy or move constructors/assignment operators yourself, and whether all the member variables have move constructors (obviously). Your struct Data satisfies all the requirements. | {
"domain": "codereview.stackexchange",
"id": 42024,
"lm_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++, queue",
"url": null
} |
cosmology, speed-of-light, space-expansion, distance
Why is it that we can see them and they can't see us? Again, static environment. Light works one-way only?
What are the conditions for simultaneous mutual observation?? You should take care when talking about a "now" on large distances. In special relativity, there is no such thing as a "now" which would be the same here and at a distant point; and you could hit at paradoxes if you stick to that idea (see here).
The best thing you can do is to think in terms of past and future light cones. The past light cone of an event $E$ in spacetime (an "event" being combination of a time and a position) is the set of all other events from which $E$ can receive a light signal. The future light cone of $E$ is the set of all other events to which $E$ can send a light signal. The event $E$ can only be influenced by events located inside his past light cone, and it can only influence events located inside his future light cone. We talk about it as the causal structure of spacetime. | {
"domain": "physics.stackexchange",
"id": 74610,
"lm_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, speed-of-light, space-expansion, distance",
"url": null
} |
spacetime, momentum, conservation-laws, symmetry, inertial-frames
Edit
To explain further:
When we deal with symmetries, the newtonian formulation of mechanics is not the best way to do it. Much better way is to use lagrangian mechanics. Here we simple declare function called lagrangian $L$ and we say, that particle will move between points $A$ and $B$ in such a way as to make the action given by this integral along the curve $\gamma(t)$ from $A$ to $B$:
$$S=\int_{\gamma(t)} L dt$$
minimal. Thus to find real movement of the particle, you just need to find which curve from $A$ to $B$ minimizes the integral. This leads to certain equations called equations of motion (EoM) or Euler-Lagrange equations. | {
"domain": "physics.stackexchange",
"id": 69503,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spacetime, momentum, conservation-laws, symmetry, inertial-frames",
"url": null
} |
c++, object-oriented
Both `port1` and `port2` must be in an Output of type Supply::Output::combined (though either can
be the primary), and `port1` cannot be the same port as `port2`.
\throw std::logic_error if `port1 == port2`.
\throw std::logic_error if the Supply does not have an Output of type Supply::Output::combined which is
composed of the two given ports.
*/
void split_ports(port_number port1, port_number port2);
};
/**\brief Returns `true` if the argument Supply::Outputs are considered equal, `false` otherwise.
Two Supply::Outputs are considered equal if:
* both are Supply::Output::single and the same port is assigned to both primaries.
* both are Supply::Output::combined and the same port is assigned to both primaries and the same port
is assigned to both secondaries.
*/
inline bool operator==(const Supply::Output& lhs, const Supply::Output& rhs) {
if (lhs.primary() != rhs.primary()) return false;
Supply::Output::output_type pairs = lhs.type(); | {
"domain": "codereview.stackexchange",
"id": 42689,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented",
"url": null
} |
random-forest, decision-trees
Is it possible to solve the presented problem with a decision tree?
Here's a notebook (github/colab, suggestions welcome) demonstrating that yes, a (sklearn) decision tree can learn $\operatorname{sign}(x\cdot y)$ (perhaps with some errors when points are extremely close to 0); but it also goes on to show some of the difficulties, e.g. when variables other than $x,y$ are available to the tree to split on. Up-shot: noise variables can wreck that first split I mentioned above, and even useful variables can make the tree lose track of the XOR.
Would using a random forest solve the problem in any way?
Probably not the basic problem, but it looks like it helps with, e.g., the noise variables above. | {
"domain": "datascience.stackexchange",
"id": 6136,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "random-forest, decision-trees",
"url": null
} |
Of course it's important to note that at least one of $$t_1,t_2$$ is non-zero (as you had in your own proof) to make sure you have a contradiction.
In your proof of necessity you have $$t$$ instead of $$t_1$$ and $$t_2$$. I would suggest something like ... so there are $$t_1,t_2\in\mathbb{R}$$, not both zero, such that $$t_1v_1+t_2v_2=0$$. Suppose that $$t_1\neq 0$$ (the case where $$t_2\neq 0$$ is similar). Then $$t_1v_1=-t_2v_2$$...'
Finally, the word is usually spelled collinear. Apart from that it's a fine proof. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717460476701,
"lm_q1q2_score": 0.8325630706182979,
"lm_q2_score": 0.8438951084436077,
"openwebmath_perplexity": 140.22072002422192,
"openwebmath_score": 0.6884004473686218,
"tags": null,
"url": "https://math.stackexchange.com/questions/3614579/linearly-independent-vectors-and-colinearity-proof-verification"
} |
Clearly $1 \in A, 2 \in B$ and given any positive integer $n$ we have the following chain of increasing rational numbers $$1, 1 + \frac{1}{n}, 1 + \frac{2}{n}, \ldots, 1 + \frac{n}{n} = 2$$ such that successive numbers in the above chain differ by $1/n$. Since the first member of the chain lies in $A$ and the last member of the chain lies in $B$ it follows that there is a last number in the chain which lies in $A$ and the next one belongs to $B$. Thus we have found two rationals $q, r$ with $q \in A, r \in B$ such that $r - q = 1/n$. Thus we can find a member of $A$ and a member of $B$ which are as close to each other as we please. Moreover we can choose $q, r$ both less than 2. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517482043892,
"lm_q1q2_score": 0.8085669091883755,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 163.4772998400005,
"openwebmath_score": 0.8928645849227905,
"tags": null,
"url": "https://math.stackexchange.com/questions/141774/choice-of-q-in-baby-rudins-example-1-1/141824"
} |
### 400. Nth Digit
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
Note:
n is positive and will fit within the range of a 32-bit signed integer (n < 231).
Example 1:
Input:
3
Output:
3
Example 2:
Input:
11
Output:
0
Explanation:
The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10.
Seen this question in a real interview before?
When did you encounter this question?
Which company? | {
"domain": "leetcode.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9585377249197138,
"lm_q1q2_score": 0.8293499119999584,
"lm_q2_score": 0.8652240704135291,
"openwebmath_perplexity": 388.2342412119561,
"openwebmath_score": 0.29145726561546326,
"tags": null,
"url": "https://leetcode.com/problems/nth-digit/"
} |
php, sql, authentication, session
?>
</div>
</div>
<div id="wrapper">
<div id="logo">
<a href="/">Albsocial</a>
</div>
<div id="login">
<?php
if (isset($_SESSION['username']) && $_SESSION['username'] != ''){
$username = $_SESSION['username'];
echo "<h4><a href='member.php?user=".$username."'>".$username."</a></h4><a href='logout.php'>LogOut</a>";
}else{
echo "<a href='login.php'>Login</a> <a href='#'>Register</a>";
}
?>
</div>
<div id="menubar">
<?php include("php/bar.php");?>
</div>
<div id="content_wrap">
<div id="content_member">
<?php
//MARRIM USERNAME QE E VEJM NE ADRESS BARS
if (isset($_GET['user'])){
$username = mysql_real_escape_string($_GET['user']);
if(ctype_alnum($username)){ | {
"domain": "codereview.stackexchange",
"id": 4005,
"lm_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, sql, authentication, session",
"url": null
} |
turtlebot, ros-hydro
Hi.
I had a similar problem after updating Ubuntu (13.04) in my PC.
I'm not sure what happened, but I had to reinstall the kinect driver:
I download this:
https://github.com/avin2/SensorKinect
And in the "Bin" folder, I extract "SensorKinect093-Bin-Linux-x64-v5.1.2.1" and install it (by running the install.sh)
I hope that could work for you as well! | {
"domain": "robotics.stackexchange",
"id": 17568,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turtlebot, ros-hydro",
"url": null
} |
### 14.1.1 Variance Stabilizing Transformations
Recall the fitted value is our estimate of the mean at a particular value of $$x$$. Under our usual assumptions,
$\epsilon \sim N(0,\sigma^2)$
and thus
$\text{Var}[Y | X = x] = \sigma^2$
which is a constant value for any value of $$x$$.
However, here we see that the variance is a function of the mean,
$\text{Var}[Y \mid X = x] = h(\text{E}[Y \mid X = x]).$
In this case, $$h$$ is some increasing function.
In order to correct for this, we would like to find some function of $$Y$$, $$g(Y)$$ such that,
$\text{Var}[g(Y) \mid X = x] = c$
where $$c$$ is a constant that does not depend on the mean, $$\text{E}[Y \mid X = x]$$. A transformation that accomplishes this is called a variance stabilizing transformation. | {
"domain": "stat420.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357195106375,
"lm_q1q2_score": 0.8003428500953451,
"lm_q2_score": 0.8152324848629214,
"openwebmath_perplexity": 4317.399344373764,
"openwebmath_score": 0.5933060050010681,
"tags": null,
"url": "https://book.stat420.org/transformations.html"
} |
audio
If the output is given by $y=f(x)$, where $x$ is the input, then the wavetable contains values $y$ for a given range of input values $x$. The function $f(x)$ can be defined in any desired way, and one way to define it is to use Chebyshev polynomials, which for a pure sinusoidal input generate a given harmonic. | {
"domain": "dsp.stackexchange",
"id": 2902,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio",
"url": null
} |
ecmascript-6, react.js, sass, redux
Also, a rule was to use React and SASS (The FCC founder said that SCSS is acceptable).
This was my first attempt at using Redux. As a result, some things in the app are experimental. For example, the reducer works well and returns a new state each time - but I'm sure the code here could be better written.
Also, in the RecipeList component, I found myself confused at how I should use the component's state, or draw data from the Redux store. Some thoughts on this are most welcome.
As was recommended to me on a different code review, I used the BEM pattern for my SCSS.
I used Vex for the modals. This resulted in some pretty ugly code. For example, html tags within a string (which I think looks really confusing in the vicinity of JSX). But the functionality is fine, I believe. Would React-Bootstrap be a better option in this case?
Here is a link to a Codepen of the app
Javascript:
const initial = () => {
let recipesInit = {
recipes: [ | {
"domain": "codereview.stackexchange",
"id": 18108,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ecmascript-6, react.js, sass, redux",
"url": null
} |
beginner, c, linked-list, database
while(1){
newa = (struct account *)malloc(sizeof(struct account));
/*This line reads each struct from the file and stores in currenta*/
fread(currenta,sizeof(struct account),1,f);
/*If we're at the last record, break out of the loop.*/
if(currenta->next == NULL)
break;
/*Otherwise, continue to the next iteration/link in file*/
currenta->next = newa;
currenta = newa;
}
fclose(f);
anum = currenta->number;
}
void clearInput(void)
{
fflush(stdin);
}
void listAll(void){ | {
"domain": "codereview.stackexchange",
"id": 23305,
"lm_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, linked-list, database",
"url": null
} |
localization, gazebo, ekf, odometry, husky
y: 0.157750826895
z: 0.0
w: 0.98747894996
-
header:
seq: 0
stamp:
secs: 1597
nsecs: 300000000
frame_id: husky1/base_link
child_frame_id: husky1/rear_left_wheel_link
transform:
translation:
x: -0.256
y: 0.2854
z: 0.03282
rotation:
x: 0.0
y: -0.158428913083
z: 0.0
w: 0.987370386177
-
header:
seq: 0
stamp:
secs: 1597
nsecs: 300000000
frame_id: husky1/base_link
child_frame_id: husky1/rear_right_wheel_link
transform:
translation:
x: -0.256
y: -0.2854
z: 0.03282
rotation:
x: 0.0
y: -0.192699433619
z: 0.0
w: 0.981257829667 | {
"domain": "robotics.stackexchange",
"id": 23708,
"lm_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, gazebo, ekf, odometry, husky",
"url": null
} |
c#, interview-questions, graph, pathfinding
foreach (int indexMove in indexMoves)
{
int move = transformedPuzzle[indexMove];
// swap cell values to simulate move
transformedPuzzle[Array.IndexOf(transformedPuzzle, 0)] = move;
transformedPuzzle[indexMove] = 0;
moveHistoryList.Add(move);
}
moveHistory = moveHistoryList.ToArray();
return IsSolved(transformedPuzzle);
}
}
ResolverImplementation.cs
public class ResolverImplementation : IResolver
{
public int[] Solve(int[] input) => new Resolver(input).Solve();
}
Unit tests
I've added NUnit tests to ensure my solution works.
public class ResolverTests
{
[Test]
public void ShouldThrowArgumentNullException_WhenNullPassed()
{
// Arrange
// Act
// Assert
Assert.Throws<ArgumentNullException>(() => new Resolver(null));
}
[Test]
public void ShouldThrowArgumentException_WhenWrongInputPassed()
{
// Arrange | {
"domain": "codereview.stackexchange",
"id": 33562,
"lm_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#, interview-questions, graph, pathfinding",
"url": null
} |
# How to sum $\frac1{1\cdot 2\cdot 3\cdot 4} + \frac4{3\cdot 4\cdot 5\cdot 6} + \frac9{5\cdot 6\cdot 7\cdot 8} + \cdots$ quickly?
The Problem:
$$\frac1{1\cdot 2\cdot 3\cdot 4} + \frac4{3\cdot 4\cdot 5\cdot 6} + \frac9{5\cdot 6\cdot 7\cdot 8} + \frac{16}{7 \cdot 8 \cdot 9 \cdot 10} + \cdots$$
Any smarter way to solve this may be within a minute or two?
I am adding my solution,If you are a student please don't read-on I find this particular problem to some sort of interesting so just try it once :-)
I started off with trying to find the $T_n$ th term
$$T_n = \frac{n^2}{(2n-1)(2n)(2n+1)(2n+2)}$$ $$= \frac1{24} \times \biggl( \frac1{2n-1} + \frac3{2n+1} - \frac4{2n+2} \biggr)$$
$$= \frac1{24} \times \biggl[\biggl( \frac1{2n-1} + \frac1{2n+1}\biggr) + 4 \times \biggl(\frac1{2n+1} - \frac1{2n+2} \biggr) \biggr]$$
After this this becomes really easy, $$S_\infty = \frac1{24} \times \biggl[( 1 - \frac13 + \frac13 - \frac15 + \frac15 + \cdots ) + 4 \times (\ln 2 - \frac12)\biggr]$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363696508799,
"lm_q1q2_score": 0.8106261622175739,
"lm_q2_score": 0.8221891261650248,
"openwebmath_perplexity": 408.46514849161406,
"openwebmath_score": 0.8366049528121948,
"tags": null,
"url": "http://math.stackexchange.com/questions/13888/how-to-sum-frac11-cdot-2-cdot-3-cdot-4-frac43-cdot-4-cdot-5-cdot-6-f"
} |
organic-chemistry, terminology
On the other hand, terpenoids:
very commonly have a carbon count that is a multiple of five (even often multiples of ten).
can very often be broken down into isoprene (2-methylbutane) units by paper chemistry.
typically have 1,5-methyl functionalisation (although this can change due to Wagner–Meerwein rearrangements in the biosynthesis).
can have 1,1-dimethylated carbons which polyketides cannot.
often form polycyclic structures composed of small all-carbon cycles (small being 5- to 7-membered rings).
rarely contain lactones or lactams (cyclic esters or amides).
are generally less oxygenated.
very rarely contain more than one or two double bonds, never contain phenyl rings to the best of my knowledge.
With that, you have some criteria at hand to attempt a classification. Artemisinin’s tricyclic structure with an all-carbon cycle looks a lot more like a terpenoid than a polyketide. | {
"domain": "chemistry.stackexchange",
"id": 6238,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, terminology",
"url": null
} |
quantum-mechanics, homework-and-exercises, heisenberg-uncertainty-principle
which doesn't bring me any closer to the desired answer
How should I go about solving this?
Thanks in advance Using just $\Delta x \Delta p = \hbar/2$, and $E = \Delta P^{2}/2m_e$, I get 1,058 MeV.
If I use the mass of a proton, I get 0.5764 MeV. | {
"domain": "physics.stackexchange",
"id": 53415,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, heisenberg-uncertainty-principle",
"url": null
} |
P[Eout > 0.5] <= 2e^(-5) = 0.013+
This seems to be saying something nontrivial about Eout.
htlin 04-08-2012 04:01 PM
Re: question about probability
Quote:
Originally Posted by canon1230 (Post 1042) Does the Hoeffding Inequality allow us to say something about this probability? P[|Ein - Eout| > epsilon] <= 2e^(-2 * epslion^2 * N) Since Ein = 0, N = 10, setting epsilon to 0.5, the inequality gives us: P[Eout > 0.5] <= 2e^(-5) = 0.013+ This seems to be saying something nontrivial about Eout.
The in Hoeffding is subject to the process of generating the sample (i.e. ), not the probability on . Indeed it tells us something nontrivial (and that's how we use it in the learning context), but it does not answer your original question.
The question that got answered by Hoeffding is roughly
"What is the probability of a big-Eout urn (many red) for generating such an Ein (all green)?"
not
"What is the probability of Eout being small in the first place?" | {
"domain": "caltech.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.951863227517834,
"lm_q1q2_score": 0.8013028776001675,
"lm_q2_score": 0.8418256472515684,
"openwebmath_perplexity": 1131.5403801752661,
"openwebmath_score": 0.8569687604904175,
"tags": null,
"url": "http://book.caltech.edu/bookforum/printthread.php?s=f4e1153670815a53b36dc19a5c148e2d&t=287&pp=40"
} |
statistical-mechanics, condensed-matter, phase-transition, critical-phenomena
It would be great if someone could tell me which one is correct! I think the conventional wisdom is correct, the choice of order parameter does not matter (as long as the symmetries are preserved, and we redefine conjugate variables).
I think the main mistake in the post is that you assume that if $M$ scales as $M\sim t^\beta$ then $M^a$ scales as $M^a\sim t^{a\beta}$. But this is not the case, $M$ is a stochastic variable, and the scaling behavior is $\langle M\rangle \sim t^\beta$. There is no simple relation between the scaling of $\langle M\rangle$ and $\langle M^a\rangle$. Also note that using $M^2$ is not a good example, because $M^2$ has different symmetries (and is indeed not an order parameter in the Ising case).
The way to investigate this is to start from the Landau-Ginzburg functional
$$
{\cal F} = \int d^3x \left(\gamma(\nabla M)^2 +\alpha M^2 +\beta M^4 + \ldots +Mh\right)
$$ | {
"domain": "physics.stackexchange",
"id": 55763,
"lm_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, condensed-matter, phase-transition, critical-phenomena",
"url": null
} |
navigation, ekf, ros-kinetic, robot-localization, ekf-localization-node
0, 0, 0, 0, 0, 0, 0, 0.115, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0.115, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-3, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-3, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-3, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-3] | {
"domain": "robotics.stackexchange",
"id": 32114,
"lm_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, ros-kinetic, robot-localization, ekf-localization-node",
"url": null
} |
computability, finite-automata
- If M' accept only one member, accept.
- If more than one or less than one accepted, reject.
But this will loop the program forever for the first step as it keeps testing every member after one member is selected. First step just doesn't seem right.
I think these questions might be relating to this: 1, 2 The approach you have given is normally used for demonstrating a language is undecidable (by using the language to decided an known undecidable language).
What you need to do is (implicitly or explicitly) construct an algorithm that decides the problem.
As I mentioned in a comment, your notation is unclear, but both possible interpretations are decidable anyway. | {
"domain": "cs.stackexchange",
"id": 4216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, finite-automata",
"url": null
} |
ros, ros-hydro, boost, dependencies, libboost
The boost thread header compiled in the vicon-lib is compatible to the thread symbol for 1.5x , while ros asks for 1.4x . Since both symbols have the same name, there is no chance for the linker to decide which lib is the correct one to link... Back then, I played quite a bit with linking, the result was always the same: either the vicon sdk segfaulted or our ros interface, depending on which boost lib the linker decided to link.
The only (but ugly) way out I see for now, is to install a matching boost version and compile ros from source. We did this on a few of our machines successfully, since we ran into other problems with the old boost version.
Even though the linking problem still exists, it didn't crash on our 64 bit machines so far. | {
"domain": "robotics.stackexchange",
"id": 19142,
"lm_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, ros-hydro, boost, dependencies, libboost",
"url": null
} |
python, ros-kinetic
Originally posted by mateusguilherme with karma: 125 on 2019-07-02
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 33248,
"lm_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, ros-kinetic",
"url": null
} |
Calculus
Consider the following.
cos(x) + sqrt(y)= 1
(a) Find y' by implicit differentiation.
(b) Solve the equation explicitly for y and differentiate to get y' in terms of x.
y' = ?
(c) Check that your solutions to parts (a) and (b) are consistent by substituting the expression for y into your solution for part (a).
y' =?
1. 👍
2. 👎
3. 👁
1. I hope for a) you had
-sinx + (1/2)y^(-1/2) dy/dx = 0
dy/dx = 2√y sinx
b) from the original:
√y = 1 - cosx
square both sides
y = 1 - 2cosx + cos^2 x
dy/dx = 2sinx + 2cosx(-sinx)
= 2sinx(1 - cosx) , but 1-cosx = √y
= 2sinx √y , which matches my other dy/dx
1. 👍
2. 👎
Similar Questions
1. Trig
Find the exact values of the six trigonometric functions 0 if the terminal side of 0 in standard position contains the points(-5,-4). (0 is not the number zero I don't know what its called) I have to find r first. r=sqrt x^2+y^2
2. re: Differential Calculus | {
"domain": "jiskha.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138196557984,
"lm_q1q2_score": 0.8126200501359745,
"lm_q2_score": 0.8311430541321951,
"openwebmath_perplexity": 6270.6010032422455,
"openwebmath_score": 0.8163922429084778,
"tags": null,
"url": "https://www.jiskha.com/questions/1734534/consider-the-following-cos-x-sqrt-y-1-a-find-y-by-implicit-differentiation-y"
} |
human-biology
EDIT
You have now changed your post. I don't really understand the new question either. You seem to imply that two alleles may be both dominant. This is impossible. They can be co-dominant.
I think your issue is that you are trying to associate a property of relationship between alleles as a property of an allele itself. Keep in mind, that saying that an allele is dominant only makes sense in a particular context that is in relationship to another allele who will therefore necessarily be recessive. | {
"domain": "biology.stackexchange",
"id": 7215,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology",
"url": null
} |
genetics, dna, rna, allele
The "Baldness" gene is called a modifier. One can also say that the expression the "Hair color" gene depends on the genetic background of the individual.
Now cases of epistasis are not always that easy and if they influence the fitness, this kind of epistatic interaction might have implications for their evolution. | {
"domain": "biology.stackexchange",
"id": 1715,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, dna, rna, allele",
"url": null
} |
tensor-calculus, group-theory, representation-theory, lie-algebra
1 + i\alpha_a J_{1\otimes 2}^a &= D_{1\otimes 2}[1 + i\alpha_aT^a] \\
&= D_{1}[1 + i\alpha_aT^a] \otimes D_{2}[1 + i\alpha_aT^a] \\
&= (1 + i\alpha_a J_{1}^a )\otimes (1 + i\alpha_a J_{2}^a )\\
&= 1 + i \alpha_a (J_1^a + J_2^a)
\end{align}
discarding the terms of order $\alpha^2$.
Therefore, we see that :
$$J^a_{1\otimes 2} = J^a_1 + J^a_2$$ | {
"domain": "physics.stackexchange",
"id": 87261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "tensor-calculus, group-theory, representation-theory, lie-algebra",
"url": null
} |
A. One Sample Proportion Calculator. Show the sampling distribution of (p), the proportion of groceries thrown out by your sample respondents (to 4 decimals)?. If random samples of size three are drawn without replacement from the population consisting of four numbers 4, 5, 5, 7. Sample statistic Any quantity computed from values in a sample e. Assuming that the population proportion is 0. pˆ = C Report your sample proportion to your. You can perform the calculation for several sample sizes and compare the differences in the Comparison List. Deliberate attempt to ensure proportions of subjects in each category in a sample match the proportion in the population. Applications of the Sampling Distribution of the Sample Proportion. 12 for both sample sizes? Calculate the probability that the sample proportion is between 0. With the probability calculator you can investigate the relationships of likelihood between two separate events. If a researcher wanted to reduce the standard deviation | {
"domain": "muse-deutsch.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9848109534209825,
"lm_q1q2_score": 0.8163480264741846,
"lm_q2_score": 0.82893881677331,
"openwebmath_perplexity": 447.9418475551134,
"openwebmath_score": 0.7959654927253723,
"tags": null,
"url": "http://skyf.muse-deutsch.de/sampling-distribution-of-the-sample-proportion-calculator.html"
} |
beginner, objective-c, ios
The implementation in my viewController then looks something like this:
_venueService = [[TNVenueService alloc] initVenueServiceWithClientID:@"MY_CLIENT_ID" clientSecret:@"MY_CLIENT_SECRET"];
NSURLRequest *request = [_venueService URLRequestWithFormat:@"venueCategories",
_venueService.clientID, _venueService.clientSecret, _venueService.todaysDate]; | {
"domain": "codereview.stackexchange",
"id": 7549,
"lm_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, objective-c, ios",
"url": null
} |
thermodynamics, statistical-mechanics, potential
\langle S \rangle &= -\frac{\partial F(T, V, N)}{\partial T} \\
\langle \mu \rangle &= \frac{\partial F(T, V, N)}{\partial N}
\end{align}
If some of the "non-natural" variables are not averages for given potentials/ensembles, then which ones? Different ensembles hold different quantities to be fixed. Quantities that are not fixed a priori (and by extension, functions of those quantities) typically fluctuate. These quantities are represented as ensemble averages. | {
"domain": "physics.stackexchange",
"id": 64904,
"lm_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, statistical-mechanics, potential",
"url": null
} |
c, library, ascii-art, dynamic-loading
"d88'`?88P'",
" ",
" ",
" " }));
d_alloc(whimsy,c,'c',8,ARRAY({
" ",
" ",
" ",
" d8888b",
"d8P' `P",
"88b ",
"`?888P'",
" ",
" ",
" " }));
d_alloc(whimsy,d,'d',11,ARRAY({
" d8b ",
" 88P ",
" d88 ",
" d888888 ",
"d8P' ?88 ",
"88b ,88b ",
"`?88P'`88b",
" ",
" ",
" " }));
d_alloc(whimsy,e,'e',8,ARRAY({
" ",
" ",
" ",
" d8888b",
"d8b_,dP",
"88b ",
"`?888P'",
" ",
" ",
" " })); | {
"domain": "codereview.stackexchange",
"id": 15856,
"lm_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, library, ascii-art, dynamic-loading",
"url": null
} |
optics, waves, diffraction
Question 2: Does that mean, the outcome of Fresnel diffraction $u(x,y,z)$ suffices the paraxial wave equation?
Question 3 (most important): Does that mean, Fresnel diffraction of the function $$u_0(x,y) = A_0 e^{-\frac{(x^2 + y^2)}{w_0^2}}$$ will yield the exact formula of a Gaussian beam? I tried to calculate it, but I failed: When I convolve $$u_0(x,y) = A_0 e^{-\frac{(x^2 + y^2)}{w_0^2}}$$ with $$h(x, y, z) = \frac{-i k}{z} e^{i(kz + \frac{k(x^2 + y^2)}{2 z})} , $$ I don't arrive at the formula for a Gaussian beam. I still think that this should be possible. Does somebody know where this is explicitly calculated? | {
"domain": "physics.stackexchange",
"id": 35485,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, waves, diffraction",
"url": null
} |
performance, c, strings, array, linked-list
buffer[i] = 0;
return buffer;
}
And if strdup is not available on your system
char *strdup(const char *txt)
{
if(txt == NULL)
return NULL;
char *tmp = calloc(strlen(txt), 1);
if(tmp == NULL)
return NULL;
return strcpy(tmp, txt);
} | {
"domain": "codereview.stackexchange",
"id": 29704,
"lm_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, c, strings, array, linked-list",
"url": null
} |
experimental-design
Title: Are there situations where in vivo results work better than in vitro results would have shown? Basically, if I have poor in vitro cell line results but decided to test them in vivo in a mouse anyway what are the possibilities of having better results in the in vivo live mouse model that I would have never known otherwise from the in vitro results?
Links are appreciated Differences between in vitro and in vivo results are (unfortunately) very common!
Somehow, all failed clinical trials (and many preclinical trials) are large-scale examples of the discrepancy between promising in vitro and actual in vivo results - which also highlights the fact that even from one in vivo system (e.g. mice) to the other (e.g. humans), there can be significant and unpredictable biological differences. It is the opposite of your case, in which you expect an improvement when moving to live animals, but it is also more common. | {
"domain": "biology.stackexchange",
"id": 9098,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "experimental-design",
"url": null
} |
performance, c, hangman, simd
char mostLikelyCharacter(char *query, char *noCount, char *forbidden, StringArray wordlist) {
int len = (int) strlen(query);
int *globalCounts = aligned_alloc(MEMORY_ALIGNMENT, 128 * sizeof(int));
int *localCounts = aligned_alloc(MEMORY_ALIGNMENT, 128 * sizeof(int));
long *largeLocalCounts = (long *) localCounts;
for (int i = 0; i < 128; i++) {
globalCounts[i] = 0;
localCounts[i] = 0;
}
for (int i = 0; i < wordlist.length; i++) {
char *string = wordlist.buffer[i];
for (int j = 0; j < len; j++) {
char predCharacter = string[j];
char realCharacter = query[j];
if (realCharacter == '_') {
if (forbidden[predCharacter] == 1)
goto forbiddenWord;
} else {
if (predCharacter != realCharacter)
goto forbiddenWord;
}
if (noCount[predCharacter] == 1)
goto skipCount; | {
"domain": "codereview.stackexchange",
"id": 38842,
"lm_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, c, hangman, simd",
"url": null
} |
scrnaseq, single-cell, gene-expression, 10x-genomics, cellranger
Title: 10X scRNAseq: Sample mix-up The student who was working on scRNA seq of KO and WT lines has made a mistake and he mixed both lines and generate the final sequencing data. Now, we are having gene expression data but don't know which is KO and which is WT.
It's a genetic KO. Looking at the presence of absence of the KO gene might not be helpful here as its not deep sequenced.
Cells were extracted from two stable line of animal; one wild type and other Chd2 gene knocked out. As a sequencing output I am having one fastq file in the format 28+10+10+90 . I can generate a count matrix out of it; but I dont know which barcode from WT and with one from KO.
Is there any way to segregate the output based on the KO gene expression?
Thanks If the samples were from different individual organisms you could try looking for mitochondrial variants that differentiate between them. You should have reasonable coverage of the entire mitochondrial mRNA transcriptome even in 10x datasets. | {
"domain": "bioinformatics.stackexchange",
"id": 1923,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scrnaseq, single-cell, gene-expression, 10x-genomics, cellranger",
"url": null
} |
quantum-mechanics, hilbert-space, antimatter, dirac-equation, spinors
and expatiatory. You are confusing the negative energy solutions of Dirac's equation (your third and forth wavefunction) with legitimate particle (or antiparticle wavefunctions). You can't learn anything about physical interactions by studying the inner products of these solutions with the positive energy solutions (which do represent real particle wavefunctions). | {
"domain": "physics.stackexchange",
"id": 34558,
"lm_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, antimatter, dirac-equation, spinors",
"url": null
} |
python, beginner, python-3.x, primes, time-limit-exceeded
largest_factor = 1
i = 2
# i is a possible *smallest* factor of the (remaining) number n.
# If i * i > n then n is either 1 or a prime number.
while i * i <= n:
if n % i == 0:
largest_factor = i
# Divide by the highest possible power of the found factor:
while n % i == 0:
n //= i
i = 3 if i == 2 else i + 2
if n > 1:
# n is a prime number and therefore the largest prime factor of the
# original number.
largest_factor = n
return largest_factor
Timing for the largest prime factor of 600851475143 (on a 3,5 GHz Intel Core i5 iMac):
Your method: 43 seconds
Sieve method from @wei2912: 0.2 seconds
Above method: 0.016 seconds | {
"domain": "codereview.stackexchange",
"id": 10667,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, primes, time-limit-exceeded",
"url": null
} |
general-relativity, black-holes, experimental-physics, speed-of-light, gravitational-lensing
Title: Can we use curved spacetime to measure the one-way speed of light? This is related to Measuring one-way speed of light with gravitational lensing and Measuring the one-way speed of light with a black hole?
The idea is to shine a beam of light from a clock towards a heavy mass, like a black hole, in some manner such that the curvature of spacetime around the mass is sufficient to "bend" the light directly back to the clock. That is, to send the light along a self-intersecting geodesic using a sufficiently curved spacetime. Note that in this case the source and the detector are the same object, so no clock synchronization is required. Hypothetically, this should measure the one-way speed of light.
None of the given refutations from the similar posts on this site are convincing. Here are some of the main refutations, as I understand them, and my counter to them:
(1) In being curved by spacetime, the light is actually changing direction, hence this is not the one-way speed. | {
"domain": "physics.stackexchange",
"id": 75272,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, black-holes, experimental-physics, speed-of-light, gravitational-lensing",
"url": null
} |
thermodynamics, temperature, everyday-life, thermal-conduction
When you touch something initially at room temperature there will be heat transfer away from your skin to the object because the temperature of your skin is higher than room temperature. How "cold" each object will feel depends primarily on the heat transfer rate from the skin as that determines how quickly the skin cools (decreases in temperature). That, in turn, will depend on the thermal conductivity of the material being touched. The thermal conductivity of rock and rock like materials (k = 0.92 W/$m\cdot K$), fall between the extremes of metal (203 W/m.K for aluminum) and plastic (average of about 0.25 W/m.K). It will also depend on what area of skin is in contact with the object. The object will feel cooler on the skin of the forearm (very thin skin) than the finger pad (thicker skin). | {
"domain": "physics.stackexchange",
"id": 95992,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, temperature, everyday-life, thermal-conduction",
"url": null
} |
optimization, performance, beginner, vba, excel
Dim path As String
path = GetFolder("") & "\"
Debug.Print path
End Sub
' strPath is the initial path
Private Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function | {
"domain": "codereview.stackexchange",
"id": 7860,
"lm_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, performance, beginner, vba, excel",
"url": null
} |
### Question 1.12
Suppose a $$p{\hbox{-}}$$group acts on a set whose cardinality is not divisible by $$p$$ ($$p$$ prime). Prove that there is a fixed point for the action.
### Question 1.13
Prove that the centre of a group of order $$pr$$ ($$p$$ prime) is not trivial.
### Question 1.14
Give examples of simple groups. Are there infinitely many?
### Question 1.15
State and prove the Jordan-Holder theorem for finite groups.
### Question 1.16
What’s Cayley’s theorem? Give an example of a group of order $$n$$ that embeds in $$S_m$$ for some $$m$$ smaller than $$n$$.
Give an example of a group where you have to use $$S_n$$.
### Question 1.17
Is $$A_4$$ a simple group? What are the conjugacy classes in $$S_4$$? What about in $$A_4$$?
### Question 1.18
Talk about conjugacy classes in the symmetric group $$S_n$$.
### Question 1.19
When do conjugacy classes in $$S_n$$ split in $$A_n$$?
### Question 1.20
What is the centre of $$S_n$$? Prove it.
### Question 1.21 | {
"domain": "dzackgarza.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743636887527,
"lm_q1q2_score": 0.8030827774478073,
"lm_q2_score": 0.8104789132480439,
"openwebmath_perplexity": 362.4303021135475,
"openwebmath_score": 0.9997151494026184,
"tags": null,
"url": "https://quals.dzackgarza.com/10_Algebra/TexDocs/QualAlgebra_stripped.html"
} |
cosmology, modified-gravity
Title: Is there any problem with the idea that gravity is repulsive at long distances? If gravity is repulsive at long distances, would this suffice in explaining "dark energy"? Was there any reason why a new concept (dark energy) was introduced rather than just assuming that gravity becomes repulsive over long distances? Gravity, per general relativity (GR), is normally attractive. Normally means that the sources of the gravity, and thus the sources that determine the geometry and curvature of spacetime, have positive energy density, and obey other positive energy conditions. The pressure and other factors that enter into the stress energy tensor that is the source of the curvature of spacetime can, however, be negative for so called exotic matter, or exotic fields. In those cases those factors contribute to a repulsive effect in gravity.
But it is not repulsive then when far away, it is then repulsive everywhere. The negative pressure contributes everywhere, not just at a distance. | {
"domain": "physics.stackexchange",
"id": 31847,
"lm_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, modified-gravity",
"url": null
} |
c#, thread-safety
The outer if seems to be effectively "If no other thread is interlaced with us and has beaten us to the update"; then the inner while / if seems to assume that we're still interlaced with another thread which has also made it past the outer if.
Either the outer if is an effective guard, in which case the body can be simplified to a direct assignment; or it isn't, in which case it needs to be replaced with one.
Although I'm not quite sure what you're trying to do, I'm almost certain that Monitor.TryEnter would be a better way of doing it than Interlocked.CompareExchange. | {
"domain": "codereview.stackexchange",
"id": 25129,
"lm_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#, thread-safety",
"url": null
} |
ros-melodic, catkin-make
And
python -c 'import catkin_pkg; print(catkin_pkg.__file__)'
got
/usr/lib/python2.7/dist-packages/catkin_pkg/__init__.pyc
And
printenv | grep ROS
ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_PACKAGE_PATH=/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=melodic | {
"domain": "robotics.stackexchange",
"id": 31049,
"lm_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-melodic, catkin-make",
"url": null
} |
quantum-mechanics, classical-mechanics, spacetime, universe, theory-of-everything
Title: Is it possible that the universe is (logically) classical (as opposed to, say, intuitionistic or minimal) within certain limits, but not generally? This question is one that has been bothering me for some time now. We have assumed, based on our observations, that the universe is subservient to the principles of classical logic. But is it necessarily so? Could it be that the universe is not logically classical but only behaves in that manner under the limits we can observe?
Additionally, there are known to be several gaps in modern theory. Is it possible that some (though not necessarily all) of them arise out of applying the limits of classical logic on systems that do not adhere to classical logic?
It seems highly unlikely, and the question feels extremely isolated from physical reality, but I cannot convince myself that it is trivial enough to be straightforwardly dismissed. So, to sum up: | {
"domain": "physics.stackexchange",
"id": 36713,
"lm_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, classical-mechanics, spacetime, universe, theory-of-everything",
"url": null
} |
regex, bash, shell, perl, sh
Finally
We need to count all lines:
echo $allFiles | xargs wc -l | tail -n 1 | cut -d " " -f 2
I wonder if my solution is good enough or not.
fileExt="*.js"
allFiles=$(find ./ -name $fileExt)
This is a bug. The wildcard in $fileExt will be expanded by the shell, and cause a syntax error when the current directory has more than one matching file in it:
$ touch a.js b.js
$ fileExt="*.js"
$ find ./ -name $fileExt
find: paths must precede expression: `b.js'
find: possible unquoted pattern after predicate `-name'?
You need to quote the variable. Better yet, use the globstar option to populate an array and eliminate find altogether:
fileExt="js"
shopt -s globstar
declare -a allFiles=( **/*.$fileExt )
grep … "${allFiles[@]}" # to use the array
This regex does not match blank lines:
grep '^[[:space:]]*//' | {
"domain": "codereview.stackexchange",
"id": 34715,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regex, bash, shell, perl, sh",
"url": null
} |
species-identification, species-distribution
Can someone help me ID this bird? And, are peacocks wild in KY? Have they always been, and are just rare? Aside from species ID, any insights about this bird and its prevalence within KY would be most appreciated. That is the male of the Indian peafowl species (Pavo cristatus), also called the blue peafowl or common peafowl. The male is called a peacock and the female a peahen, collectively peafowl, although often "peacocks" is used instead of peafowl. The hen does not have the impressive tail of the peacock (although she does have a similar crest on the head).
They are not native to Kentucky, or anywhere else in the Americas, but have been widely introduced (because of their appearance). There are only 3 species of peafowl, the green peafowl being similar and native to southeast Asia, and the Congo peafowl being much more subdued and native to Africa. | {
"domain": "biology.stackexchange",
"id": 7867,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "species-identification, species-distribution",
"url": null
} |
python, python-3.x, pyqt
if numberOfFeatures >= 0: # Checks if numberOfFeatures is greater than or equal to 0
while numberOfFeatures >= 0: # Loop that runs while numberOFFeatures is greater than or equal to 0
name = features[numberOfFeatures].find('Name') # Finds the tag name in the selected feature and stores it in the variable name
self.listOfFeatures[name.text]= numberOfFeatures # Creates a key for self.listOfFeatures and gives it the value of numberOfFeatures
self.featureComboBox.addItem(name.text) # Adds the text value of name to featureComboBox | {
"domain": "codereview.stackexchange",
"id": 17855,
"lm_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, pyqt",
"url": null
} |
ros, moveit, ur-modern-driver, ur10
Originally posted by Jarek Potiuk on ROS Answers with karma: 31 on 2017-11-28
Post score: 3 | {
"domain": "robotics.stackexchange",
"id": 29467,
"lm_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, moveit, ur-modern-driver, ur10",
"url": null
} |
functional-programming, ct.category-theory, recursion
This f has a completely non-circular definition, so to give meaning to recursive definitions it suffices to have a "fixed-point operator"
fix :: (a -> a) -> a
that guarantees fix g == g (fix g) for every function g, because then we can define fact = fix f (instantiating a to Int -> Int), cf. https://hackage.haskell.org/package/base/docs/Data-Function.html#v:fix
So now, the category-theoretic counterpart of fix is going to be a family of morphisms $fix_A : (A \to A) \to A$ satisfying a bunch of conditions (such as the fixed-point equation and dinaturality); such categorical fixed-point operators have been studied in the literature, for example here (this paper involves the domain theory that Andrej mentioned). And that gives you a categorical treatment of general recursion!
(I'll let someone else explain the catamorphism stuff, but for now let me note that there is no "polynomial functor for factorial", but there is a functor whose initial algebra is the natural numbers.) | {
"domain": "cstheory.stackexchange",
"id": 5524,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "functional-programming, ct.category-theory, recursion",
"url": null
} |
newtonian-mechanics, harmonic-oscillator, spring
Title: Why does a spring mass system oscillate? For simply harmonic motion,
acceleration $= -\omega^2 x$, where $\omega$ is the angular frequency.
Within limits of Hooke's law,
the restoring force on the spring is given by
$$F= -k \cdot x$$
This force fits the simple harmonic motion condition with $k=\omega^2m$.
But, we have $F = 0$ for $x=0$.
If I displace block (of some mass) attached to a spring (massless) rightward (on horizontal plane), and then release it, it would accelerate leftward because of above spring force.
But at the moment when $x=0$, $F=0$ and thus $a=0$.
Then why does the spring block system experience simple harmonic motion?
Or why would the block accelerate farther leftward if there is no force on it?
I'm confused.
Or why would the block accelerate farther leftward if there is no force on it? | {
"domain": "physics.stackexchange",
"id": 86684,
"lm_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, harmonic-oscillator, spring",
"url": null
} |
Commented Mathematical property (CMP):
\psi : (integer, real) $\rightarrow$ real
Commented Mathematical property (CMP):
\psi : (integer, complex) $\rightarrow$ complex
Commented Mathematical property (CMP):
\psi : (symbolic, symbolic) $\rightarrow$ symbolic
Commented Mathematical property (CMP):
$\psi^{(n)}(1)=(-1)^{n+1}n! \zeta (n+1)$, $n>0$, integer value
Commented Mathematical property (CMP):
$\psi^{(n)}(\frac{1}{2})=(-1)^{n+1}n!(2^{n+1}-1) \zeta(n+1)$, $n=1, 2, \dots$, fractional value
Commented Mathematical property (CMP):
$\psi^{(n)}(z+1)=\psi^{(n)}(z)+(-1)^nn!z^{-n-1}$, recurrence relation
Commented Mathematical property (CMP):
$\psi^{(n)}(z)=(-1)^{n+1}n!\sum_{k=0}^{\infty}(z+k)^{-n-1}$ , $z \neq 0. -1. -2. \dots$, series expansion
Signatures:
sts
[Next: IncompleteGammaQuotient] [Previous: Digamma] [Top]
## IncompleteGammaQuotient | {
"domain": "uwo.ca",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429147241161,
"lm_q1q2_score": 0.8007091875811518,
"lm_q2_score": 0.8128673133042217,
"openwebmath_perplexity": 8260.870328403802,
"openwebmath_score": 0.8763903379440308,
"tags": null,
"url": "http://www.scl.csd.uwo.ca/~bill/OpenMath/SpecialFns/html/cd/gammaFnsPlus.html"
} |
quantum-mechanics, general-relativity, operators, dirac-equation
Title: Dirac equation from a vierbein operator? Klein-Gordon equation can be derived straightforwardly by getting the mass-energy relation from special relativity in tensorial form, $$\eta^{\mu\nu}p_{\mu}p_{\nu} = m^2c^2$$
and promoting the variables to operators.
Dirac's motivation to find its equation was to find a first order equation instead of second order, so my idea was: | {
"domain": "physics.stackexchange",
"id": 28775,
"lm_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, general-relativity, operators, dirac-equation",
"url": null
} |
python, noise, digital-to-analog
I have a suggestion:
if my signal would be greater than B, could I say:
if signal[i] > B : signal[i] = B - (signal[i] - B) | {
"domain": "dsp.stackexchange",
"id": 12408,
"lm_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, noise, digital-to-analog",
"url": null
} |
bash
# start the machine
open -a VirtualBox
VBoxManage startvm "$OS_NAME"
}
build_main
Here is a simple operating system to use for testing, hello.asm
BITS 16
start:
mov ax, 07C0h ; Set up 4K stack space after this bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; Set data segment to where we are loaded
mov ds, ax
mov si, text_string ; Put string position into SI
call print_string ; Call our string-printing routine
jmp $ ; Jump here - infinite loop!
text_string db 'hello world', 0
print_string: ; Routine: output string in SI to screen
mov ah, 0Eh ; int 10h 'print char' function
.repeat:
lodsb ; Get character from string
cmp al, 0
je .done ; If char is zero, end of string
int 10h ; Otherwise, print it
jmp .repeat
.done:
ret | {
"domain": "codereview.stackexchange",
"id": 8343,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bash",
"url": null
} |
quantum-field-theory, gauge-theory, path-integral, yang-mills, wilson-loop
Vacuum bubbles
As usual in perturbation theory, we can factorise vacuum diagrams. You will obtain up to notations:
All $n ≥ 2$ factors vanish because the product of the step functions vanishes everywhere except on a set of measure zero.
So we have only one contribution ($\theta(0)=1/2$):
$$
\exp\left(i (N/2 - \kappa )\int dt\; \alpha(t)\right)
=
\exp\left(-i \kappa_{eff} \int dt\; \alpha(t)\right)
$$
Path integral with insertions
$$
Z_w[A]= \int\mathcal{D}\lambda\mathcal{D}w \mathcal{D}w^{\dagger}\; e^{iS_w (w;\lambda;A)} w_i(\tau=\infty)w_i^{\dagger}(\tau=-\infty)
$$
This integral correspond to following series of diagrams (times to vacuum bubbles factor):
This series correspondence to:
Including vacuum bubbles we left with:
$$
Z_\omega[A] = W[A]\int D\alpha e^{-i\int dt \;\alpha(t) (\kappa_{eff}-1)}
$$
If $\kappa_{eff}= 1$, we obtain:
$$
Z_\omega[A] = W[A]
$$ | {
"domain": "physics.stackexchange",
"id": 66078,
"lm_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, gauge-theory, path-integral, yang-mills, wilson-loop",
"url": null
} |
species-identification, zoology, invertebrates, limnology
Photo Credit: Jean-Marie Cavanihac
Rotifers are small (always < 2 mm) and so eat small planktonic and protist prey. From UC Berkeley:
As rotifers are microscopic animals, their diet must consist of matter small enough to fit through their tiny mouths during filter feeding. Rotifers are primarily omnivorous, but some species have been known to be cannibalistic. The diet of rotifers most commonly consists of dead or decomposing organic materials, as well as unicellular algae and other phytoplankton that are primary producers in aquatic communities.
As for body shape:
Although all Rotifer species are bilateral animals, they vary quite a bit in body shape. Box-like shaped rotifers are referred to as being loricate, while more flexible worm-shaped species are considered to be illoricate. | {
"domain": "biology.stackexchange",
"id": 9583,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "species-identification, zoology, invertebrates, limnology",
"url": null
} |
galaxy, classification
Title: Where did the grand design spiral galaxy designation come from? What is the history behind the name that we gave to that class of galaxies? The term can be traced back to the theoretical work of C.C.Lin in explaining the spirals as due to density waves in galactic discs.
A paper from 1970 discusses the "Existence of 'Grand Design'". Note the use of "scare quotes", suggesting that the term was new and would not be widely recognised by his readers.
Chia-Chiao Lin was an important Chinese/American Mathematician. It is reasonable to believe that the term was coined by him or one of the mathematicians that he worked with at MIT. And was in use since about 1964, when the first of a series of papers "On the structure of Spiral Galaxies" was published. | {
"domain": "astronomy.stackexchange",
"id": 1690,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "galaxy, classification",
"url": null
} |
And let's check that its cube really is unity (that is, $$1$$):\begin{align*} \left( 1 \cdot \mathrm{e}^{\mathrm{i} (1 \cdot 2\pi /3)} \right) ^ 3 &= 1^3 \cdot \left( \mathrm{e}^{\mathrm{i} (1 \cdot 2\pi /3)} \right) ^ 3 \\ &= 1 \cdot \mathrm{e}^{3 \mathrm{i} (1 \cdot 2\pi /3)} \\ &= 1 \cdot \mathrm{e}^{\mathrm{i} 2\pi} \\ &= 1 \cdot 1 \\ &= 1 \text{.} \end{align*} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462226131666,
"lm_q1q2_score": 0.8030692006220346,
"lm_q2_score": 0.8128673223709251,
"openwebmath_perplexity": 394.90185322550167,
"openwebmath_score": 0.9952365159988403,
"tags": null,
"url": "https://math.stackexchange.com/questions/3261726/what-is-the-meaning-of-nth-root-of-unity/3261739"
} |
python, object-oriented, array, random
How can I make this faster? The larger the world size, the longer the generation time.
What am I doing that is "un-pythonic"?
Are there any issues that I missed?
You can remove some nesting by returning early.
There are other changes that could bring down memory usage, but in
general using generators instead of creating full lists is beneficial
(xrange below).
List comprehensions as a single function argument can be used without
the rectangular brackets, i.e. "".join(x for x in []).
Multiplying a list is a bit more concise then the equivalent list
comprehension ([None] * 4), but beware of sharing if you were to
nest that ([[None] * 4] * 4 contains the same list four times). That
was already mentioned in the first post/answer.
I've added _map_tiles method to extract the shared "iterate over all
map tiles" behaviour.
The smoothing function is a bit weird in the sense that the two tests
can easily be merged into a single case and an addition. I don't know | {
"domain": "codereview.stackexchange",
"id": 13483,
"lm_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, array, random",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.