text stringlengths 1 1.11k | source dict |
|---|---|
genetics, molecular-genetics
"The application of the phenotype test to pairs of rII mutants leads to the division of the region into two functionally separable segments."
This is as close as he dared to go to claiming to be studying genes. He refers to 'functional units' but never uses the word 'genes' because at this stage that word belonged to classical genetics in higher organisms. In 1957 he proposed the word cistron for the functional unit defined by this type of test, and the word caught on, particularly because of its incorporation into the operon model with the idea of polycistronic mRNA. His other coinings, muton and recon were not adopted.
The two T4 genes/cistrons in the rII region of the phage genome are now called rIIA and rIIB.
Benzer, S (1955) Fine structure of a genetic region in bacteriophage Proc. Natl. Acad. Sci. USA 41:344-354 | {
"domain": "biology.stackexchange",
"id": 2392,
"lm_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, molecular-genetics",
"url": null
} |
that can be computed from the elements of a square matrix. If necessary, refer to the information and examples above for description of notation used in the example below. And press "to A" SAVING. Frank Wood, fwood@stat.columbia.edu Linear Regression Models Lecture 11, Slide 21 Hat Matrix Properties ⢠The hat matrix is symmetric ⢠The hat matrix is idempotent, i.e. For example, you can multiply a 2 × 3 matrix by a 3 × 4 matrix, but not a 2 × 3 matrix by a 4 × 3. {\displaystyle (\mathbf {P})}, sometimes also called the influence matrix or hat matrix {\displaystyle (\mathbf {H})}, maps the vector of response values (dependent variable values) to the vector of fitted values (or predicted values). Eventually, we will end up with an expression in which each element in the first row will be multiplied by a lower-dimension (than the original) matrix. If necessary, refer above for description of the notation used. For example, the determinant can be used to compute the inverse of a matrix | {
"domain": "fourstudios.media",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551495568569,
"lm_q1q2_score": 0.8181660564755098,
"lm_q2_score": 0.8479677564567912,
"openwebmath_perplexity": 641.5613088290357,
"openwebmath_score": 0.7779673933982849,
"tags": null,
"url": "https://fourstudios.media/xa6krg/hat-matrix-calculator-84cb16"
} |
• $\ln3~\simeq~{\large1}~\dfrac{71}{720}~.~$ – Lucian Aug 22 '17 at 23:35
• How? Seems impressively close, better than taking the Taylor series in both answers to the fifth power! – Oscar Lanzi Aug 23 '17 at 1:15
• @Lucian : $\frac{713}{649}$ is closer, with a smaller denominator. (In case OscarLanzi is interested: this number is the four term continued fraction of $\ln 3$, $[1; 10,7,9] = 1+\frac{1}{10+\frac{1}{7+\frac{1}{9}}}$.) – Eric Towers Aug 23 '17 at 3:34 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9755769099458927,
"lm_q1q2_score": 0.8212656694660101,
"lm_q2_score": 0.8418256532040708,
"openwebmath_perplexity": 541.3147817891767,
"openwebmath_score": 0.9875024557113647,
"tags": null,
"url": "https://math.stackexchange.com/questions/2402177/best-approximation-of-log-3"
} |
quantum-mechanics, observational-astronomy, interferometry, instrument
Where $I_1$ and $I_2$ are the measurements at two separated detectors, and the angle brackets indicate time averages.
[1] The Intensity Interferometer, Hanbury Brown.
[2] Optical Stellar Interferometry, Labeyrie. | {
"domain": "physics.stackexchange",
"id": 3012,
"lm_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, observational-astronomy, interferometry, instrument",
"url": null
} |
special-relativity, time-dilation
The bottom line is that:
while the actual observations of the other traveler appear to be irregular because of their relative motions, they will be identical when they reunite and compare notes. Indeed, by your construction, their worldlines through spacetime are symmetrical.
I've located events that would be useful to describe what Bob [in BLUE] (the initially-forward traveler) would say about Carol [in GREEN] (the initially-backward traveler). Alice [in RED] is the inertial observer. | {
"domain": "physics.stackexchange",
"id": 52482,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, time-dilation",
"url": null
} |
thermodynamics
PD:it's very likely that its methanol instead of ethanol, please let me know... I have access to both, I just want the one that will go to the lowest temp. its me again, I want to post the answer I found because I think it might be useful for somebody in the future; it appears a 2:3 molar acetone:methanol proportion gives the lowest freezing temperature ~158 K (see attached picture below).
It appears the difficulty finding these curves was because they are usually called "solid-liquid equilibrium" curves instead of "freezing point curves", as its the same physical situation (Explanation Here)
There is a large database of these in the following link.
EDIT: As commented by "Ivan Neretin", ethanol-acetone mixtures are also good for low freezing temperatures: | {
"domain": "chemistry.stackexchange",
"id": 12096,
"lm_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",
"url": null
} |
python, performance, python-2.x, image, multiprocessing
#Backup classes if section closed
for key in classes:
ClassDict = {}
if (classes[key]["title"] == classes[selection]["title"]) and (classes[key] != classes[selection]):
for classkey in classes[key]:
ClassDict[str(classkey)] = classes[key][classkey]
backupClasses[str(ClassDict["section"])] = ClassDict #Put extra sections with the same title in a dictionary
if classToSort:
var.SendVars("color", colorStep + 30)
activities = ["LEC", "L/L", "LAB", "PSI", "QUZ", "RCT", "SEM", "PRA", "HSG", "MCE", "WSP"]
activitiesDict = {"LEC": {}, "L/L": {}, "LAB": {}, "PSI": {}, "QUZ": {}, "RCT": {}, "SEM": {}, "PRA": {}, "HSG": {}, "MCE": {}, "WSP": {}} | {
"domain": "codereview.stackexchange",
"id": 26996,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-2.x, image, multiprocessing",
"url": null
} |
Otherwise, if we draw a half-tablet, then the total number of tablets and the number of half-tablets both decrease by one, and the number of whole tablets stays the same.
Hence, knowing only the number of whole tablets chosen over the total number of days, we can calculate exactly how many half-tablets and whole tablets are left in the jar. Specifically, let $X_t$ be the number of whole tablets drawn up to time $t$ (inclusive). Then, the number of remaining whole tablets is $W_t = n - X_t$ and the number of half-tablets is $H_t = X_t - (t-X_t) = 2 X_t - t$. (The last quantity can be seen to arise from the $X_t$ half-tablets created by drawing each of the $X_t$ whole tablets and replacing them with a half-tablet minus the $t-X_t$ half-tablets we must have consumed.)
Conditional probability | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399069145609,
"lm_q1q2_score": 0.8064081472995706,
"lm_q2_score": 0.8311430415844384,
"openwebmath_perplexity": 596.6318101226778,
"openwebmath_score": 0.8288044333457947,
"tags": null,
"url": "http://stats.stackexchange.com/questions/19667/taking-random-items-out-of-a-container-with-replacement/19689"
} |
\blue2 \red i^6 \\ ( … Imaginary numbers are called imaginary because they are impossible and, therefore, exist only in the world of ideas and pure imagination. In these cases, we call the complex number a number. can give results that include imaginary numbers. This tutorial shows you the steps to find the product of pure imaginary numbers. Meaning of pure imaginary number with illustrations and photos. Addition / Subtraction - Combine like terms (i.e. (More than one of these description may apply) 1. See more. The square root of minus one √(−1) is the "unit" Imaginary Number, the equivalent of 1 for Real Numbers. Another Frenchman, Abraham de Moivre, was amongst the first to relate complex numbers to geometry with his theorem of 1707 which related complex numbers and trigonometry together. Imaginary Numbers are not "imaginary", they really exist and have many uses. If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. The | {
"domain": "gridserver.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9553191335436404,
"lm_q1q2_score": 0.8081449999477799,
"lm_q2_score": 0.8459424411924673,
"openwebmath_perplexity": 944.4802991591857,
"openwebmath_score": 0.7889542579650879,
"tags": null,
"url": "https://s147164.gridserver.com/innovative-industrial-lgdzje/393838-pure-imaginary-numbers-examples"
} |
c#, reflection
Any exceptions at this point will be fatal, and are trapped and logged in the calling code before a (hopefully) graceful exit. This code is only called once at startup and the object it obtains isn't released until the application exits. I've been having a hard time finding information about the performance implications of using an object reference obtained this way, so I'd especially welcome comments from that direction. My assumption is that the main performance penalty is in obtaining the reference, but I haven't been able to find out whether or not that is true in practice.
I'm mainly looking for feedback on my method of connecting with the back-end, but am certainly open to comments/criticism of code style, practices, etc.
Thoughts? You're loading every DLL in the directory even if you find what you want in the first one.
I'd guess that loading an assembly is what takes more time and resources than looking for what you want in the assembly-after-it's-loaded. | {
"domain": "codereview.stackexchange",
"id": 6084,
"lm_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#, reflection",
"url": null
} |
electric-circuits, electronics
the desirable effect of providing a stable 'zero beat',
so that the instrument, once properly tuned, is silent
when the player steps away from it.
Question:
What I would like to understand is how the two output signals of the two oscillators are combined with the use of the capacitors C2 and C6.
Is it correct to say that the two capacitors work as modulator?
I'm saying this because the produced signal as you can see goes through a detector. Could you explain what exactly happens at the capacitors or how they combine the signal? | {
"domain": "physics.stackexchange",
"id": 23555,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, electronics",
"url": null
} |
of the cycloid. can be found from the equations: *If is positive, (i. 2-find the coordinates of a point P on the circumference of a circle as it rolls along a line. Learn what is cycloid. Whether you are a mathlete or math challenged, Photomath will help you interpret problems with comprehensive math content from arithmetic to calculus to drive learning and understanding of fundamental math concepts. The equivalent of any such equation, as a mathematical representation of a curve, is a computerized procedure that contains, in our case, a simple-action-step. Previously he had taught Greek, and actually had devoted the first part of his youth to literary and theological studies. θ is the angle rotated by the rolling circle. Parametrizations of Plane Curves Definition. The derivative of a vector function22 8. Find the volume of the. A model teaching for the cycloid curves by the use of dynamic software with multiple representations approach. The History of Mathematics. C) Find The Area | {
"domain": "crashmobile24.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692325496973,
"lm_q1q2_score": 0.8095990297539375,
"lm_q2_score": 0.8289388083214155,
"openwebmath_perplexity": 737.7284894527172,
"openwebmath_score": 0.7113257050514221,
"tags": null,
"url": "http://hhdg.crashmobile24.de/cycloid-mathematical-equation.html"
} |
inorganic-chemistry, nomenclature, coordination-compounds
Nomenclature
For nomenclature purposes, any form of $\ce{NO}$ bound to a metal is always treated as a neutral three electron donor and is always termed nitrosyl. This is because IUPAC wants rules that can be applied blindly without having to perform complicated experiments to determine how exactly the ligand is bound. And we shall see in a second that it is very non-trivial.
Considering that and checking the $\ce{[Fe(CN)5NO]^2-}$ fragment, we take away 5 $\ce{CN-}$ leaving us with $\ce{[Fe(...)NO]^3+}$ which indicates that the correct IUPAC name for sodium nitroprusside is sodium pentacyanidonitrosylferrate(III). (Not (II).)
The product formed would be, by the same approach, sodium pentacyanidonitrosylsulfidoferrate(III). But we’ll come back to that.
But what is the actual ligand? | {
"domain": "chemistry.stackexchange",
"id": 4400,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, nomenclature, coordination-compounds",
"url": null
} |
$$2x^2-x-3 = (2x \color{green}{-3})(x\color{green}{+1})$$
We do a quick check:
$$(2x-3)(x+1) = 2x^2 +2x -3x -3 = 2x^2 -x -3$$
It works.
• The quadratic formula is introduced pretty early, I thought. But this use of it may be something that OP hasn't seen. I've thought that maybe a diagram could be used to illustrate completing the square. Oct 13 '15 at 3:37
• @AdamHrankowski It is introduced pretty early. In the US, it's often shown in grade 7-9 depending on skill. That being said, there are classes at my university that have students who have yet to learn to factor. I hope my dialogue helps instead of hinders! There are a lot of ways to slice this cake :) Oct 13 '15 at 3:43
• I'm in BC, Canada, and I haven't seen it until Grade 11. Oct 13 '15 at 3:45
You can get a monic polynomial out of his by putting $y=2x$. The expression becomes $$\frac12(y^2-y-6)$$ which you can easily factorise as $$\frac12(y-3)(y+2)$$ Substituting back gives $$(2x-3)(x+1)$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743636887527,
"lm_q1q2_score": 0.8320708608850618,
"lm_q2_score": 0.8397339676722393,
"openwebmath_perplexity": 222.68592158994713,
"openwebmath_score": 0.8389829993247986,
"tags": null,
"url": "https://math.stackexchange.com/questions/1477307/how-do-you-factorize-quadratics-when-the-coefficient-of-x2-gt-1"
} |
## Option 3:
\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\intertext{where}
\begin{aligned}
&k =\frac{2 \pi }{\lambda }\\
&s =\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{aligned}\notag
\end{gather}
\end{document}
## Option 4:
Using \shortintertext (Peter Grill's idea):
\documentclass[preview,border=12pt]{standalone}
\usepackage{mathtools}
\begin{document}
\begin{gather}\label{eq:2.1}
\frac{J_1(a k s)}{\sqrt{\pi } s}\\
\shortintertext{where}
\begin{aligned}
&k =\frac{2 \pi }{\lambda }\\
&s =\sqrt{\left(\frac{u}{z_2}+\frac{x}{z_1}\right){}^2+\left(\frac{v}{z_2}+\frac{y}{z_1}\right){}^2}
\end{aligned}\notag
\end{gather}
\end{document}
The difference between \intertext and \shortintertext: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.8872045817875224,
"lm_q1q2_score": 0.8127766486281761,
"lm_q2_score": 0.9161096158798117,
"openwebmath_perplexity": 5139.35085627615,
"openwebmath_score": 0.9594568610191345,
"tags": null,
"url": "https://tex.stackexchange.com/questions/110746/equations-and-defining-equation-variables"
} |
c#, performance, array, console, ascii-art
it initialises all fields, including the Cells 2D array, which is an array of Cell objects. A Cell has four "walls": north, east, south and west, and they're all initially set to true. The Maze constructor then calls the Create method, which traverses through each cell of the maze and "knocks down" walls until each cell has been visited, using the depth-first search algorithm outlined here: https://scipython.com/blog/making-a-maze/.
Once this is done, the SetDisplayGrid method is then called by the Maze constructor. This takes a 2D char array, DisplayGrid - which has the size 2n + 1 for each dimension of the Cells array n (meaning that if the Cells array is 5 x 10, DisplayGrid will be 11 x 21) - and populates it with box characters, according to the "wall" boolean values in each cell. This is where I think my code may be inefficient, because I have so many conditionals.
Broadly, the approach is: | {
"domain": "codereview.stackexchange",
"id": 41624,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, array, console, ascii-art",
"url": null
} |
homework-and-exercises, electromagnetism, electric-circuits, electric-current, electromagnetic-induction
Title: Can Faraday Law be applied to a loop with some twists and turns in it?
Consider the above question. I have been able to solve the question understanding area vector of A and B are opposite in direction.
However I have some conceptual doubts.
In Faraday Law, when we say "area enclosed by a closed loop", does it coherently include all type of loops -- with twists and turns as given in the above question. | {
"domain": "physics.stackexchange",
"id": 71218,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, electromagnetism, electric-circuits, electric-current, electromagnetic-induction",
"url": null
} |
c, generics, c11
static unsigned char *map_uc(size_t len, const unsigned char iter[static len],
unsigned char (*func)(unsigned char x))
{
unsigned char *out = malloc(sizeof *out * len);
if (!out) {
return ((void *) 0);
}
for (size_t i = 0; i < len; ++i) {
out[i] = func(iter[i]);
} return out;
}
static short int *map_si(size_t len, const short int iter[static len],
short int (*func)(short int x))
{
short int *out = malloc(sizeof *out * len);
if (!out) {
return ((void *) 0);
}
for (size_t i = 0; i < len; ++i) {
out[i] = func(iter[i]);
} return out;
}
static unsigned short int *map_usi(size_t len,
const unsigned short int iter[static len],
unsigned short int (*func)(unsigned short int x))
{
unsigned short int *out = malloc(sizeof *out * len);
if (!out) {
return ((void *) 0);
}
for (size_t i = 0; i < len; ++i) {
out[i] = func(iter[i]);
} return out;
} | {
"domain": "codereview.stackexchange",
"id": 45401,
"lm_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, generics, c11",
"url": null
} |
ros, pcl, ros-fuerte, ubuntu
Title: Upgrading to PCL 1.6.0 with ROS fuerte Ubuntu 12.04
Hi all,
I am trying to download the latest PCL library so that I can try using their object recognition code, however I can't figure out how to properly install it.
I followed the instruction for compiling from source on the PCL website http://pointclouds.org/downloads/source.html.
"cd PCL-1.6.0 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install"
Everything seems to install fine but when I searched through the folders it generated, the file paths were all different. For example, planar_polygon.h should be in /pcl/geometery/planar_polygon.h, instead it is in pcl-1.6/pcl/geometery/include/pcl/geometery/. It seems like all the header files that my programs want are buried in sub-directories. Did I compile/make my pcl library incorrectly? | {
"domain": "robotics.stackexchange",
"id": 10380,
"lm_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, pcl, ros-fuerte, ubuntu",
"url": null
} |
fourier-transform, frequency-response, fourier
Title: Computing the frequency response using fourier transform of an unstable LCCDE system Given LCCDE system. Is it possible to calculate the frequency response using Fourier transform? It is slightly more intuitive to solve this problem using the Z-domain, which is a more generalized version of the Fourier transform. The Z-transform of a discrete-time signal $x[n]$ is
$$X(z)=\sum_{n=-\infty}^{\infty}{x[n]z^{-n}}.$$
Applying this transform to both $x$ and $y$ in your equation,
$$y[n]-\frac{1}{15}y[n-1]+\frac{1}{5}y[n-2]=x[n]+2x[n-1],$$
becomes
$$Y(z)-\frac{1}{15}Y(z)z^{-1}+\frac{1}{5}Y(z)z^{-2}=X(z)+2X(z)z^{-1}.$$
Collecting and solving for the definition of the transfer function:
$$H(z)=\frac{Y(z)}{X(z)}=\frac{1+2z^{-2}}{1-\frac{1}{15}z^{-1}+\frac{1}{5}z^{-2}}$$
Then the frequency response function is simply the transfer function evaluated at $z=e^{j\omega}$. Recall that the Fourier transform is evaluated on the unit circle. | {
"domain": "dsp.stackexchange",
"id": 11036,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, frequency-response, fourier",
"url": null
} |
temperature, acoustics, everyday-life
Alas, it gets messier. The sound of the train itself is anything but a point source, since you may be able to hear wheel-on-rail sounds for very long lengths, such as a kilometer for a long train. That also messes up the model and adds even more complexity in the form of orientation and sound delays. So, I'm going to wrap all of that complexity up into a single huge approximation and say that for a long train, the sound of the all the train wheels on all the track sounds "about the same" for anyone within a kilometer of the train as it passes by, inversion layer or not. So, the length unit for assessing how train track noises changes over distance becomes $s_u = s_t = 1$ km.
The equation now has to be altered slightly so that these "sounds the same" units $s_u$ are factored in: | {
"domain": "physics.stackexchange",
"id": 6190,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "temperature, acoustics, everyday-life",
"url": null
} |
electromagnetism, quantum-field-theory, gauge-theory, commutator, gauge
Title: Quantization of a spin-1 field canonical commutator This is a question regarding the spin-1 massive field commutator $[A_i(\mathbf{x},t),\Pi_j(\mathbf{y},t)]$, where $\Pi$ is the conjugate field and $A^\mu$ is the four-potential. My result was,
$$[A_i(\mathbf{x},t),\Pi_j(\mathbf{y},t)]=-i \left(\delta_{ij}-\frac{\nabla_i \nabla_j}{m^2}\right)\delta^3(\mathbf{x}-\mathbf{y}).$$
One of my textbooks says it should be equal to, $[A_i(\mathbf{x},t),\Pi_j(\mathbf{y},t)]=-ig_i^j\delta^3(\mathbf{x}-\mathbf{y})$. But where does the second term go? Another textbook replaces the $m^2$ with $\nabla^2$ for some reason. I am using the Lorenz gauge: $\partial_\mu A^\mu=0$.
Here's the university textbook: A massless spin $j=1$ field has
$$
[A_i(\mathbf{x},t),\Pi_j(\mathbf{y},t)]=-i \left(\delta_{ij}+\frac{\nabla_i \nabla_j}{{\color{red}\nabla^2}}\right)\delta^3(\mathbf{x}-\mathbf{y}).
$$
while a massive spin $j=1$ field has
$$ | {
"domain": "physics.stackexchange",
"id": 39976,
"lm_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, quantum-field-theory, gauge-theory, commutator, gauge",
"url": null
} |
php, performance, zephir
Run using PHP with microtime(true) capture before and after relevant actions.
EDIT: With a bit more fooling around I can now give you an "answer" regarding how to increase performance.
Split your data internally in order to get as much work as possible out of a single call to unpack.
if ( 1 )
{
echo "<br>\n";
echo "Running unpack on binary file (preload, split into 3 streams, unpack each stream)...<br>\n";
ob_flush();
flush();
$records = 0;
$fread_time = 0.0;
$unpack_time = 0.0;
$measured = 0.0;
$start = microtime(true);
$data = file_get_contents($bin_file);
$size = filesize($bin_file);
$stop = microtime(true);
$fread_time = $stop - $start;
$Ldata = '';
$fdata = '';
$Idata = '';
$offset = 0;
$start = microtime(true);
while ($offset < $size)
{
$Ldata .= substr($data,$offset,4);
$offset += 4;
$fdata .= substr($data,$offset,4);
$offset += 4;
$Idata .= substr($data,$offset,4);
$offset += 4; | {
"domain": "codereview.stackexchange",
"id": 14085,
"lm_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, performance, zephir",
"url": null
} |
homework-and-exercises, newtonian-mechanics, forces, friction
Considering this, one can also say that the friction can take any value less than $50\;\text{N}$ and the normal force will be $60 \;\text{N}$ minus that value.
Who is right? This question is tricky in that the idealizations make it not totally clear what the correct answer should be, so this is an ill-posed problem. In the real world, there is nothing like instantaneous forces and infinitely stiff bodies. Pushing on the object will internally deform it and make it lean over to the wall without breaking contact with the floor; the exact distribution of forces between the friction from the floor and the resistance of the wall will depend on the microscopic parameters of the bodies and surfaces involved. | {
"domain": "physics.stackexchange",
"id": 79824,
"lm_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, friction",
"url": null
} |
c#, community-challenge, lexical-analysis
}
char GetChar()
{
if (EOF) return (char)0;
char c = Lines[Line][Position];
if (Position + 1 < Lines[Line].Length)
{
Position++;
}
else
{
if (Line + 1 < Lines.Count)
{
Line++;
Position = 0;
}
else
{
EOF = true;
Position++;
}
}
return c;
}
void UngetString(int count)
{
for (int i = 0; i < count; i++)
{
UngetChar();
}
} | {
"domain": "codereview.stackexchange",
"id": 26795,
"lm_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#, community-challenge, lexical-analysis",
"url": null
} |
python, python-requests
esx_name = sys.argv[1]
session_id = ''
sys.tracebacklimit = 0
def vc_auth():
response = requests.post(f"https://{vc_url}/api/session", auth=(vc_user, vc_password))
if response.ok:
session_id = response.json()
with open(auth_store, "w") as file:
file.write(session_id)
return session_id
else:
raise PermissionError("Unable to retrieve a session ID.")
def read_auth():
try:
with open(auth_store, "r") as file:
session_id = file.read()
return session_id
except FileNotFoundError:
vc_auth()
def get_host_state():
response = requests.get(f"https://{vc_url}/api/vcenter/host?names={esx_name}", headers={"vmware-api-session-id": session_id})
if response.status_code == 401:
raise PermissionError("Authentication required.")
if response.ok:
print(f"{response.text}")
else:
raise ValueError(response.text)
session_id = read_auth()
try:
get_host_state()
except PermissionError:
session_id = vc_auth()
get_host_state() | {
"domain": "codereview.stackexchange",
"id": 43819,
"lm_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-requests",
"url": null
} |
Joint distributions applied probability and statistics. The probability density function over the variables has to. The multinomial distribution basic theory multinomial trials. In the case of only two random variables, this is called a bivariate distribution, but the concept generalizes to any. | {
"domain": "web.app",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743636887528,
"lm_q1q2_score": 0.8030827729118606,
"lm_q2_score": 0.8104789086703225,
"openwebmath_perplexity": 282.0339363360755,
"openwebmath_score": 0.8619453310966492,
"tags": null,
"url": "https://oberalem.web.app/1069.html"
} |
coding-theory, crc
what are the eventual advantages and disadvantages of the first approach in respect to the second considering error detection capabilities?
Please provide also some references if you have them! Ok, i found what i was searching in a paper "Selection of Cyclic Redundancy Code and Checksum Algorithms to Ensure Critical Data Integrity" https://www.faa.gov/aircraft/air_cert/design_approvals/air_software/media/TC-14-49.pdf | {
"domain": "cs.stackexchange",
"id": 14272,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "coding-theory, crc",
"url": null
} |
which is absurd.
In light of this observation, we define
Since $\mathcal{R}$ contains precisely $\vert \mathcal{K} \vert$ many chips, we see from $(\ast)$ that $\mathcal{R}$ cannot contain more than $n/2 - \vert \mathcal{D} \vert$ many chips. Moreover, more than half of the pairs in $\mathcal{K}$ are good pairs, and so more than half of the chips in $\mathcal{R}$ are good chips. We now recurse on $\mathcal{R}$. $\square$
The procedure described above can be implemented as follows:
"""We identify chips by unique nonnegative integers and assume that
chip_table, an immutable two-dimensional list of numbers, is given.
To see what a testing chip ("testing") has to say about another chip
("tested"), we call chip_table[testing][tested], which returns
True for 'good', and False for 'bad'.
We record the chips to be tested in a list of numbers called chip_list.
chip_list is changed at each recursive step to track the progress.
""" | {
"domain": "markhkim.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.962673113726775,
"lm_q1q2_score": 0.8655599823803488,
"lm_q2_score": 0.8991213840277783,
"openwebmath_perplexity": 732.0085319858442,
"openwebmath_score": 0.9267470836639404,
"tags": null,
"url": "https://markhkim.com/clrs/ch04/"
} |
homework-and-exercises, thermodynamics, entropy, electrical-resistance
$$\Delta S_{surroundings}=\frac{\Delta Q}{T}$$
therefore
$$\Delta S_{universe}=\Delta S_{resistor}+\Delta S_{surroundings}=0$$
To be clear,you already had the answer.
Note: Joule heating is irreversible therefore $\Delta S_{universe}>0$. The reason that doesn't happen here is because the additional system keeping the resistor at surroundings' temp isn't considered here. | {
"domain": "physics.stackexchange",
"id": 59222,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, thermodynamics, entropy, electrical-resistance",
"url": null
} |
electromagnetic-radiation, visible-light, refraction, frequency, wavelength
Why are then colours not defined only on the basis of frequencies? Why are they defined on the basis of wavelengths when wavelength doesn't even matter on the change of media?
Color can be defined either in terms of wavelengths or frequencies. In vacuum the relationship between wavelength and frequency is unambiguous, it is the speed of light $c$. Here is a chart showing different colors and their corresponding frequency, wavelength (in vacuum) and energy:
If you see a color specified in terms of wavelength then you should understand that that is probably the wavelength in vacuum and can be converted to a frequency using $c$. | {
"domain": "physics.stackexchange",
"id": 99725,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation, visible-light, refraction, frequency, wavelength",
"url": null
} |
inorganic-chemistry, nomenclature, organosilicon-compounds
TL;DR So the question is: | {
"domain": "chemistry.stackexchange",
"id": 13537,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, nomenclature, organosilicon-compounds",
"url": null
} |
c++, performance, reinventing-the-wheel, c++20
| ^~~~~~~~~~~~
FileProcessor.cpp: In constructor ‘FileProcessor::FileProcessor(std::vector<std::__cxx11::basic_string<char> >&, ProgramOptions&)’:
FileProcessor.cpp:11:1: warning: ‘FileProcessor::fileNames’ should be initialized in the member initialization list [-Weffc++]
11 | FileProcessor::FileProcessor(std::vector<std::string>& filesToProess, ProgramOptions& progOptions)
| ^~~~~~~~~~~~~
FileProcessor.cpp: In member function ‘std::string FileProcessor::processAllFiles()’:
FileProcessor.cpp:34:43: warning: catching polymorphic type ‘class std::runtime_error’ by value [-Wcatch-value=]
34 | catch (std::runtime_error re)
| ^~
FileProcessor.cpp: In member function ‘void FileProcessor::processLoop(std::ifstream&, FileStatistics&)’:
FileProcessor.cpp:52:25: warning: unused variable ‘inBuf’ [-Wunused-variable]
52 | std::streambuf* inBuf = inStream.rdbuf(); | {
"domain": "codereview.stackexchange",
"id": 44065,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, reinventing-the-wheel, c++20",
"url": null
} |
- Convert between Rectangular & Polar Coordinates to a friend Read More. to get rid of the fraction. The purpose of this Java program it's to plot the graph of functions, both with one real variable (cartesian and polar coordinates) and with two real variables (cartesian coordinates). This article will provide you with a short explanation of both types of coordinates. Your calculator may have polar to rectangular (denoted P → R or → x y) and rectangular to polar conversion (denoted R → P or → r θ) built in. To convert rectangular coordinates to polar coordinates, we will use two other familiar relationships. This function accepts x & y coordinates as input value parameters, and then returns, through reference parameters, the polar coordinate position of the point (r and theta). Testing Polar Equations for Symmetry. In both rectangular and polar coordinates, a given coordinate pair specifies a unique point in the plane: Rectangular coordinates: once coordinate axes are positioned, each | {
"domain": "gesuitialquirinale.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226287518853,
"lm_q1q2_score": 0.8055179522932492,
"lm_q2_score": 0.8244619199068831,
"openwebmath_perplexity": 486.69841462743466,
"openwebmath_score": 0.8996694087982178,
"tags": null,
"url": "http://gesuitialquirinale.it/arxd/polar-to-rectangular-coordinates-calculator.html"
} |
Note that the difference between successive elements is about $-3$; because this is a log-log table, that means that this error is $O(1/n^3)$ and that the approximation is correct.
• Very good, thanks! Apr 29, 2013 at 6:59
• Since $\exp(x^n)=\sum_0^\infty x^{nk}/k!$ converges absolutely on $[0,1]$, the interchange of summation and integration is justified. The interchange of summation is valid for the absolute convergence of the double sum. Am I right? Apr 29, 2013 at 7:18
• @FrankScience: absolutely correct. Apr 29, 2013 at 7:20
• @Ron Gordon The first few terms are numerically $\left\{\frac{1.3179}{n},-\frac{1.1465}{n^2},\frac{1.0694}{n^3},-\frac{1.03348}{n^4},\frac{1.01635}{n^5}\right\}$ Neglecting the difference from unity in the numerator and summing up the asmptotic series the asymptotic behaviour of the integral can be written in this approximation as $\frac{n+2}{n+1}$ Nov 7, 2019 at 10:05 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575137315161,
"lm_q1q2_score": 0.8409229732821266,
"lm_q2_score": 0.8558511451289037,
"openwebmath_perplexity": 304.8925525966959,
"openwebmath_score": 0.9875257015228271,
"tags": null,
"url": "https://math.stackexchange.com/questions/375950/asymptotic-expansion-of-the-integral-int-01-exn-dx-for-n-to-infty"
} |
inorganic-chemistry
Title: Why does nitrogen have a maximum covalency of 4? As nitrogen has $1$ lone pair and $3$ electrons, either it should have maximum covalency of $5$ or $3$. But why does it have a maximum covalency of $4$ instead?
Why did it leave $1$ electron? Why did it have to break a lone pair? Recall that covalency is the number of shared electron pairs formed by an atom of that element. Nitrogen's maximum covalency is indeed $4$. And no, it does not break up its lone pair.
I'll give you a simple example. Have a look at the Lewis structure of the ammonium ion: | {
"domain": "chemistry.stackexchange",
"id": 9632,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry",
"url": null
} |
organic-chemistry, nomenclature, biochemistry, history-of-chemistry
That explanation seems sufficient to understand the source of the name, but if you are interested in the specifics of the original discovery, reference 26 is to the Dictionary of Natural Products published in 1992 by Chapman & Hall, which is available only by subscription. Perhaps someone with access to that Dictionary can look up the entry on urolithin and provide more info.
UPDATE: Since this answer has received a decent amount of attention, I dug a bit deeper to find the references for the first isolation and naming of the compounds (thereby actually answering the question).
In 1963 at the 430th meeting of the Biochemical Society in Oxford, England, Nottle and Pope first reported isolating two compounds that they named "urolithin A" and "urolithin B". Their report was published among the proceedings of the meeting in the Biochemical Journal, which are available for free from the journal here. The full reference is | {
"domain": "chemistry.stackexchange",
"id": 14149,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature, biochemistry, history-of-chemistry",
"url": null
} |
performance, sql, mysql, unit-testing, stored-procedure
DELETE BKI, i, sba, pub, pur, v, o, fs, hr, BDesk
FROM bookinfo AS BKI
INNER JOIN authorsTab AS a ON a.idAuthors = BKI.AuthorFKbi
INNER JOIN title AS t ON t.idTitle = BKI.TitleFKbi
INNER JOIN bookformat AS bf ON bf.idFormat = BKI.BookFormatFKBi
LEFT JOIN isbn AS i ON i.BookFKiSBN = BKI.idBookInfo
LEFT JOIN signedbyauthor AS sba ON sba.BookFKsba = BKI.idBookInfo
LEFT JOIN publishinginfo AS pub ON pub.BookFKPubI = BKI.idBookInfo
LEFT JOIN purchaseinfo AS pur ON pur.BookFKPurI = BKI.idBookInfo
LEFT JOIN volumeinseries AS v ON v.BookFKvs = BKI.idBookInfo
LEFT JOIN owned AS o ON o.BookFKo = BKI.idBookInfo
LEFT JOIN forsale AS fs ON fs.BookFKfs = BKI.idBookInfo
LEFT JOIN haveread AS hr ON hr.BookFKhr = BKI.idBookInfo
LEFT JOIN bksynopsis AS BDesk ON BDesk.BookFKbd = BKI.idBookInfo | {
"domain": "codereview.stackexchange",
"id": 35341,
"lm_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, sql, mysql, unit-testing, stored-procedure",
"url": null
} |
Finally, we prepend dataset 1 to the results and plot them:
PrependTo[results, dat[[1]]];
ListLinePlot[results]
After importing your data, I needed some fixes to convert it to numerical data:
dat = Import["https://pastebin.com/j3Bgfxqm", "Data"][[1]];
dat = ToExpression[ StringCases[#,
"{" ~~ NumberString ~~ "," ~~ NumberString ~~ "}"]] & /@ dat;
Now we have table of numerical data. To pick out the points with prescriped x values:
dat = Flatten[{Take[#, 29 ;; 41], Take[#, 72 ;; 85]} & /@ dat, 1];
Your plot statement has a superfluous Show and the plot range is wrong. With this fixes:
ListLinePlot[dat, PlotStyle -> {Red, Blue, Gray, Black},
LabelStyle -> {Black, Bold, 14}, ImageSize -> Large, Frame -> True,
Axes -> False, GridLines -> Automatic,
GridLinesStyle -> Lighter[Gray, .8]] | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290930537121,
"lm_q1q2_score": 0.8234861638633921,
"lm_q2_score": 0.8479677622198947,
"openwebmath_perplexity": 2941.583968622526,
"openwebmath_score": 0.17139621078968048,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/238052/superimposed-data-on-top-of-each-other-in-a-do-loop"
} |
performance, sql, mysql
(
SELECT
CONCAT(
'<roles>',
GROUP_CONCAT(
'<int><![CDATA[',er.accommodation_id,']]></int>'
SEPARATOR ''
),
'</roles>'
)
FROM
employee_roles as er
WHERE
er.employee_id = emp.id and er.available = 1
),
),
'</Employee>'
SEPARATOR ''
),
'</employees>'
FROM
employees AS emp
left join employee_roles emro
on emp.id = emro.employee_id and emro.action_id = @action_id
WHERE | {
"domain": "codereview.stackexchange",
"id": 17432,
"lm_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, sql, mysql",
"url": null
} |
c++, performance, object-oriented, file, compression
root = queue.top(); queue.pop();
}
void HuffmanTree::recursiveNodeDelete(TreeNode* node) {
if (node == NULL) {
return;
}
recursiveNodeDelete(node->getLeftTree());
recursiveNodeDelete(node->getRightTree());
delete node;
}
HuffmanTree::~HuffmanTree() {
recursiveNodeDelete(root);
}
TreeNode* HuffmanTree::merge(TreeNode* node1, TreeNode* node2) {
TreeNode* new_node = new TreeNode(0, node1->getCount() + node2->getCount(), false, NULL, NULL);
if (node1->getCount() < node2->getCount()) {
new_node->setLeftTree(node1);
new_node->setRightTree(node2);
}
else {
new_node->setLeftTree(node2);
new_node->setRightTree(node1);
}
new_node->setChar(std::max(node1->getChar(), node2->getChar()));
return new_node;
}
bitstring.h
#ifndef HUFFMAN_BITSTRING_H
#define HUFFMAN_BITSTRING_H
#include <iostream>
#include <vector>
class BitStringWrite { | {
"domain": "codereview.stackexchange",
"id": 25426,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, object-oriented, file, compression",
"url": null
} |
The second portion of the question made me think that if there is someone who has a birthday on July $$15$$, then the remaining 1016 will have the probability of $$\frac{364}{365}$$ and the one person will have the probability of $$\frac{1}{365}$$. However, I am unsure because the equation $$(\frac{364}{365})^{1016}(\frac{1}{365})$$ will represent the probability for exactly one person to have their birthday on that date, not at least one person.
Any help will be greatly appreciated. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765546169712,
"lm_q1q2_score": 0.8269974227543971,
"lm_q2_score": 0.8438951104066293,
"openwebmath_perplexity": 271.8601538015679,
"openwebmath_score": 0.5503652691841125,
"tags": null,
"url": "https://math.stackexchange.com/questions/2944843/probability-that-no-one-has-a-specific-birthday-and-at-least-one-person-does"
} |
biochemistry, dna, synthetic-biology, crispr
Here we are using standard 3-base codons. From the predefined value for each color (1 to 21), we can find the color using the codon. For example, from the same sequence:
AAGCCCTGGTCAGCT
Ignore AAG again and start with CCC. From the table, CCC encodes a value of 1. Move to next, TGG encodes a value of 16, TCA encodes 10 and GCT encodes 7, and so on for longer sequences. So, now we get an image with 4 pixels i.e. 2 x 2 with the pixels having color code 1, 16, 10, 7. In this way, each pixel can have a color from predefined values. On extracting this data, the image comes out as (from gizmodo): | {
"domain": "biology.stackexchange",
"id": 7426,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, dna, synthetic-biology, crispr",
"url": null
} |
materials, pressure
Title: When styrofoam shrinks from pressure, why doesn't it go back to normal after decreasing the pressure? In this article (https://oceanexplorer.noaa.gov/explorations/16carolina/logs/sep3-2/sep3-2.html) and articles like this one, Styrofoam cups were taken to the depths of the ocean in an AUV to demonstrate the extreme pressure of deep water. Once the Styrofoam is brought back up to normal atmospheric pressure, why doesn't the air rush in and the Styrofoam expand again? The structure of styrofoam isn't as perfectly elastic as you think
Most styrofoam is created by various mechanisms that blow gases into the polystyrene matrix as it cools. One common process involves creating small beads saturated with pentane which are then expanded by treatment with steam (the pentane expands creating bubbles in the beads). The resulting beads can be extruded to create specific shapes (polystyrene is a thermoplastic). This process also creates many air-filled voids. | {
"domain": "chemistry.stackexchange",
"id": 17174,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "materials, pressure",
"url": null
} |
c#, object-oriented, validation, generics, inheritance
public InputValidatorUnparsed(Func<TSource> getUnparsedValue, InputTryParse tryParse)
{
inputTryParse = tryParse ?? throw new ArgumentNullException(nameof(tryParse));
_getUnparsedValue = getUnparsedValue;
}
public InputValidatorUnparsed<TSource, TValue> WithFailedAction(Action onFailedAction)
{
_onFailedAction = onFailedAction;
return this;
}
public InputValidatorUnparsed<TSource, TValue> WithAllowedItems(IEnumerable<TValue> allowedItems)
{
return WithAllowedItems(allowedItems, _comparer);
}
public InputValidatorUnparsed<TSource, TValue> WithAllowedItems(IEnumerable<TValue> allowedItems,
IEqualityComparer<TValue> comparer)
{
_allowedItems = allowedItems ?? throw new ArgumentNullException(nameof(allowedItems));
_comparer = comparer ?? throw new ArgumentNullException(nameof(comparer));
return this;
} | {
"domain": "codereview.stackexchange",
"id": 25955,
"lm_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, validation, generics, inheritance",
"url": null
} |
python, performance, pandas
L_fin = [] # L_fin stores aggregated rows.
for name, group in df.groupby(["Id"]): # Group "foo", "bar", "baz" together
i = 0
L = [] # L will temporarly stores rows before aggregation
for index, row in group.iterrows():
L.append(row.to_dict()) # Stores row in L
if row["Cumsum"] > i + max_size: # If cumulated size of all rows in L is above maximal size authorized
i = row["Cumsum"]
temp = pd.DataFrame.from_dict(L).drop(["Cumsum", "Anticipation"], axis=1) \
.groupby("Id") \
.agg({"Size": "sum", "Anticipation*Size": "sum"}) # Then rows are aggregated
temp["Anticipation"] = temp["Anticipation*Size"] / temp["Size"] # Mean anticipation is calculated
L_fin.append(temp) # Aggregated row is added to aggregated rows list
L = [] # Bucket is emptyied
if L: # If no rows remains in the grouped df | {
"domain": "codereview.stackexchange",
"id": 35917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, pandas",
"url": null
} |
electromagnetism, electric-current, biophysics, biology
Now my actual question. Modelling a neuron as a simple one dimensional
membrane/cable, how can a lowered capacitance lead to a faster conduction of the voltage perturbation i.e a change in voltage
(depolarisation), which is initially limited to a small localised
region? This conduction of the voltage change can occur through the
ion flow along the inner side of the membrane and also due to long
distance changes in potential due to the altered distribution of
charges along the membrane. A very good physical modelling of the
neuron is given here and here, but because of the quite
complicated mathematical nature of the modified telegrapher's equation
which appears as the final answer, I am unable to understand how
lowered capacitance increases the speed of voltage conduction? | {
"domain": "physics.stackexchange",
"id": 11126,
"lm_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, electric-current, biophysics, biology",
"url": null
} |
c++, performance, graph
Use appropriate data structures
Your use of an unordered_map is a sound idea, but I'm not so sure about the conversion to a std::vector. It seems to me that a std::priority_queue more directly matches what you're trying to accomplish. Here's the equivalent to your select_coordinates_highest_occurrence (which I find a bit wordy):
void popularEdges(const std::vector<Coordinate> & coordinates) {
std::unordered_map<int, int> m;
for (const auto &coord : coordinates) {
++m[coord.x];
++m[coord.y];
}
std::priority_queue<std::pair<int, int>> pq;
for (const auto &node : m) {
pq.emplace(node.second, node.first);
}
for (auto n=pq.size()/2; n; --n) {
std::cout << pq.top().second << '\n';
pq.pop();
}
} | {
"domain": "codereview.stackexchange",
"id": 25947,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, graph",
"url": null
} |
ros, bullet, pcl
/home/sam/code/ros/sam_perception/sam_recognition/eigen/bullet/build/bullet_svn/src/BulletSoftBody/btSoftBody.cpp:315:20: instantiated from here
/home/sam/code/ros/sam_perception/sam_recognition/eigen/bullet/build/bullet_svn/src/BulletSoftBody/btSoftBodyInternals.h:175:17: 錯誤: 未初始化的常數 「zerodummy」 [-fpermissive]
/home/sam/code/ros/sam_perception/sam_recognition/eigen/bullet/build/bullet_svn/src/BulletSoftBody/btSoftBody.h:225:9: 附註: 「const struct btSoftBody::Tetra」 has no user-provided default constructor
make[5]: Leaving directory `/home/sam/code/ros/sam_perception/sam_recognition/eigen/bullet/build/bullet_svn'
make[5]: *** [src/BulletSoftBody/CMakeFiles/BulletSoftBody.dir/btSoftBody.o] Error 1
make[4]: Leaving directory `/home/sam/code/ros/sam_perception/sam_recognition/eigen/bullet/build/bullet_svn'
make[3]: Leaving directory `/home/sam/code/ros/sam_perception/sam_recognition/eigen/bullet/build/bullet_svn' | {
"domain": "robotics.stackexchange",
"id": 10559,
"lm_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, bullet, pcl",
"url": null
} |
quantum-mechanics, quantum-field-theory, special-relativity, quantum-electrodynamics, klein-gordon-equation
Title: What is the interpretation of the quantum field operator solving the Klein-Gordon equation? Does the quantum field operator $\hat \psi^\dagger(x)$ solving the KGE mean that we should think that every quantum field configuration evolves under a KGE field equation. Or do we just understand it that a specific quantum field configuration which is created by $\hat \psi^\dagger(x)$ (i.e. a field configuration representing a single on-mass-shell matter particle at $x$) evolves like this (as it must to obey special relativity)? You shouldn't really think of "a" field configuration that is evolving in quantum field theory. You are letting some classical ideas slip into your picture. | {
"domain": "physics.stackexchange",
"id": 86871,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, special-relativity, quantum-electrodynamics, klein-gordon-equation",
"url": null
} |
reinforcement-learning, ai-design, markov-decision-process, state-spaces, state-representations
The Atari DQN work by DeepMind team used a combination of feature engineering and relying on deep neural network to achieve its results. The feature engineering included downsampling the image, reducing it to grey-scale and - importantly for the Markov Property - using four consecutive frames to represent a single state, so that information about velocity of objects was present in the state representation. The DNN then processed the images into higher-level features that could be used to make predictions about state values. | {
"domain": "ai.stackexchange",
"id": 680,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, ai-design, markov-decision-process, state-spaces, state-representations",
"url": null
} |
python, beginner
Title: Summing over the values of a dict I'm coming from the Java world and making my first steps on Python and see how good it is to express more with less code. I'd like to know if, via Python, the size of the following code could be reduced:
column_entropy = 0
for k in frequencies.keys():
p = frequencies[k] / 10
column_entropy += p * log(p, 2) if p > 0 else 0
column_entropy = -column_entropy If frequencies is a dict, then the code could be reduced and optimized a little bit by iterating over the items in it instead of the keys and then doing a lookup,
like this:
column_entropy = 0
for k, v in frequencies.items():
p = v / 10
column_entropy += p * log(p, 2) if p > 0 else 0
column_entropy = -column_entropy
And, if you change += to -= then you can drop the final negation of column_entropy.
Actually, it would be nice to give a name to the calculation inside the loop:
def calculate(k, v):
p = v / 10
return p * log(p, 2) if p > 0 else 0 | {
"domain": "codereview.stackexchange",
"id": 10594,
"lm_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",
"url": null
} |
planet, alignment
Is it common for five planet appear to align within 25°-30°, viewed from any of the inner planets? It is not super-unlikely. Let's look at alignments of the three interior planets and two superior ones.
From Mars, the three interior planets (Earth Venus and Mercury) all appear to remain quite close to the sun, and so quite close to each other. Moreover they will seem to move slowly as they reach greatest elongation. The chance that two interior planets will be on the same side of the sun as each other is 50%, and they will be "close" quite often. I've not done careful calculations, but let's say there is a 1/3 chance that two interior planets are close.
So to get the third planet close is another 1/3 chance, it would have to be close to both other two planets but the probability of all three interior planets aligning somewhat is around 1/3^2 or roughly 10%. (This is a Fermi estimate so I'm taking the liberty of rounding) | {
"domain": "astronomy.stackexchange",
"id": 4278,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planet, alignment",
"url": null
} |
javascript, jquery, event-handling, dom
$button = $('#button');
$button.trigger('click');
The simplest case above works as-is if the menu is added in one mutation, otherwise you'd have to check each of the mutations array elements for addedNodes. | {
"domain": "codereview.stackexchange",
"id": 21327,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, event-handling, dom",
"url": null
} |
channelcoding
\frac{55\cdot 10^6}{17\cdot 10^6} &\overset?\le \log_2(1+10^{1})\\
\frac{5.5}{1.7} &\overset?\le \log_2(11)\\
3.26 &\overset?\le 3.46
\end{align}
That's actually pretty close! So your code needs to be very close to optimal.
It's hence necessary to check whether achieving the required capacity of 55/17 = 3.26 bits per channel usage is possible at all in the finite block-length regime[1]. If theory says our code is impossible, we can stop designing right here, and write a nice email that we can't do the undoable, but are willing to meet with the application team to help them redefine their requirements. This might just mean you just say "hey, I don't care about capacity, let's deal with | {
"domain": "dsp.stackexchange",
"id": 11576,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "channelcoding",
"url": null
} |
c
Avoid passing your player by value - it's much cheaper to pass a pointer to a readonly struct.
With the code below, we can check the worst-case output by constructing a struct player with id of INT_MIN, points of -FLT_MAX and a maximum-length display_name, and a debug version will tell us how big a buffer is required. You can then modify the constant to the value indicated.
If you later internationalize the program, the fixed portion of the strings are no longer fixed. You might even have to resort to the technique of calling snprintf(NULL, 0, format, args...) to measure the size, then allocating sufficient memory with malloc(). That adds to your work, as you then need to ensure that the allocated memory is correctly freed.
#include <stdio.h>
#include <string.h>
typedef struct player {
int id;
float points;
char display_name[256];
} player_t; | {
"domain": "codereview.stackexchange",
"id": 26960,
"lm_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
} |
ros, roslauch, nodes, namespaces, getparam
Of course this is how it's supposed to be due to the fact that parameters have to be unique hence adding the namespace is required when running multiple nodes that have the same parameters.
Every once in a while when I have to deal with namespaces in ROS things get messy. This case is no different. That's why I would like to ask for a tip how to solve my problem - use the same node multiple times with different name and message WITHOUT creating multiple versions of that node by writing code. I thought about a way to retrieve the name of the node from the launch file but have no idea how to that without writing a huge blob of code...Is it even possible?
I can easily copy-paste my talker.py and create talker1.py, talker2.py etc. with rospy.init_node('talker1'), rospy.init_node('talker2') and so on but there has to be a better way of doing this. | {
"domain": "robotics.stackexchange",
"id": 24925,
"lm_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, roslauch, nodes, namespaces, getparam",
"url": null
} |
oceanography, water, environmental-protection, desert
A lot of these thoughts are just me thinking out loud with no data to back me up because honestly, I wouldn't know what to look up regarding things like this. I'd love some science-based replies to this! I'm definitely missing something big. Starting with question 2): you can use heat to evaporate the water but you need some sort of energy or thermal exchange to cool and condense it back to liquid. My understanding is that reverse osmosis (RO) is more energy efficient overall.
Question 1) Brine is only put into the oceans from system that are near the sea, which usually use seawater as a water source. The brine has an insignificant effect on the ocean salinity once it is mixed in but can have a local effect because of poor mixing and because differences in density between the brine and seawater cause it to sink to the bottom. Systems can be engineered to minimise the impact. | {
"domain": "earthscience.stackexchange",
"id": 1866,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "oceanography, water, environmental-protection, desert",
"url": null
} |
In summary: the final answer is ( 4 3) 12 ( 4 2). The -combinations from a set of elements if denoted by . Example: The coach of a basketball team is picking among 11 players for the 5 different positions in his starting lineup. Combinatorics and Discrete Mathematics. Example: Let be the set {1,2,3}. Sample Question. Combinatorics is a branch of mathematics dealing primarily with combinations, permutations and enumerations of elements of sets. | {
"domain": "asia-pacific.tv",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105273220726,
"lm_q1q2_score": 0.8071274359491588,
"lm_q2_score": 0.8267118026095991,
"openwebmath_perplexity": 716.1330881065412,
"openwebmath_score": 0.6230892539024353,
"tags": null,
"url": "http://new.asia-pacific.tv/rpa/11315481aca6dfb353c0501aec280124-combination-discrete-math"
} |
game, objective-c
Notice that this break statement only breaks the inner-most loop. Once we know we need to handle this row, we don't need check any more orbs, so let's move on to the next row.
We can do the same with our columnsWithChanges method as well. But note in that method, we can eliminate this line:
NSMutableArray *columns = _board.columns;
And just reference _board.columns directly in the forin loop.
And one final note about these two methods... why don't we declare some readonly properties?
@property (readonly) NSMutableSet *rowsWithChanges;
@property (readonly) NSMutableSet *columnsWithChanges;
No local instance variable is created--there is no _rowsWithChanges or _columnsWithChanges, because we manually implemented each getter already and didn't use the variable. But meanwhile, without changing anything else specifically regarding these properties or methods, we can stop writing:
[self rowsWithChanges] | {
"domain": "codereview.stackexchange",
"id": 11301,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, objective-c",
"url": null
} |
is lim n→∞ n+2 5n+17 =lim n→∞ 1+ 2 n 5+ 17 n = 1 5. For this example we should use the integral test since many of the other tests seem complicated. (-1)^(n+1)*(n/n^2+4) 8. or if the limit does not exist, then. Use the nth term test to determine whether the following series converges or diverges. If nl!im• an = 0, we can't conclude anything. How old are you? A. If not, we can use the divergence test to conclude the series diverges. See full list on gauravtiwari. Maclaurin Series Taylor and Maclaurin Series interactive applet 3. For the biases: Where the sampled b corresponds to the biases used on the linear transformation for the ith layer on the nth sample. I Geometric series. nth-Term Test for Divergence. This simple t-test calculator, provides full details of the t-test calculation, including sample mean, sum of A t-test is used when you're looking at a numerical variable - for example, height - and then comparing the averages of two separate populations or. ( , , ) Leave empty, if | {
"domain": "schuetzen-wuerm.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754456551737,
"lm_q1q2_score": 0.8536621196061944,
"lm_q2_score": 0.8670357598021707,
"openwebmath_perplexity": 572.843145363113,
"openwebmath_score": 0.7924398183822632,
"tags": null,
"url": "http://mdnu.schuetzen-wuerm.de/nth-term-test-for-divergence-calculator.html"
} |
ros, roomba, urdf, turtlebot
Title: modify the URDF and kinect position turtlebot
Is there a easy way to modify the URDF file for a turtlebot roomba (metric)?
I need to change the kinect position and also the inertia as i dont use the baseplates. Not really sure how this is done however, is it possible to manually edit the urdf file? If so where is it positioned?
many thanks
Originally posted by krst on ROS Answers with karma: 11 on 2012-10-22
Post score: 1
The urdf of the turtlebot is placed under turtlebot/turtlebot/desription/urdf/.
There are different xacro files.
When I remeber correctly the main file is turtlebot.urdf.xacro which includes the other ones (you will see it in the xml code)
You can get help for editing under http://www.ros.org/wiki/urdf. You don't have to build the urdf explicitly it is normally done in the launch file via xacro.
Originally posted by Fabian Saccilotto with karma: 51 on 2012-12-19
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 11464,
"lm_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, roomba, urdf, turtlebot",
"url": null
} |
java, object-oriented, array
/*
* Main method that instantiates an ArrayBuilder object, then calls the
* build and printMessages methods to create and display an array of user input.
*/
public static void main(String[] args){
//Create a new ArrayBuilder object
ArrayBuilder AB = new ArrayBuilder();
//Invoke the build method to build up an array
AB.build();
//Invoke the printMessages method to display what is stored in the array
AB.ptrintMessaages(AB.s);
}
} thanks for sharing your code.
here are my thoughts about it:
Naming
Finding good names is the hardest part in programming, so always take your time to think about the names of your identifiers.
avoid single character names / abbreviations | {
"domain": "codereview.stackexchange",
"id": 27738,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, array",
"url": null
} |
java, performance, game
I've been thinking about moving everything directly related to the Window and the Frame out of the Game.java class and instead let Game have a Window class, maybe even split up Window and Frame.
Small addition: The package names are a bit temporary as well, do not worry about them not following the naming convention. They will later on when I have the structure more set in stone. First of all, it's a lot easier to review code if I can easily compile and run it on my PC. When reviewers can run your code, they can also test their theories, and often tell you more than theories, and include actual code that you can use. So if you want interesting answers, make it easier to review your code, ideally provide a GitHub link. | {
"domain": "codereview.stackexchange",
"id": 14054,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, game",
"url": null
} |
c#, object-oriented, role-playing-game
public SkillsComponent(
List<AttackSkillData> strikeSkills,
List<AttackSkillData> magicSkills,
List<AttackSkillData> techSkills,
List<AttackSkillData> dualTechSkills,
List<AttackSkillData> triTechSkills)
{
_skillData = new Dictionary<AttackSkillType, List<AttackSkillData>>
{
{ SkillAttackType.Strike, List<AttackSkillData> strikeSkills },
{ SkillAttackType.Magic, List<AttackSkillData> magicSkills },
{ SkillAttackType.Tech, List<AttackSkillData> techSkills },
{ SkillAttackType.DualTech, List<AttackSkillData> dualTechSkills },
{ SkillAttackType.TriTech, List<AttackSkillData> triTechSkills },
};
}
public void AddNewSkill(AttackSkillType skillAttackType, AttackSkillData data)
{
var skillDataList = GetSkillData(skillAttackType);
skillDataList.Add(data);
} | {
"domain": "codereview.stackexchange",
"id": 10037,
"lm_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, role-playing-game",
"url": null
} |
• Both are eigenvectors. Eigenvectors are not unique in general. – Arctic Char Nov 30 '19 at 9:32
• A constant times an eigenvector is also an eigenvector. – Ameet Sharma Nov 30 '19 at 10:06
• Conclusion: Any scalar that is multiplied with an eigenvector is still an eigenvector (In the same eigenspace). Even when the eigenvector is multiplied with different scalars, the λ would be the same, Av = λV. *I cannot choose which comment is the best since all of it helped me in understanding the given problem. Thank you all. – Kamarul Adha Nov 30 '19 at 10:36
• For some reason most problems I've encountered (in college) have asked me to find eigenvalues and the corresponding eigenvectors, when in reality what we care about are the eigenvalues and the corresponding eigenspaces. – BallpointBen Nov 30 '19 at 22:43
• @KamarulAdha: Second conclusion: If anyone tells you that $v$ is an eigenvector of a matrix but $2v$ is not, that one does not know mathematics. – user21820 Dec 1 '19 at 15:28 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211597623861,
"lm_q1q2_score": 0.8778554833475471,
"lm_q2_score": 0.9005297787765764,
"openwebmath_perplexity": 191.53619245914248,
"openwebmath_score": 0.964476466178894,
"tags": null,
"url": "https://math.stackexchange.com/questions/3456797/is-it-acceptable-to-have-a-fraction-in-an-eigenvector"
} |
c++, c++11, graph
void adjVertices(int v)
{
std::cout<<"Adjacent vertices of"<< v <<std::endl;
for(auto &x : adjList[v])
std::cout<< x << std::endl;
}
private:
int N;
int E;
std::vector< std::vector<int> > adjList;
};
int main()
{
Graph G(10);
G.addEdge(3, 4);
G.addEdge(0, 2);
G.addEdge(0, 4);
G.addEdge(0, 9);
G.adjVertices(0);
G.adjVertices(4);
} First very important thing: Good/clear code without comments is better than bad code with comments. I say this because you are using comments to make up for vague variable and method names. For instance:
//n is the number of vertices in graph
Graph(int n)
{
....
Then why not rename n to numberOfVerts?
Other instances:
//# of vertices
int Vertices() { ... }
//# of Edges
int Edges() { ... } | {
"domain": "codereview.stackexchange",
"id": 12649,
"lm_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++, c++11, graph",
"url": null
} |
general-relativity, black-holes, orbital-motion, event-horizon
(Image from the book V. Frolov, I. Novikov, Black Hole Physics: Basic Concepts and New Developments, 1998).
A second parameter characterizing given geodesic is specific energy $\tilde E$ and the allowed range of radial coordinate would correspond to the parts of line $\tilde E=\text{const}$ above the effective potential on the plot.
A trajectory that starts at infinity and ends at infinity would correspond to the case $\tilde E_2$ in the image, it would have a turning point at some value of radial coordinate larger than the radius of unstable circular orbit ($\tilde E_\text{max}$ in the image), but unstable circular orbits lie within the interval $3/2 r_s < r_\text{uco} < 3 r_s$ (from photon sphere to ISCO).
So for a trajectory to approach within 1 m from event horizon it must be either of the type $\tilde E_3$ or $\tilde E_4$ in the image. $\tilde E_3$ corresponds | {
"domain": "physics.stackexchange",
"id": 63428,
"lm_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, orbital-motion, event-horizon",
"url": null
} |
lagrangian-formalism, variational-principle, action, variational-calculus
However, when he expands the square, he claims he can disregard the $\left(\frac{d \eta}{dt}\right)^2$ term, since it is of "second order," which I don't really understand. I understand the idea that we're letting $\eta$ go to zero (though it's still kind of confusing because $\eta$ is a function and not a variable), and since $\eta$ is going to zero, we can disregard any second order approximations with it because they will be much smaller than any first order approximations with $\eta$. However, just because $\eta$ is going to zero, that doesn't mean $\frac{d \eta}{dt}$ is going to zero. In fact, $\frac{d \eta}{dt}$ could be as large as we please, so how are we allowed to just disregard $\left(\frac{d \eta}{dt}\right)^2$? Instead of using $\eta(t)$, $\eta(t_1)=\eta(t_2)=0$, replace $\eta(t)$ with $\epsilon \xi(t)$ where now $\xi(t)$ is fixed, and $\xi(t_1)=\xi(t_2)=0$. Then expand wrt $\epsilon$ and let $\epsilon \to 0$. | {
"domain": "physics.stackexchange",
"id": 96243,
"lm_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, variational-principle, action, variational-calculus",
"url": null
} |
density-matrix, state-tomography
Title: How to reconstruct the density matrix $\rho$ from the overlap matrix $T_{a,a'}={\rm Tr}(M^{(a)}M^{(a')})$? Suppose we have $N$-qubit POVM
$${\bf M} = \{M^{(a_1)} \otimes M^{(a_2)} \otimes \cdots \otimes M^{(a_N)}\}_{a_1, \ldots, a_N}.$$
Given an $N$-qubit state $\rho$, the measurement outcome ${\bf a} = (a_1, a_2, \ldots, a_N)$ occures with probability $P({\bf a})$ such that $\sum_{{\bf a}}P({\bf a})=1$. Equivalently, we can write
$$P({\bf a}) = Tr(M^{({\bf a})} \rho).$$
Provided that the measurement is informationally complete, the density matrix can be unambiguously inferred from the probability distribution of measurement outcomes:
$$\tag{1} \rho = \sum_{{\bf a, a'}} P({\bf a}) T^{-1}_{{\bf a, a'}} M^{({\bf a'})},$$
where the matrix $T$ is called an overlap matrix defined as follows:
$$T_{{\bf a, a'}} := Tr(M^{({\bf a})}M^{({\bf a'})}).$$ | {
"domain": "quantumcomputing.stackexchange",
"id": 4887,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "density-matrix, state-tomography",
"url": null
} |
quantum-mechanics, operators, hilbert-space, notation, matrix-elements
Title: Using Dirac notation to find matrix representation I am currently reading Sakuria, and I cannot get my head around how one uses the completeness relation to derive the matrix representations of outer products. In the first chapter he states that an operator X can be represented as
$$X = \sum_{a^{\prime\prime}}\sum_{a^{\prime}}|a^{''}\rangle
\langle a^{''} | X|a^{'}\rangle \langle a^{'}|.$$ This is fine and it helps do the problems, but I don't understand how this works. I have a bachelors in physics so I know how matrix multiplication works and all that, its the notation itself that I'm struggling with.
If $\langle a^{"}|a^{\prime} \rangle = \delta_{a^{"}a^{'}}$, then wouldn't the equation above always yield a matrix with all zeros except for the diagonal because
\begin{align}
X =& \sum_{a^{2}}\sum_{a^{1}}|a^{2}\rangle \langle a^{2}|X|a^{1} \rangle \langle a^{1}| \\ | {
"domain": "physics.stackexchange",
"id": 48374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, hilbert-space, notation, matrix-elements",
"url": null
} |
java, security
However, it looks that your requirement is just to upload some MIS reports onto the Box cloud, so this looks good enough. Also, it appears that the user of this local machine actually knows the Box ID/password, so you probably don't have to worry about the user stealing your refresh token. | {
"domain": "codereview.stackexchange",
"id": 4125,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, security",
"url": null
} |
dimensional-analysis, physical-constants, metrology
I guess, something similar was done by Max Planck. He had a couple of black-body radiation spectra available and it checked it against his new model of the black-body radiation and at the end fitted his model to the radiation data. And one of the fit parameters he chose was $\hbar$ (or $h$). In this way Planck's constant was found for the first time. Further experiments based on other physics were carried out for this purpose, but at the end the procedure is always the same, the underlying model is fitted to the measured data and the fit parameters extracted serve for determination of the constant. It is the same for the speed of light or gravitational constant determined by the Cavendish experiment etc. | {
"domain": "physics.stackexchange",
"id": 56666,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dimensional-analysis, physical-constants, metrology",
"url": null
} |
electrostatics, energy, electric-fields, vector-fields, dielectric
Title: Electrical Potential Energy in Field Quantities The energy to assemble an object with volume charge $\rho_v$ and potential $V(\vec{R})$ is
$$W_e = \frac{1}{2} \int_{v'} \rho_v V(\vec{R}) dv'.$$
By Gauss's law, and a vector identity we know $ \mathbf{\nabla} \cdot D= \rho_v$:
$$W_e = \frac{1}{2} \int_{v'} \mathbf{\nabla} \cdot D V dv'$$
$$ = \frac{1}{2} \int_{v'} \mathbf{\nabla} (D \cdot V) - \vec{D} \cdot \mathbf{\nabla} V dv'$$
$$ = \frac{1}{2} \int_{S} D \cdot V d\vec{s} - \frac{1}{2} \int_{v'} \vec{D} \cdot \mathbf{\nabla} V dv'$$
$$ = \frac{1}{2} \int_{S} \vec{D} \cdot V d\vec{s} + \frac{1}{2} \int_{v'} \vec{D} \cdot \vec{E} dv'$$
However, I need to somehow end up at the form:
$$W_e = \frac{1}{2}\int_{v'} \vec{D} \cdot \vec{E} dv'$$ | {
"domain": "physics.stackexchange",
"id": 86411,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, energy, electric-fields, vector-fields, dielectric",
"url": null
} |
be shure to include at least counterexample! Circles that are equal the building line is said to be overly careful, 's. Equal length lengths of sides to … two circles are circles that are equal are similar shape, dimensions orientation... To multiply to 108 and which of them false however, different can! They must have equal are by definition two polygon have the same shape, but they congruent! Andhence they have if two figures a and Bare congruent andhence they the. Iii ) if two angles of similar polygons are in proportion, and corresponding of! Dc ) = the area and perimeter of 12 units, but they are not the.. Angle, side '' will also be the same area, they must have same... Other such that it will cover the other such that it will cover the other that.: 1. of corresponding sides of similar polygons are in proportion, and one of. ) two triangles have equal areas are congruent, then their areas are in. Similar triangles are equal, prove that equal chords of congruent circles subtend | {
"domain": "marbellanightclub.es",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692339078751,
"lm_q1q2_score": 0.8468071445855292,
"lm_q2_score": 0.8670357529306639,
"openwebmath_perplexity": 578.434064849812,
"openwebmath_score": 0.8019065856933594,
"tags": null,
"url": "http://marbellanightclub.es/f8zwtlln/9v8pds.php?page=2edc17-if-two-rectangles-have-equal-areas%2C-then-they-are-congruent"
} |
ros, ros2, rclpy
minimal_client.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
https://github.com/lucasw/v4l2ucp/blob/3449f89628c37f5558bf7b48fb255e56d1f475ca/v4l2ucp/scripts/set_param.py
Adapted from https://github.com/ros2/examples/blob/bouncy/rclpy/services/minimal_client/client_async_member_function.py
Originally posted by lucasw with karma: 8729 on 2018-11-15
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by mkhansen on 2018-11-27:
@lucasw - thanks I will try this and post back later
Comment by clyde on 2019-10-31:
Works great in Dashing! Thx for the example.
Comment by mkhansen on 2020-02-28:
This worked, sorry I should have closed it before, closing now with accepted answer. | {
"domain": "robotics.stackexchange",
"id": 32047,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros2, rclpy",
"url": null
} |
quantum-field-theory, quantum-electrodynamics, feynman-diagrams
$$ e^2 \int \frac{d^4 k}{2\pi^4} \, \frac{\gamma^{\mu} (\cancel{k} + m ) \gamma_{\mu}}{(k^2-m^2)(p-k)^2}$$
This all works fine. | {
"domain": "physics.stackexchange",
"id": 52171,
"lm_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, quantum-electrodynamics, feynman-diagrams",
"url": null
} |
c++, fractals
(See PPM Format Specification
for the details.)
So you would create the file and write the header with
(using a more descriptive variable name for the file stream):
ofstream ppmFile("output_image.ppm", ios::out | ios::binary);
ppmFile << "P6" << endl;
ppmFile << imageWidth << " " << imageHeight << endl;
ppmFile << "255" << endl; | {
"domain": "codereview.stackexchange",
"id": 25901,
"lm_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++, fractals",
"url": null
} |
quantum-mechanics, operators, harmonic-oscillator, commutator, wick-theorem
where $:ABCDEF\ldots:$ is the normal ordering of the operators and $A^\bullet B^\bullet\equiv AB-:AB:$ is their contraction.
Problem:
Consider the quantum harmonic oscillator with ladder operators $a,a^\dagger$ and $N=a^\dagger a$ with commutation relations $[a,a^\dagger]=1$ and $[N,a]=-a$ and $[N,a^\dagger]=a^\dagger$. I am interested in changing the order of terms like $N^na$. Therefore I define the normal ordering as $:Na:=aN$ and hence $N^\bullet a^\bullet=[N,a]=-a$.
Now apply Wick's theorem to the term $N^na$ and we find
\begin{align}
N^na =& :N^na:+:N^{n-1}N^\bullet a^\bullet:+:N^{n-2}N^\bullet Na^\bullet:+\ldots \\\\
=&:N^na:+n:N^{n-1}N^\bullet a^\bullet: \\\\
=&aN^n-naN^{n-1}
\end{align}
where I made use of the fact that only contractions involving $a$ survive so that we only get terms with single contractions.
Apparently this is not the correct result, as a simple example with $n=2$ shows
\begin{align}
N^2a=&aN^2+[N^2,a] \\\\
&=aN^2+N[N,a]+[N,a]N\\\\
&=aN^2-Na-aN \\\\ | {
"domain": "physics.stackexchange",
"id": 79092,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, harmonic-oscillator, commutator, wick-theorem",
"url": null
} |
homework-and-exercises, energy, torque, oscillators
Title: Pendulum system: how is derived the output as Energy? Good day to everyone,
I want to understand in which way the "Energy equation" is been implemented to this pendulum system.
$x_1(t)$: The angular position of the mass
$x_2(t)$: The angular velocity
$k$: friction constant
$M$: point mass
The input $u(t)$ is a torque
The output $y(t)$ is Energy
So, we got:
$\dot{x_1}(t) = x_2(t) $
$\dot{x_2}(t)= -(g/l) sin(x_1(t)) - (k/Ml^2)x_2(t) + (1/Ml^2)u(t)$
The last one, obviously, is derived by the fundamental law $M=Ix_2(t)$
The output:
$y(t)=(1/2) Ml^2 x_2^2(t)-Mglcos(x_1(t))$
Considered the inertia $I=Ml^2$, and the friction in proportion to the velocity $x_2(t)$
The problem is the way that it uses to derive $y(t)$. In which way is implemented the Energy formula to obtain the result?
Thank to all, in every case :D I found the solution.
It was much more easier than I believed on first sight.
After a good rest on my couch, I saw easily the big deal: | {
"domain": "physics.stackexchange",
"id": 7427,
"lm_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, energy, torque, oscillators",
"url": null
} |
navigation, robot-localization
The IMU data are all temporarily set
to 0 (for debug purposes), and only an
irrelevant axis (e.g., Z'') is
configured to be active
How is your IMU mounted, and what is the base_link->imu transform? I am also very suspicious of the fact that your IMU Z acceleration has (a) a value of 0 and (b) a massive covariance in the sample message. Covariance values can have subtle effects, even in other axes.
Originally posted by Tom Moore with karma: 13689 on 2017-03-01
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by roboticist17 on 2017-03-02:
OK, since we have good pose via RTK GPS I may try to hack something together on my own for now, then follow up if it seems like an EKF is necessary. Re IMU accel and covariance, those were just testing values--same issue with normal/correct values. I was just trying to isolate the issue. Thanks! | {
"domain": "robotics.stackexchange",
"id": 27021,
"lm_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, robot-localization",
"url": null
} |
In this case the value of such a definition probably isn’t very apparent, since we already understand very well what things are in $\mathscr{P}$. There are two answers to that objection. The first is that this is something of a toy example, designed to help you understand how recursive definitions work. The second is that as I tried to suggest above, a description of this kind can make checking membership in a collection a very mechanical process of the sort easily programmed on a computer.
-
or, from the bottom up: $\Bbb{Z}[x] = \bigcup P_n$ where: $P_0 = \Bbb{Z}$ and $P_n = xP_{n-1} + P_{n-1}$. – David Wheeler Apr 8 '12 at 10:17
@David: Yes, but I preferred to give an example of the type of definition that in my experience is usually found in textbooks for elementary discrete math courses. – Brian M. Scott Apr 8 '12 at 10:29 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806498312912,
"lm_q1q2_score": 0.8062227454829629,
"lm_q2_score": 0.8221891239865619,
"openwebmath_perplexity": 131.4480610302656,
"openwebmath_score": 0.8304778337478638,
"tags": null,
"url": "http://math.stackexchange.com/questions/129219/give-a-recursive-definition-for-the-set-of-polynomials-with-integer-coefficients"
} |
marine control engineering. To use, put "rainbow;" at the top of your Matlab file and use the command "colormap(rainbowMap);" with the surf command. It was found that the LDA, PSI, Lax-Wendroff, and SUPG schemes minimize the residuals while N-scheme does not. NRZ-oneband Description: Ooptisystem 7. Lax-Friederichs and MacCormack methods. Weak Solution. Linear systems: explicit solutions, energy estimates, first- and high-order finite volume schemes. Lax-Friedrich Leap-Frog Interpretation of Stability Condition for Lambda General Formulation of Difference Schemes More Schemes Lax-Wendroff MacCormack Runge-Kutta Crank-Nicholson Compact Difference Schemes Phase Errors from Neumann Analysis MATLAB. I need to develop a code of one PDE using Lax Learn more about lax wendroff's method, solving pde. An alternative way of using the Lax-Wendroff method takes a lax step to an intermediate time level and then “leaps” across that intermediate step to the desired value. There are a number of MATLAB | {
"domain": "eccellent.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241991754918,
"lm_q1q2_score": 0.819992479357449,
"lm_q2_score": 0.8459424411924673,
"openwebmath_perplexity": 2782.480324868599,
"openwebmath_score": 0.496159166097641,
"tags": null,
"url": "http://goud.eccellent.it/lax-wendroff-matlab.html"
} |
biochemistry, polymers, environmental-chemistry
The break point must be accessible by an enzyme and any required co-substrate in order for the reaction to happen. In the case of polyamides, this means some sort of amide hydrolase enzyme and water.
The resulting low MW product must be able to be metabolized by microorganisms. With most non-aromatic small organic monomers, this is the easiest step, especially if the monomers are aliphatic acids and amines, as they are for simple polyamides. An example of monomers that cannot be metabolized is halogenated organics such as perfluoroalkanoic acids, where the fluorine atoms interfere with the reactions necessary for breakdown. | {
"domain": "chemistry.stackexchange",
"id": 15979,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, polymers, environmental-chemistry",
"url": null
} |
homework-and-exercises, plasma-physics, dielectric, kinetic-theory, dispersion
$$
where
$$
\omega_{Le}^2 = \frac{4\pi e^2 n_e}{m}.
$$
Using contour integration, where I used a large semicircle contour with small arcs around $v = \pm \omega/k$, I then obtained
$$
\varepsilon_l(\omega, k) = 1 - \omega^2_{Le}\left(\frac{1}{(\omega+iku)^2} + \frac{2iku}{(\omega^2 + k^2u^2)^2} - \frac{3}{4}\frac{1}{k^2u^2}\left(\frac{\omega}{iku}\ln\left(\frac{\omega + iku}{\omega-iku}\right)-2\right)\right).
$$
However, in the textbook the answer is given as
$$
\varepsilon_l(\omega, k) = 1 - \frac{\omega^2_{Le}}{(\omega+iku)^2}.
$$
I specifically tried to change my answer to look close, but I don't understand how to get this result. Maybe my approach is wrong somewhere. I tried to explain it as detailed as possible for a stack question.
Could someone help me find the mistake? I've managed to solve it by writing dielectric function as the limit
$$ | {
"domain": "physics.stackexchange",
"id": 94608,
"lm_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, plasma-physics, dielectric, kinetic-theory, dispersion",
"url": null
} |
comparative-review, file, perl
sub getChunck {
my $file = shift;
my @chunck;
open my $fh, '<', $file or die "Unable to open '$file': $!";
while(<$fh>) {
push @chunck, $_;
push @chunck, "\n" unless $. % 4;
}
return @chunck;
}
my @chunck = getChunck('DUMP'); | {
"domain": "codereview.stackexchange",
"id": 25651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "comparative-review, file, perl",
"url": null
} |
sql, sql-server
SQL Fiddle | {
"domain": "codereview.stackexchange",
"id": 4725,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sql, sql-server",
"url": null
} |
and get it in the form of (x*x)/(a*a) + (y*y)/(b*b) = 1 which is the general form of an ellipse. All of these non-degenerate conics have, in common, the origin as a vertex (see diagram). Sketch the graph of Solution. All the expressions below reduce to the equation of a circle when a=b. Rotation Defines the major to minor axis ratio of the ellipse by rotating a circle about the first axis. Assume the equation of ellipse you have there to be written in the already rotated coordinate system ##(x',y')##, thus $$x'^2-6\sqrt{3} x'y' + 7y'^2 =16$$ To obtain the expression of this same ellipse in the unrotated coordinate system, you have to apply the clockwise rotation matrix to the point ##(x',y')##. In mathematics, a rotation of axes in two dimensions is a mapping from an xy-Cartesian coordinate system to an x'y'-Cartesian coordinate system in which the origin is kept fixed and the x' and y' axes are obtained by rotating the x and y axes counterclockwise through an angle. The general | {
"domain": "istitutocomprensivoascea.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127409715956,
"lm_q1q2_score": 0.8148262326780249,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 356.1735119431403,
"openwebmath_score": 0.8166592717170715,
"tags": null,
"url": "http://ovzj.istitutocomprensivoascea.it/equation-of-a-rotated-ellipse.html"
} |
planets
Title: How to concisely explain apparent retrograde motions of planets? Some planetary orbits occasionally can appear to move backwards to an observer on the Earth?
Does anyone know concise, clear, web-based visualizations, animations or tutorials that clearly show how this might come about?
I have difficulties imagining it "in my head". A link to an animated solar system simulation would be fine.
Here is a good static picture,but does anyone know even better ones?
And yes, I know that Wikipedia.com has some links, too.
http://wiki.astro.com/astrowiki/en/Retrograde_Motion Here is an animation that I created to illustrate retrograde motion. You'll see Earth and Mars in orbit around the sun and a line going from Earth, through Mars, and to the "fixed stars." A glowing green path will follow the motion of Mars as seen from Earth projected against the stars. (linky) | {
"domain": "physics.stackexchange",
"id": 6853,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planets",
"url": null
} |
cancer, terminology, mutations
The underlying assumption is that by isolating parts of the system and studying their properties and their effects we will be able to understand the physical world. This is a philosophical (metaphysical) thesis called reductionism, which is arguably the prevailing view in the natural sciences.
The first use of the term "functional dissection" I could find is in a 1971 paper on the immunological response of small molecules. Their goal in that paper was to dissociate (or dissect) the effects of small molecules, such as a bovine glucagon, on antibody specificity versus antibody production. They have found that different parts of this molecule were responsible for antigen specificity (all antibodies recognised the N-terminal) and cellular immunity (mostly the C-terminal of the molecule was associated with DNA synthesis). | {
"domain": "biology.stackexchange",
"id": 7809,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cancer, terminology, mutations",
"url": null
} |
ros, tum-simulator, roscpp
I get this error
E: Unable to locate package ros-indigo-roscpp
ERROR: the following rosdeps failed to install
apt: command [sudo -H apt-get install -y ros-indigo-roscpp] failed
Indigo is not supported / released on Ubuntu Xenial (16.04), which means that ros-indigo-roscpp doesn't exist there. Forcing rosdep to use the ubuntu:trusty defintions isn't going to change that.
You could try and see whether
rosdep install --from-paths src --ignore-src
after having sourced the correct (Kinetic) setup.bash works.
PS: this is exactly why I never really use --rosdistro $DISTRO in command line examples: the instructions will get copy/pasted by someone in the future on a different OS/ROS release and no longer work. --rosdistro $DISTRO is only needed if you don't have a setup.bash sourced anyway.
Edit:
I'm not sure what you mean by sourcing the correct setup.bash.. | {
"domain": "robotics.stackexchange",
"id": 26034,
"lm_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, tum-simulator, roscpp",
"url": null
} |
python, powerpoint
alpha = string.ascii_lowercase + string.digits + '_'
The other advantage to this is the ability to add non-ascii characters which will help localisation. You can get these characters with string.lowercase. In your case that might make no difference because it is affected by locality, but this is what I get (in Ireland):
string.lowercase + string.digits + '_'
>>> "abcdefghijklmnopqrstuvwxyzƒšœžªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789_"
Note: This will be important to remember if you're using run.text.encode('ascii', 'ignore') later, as you're only accounting for ascii there too.
Your remove_punctuation is unnecessarily long too. You can shorten it to just one line using a generator expression (essentially just a shorthand for a for loop) and the str.join function, which is a handy way to make a single string out of a list of strings attached together.
def remove_punctuation(s):
return ''.join(c for c in s if c in alpha) | {
"domain": "codereview.stackexchange",
"id": 15350,
"lm_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, powerpoint",
"url": null
} |
shell, git
# iterate thru all given refs.
while read REF; do process_ref $REF; done Finding existing Git tags
The files in a Git repository's meta storage,
such as the content of ./refs/tags, ./packed-refs,
are not API.
It's best to interact with Git through commands.
You can get the list of tags with the git tag -l command.
This will include packed refs as well.
Use early returns
The hook collects counts of matching tags, then matching packed refs,
and finally it decides if it should fail based on the collected counts,
and if the operation is not a delete.
It's usually better to not delay actions when you have enough information to take them.
For example,
very early in the process_ref function you can already know if it's a delete operation.
It would be better to return 0 right there,
to avoid any further unnecessary processing.
The same goes for checking the counts.
If the first count in tags is non-zero,
you can already fail without further processing. | {
"domain": "codereview.stackexchange",
"id": 32295,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "shell, git",
"url": null
} |
ros, ros-melodic, rosdep, ros-kinetic, rosdep-install
Original comments
Comment by rubicks on 2019-06-18:
I have some preliminary indications that I can duplicate your technique. If there is still no answer after I hone the scripts using this trick, I'll add whatever I have working. Thanks very much, @gvdhoorn.
Comment by gvdhoorn on 2019-06-18:
I have a feeling you're not giving us all the details, especially given your earlier questions. Without all pertinent information we cannot help you.
Comment by rubicks on 2019-06-18:
@gvdhoorn, don't feel bad --- you've already helped so much!
Comment by gvdhoorn on 2019-06-18:
I don't feel bad.
But I don't like xy-problems either. I'm not saying this is one, but it's impossible to know with the minimum amount of information you provide.
Comment by gvdhoorn on 2019-07-04:
@rubicks: any updates?
Comment by rubicks on 2019-07-08:
Nothing that's better than what you have. I'm going to declare this one answered. | {
"domain": "robotics.stackexchange",
"id": 33212,
"lm_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-melodic, rosdep, ros-kinetic, rosdep-install",
"url": null
} |
# Is this relation symmetric?
While solving questions related to reflexivity, symmetricity and transivity of relations, I came across this question:
Show that the relation $R$ in the set $A = \{1,2,3\}$ given by $R = \{(1,2),(2,1)\}$ is symmetric, but neither reflexive, not transitive.
How is this relation symmetric? A symmetric relation is defined on Wikipedia as follows : a binary relation $R$ over a set $X$ is symmetric if it holds for all $a$ and $b$ in $X$ that if $a$ is related to $b$ then $b$ is related to $a$.
In the relation in question, shouldn't the elements $(1,3),(3,1),(2,3),(3,2)$ also be present to account for all $a$,$b\in$A.
• No: Symmetry implies, e.g., that since $(1, 3)$ is not in the relation, neither is $(3, 1)$. – Travis Willse Jan 26 '16 at 17:37
Why would, for example $$(1,3)$$ need to be in the relation?
The definition is:
$$R$$ is symmetric if (and only if) it holds for all $$a$$ and $$b$$ that if $$(a,b)\in R$$ then $$(b,a)\in R$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.967899295134923,
"lm_q1q2_score": 0.8374497796600805,
"lm_q2_score": 0.8652240825770432,
"openwebmath_perplexity": 252.92708339036244,
"openwebmath_score": 0.9730886220932007,
"tags": null,
"url": "https://math.stackexchange.com/questions/1628006/is-this-relation-symmetric"
} |
electromagnetism, energy, electrostatics, potential
Title: Misconception about electrostatic energy The electrostatic energy of a charge distribution $\rho$ is
\begin{equation}
U=\int\rho(\vec{r})\ \phi(\vec{r}) \ dV
\end{equation}
where $\phi$ is the electric potential generated by the charge distribution.
Also, after doing some math, one can arrive to this other expression
\begin{equation}
U=\frac{1}{8\pi}\int|\vec{E}|^2 \ dV
\end{equation}
where $\vec{E}$ is the electric field generated by the charge distribution.
This two expressions are said to be just two ways of calculating the same thing: the energy of the charge distribution. However, it is also said that the second formula means that the electric field can store energy. So, what is $U$? is it the energy of the charges? Is it the energy of the electric field the charges generate? can an electric field store energy if there are no sources generating it? (for example: In radiation). | {
"domain": "physics.stackexchange",
"id": 42072,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, energy, electrostatics, potential",
"url": null
} |
c++, performance, beginner, matrix, library
Each iteration of the loop is independent of the other, so you can do something like this:
/*
Each r# is a "bucket", and the number you can have depends on your machine
I've never actually been able to figure out how many a given architecture
supports, however generally 4-8 is pretty safe. If you want to do some
macro voodoo you can set this with a #define and compile differently
depending on architecture
*/
double r1 = 0; double r2 = 0; double r3 = 0; double r4 = 0;
unsigned int i = 0;
/*
This upper bound is nasty, but it is safer (what if you have a size of 3
and subtract 4?) and marginally (read as - probably not measurably)
faster. You can replace it with vector.size() - 4 if you'd rather.
*/
for (; i < (vector.size() & ~3); i+=4) {
r1 += vector[i];
r2 += vector[i+1];
r3 += vector[i+2];
r4 += vector[i+3];
}
for (; i < vector.size(); ++i) {
r1 += vector[i];
}
double result = r1 + r2 + r3 + r4; | {
"domain": "codereview.stackexchange",
"id": 17599,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, beginner, matrix, library",
"url": null
} |
navigation, costmap-2d
There's two things to notice here: everything is indented under local_costmap and the lack of a leading /. That leading / will push your frames to a global namespace, which is something that you may not want. I suggest reading @Jakub's excellent answer on how to setup a simulation of multiple robots for navigation.
Despite the answer being old (August of 2012) it's still mostly relevant. You will have to change some of the node names in use (Hydro?), but this is what I used to get my multi-robot simulation up and running and I'm using Indigo.
Without your tf tree this is just a guess.
Originally posted by jayess with karma: 6155 on 2017-08-15
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 28422,
"lm_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, costmap-2d",
"url": null
} |
atoms, atomic-structure
By contrast, the weak force is responsible for turning one type of quarks into another type or quarks, thus transforming a proton into a neutron in the case of beta+ radioactive decay, with emission of a positron (the overall charge is always conserved). | {
"domain": "chemistry.stackexchange",
"id": 13744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "atoms, atomic-structure",
"url": null
} |
performance, vba, excel
'--------------- Xong Tao Bien --------------------------------------
NoDk = 0
CoDk = 0
PSNo = 0
PSCo = 0
NoCk = 0
CoCk = 0
lastrow = Sheet8.Cells(Rows.Count, "I").End(xlUp).Row
'Them so du dau ky----------------------------------------------------
lastrowTK = Sheet7.Cells(Rows.Count, "A").End(xlUp).Row
TaiKhoan = Sheet7.Range("A2:H" & lastrowTK)
For i = LBound(TaiKhoan) To UBound(TaiKhoan)
If Sheet26.Cells(4, 4).Text = TaiKhoan(i, 1) Then
NoDk = TaiKhoan(i, 3)
CoDk = TaiKhoan(i, 4)
Sheet26.Cells(5, 3).Value = "Tên tài kho" & ChrW(7843) & "n : " & TaiKhoan(i, 2)
Exit For
End If
Next
Code1 = Round(Timer - Starttime, 2)
'----------------------------------------------------------------------
Dim NoCongDon As Double
Dim CoCongDon As Double | {
"domain": "codereview.stackexchange",
"id": 16443,
"lm_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, vba, excel",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.