text stringlengths 1 1.11k | source dict |
|---|---|
human-genetics, natural-selection, intelligence, human-evolution
Finally, he cites two papers that are of interest here as they deal with the change of intellectual abilities of humans over time (Crabtree (2013) and Woodley (2015)). The latter is a meta-analytic study based in the US and UK and Lynch already points out that there there are the usual issues with entangling genetic and environmental factors. However, in that study a slow decline of general intelligence of about 0.39 points per decade due to selection and about 0.84 points per decade due to mutational load is suggested. Interestingly, Woodley points out that there are two major hypothesis for this decline: (i) Since the industrial revolution people with lower general intelligence have higher average number of offspring (that might be the 'differential procreation' you have been hinting at). (ii) Mutation accumulation due to relaxed purifying selection against deleterious variants. Woodley concludes that the decline is a combination of both. | {
"domain": "biology.stackexchange",
"id": 6160,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-genetics, natural-selection, intelligence, human-evolution",
"url": null
} |
audio
Let us take an example. We assume in this example that the BPM is 120 ; and the audio is processed at a rate of 48kHz. Thus, a beat has a duration of 0.5 seconds or 24000 samples.
To implement the "beat divide" effect, the audio is shoved in a ringer buffer as it is played, and a beat tracker collects the time stamp of beats. For example, the beat tracker is aware that the previous beats are at timestamps 86000, 60000, 36000... in the ring buffer ; while the play-head is at timestamp 90000. When you press the "beat divide" button, with a ratio of 1, the device loops the content of the buffer between timestamps 60000 and 86000. With a ratio of 1/4, the device loops the content between timestamps 60000 and 66000 - the loop has thus a duration of 6000 samples, or 0.125s, or one fourth of the duration of a beat. | {
"domain": "dsp.stackexchange",
"id": 1764,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio",
"url": null
} |
Plug the x-coordinate (which is 7) into x and the y-coordinate (which is 75) into y in our y=mx+b equation. Then we solve for b.
$75 = \frac{3}{20}(7) + b$
$75 = \frac{21}{20} + b$
$b = 75 - \frac{21}{20} = 73.95$
Now we have m and b. That is enough information. The equation of our line is $y = \frac{3}{20}x + 73.95$. Choose either decimals or fractions. I would simply write:
$y = 0.15x + 73.95$.
-Andy
5. 4. Ok, for the next part below it is asking to use technology to find the regression line.
And I came up with r = 0.2726285576 is this right?
Using technology find the regression line for the high temperatures. Give the equation including the regression coefficient, r. Now use this model to predict the same 5 years from part 3. Record the difference from this model with the actual temperature for those years. How does this model compare to the model generated in part 3? | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9674102524151826,
"lm_q1q2_score": 0.8019239017949614,
"lm_q2_score": 0.8289388083214156,
"openwebmath_perplexity": 404.6968837067163,
"openwebmath_score": 0.6091918349266052,
"tags": null,
"url": "http://mathhelpforum.com/algebra/44919-algrbra-help.html"
} |
ros-kinetic, rqt
I then run backtrace and get the following. I'm not sure what to do next.
#0 0x00007fffbe4bc5a4 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#1 0x00007ffff7de74ea in call_init (l=<optimized out>, argc=argc@entry=4,
argv=argv@entry=0x7fffffffd8c8, env=env@entry=0xf80890) at dl-init.c:72
#2 0x00007ffff7de75fb in call_init (env=0xf80890, argv=0x7fffffffd8c8,
argc=4, l=<optimized out>) at dl-init.c:30
#3 _dl_init (main_map=main_map@entry=0x13f48f0, argc=4, argv=0x7fffffffd8c8,
env=0xf80890) at dl-init.c:120
#4 0x00007ffff7dec712 in dl_open_worker (a=a@entry=0x7fffffffada0)
at dl-open.c:575
#5 0x00007ffff7de7394 in _dl_catch_error (
objname=objname@entry=0x7fffffffad90,
errstring=errstring@entry=0x7fffffffad98,
mallocedp=mallocedp@entry=0x7fffffffad8f,
operate=operate@entry=0x7ffff7dec300 <dl_open_worker>,
args=args@entry=0x7fffffffada0) at dl-error.c:187
#6 0x00007ffff7debbd9 in _dl_open ( | {
"domain": "robotics.stackexchange",
"id": 24733,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-kinetic, rqt",
"url": null
} |
newtonian-mechanics, newtonian-gravity, kinematics, orbital-motion, simulations
Let the small orbiting body have mass $m$. You know its initial position and velocity vectors, $\mathbf{r}_0$ and $\mathbf{v}_0$, in an arbitrary Cartesian coordinate system.
I’ll assume that you want to treat the “significantly heavier” body with mass $M$ as being stationary and consider it to be the origin of your coordinate system. So in the formulas below I have assumed that $M\gg m$.
From the initial position and velocity you know the (constant) angular momentum,
$$\mathbf{L}=m\mathbf{r}_0\times\mathbf{v}_0\tag1.$$
This vector is perpendicular to the plane of the orbit, so now you know the orbital plane.
From the vis-viva equation
$$v^2=GM\left(\frac2r-\frac1a\right)\tag2$$
you can use $\mathbf{r}_0$ and $\mathbf{v}_0$ to find the semimajor axis $a$ of the ellipse in this plane.
From the semimajor axis you can find the (constant) energy using
$$E=-\frac{GMm}{2a}\tag3.$$
From the energy and the angular momentum you can find the orbital eccentricity | {
"domain": "physics.stackexchange",
"id": 65371,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, newtonian-gravity, kinematics, orbital-motion, simulations",
"url": null
} |
4. ## Re: Point of best fit?
Originally Posted by Ackbeet
That's a very interesting problem. I have a couple of questions for you:
1. Does the "point of best fit" have to be on at least one of the lines? On at least two of the lines? Or could it be anywhere?
2. How are you defining "closest"? Since you only have two variables, x and y, in your equations, are you in just the xy plane? If so, are you measuring distance using Euclidean distance?
1. The point can be anywhere at all.
2. Yes, this is only in 2-dimensions with variables x and y. Defining "closest" is the main problem I have with this. What would the point have to satisfy for it to be considered the "closest" to a triple intersection?
I have found a few set of points that satisfy different things: | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357205793903,
"lm_q1q2_score": 0.8678929382860785,
"lm_q2_score": 0.8840392786908831,
"openwebmath_perplexity": 303.09679489483244,
"openwebmath_score": 0.615688681602478,
"tags": null,
"url": "http://mathhelpforum.com/advanced-algebra/183398-point-best-fit.html"
} |
genetics, molecular-biology, molecular-genetics
The L1 gene is located on the X chromosome, and its deletion results in poor breeding capability of males and thus female mice homozygous null for the CHL1 gene and heterozygous for L1 ($CHL1^{-/-}$/$L1^{+/-}$; C57BL/6/Sv129, ∼9:1) were crossed with $CHL1^{-/-}$/$L1^{+/y}$ males (C57BL/6) to produce $CHL1^{-/-}$/$L1^{-/y}$ double mutants. | {
"domain": "biology.stackexchange",
"id": 11780,
"lm_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-biology, molecular-genetics",
"url": null
} |
f(k+1) = 2\cdot(k-1)+f(a)+f(b) \\ \le 2\cdot(k-1)+a^2+b^2 \\ \le a^2 + 2\cdot ab + b^2 \\ \le (a+b)^2 = (k+1)^2 \\ \ \\ \implies f(k+1) \le (k+1)^2
The base case, with x=1 has f(x)=0.
Thus proved.
# TIME COMPLEXITY:
Determining each edge of the hidden tree takes \approx O(2\cdot N). The total time complexity is therefore:
O((N-1)\cdot(2\cdot N)) \approx O(N^2)
per test case.
# SOLUTIONS:
Editorialist’s solution can be found here
Experimental: For evaluation purposes, please rate the editorial (1 being poor and 5 excellent)
• 1
• 2
• 3
• 4
• 5
0 voters
1 Like
Does anyone have edge cases where a solution might fail? I seem to have implemented the solution in the editorial, but still fails with WA - Solution: 59759816 | CodeChef
Alternate approach:
• assume tree rooted at 1
• ? 3 1 i j for(all i, j)
• if its one that means j is in subtree of i. do size[i]++, ancestor[j][i] = 1; | {
"domain": "codechef.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540692607815,
"lm_q1q2_score": 0.8244453771303196,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 2272.3547532381426,
"openwebmath_score": 0.9618238210678101,
"tags": null,
"url": "https://discuss.codechef.com/t/secretree-editorial/99732"
} |
c++, graph, c++17, data-visualization, fltk
Text_ellipse.h
#ifndef TEXT_ELLIPSE_GUARD_300820182217
#define TEXT_ELLIPSE_GUARD_300820182217
#include "Graph.h"
namespace Graph_lib
{
class Text_ellipse : public Ellipse {
public:
Text_ellipse(Point p, const std::string& text_label, int font_size);
void draw_lines() const override;
std::string label() { return text.label(); }
private:
Text text;
};
int calculate_ellipse_width(const std::string& text_label, int font_size);
int calculate_ellipse_height(int font_size);
Point calculate_ellipse_text_position(Point p, const std::string& text_label, int font_size);
Point north(Text_ellipse& text_ellipse);
Point east(Text_ellipse& text_ellipse);
Point south(Text_ellipse& text_ellipse);
Point west(Text_ellipse& text_ellipse);
}
#endif
Text_ellipse.cpp
#include "Text_ellipse.h" | {
"domain": "codereview.stackexchange",
"id": 31860,
"lm_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++, graph, c++17, data-visualization, fltk",
"url": null
} |
time, measurements
Title: About time measurements What we regard as TIME is just a way of measuring duration for various phenomena. Like a ruler is a measuring device for measuring length ( or breadth or width). Saying Time is an illusion is like saying the measuring 'ability' of a ruler is an illusion. Is a measure of length, width, or breadth just an illusion? Why do some scientists or philosophers say Time is an illusion? Philosophically, both time and distance are illusions. Distance is actually more disturbing than time. So first, let's define what "time" is. It is the number of transitions of an atomic state (see atomic clock wiki). Distance, a meter, is defined to be the length a photon (light) travels in $\frac{1}{299,792,458}$ of a second (source) which simultaneously defines both distance and the speed of light! | {
"domain": "physics.stackexchange",
"id": 15446,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "time, measurements",
"url": null
} |
c#, .net, wpf, video
converter is Basler.Pylon.PixelDataConverter. It converts the grabbed frame which is in Bayer array format into a normal BRG image.
The lock is in place because there is another routine to save the current image, and I don't want to do this while it is being updated:
public void SaveImage()
{
if (cameraImage == null) return;
lock(cameraImage)
{
String filename = folder + "\\" + stem + "-" + set.ToString("D2") + "-" + subset.ToString("D2") + ".png";
if (filename != string.Empty)
{
using (FileStream stream = new FileStream(filename, FileMode.Create))
{
PngBitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(cameraImage));
encoder.Save(stream);
}
}
}
}
Questions | {
"domain": "codereview.stackexchange",
"id": 28760,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, wpf, video",
"url": null
} |
reference-request, computability, big-picture
an interesting program but I am more interested in having a geometric view of extremely fundamental concepts like the dynamics of a Turing Machine, Lambda Calculus or the structure of (un)computable sets (rather than specific problems). Is it a hopeless job to find geometrical structure in these objects or can one expect some intricate results? Is there any formulation of TCS which treats it geometrically? The semantics of computer programs can be understood geometrically in three distinct (and apparently incompatible) ways. | {
"domain": "cstheory.stackexchange",
"id": 2265,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, computability, big-picture",
"url": null
} |
# Powers of a function being analytic [duplicate]
Question is as follows :
Suppose that $f:\mathbb{C}\rightarrow \mathbb{C}$ is continuous such that $f^3,f^4$ are analytic in $\mathbb{C}$ then prove that $f$ is analytic in $\mathbb{C}$..
Choose $z_0\in \mathbb{C}$. Suppose that $f(z_0)\neq 0$. As $f$ is continuous, in a nbd around $z_0$ the value of $f$ is nonzero.
So, $f^4(z)/f^3(z)=f(z)$ in a small open ball centered at $z_0$.. So, $f$ is analytic at $z_0$.
Suppose $z_0$ is such that $f(z_0)=0$ then we can not say that $f^4(z)/f^3(z)=f(z)$ for all $z$ in a small open ball around $z_0$ as $f(z_0)=0$ we can not cancel.
But then we can certainly say that there is a ball where $f(z)$ is non zero except at $z_0$. Then in this ball we do have that $f^4(z)/f^3(z)=f(z)$. So, $f(z)$ is analytic in punctured disk around $z_0$.
I some how feel that function being analytic on punctured disk and function being continuous imply that function is analytic.. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9597620550745211,
"lm_q1q2_score": 0.8176719684359105,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 195.37352718237238,
"openwebmath_score": 0.9500122666358948,
"tags": null,
"url": "https://math.stackexchange.com/questions/1751611/powers-of-a-function-being-analytic"
} |
bond, coordination-compounds, transition-metals, ionic-compounds
Basically, why can transition metals exhibit coordination in addition to (at least what seems like) ionic and covalent bonds? Your approach is fundamentally wrong. Main group elements form complexes all the time. It is just that these complexes are typically kinetically labile and quickly decompose, rearrange and so on.
Main group elements’ complexes are also typically colourless due to the lack of d-electrons or due to the fully populated d-subshell meaning that all electron transitions are in the UV range, so you cannot easily study them via colour changes.
The state of the d-subshell (full or empty, nothing in-between) also means that no additional stability of certain geometries exist; the s and p orbitals can more or less rearrange to whatever is required.
And finally note that ‘simple’ ionic compounds are, in fact, huge coordinative compounds. A single sodium ion in a $\ce{NaCl}$ crystal could be described as a $\ce{[Na(Cl)_{\frac{6}{6}}]}$ complex. | {
"domain": "chemistry.stackexchange",
"id": 5450,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bond, coordination-compounds, transition-metals, ionic-compounds",
"url": null
} |
[ noun ] in matrix mathematics, the ij entry of a Duane Q. Nykamp licensed! Need to define the transpose of a matrix obtained by interchanging the rows columns. Placed At jth row and jth column in X will be placed At jth row and ith column X., including Dictionary, Thesaurus, Encyclopedia place of ; interchange properties: 1, commute, transpose verb! Is obtained by interchanging the rows and columns of a is the matrix defined transpose matrix definition where denotes transposition and second! … Example 1: Consider the matrix defined by where denotes transposition and the row! ( verb ) change the order or place of ; interchange, pronunciation, translations and Examples.. '' ( matrix ) Let Abe an m nmatrix given matrix and columns a..., because how did we define these two transpose definition: 1. to change something one! The top right-hand corner to mean transpose: Notation At is n m. Here are some properties:.. Define the transpose of a matrix is the interchanging of rows and columns | {
"domain": "southernmines.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631623133665,
"lm_q1q2_score": 0.8909761398531966,
"lm_q2_score": 0.9032942164664239,
"openwebmath_perplexity": 714.7809239474072,
"openwebmath_score": 0.6923036575317383,
"tags": null,
"url": "http://www.southernmines.org/water-pressure-rzyocn/transpose-matrix-definition-d896ca"
} |
ros, catkin-install, c++11, rospack
undefined reference to : undefined reference to boost::program_options::argstd::ios_base::Init::Init()' ' /opt/qnx/install/arm_catkin_ros/devel_isolated/rospack/lib/librospack.so: undefined reference to std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_replace(unsigned int, unsigned int, wchar_t const*, unsigned int)' | {
"domain": "robotics.stackexchange",
"id": 28184,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, catkin-install, c++11, rospack",
"url": null
} |
beginner, r, binary-search
To fix that, you need to allow for some very small tolerance. You could mimic all.equal by setting that tolerance to .Machine$double.eps ^ 0.5:
BiSearch <- function(table, key, tol = .Machine$double.eps ^ 0.5) {
...
if (table[m] > key + tol) { ... }
else if (table[m] < key - tol) { ... }
...
} | {
"domain": "codereview.stackexchange",
"id": 23713,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, r, binary-search",
"url": null
} |
c++, algorithm, binary-search
I'm not sure I agree with the interface design presented for this data structure. If you're doing this as just a practice exercise I suppose it's probably okay. However, if you're planning to reuse this in production code or real-world projects it's a good idea to follow the same interface design as the stl for consistency. In particular, you don't want client code to be able to manipulate those binary nodes since those are just implementation details.
To better separate the concerns, one idea you can try is to define an outer structure that contains a BinaryNode. Something along the lines of this:
template <typename T>
class BinaryTree
{
public:
BinaryTree() : root(0) {}
// rest of your interface methods here
// Insert, GenerateTree etc.
// ...
private:
struct BinaryNode
{
T data;
BinaryNode *left, *right;
void Insert(const T &data_);
};
BinaryNode *root;
}; | {
"domain": "codereview.stackexchange",
"id": 931,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, binary-search",
"url": null
} |
navigation, gmapping
Title: Navigation Stack with gmapping
Has anyone had success getting the navigation stack to work with the gmapping package? If I understand it correctly, it appears that you could stop using the map_server and amcl, replace those with gmapping, and you could then perform autonomous mobility in an environment while you SLAM. Is that understanding correct? Do the local_costmap and global_costmap support this idea, and if so, what are the key parameters to configure this to happen?
Originally posted by jdt141 on ROS Answers with karma: 118 on 2011-03-15
Post score: 5
I was able to get this to work by not running both amcl and map_server, and running gmapping. The only parameter that I had to change (from the defaults in the navigation tutorial) were to change the global_costmap to NOT have a static map (static_map: false) and to set the rolling_window to true (rolling_window: true) in the global_costmap_params.yaml file. | {
"domain": "robotics.stackexchange",
"id": 5081,
"lm_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, gmapping",
"url": null
} |
equivalent vectors vectors that have the same magnitude and the same direction
equilibrium solution any solution to the differential equation of the form $$y=c,$$ where $$c$$ is a constant
epsilon-delta definition of the limit $$\displaystyle \lim_{x→a}f(x)=L$$ if for every $$ε>0$$, there exists a $$δ>0$$ such that if $$0<|x−a|<δ$$, then $$|f(x)−L|<ε$$
end behavior the behavior of a function as $$x→∞$$ and $$x→−∞$$
elliptic paraboloid a three-dimensional surface described by an equation of the form $$z=\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}$$; traces of this surface include ellipses and parabolas
elliptic cone a three-dimensional surface described by an equation of the form $$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}−\dfrac{z^2}{c^2}=0$$; traces of this surface include ellipses and intersecting lines
ellipsoid a three-dimensional surface described by an equation of the form $$\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}+\dfrac{z^2}{c^2}=1$$; all traces of this surface are ellipses | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964207345893,
"lm_q1q2_score": 0.8034087069589012,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 141.3882769672332,
"openwebmath_score": 0.9248999357223511,
"tags": null,
"url": "https://math.libretexts.org/Bookshelves/Calculus/CLP-4_Vector_Calculus_(Feldman_Rechnitzer_and_Yeager)/zz%3A_Back_Matter/20%3A_Glossary"
} |
ros, ros-kinetic
Title: canopen master hard- and software advice
At work I am trying to integrate a Rinco Ultrasonic Welding Generator with a KUKA industrial robot. I have some experience with integrating a sensor with this robot, so I'd like to use this project to increase my skills with ROS. For now I want to focus on controlling all functionality of the generator from ROS.
CANOpen
The generator supports communications based on RS485 and CANOpen. I have a detailed manuals of both communications options (easily found online) and the .EDS files for the CANOpen communication. For the project I'd like to get more into working with industrial field busses, so using CANOpen has my preference.
My questions
The questions I am currently trying to answer: | {
"domain": "robotics.stackexchange",
"id": 31259,
"lm_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-kinetic",
"url": null
} |
ros-melodic
E: The repository 'http://packages.ros.org/ros/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details. | {
"domain": "robotics.stackexchange",
"id": 33102,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-melodic",
"url": null
} |
# math
A bottle contains 12 red marbles and 8 blue marbles. A marble is chosen at random and not replaced. Then, a second marble is chosen at random. Determine the probability that the two marbles are not the same color. Determine the probability that at least one of the marbles is red.
1. 👍 0
2. 👎 0
3. 👁 647
1. 20 marbles in all
P1(red,blue) = 12/20 * 8/19
P2(blue,red) = 8/20 * 12/19
so, P(different) = P1+P2 = 48/95
Note that
P1(red,red) = 12/20 * 11/19
P2(blue,blue) = 8/20 * 7/19
P(not same) = 1 - (P1+P2) = 48/95
P(at least 1 red) = 1 - P(blue,blue) = 81/95
Check to see that this is also P(not same) + P(red,red)
1. 👍 1
2. 👎 1
👨🏫
oobleck
## Similar Questions
1. ### math
A bag contains 5 red marbles, 6 white marbles, and 8 blue marbles. You draw 5 marbles out at random, without replacement. What is the probability that all the marbles are red? The probability that all the marbles are red is? What
2. ### Math | {
"domain": "jiskha.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668734137681,
"lm_q1q2_score": 0.804452178772081,
"lm_q2_score": 0.8198933337131076,
"openwebmath_perplexity": 279.25923584468103,
"openwebmath_score": 0.8649135828018188,
"tags": null,
"url": "https://www.jiskha.com/questions/1793168/a-bottle-contains-12-red-marbles-and-8-blue-marbles-a-marble-is-chosen-at-random-and-not"
} |
rosout, rosmake, mavericks, macosx, homebrew
[rosmake-4] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization
No Makefile in package roscpp_serialization
[rosmake-7] Starting >>> message_runtime [ make ]
[rosmake-5] Finished <<< rosunit ROS_NOBUILD in package rosunit
No Makefile in package rosunit
[rosmake-7] Finished <<< message_runtime ROS_NOBUILD in package message_runtime
No Makefile in package message_runtime
[rosmake-1] Starting >>> std_msgs [ make ]
[rosmake-6] Starting >>> rosbuild [ make ]
[rosmake-1] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
No Makefile in package std_msgs
[rosmake-6] Finished <<< rosbuild ROS_NOBUILD in package rosbuild [ 2 Active 17/23 Complete ]
No Makefile in package rosbuild
[rosmake-6] Starting >>> rosconsole [ make ]
[rosmake-1] Starting >>> rosgraph_msgs [ make ]
[rosmake-1] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
No Makefile in package rosgraph_msgs | {
"domain": "robotics.stackexchange",
"id": 20047,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosout, rosmake, mavericks, macosx, homebrew",
"url": null
} |
javascript, html, css
}
else{
$(images[i]).css({"top":0});
}
$("#gallery").append(images[i]);
}
} | {
"domain": "codereview.stackexchange",
"id": 2445,
"lm_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, html, css",
"url": null
} |
brain
Title: Are we naturally born right or left handed or ambidextrous? Most of you here will be right or left handed. A few might be ambidextrous. But were we born that way?
I'm wondering if everyone was born ambidextrous, but as they grew up became more dependent on one hand, and that hand after more use now has stronger muscles, bones etc. Or were we naturally born with one hand stronger than the other?
I've heard somewhere that it has something to do with the brain, and which side which hemisphere is on. Not sure the validity of this statement. It's also been pointed out that chimps and apes show handedness, so this probably not just a human thing.
So, are we naturally born right or left handed? Or are we all born ambidextrous and does left or right handedness develops later? tl;dr
Yes!
Is handedness determined before birth?
Without thinking of whether handedness is genetically or environmentally defined (see below), is handedness decided before birth? | {
"domain": "biology.stackexchange",
"id": 7376,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "brain",
"url": null
} |
roslaunch
#Time/Date stamp the log
echo -e "\n$(date +%Y:%m:%d-%T) - Starting ROS daemon at system startup" >> $LOG
echo "This launch will export ROS's IP as $ip" >> $LOG
#For bootup time calculations
START=$(date +%s.%N)
#This is important. You must wait until the IP address of the machine is actually configured by all of the Ubuntu process. Otherwise, you will get an error and launch will fail. This loop just loops until the IP comes up.
while true; do
IP="`ifconfig | grep 'inet addr:'192.168.9.123''| cut -d: -f2 | awk '{ print $1}'`"
if [ "$IP" ] ; then
echo "Found"
break
fi
done
#For bootup time calculations
END=$(date +%s.%N)
echo "It took $(echo "$END - $START"|bc ) seconds for an IP to come up" >> $LOG
echo "Launching default_package default_launch into a screen with name 'ros'." >> $LOG
screen -dmS ros roslaunch panda_cam high.launch
}
case "$1" in
start)
start_ros
esac
exit 0 | {
"domain": "robotics.stackexchange",
"id": 12371,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "roslaunch",
"url": null
} |
c++, json, c++17
return *this;
}
private:
std::unique_ptr<T> p;
};
}
class Array;
class Object;
using Value = std::variant<
std::monostate,
Internal::RecursiveWrapper<Object>,
Internal::RecursiveWrapper<Array>,
std::string,
bool,
long long int,
double
>;
class Json : protected Value {
using Value::Value;
public:
Json(std::nullptr_t = nullptr);
Json(std::initializer_list<Json> init);
Json(const char* s); // prevent "string" to be casted to bool
template<
typename T,
std::enable_if_t<!std::is_convertible_v<T, Value> && !std::is_same_v<T, bool>&& std::is_integral_v<T>, bool> = true
>
Json(const T i) : Value(static_cast<long long int>(i)) { } // Cast other int types to long long int | {
"domain": "codereview.stackexchange",
"id": 44239,
"lm_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++, json, c++17",
"url": null
} |
waves, differential-geometry, coordinate-systems, differential-equations
$$
\partial^{\mu}\partial_{\mu}\phi=0
$$
still holds? You want to re-express the wave equation in spherical coordinates for a constant $r$. In spherical coordinates the Laplacian is
$$\nabla^2 u = \frac{\partial^2 u}{\partial r^2} + \frac{2}{r}\frac{\partial u}{\partial r} + \frac{1}{r^2 \sin \theta}\left[\frac{\partial}{\partial \theta}\left(\sin\theta \frac{\partial u}{\partial \theta}\right)+\frac{1}{\sin \theta}\frac{\partial^2 u}{\partial \phi^2}\right].$$
If we set $r=1$ we get
$$\nabla^2 u = \frac{1}{\sin \theta}\left[\frac{\partial}{\partial \theta}\left(\sin\theta \frac{\partial u}{\partial \theta}\right)+\frac{1}{\sin \theta}\frac{\partial^2 u}{\partial \phi^2}\right].$$
So the wave equation $$\nabla^2 u = \frac{1}{c^2}\frac{\partial^2 u}{\partial t^2}$$ becomes | {
"domain": "physics.stackexchange",
"id": 96528,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, differential-geometry, coordinate-systems, differential-equations",
"url": null
} |
c#, linq
If you make this change, you can start to play games with exactly what you're asking to be active:
public IEnumerable<AnswerSelectLabel> GetByVariable(IEnumerable<Respondent> respondents, string idVariable)
{
return respondents.SelectMany(x => x.AnswerSelect)
.Select(x => x.AnswerSelectLabel)
.Where(x => new IActivatable[]{x, x.Answer, x.Answer.Question}.all(x => x.Active))
.Where(x => x.idVariable == idVariable);
} | {
"domain": "codereview.stackexchange",
"id": 16963,
"lm_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#, linq",
"url": null
} |
algorithms, dynamic-programming
Title: Integer Knapsack Problem - No duplicates Allowed In the bounded Integer Knapsack problem, we are given N items of sizes S1 through SN, having values V1 through VN. The problem requires us to find the maximum value that can be attained for a given capacity C, provided we cannot use an already used item twice.
In their book, Introduction to Algorithms, the authors have mentioned that for Dynamic programming to be applicable we MUST have "independent" subproblems. That is, the solution to one subproblem should not affect another subproblem. They have illustrated this through the "Longest-Path-Problem" in which they mention that once we solve a subproblem of finding the longest path from 'A' to 'B', for solving another subproblem, we would not be able to use the vertices used in the longest path from 'A' to 'B' and hence the subproblems are not independent. | {
"domain": "cs.stackexchange",
"id": 4667,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, dynamic-programming",
"url": null
} |
test1D = {a1, a2, a3};
Table[test1D[[col]]^col, {col, 1, Length@test1D}]
Flatten[MapIndexed[#1^#2 &, test1D], 1]
But suppose I want to raise each element in a 2D array to a power equal to its row no. x column no. With Table that's conceptually straightforward:
Table[test2D[[row, col]]^(row*col), {row, 1, Length@test2D}, {col, 1, Length@test2D[[row]]}]
But how would one do that with MapIndexed? It would be nice if it were just something like:
MapIndexed[#1^(#2*#3) &, test2D]
where #2 were the column index and #3 were the row index, but it doesn't work like that. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731158685837,
"lm_q1q2_score": 0.8063542141624985,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 2419.7701793333194,
"openwebmath_score": 0.3594249188899994,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/203203/map-vs-table-for-index-specific-operations-on-2d-arrays/203213"
} |
kinect, turtlebot, ros-fuerte
killall XnSensorServer
XnSensorServer
After performing this try to roslaunch the openni.launch file. Let us know if this works. Just to add to your information this happens when you launch openni topics multiple times as sometimes the XnSensorServer process is not properly cleared and shutdown.
Please note that if you have the process XnSensorServer linked to any other program or doing something else killing the process may not be a safe choice. It is advisable to kill/ Terminate any other processes using XnSensorServer before killing this process.
GoodLuck,
Regards,
Sivam
Originally posted by SivamPillai with karma: 612 on 2013-07-20
This answer was ACCEPTED on the original site
Post score: 5 | {
"domain": "robotics.stackexchange",
"id": 14992,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinect, turtlebot, ros-fuerte",
"url": null
} |
physical-chemistry, nanoscience
The covenant bond energy between two carbon atoms seems pretty high, I'll admit, at 348 kJ/mol, but it's less than some other bonds, say Carbon and Hydrogen at 419 kJ/mol (source). So it doesn't seem like that's the limiting factor. I do know that there is energy stored in the organization of the lattice itself, but I don't know how much that contributes; Wikipedia only helpfully notes that the energy is "greater in materials like diamond than sugar." | {
"domain": "physics.stackexchange",
"id": 40107,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, nanoscience",
"url": null
} |
• Interestingly, Scipy’s implementation of Kendall’s τ yields the same coefficient but a drastically different p-value, namely 0.042. – Wrzlprmft Jul 3 '15 at 4:40
• Regarding the Poisson model, I would instead use drop1(fit, test="LRT") to do a likelihood ratio test, instead of doing an asymptotic z-test on the Poisson statistic. (Doing so gives you a p-value of 0.107, so still not statistically significant.) You don’t need to include the population number in the regression if it’s the same for each year. Then it just plays the role of a scaling factor. But you should include it (with per-year population values), as the population at risk probably does vary over the twenty years. Just add offset=log(pop_at_risk) to the glmcall. – Karl Ove Hufthammer Jul 12 '15 at 15:51 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566342024724487,
"lm_q1q2_score": 0.8205703139800452,
"lm_q2_score": 0.8577681122619885,
"openwebmath_perplexity": 1608.937562646428,
"openwebmath_score": 0.665550708770752,
"tags": null,
"url": "https://stats.stackexchange.com/questions/159676/statistical-test-for-increasing-incidence-of-a-rare-event/159693"
} |
## Taking out an irreducible quadratic factor
If we are doing real analysis and don't allow polynomials to have complex coefficients, then $$D(x)$$ might have a factor of the form $$x^2 + bx + c$$ that cannot be factored into first-degree polynomials (that is, it is irreducible). In that case, if the highest power of $$x^2 + bx + c$$ that divides $$D(x)$$ is the $$m$$th power, then we can write $$P_1(x) = (x^2 + bx + c)^m$$ and $$P_2(x) = \frac{D(x)}{(x^2 + bx + c)^m}.$$ It follows that $$P_1(x)$$ and $$P_2(x)$$ have no common factor, and therefore (according to $$(1)$$ again) $$\frac{N(x)}{D(x)} = \frac{R_2(x)}{P_2(x)} + \frac{R_1(x)}{(x^2 + bx + c)^m}$$ where $$\deg(R_2(x)) < \deg(P_2(x))$$ and $$\deg(R_1(x)) < 2m = \deg((x^2 + bx + c)^m).$$
## Completing the decomposition | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.991014573105103,
"lm_q1q2_score": 0.8170537861466729,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 220.60565983699706,
"openwebmath_score": 0.9892578721046448,
"tags": null,
"url": "https://math.stackexchange.com/questions/3132606/how-can-the-correct-form-of-the-partial-fractions-decomposition-be-found-for-arb"
} |
sam, samtools
where qnames.txt has
EXAMPLE:QNAME1
EXAMPLE:QNAME2
EXAMPLE:QNAME3
EXAMPLE:QNAME4
EXAMPLE:QNAME5
(2)
This would be a little more complicated but can you give an example where the grep might be have the correct QNAME?
(3)
To keep the BAM header I would use samtools -H file.bam > header.txt to get the header and then cat the header file with the grep'ed file | {
"domain": "bioinformatics.stackexchange",
"id": 1591,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sam, samtools",
"url": null
} |
c++, tic-tac-toe
size_t columnStarts[] = {0, 1, 2};
for (size_t column = 0; column < 3; column++)
{
if (checkColumn(a, arr, columnStarts[column])) {
return true;
}
}
if (arr[0] == a && arr[4] == a && arr[8] == a) {
return true;
}
else if (arr[2] == a && arr[4] == a && arr[6] == a) {
}
return false;
}
Using the DRY principle generally results in less code, it didn't happen this time because the sample size is so small. There are variations on this code that would result in less code, such as having checkRow(size_t firstColumnInRow) be checkRows(char user, char arr[], size_t rowStarts[]) and move the loop into the function.
Always Check User Input
What a user enters may not be the correct type for the receiving variable, always check user input to see that it is correct, an example in this program is that when entering a box id number the user could use a character rather than a number (I did, the program just sat there). | {
"domain": "codereview.stackexchange",
"id": 39263,
"lm_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++, tic-tac-toe",
"url": null
} |
quantum-information
The relevant matrices are
\begin{align*}
H = \frac{1}{\sqrt{2}}\left[\begin{matrix} 1 & 1 \\ 1 & -1\end{matrix}\right]\ ,\ X = \left[\begin{matrix} 0 & 1 \\ 1 & 0\end{matrix}\right]\ ,\ Z = \left[\begin{matrix} 1 & 0 \\ 0 & -1 \end{matrix}\right]
\end{align*}
and the middle gate is a CNOT: $\left[\begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{matrix}\right]$
If the top qubit register is $|x\rangle$, the bottom is $|y\rangle$, and the computational basis is $\lbrace |0\rangle,|1\rangle\rbrace$, then:
\begin{align*}
(H \otimes I)(I \otimes H)(I \otimes X^x)(H \otimes I)(I \otimes H)|x\rangle |y\rangle &= (H^2 \otimes HX^x H)|x\rangle |y\rangle \\
&= (I \otimes HX^x H)|x\rangle|y\rangle
\end{align*}
But since $Z = HXH$, then $Z^x = (HXH)^x = HX^xH$, so:
\begin{align*}
LHS = (I \otimes Z^x)|x\rangle|y\rangle
\end{align*} | {
"domain": "physics.stackexchange",
"id": 32339,
"lm_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-information",
"url": null
} |
c#, unit-testing
Don't re-invent the wheel
The problem you have has been well-solved by Automapper, I recommend using their solution as it has already been thoroughly tested and is likely to be more flexible.
Use var
Using var for variable declarations where the assignment makes the type obvious saves you time in the future when you want to change the type. You already use var in the Act part of your testing pattern, may as well use it in the Arrange section, too.
Comments
The comment:
// PS: Convert data from our type to customer's data-type | {
"domain": "codereview.stackexchange",
"id": 30050,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, unit-testing",
"url": null
} |
java, database, homework, swing
searchButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
try {
db.search(cityNameInput.getText(),
continentInput.getText(),
parsePopulationInput(),
(matchSearchOptions.getSelectedIndex() == 0),
(populationSearchOptions.getSelectedIndex() == 0));
tableModel.fireTableDataChanged();
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
});
} | {
"domain": "codereview.stackexchange",
"id": 12197,
"lm_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, database, homework, swing",
"url": null
} |
quantum-field-theory, standard-model, group-theory, unified-theories
$$\overline{\mathbf 3} = {(0 1), (1 -1), (-1 0)}$$
and finding $(0 1)$ in that list makes us identify it as a member of $\overline{\mathbf 3}$.
P.S.: We could also have seen that $\overline{\mathbf 3}$ and $\mathbf 3$ are conjugate from seeing that if $(a b)$ is a member of $\overline{\mathbf 3}$, $(-a -b)$ is a member of $\mathbf 3$! | {
"domain": "physics.stackexchange",
"id": 13919,
"lm_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, standard-model, group-theory, unified-theories",
"url": null
} |
homework-and-exercises, special-relativity, spacetime, metric-tensor, vectors
Title: Proportional null vectors the past few days I've been studying special relativity and was just now making some exercices on it. One exercice was the following:
Let $U$ and $V$ be two null vector is a $d$-dimensional Minkowski space. Proof that if $U$ and $V$ are orthogonal, that $U$ and $V$ are proportional. | {
"domain": "physics.stackexchange",
"id": 97450,
"lm_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, special-relativity, spacetime, metric-tensor, vectors",
"url": null
} |
python, gwas, polygenic-risk-score
A split that's considered acceptable in Computer Science is a 10%/90% split, i.e. use 10% of the data for training / algorithm generation and the remaining 90% for testing. This will give you good confidence that the algorithm works.
I personally think it's a good idea to do population sub-sampling (i.e. further subsample that 10%) to determine an informative marker set prior to any risk calculations. What you should be looking for are markers that are consistently linked with the trait of interest (i.e. in your case alcohol dependence) in multiple sub-sampled populations. I go into a lot of detail about how to do this here [bearing in mind it's an old pre-print, and doesn't do the 10/90 split I've recommended above]. | {
"domain": "bioinformatics.stackexchange",
"id": 2049,
"lm_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, gwas, polygenic-risk-score",
"url": null
} |
function with period 2p, de ned on ( p;p). The time-independent Schrödinger wave functions for an electron in a box (here a one-dimensional square well with infinite walls) are just the sine and cosine series determined by the boundary conditions. Discrete-Time Periodic Signals: The Discrete-Time Fourier Series 20 Symmetry property of DTFS coefficient: X[k] = X[ k]. I’ll explain the occurrence of this ringing from the perspective of the underlying theory, and then relate it back to using an oscilloscope. Since Fourier series have such good convergence properties, many are often surprised by some of the negative results. 5 we establish the L2-convergence of the Fourier series without any additional regularity assumption. If f(t) is a periodic function of period T with half-wave symmetry the Fourier series contains only odd harmonics i. series is an example of this), but the Fourier Series is perhaps the most common and useful. The Fourier Transform of the triangle function is the sinc | {
"domain": "chiesaevangelicapresbiteriana.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692264378963,
"lm_q1q2_score": 0.8007645837009872,
"lm_q2_score": 0.8198933293122507,
"openwebmath_perplexity": 720.3926557973892,
"openwebmath_score": 0.8425406813621521,
"tags": null,
"url": "http://yfwv.chiesaevangelicapresbiteriana.it/fourier-series-of-sawtooth-wave-pdf.html"
} |
newtonian-mechanics, forces, electrostatics, vectors, dipole-moment
c & 0 & 0 & \hat{e}_2 & \hat{e}_1 \\
C_1 & \hat{e}_1 & -\hat{e}_1 & \vec{r}_1-\vec{r}_2 & 0 \\
C_2 & \hat{e}_2 & -\hat{e}_2 & 0 & \vec{r}_1-\vec{r}_2
\end{array}
$$
The forces and torques may then be expressed
$$
\vec{F}_1 = -\vec{\nabla}_{r_1} V, \quad
\vec{F}_2 = -\vec{\nabla}_{r_2} V, \quad
\vec{T}_1 = -\hat{e}_1\times\vec{\nabla}_{e_1} V, \quad
\vec{T}_2 = -\hat{e}_2\times\vec{\nabla}_{e_2} V
$$
The last two equations follow from considering the derivative $-\partial V/\partial\psi$ resulting from
rotating the object by an angle $\psi$ about an arbitrary unit axis vector $\hat{n}$,
which by definition gives the $\hat{n}$ component of the torque.
In considering $\vec{\nabla}_{e_i}$, there is no need to worry about the constraint that
$\hat{e}_i$ is a unit vector,
because the cross-product $\hat{e}_i\times$ eliminates any unphysical component of the gradient along $\hat{e}_i$.
For the dipole-dipole case we get, in very few lines,
\begin{align*} | {
"domain": "physics.stackexchange",
"id": 51399,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, forces, electrostatics, vectors, dipole-moment",
"url": null
} |
and inverses more broadly n't want her fail... Learn how to verify whether you have an inverse, the converse relation \ ( )... Videos, simulations and presentations from external sources are not necessarily covered by License! The converse relation \ ( y\ ) -values makes no difference understanding operations, identities and. Work and do n't have the same mathematical meaning and are equal external!, find the inverse of f if f a particular day of the original function the... A given function, with steps shown using the limit definition of the function... I 'm at work and do n't have the time to do it, so 5x is to. To restrict it ’ s domain left inverse function make it so inverse function of a function will become range. Chooses to do it, so if anyone can help awesome is zero... Steps in Finding the inverse of f ( x \right ) =x [ /latex ] not a using. ] is called the inverse function definition by Duane Q. Nykamp is licensed under a Creative Attribution-Noncommercial-ShareAlike... | {
"domain": "momon.bio",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978051746285132,
"lm_q1q2_score": 0.8480058272049631,
"lm_q2_score": 0.8670357477770337,
"openwebmath_perplexity": 458.23095543335194,
"openwebmath_score": 0.7499845623970032,
"tags": null,
"url": "http://www.momon.bio/what-kind-kbstry/73da66-left-inverse-function"
} |
thermodynamics, temperature, entropy, definition, reversibility
Title: A reversible transformation, but there is finite temperature heat transfer? Suppose to have 3 heat reservoirs, the first at temperature $T_1$, the second at temperature $T_1+dT$ and the third at temperature $T_2>T_1$
Then, consider a system, which volume is constant, in thermal equilibrium with the colder reservoir, $T_{system}=T_1$, and do the following steps (order matters):
put the system in contact with the hotter reservoir, and wait until $T_{system}=T_2$
put the system in contact with the reservoir at temperature $T_1+dT$ and wait until $T_{system}=T_1+dT$ | {
"domain": "physics.stackexchange",
"id": 93439,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, temperature, entropy, definition, reversibility",
"url": null
} |
gazebo, rviz, urdf, ros-tutorials, controller-manager
PARAMETERS
* /r2d2_diff_drive_controller/angular/z/has_acceleration_limits: True
* /r2d2_diff_drive_controller/angular/z/has_velocity_limits: True
* /r2d2_diff_drive_controller/angular/z/max_acceleration: 6.0
* /r2d2_diff_drive_controller/angular/z/max_velocity: 2.0
* /r2d2_diff_drive_controller/base_frame_id: base_link
* /r2d2_diff_drive_controller/left_wheel: ['left_front_whee...
* /r2d2_diff_drive_controller/linear/x/has_acceleration_limits: True
* /r2d2_diff_drive_controller/linear/x/has_velocity_limits: True
* /r2d2_diff_drive_controller/linear/x/max_acceleration: 0.6
* /r2d2_diff_drive_controller/linear/x/max_velocity: 0.2
* /r2d2_diff_drive_controller/pose_covariance_diagonal: [0.001, 0.001, 0....
* /r2d2_diff_drive_controller/publish_rate: 50
* /r2d2_diff_drive_controller/right_wheel: ['right_front_whe...
* /r2d2_diff_drive_controller/twist_covariance_diagonal: [0.001, 0.001, 0....
* /r2d2_diff_drive_controller/type: diff_drive_contro... | {
"domain": "robotics.stackexchange",
"id": 29083,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, rviz, urdf, ros-tutorials, controller-manager",
"url": null
} |
c++, integer
if (b == 2) {
whole_number a = *this;
return a * a;
}
if (b == 1) {
return *this;
}
if (b == 0) {
return 1;
}
whole_number a = *this;
whole_number res = 1;
while (b) {
if (b & 1) {
res *= a;
}
b >>= 1;
if (b) {
a *= a;
}
}
return res;
}
whole_number whole_number::sqrt() const {
return static_cast<Word>(_bitvec.lead_bit() - 1);
}
whole_number whole_number::root(const whole_number& b) const {
std::size_t n = b.to_integral<std::size_t>();
whole_number low = 0;
whole_number high = 1;
whole_number ONE = 1;
whole_number TWO = 2; | {
"domain": "codereview.stackexchange",
"id": 44590,
"lm_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++, integer",
"url": null
} |
beginner, c, unit-conversion
if (option == F_TO_C || option == C_TO_F) {
printf("Temp: ");
input_temp = get_input_temp();
}
switch (option) {
case F_TO_C:
printf("Celsius: %f\n", F_to_C(input_temp));
break;
case C_TO_F:
printf("Fahrenheit: %f\n", C_to_F(input_temp));
break;
case OFF:
puts("OFF"); // No need for printf()!
break;
default:
puts("Incorrect input, try again"); // No need for printf() as well!
break;
}
}
getchar();
} | {
"domain": "codereview.stackexchange",
"id": 21703,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, unit-conversion",
"url": null
} |
soft-question, advice-request, research-practice, paper-review
Would this be an example of something that I should put up on the ArXiv? or is the appropriate measure to keep it in on my website? ArXiv papers still need to be recognizable as papers. I'd only put something on the arXiv if I'd feel comfortable publishing it as a letter in a journal (like, say, Information Processing Letters). For stuff that's even smaller than that, but that I still want to put on some sort of public record, I'll just make a blog post.
But in your case, if you've written it up as a preprint anyway, and you clearly state in it how much or how little is new, then why not? ArXiv papers don't actually have to have any new research content — survey papers are also welcome — so a paper that's mostly a survey but that extends the problem a small step in some direction doesn't sound problematic to me. | {
"domain": "cstheory.stackexchange",
"id": 1007,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "soft-question, advice-request, research-practice, paper-review",
"url": null
} |
or infeasible, or you may wish to integrate tabulated data rather than known functions. NDSolve[eqns, u, {x, xmin, xmax}] finds a numerical solution to the ordinary differential equations eqns for the function u with the independent variable x in the range xmin to xmax. Numerical integration is a mature subject, but still very active - espe-cially with regard to algorithms designed for special classes of equations. 5,18) % Defining the x-array x=[1 2 4 6. The second type of numerical method approximates the equation of interest, usually by approximating the derivatives or integrals in the equation. Stability, consistency, and convergence of numerical discretizations Douglas N. Various symmetric compositions are investigated for order, complexity, and reversibility. The oscillatory nature of the discrete transform largely results from the small number of points used to represent the function and the truncation of the function at t = ±2. [HELP] Numerical integration over a discrete | {
"domain": "cbeu.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982287698185481,
"lm_q1q2_score": 0.8053711333692151,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 661.7691727436978,
"openwebmath_score": 0.6184567809104919,
"tags": null,
"url": "http://luxu.cbeu.pw/numerical-integration-of-discrete-data.html"
} |
slam, navigation, mapping, octomap, frame-id
Originally posted by xuningy on ROS Answers with karma: 101 on 2014-07-03
Post score: 1
The estimates of the different transformation from /map to /camera_link belong to different systems (RGBDSLAM and something else). Therefore I suggest using a different name for RGBDSLAM's /map frame. You can change the name by setting the parameter "config/fixed_frame_name" in RGBDSLAM's launch file.
There are ways to combine the two estimates, but to make it sound, you would need the uncertainty (covariance) for the respective transformations, which are not provided (at least RGBDSLAM doesn't do that). Otherwise you could just interpolate them with manually tuned weights.
Originally posted by Felix Endres with karma: 6468 on 2014-08-08
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 18500,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, mapping, octomap, frame-id",
"url": null
} |
ros, launch-file
Title: Why do ros programs often have difficulty stopping cleanly
Hello List,
I am working with different ros versions, mostly kinetic and melodic.
But my question pertains to all versions.
Often it is difficult to stop ros programs, typing control-C often is not enough.
It has to be repeated multiple times, it also take a long time to actually react.
I usually ends with "excalating to SIGTERM" or something.
I currently see this with gazebo_ros launch files.
Why is this so, what is the technical reason that a more clean and faster stop does not seem to be possible?
Regards, Sietse | {
"domain": "robotics.stackexchange",
"id": 31861,
"lm_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, launch-file",
"url": null
} |
javascript, node.js, promise
if (rows.length > 0)
return reject('A user with email: ' + email + ' is already logged in.');
//Get the current XPROCESS.
xprocess.getByProcessId(process.pid)
.then((xproc) => {
//Create a brand new session object
let session = generateSession(user);
//Save the session in the signed on table.
signedon.signin(session, xproc.pid)
.then(() => {
resolve(parseSessionToToken(session));
},
reject);
},
reject);
},
reject);
},
reject);
},
reject);
});
}, Potential improvements
generateToken(email, password) {
let user, session; | {
"domain": "codereview.stackexchange",
"id": 24086,
"lm_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, node.js, promise",
"url": null
} |
cmake
CMakeLists.txt of BB
cmake_minimum_required(VERSION 2.8.3)
project(BB)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
find_package(catkin REQUIRED COMPONENTS
roscpp
AA
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
# DEPENDS system_lib
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(
${PROJECT_NAME}
src/BB_main.cpp
)
add_dependencies(
${PROJECT_NAME}
DEPS ${${PROJECT_NAME}_EXPORTED_TARGETS}}
)
target_link_libraries(
${PROJECT_NAME}
${catkin_LIBRARIES}
)
Originally posted by yoo00 on ROS Answers with karma: 25 on 2016-05-03
Post score: 1
Well, what I see is: if you want to #include <AA/AAA.hpp> the folder structure in AA should be:
/AA
CMakeLists.txt
package.xml
/src
AAA.cpp
/include
/AA
AAA.hpp | {
"domain": "robotics.stackexchange",
"id": 24546,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cmake",
"url": null
} |
quantum-field-theory, conformal-field-theory, duality, bosonization, tomonaga-luttinger-liquid
In the central bosonization formula, $\psi \sim e^{-i \phi}$, $\phi$ appears inside an exponential. As a result, all the observables one considers in the bosonized side of the theory seem to respect the periodicity of $\phi$. This is transparent from the form of the bosonized action as well: it's easy to find terms in the fermionic theory which translate to objects like $\cos \phi$ in the action of the bosonized theory, but one can never generate a mass term like $m \phi^2$ to my knowledge.
In books on the Luttinger liquid, the parameter $K$ above is said to be related to the compactification radius of the boson. In Fradkin's book, for example, $K$ is referred to as the compactification radius, but then the compactness of $\phi$ is never used thereafter. | {
"domain": "physics.stackexchange",
"id": 82982,
"lm_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, conformal-field-theory, duality, bosonization, tomonaga-luttinger-liquid",
"url": null
} |
homework-and-exercises, kinematics, rotational-dynamics, moment-of-inertia
r_5^2 &= \Big(\frac{2}{11}\Big)^2 + \Big(\frac{3}{11}\Big)^2 = \frac{13}{121}\quad \text{(origin to center of mass)}
\end{aligned}
and $Md^2 = \sum\limits_{i=1}^4 m_ir_i^2$
I'm not sure about this one, but for the moment of inertia at the center of mass $I_{cm}$ I'm thinking that it could be modeled as a single particle of mass $11kg$ rotating about the $z$-axis which would give $I_{cm} = \frac{1}{2}mr_5^2 = \frac{1}{2}(11kg)*\frac{13}{121} = \frac{143}{242}kg \ m^2$. Putting it all together we would then arrive at:
$$I = \Big(\frac{143}{242} + \sum\limits_{i=1}^4 m_ir_i^2\Big) \ kg \ m^2$$
shouldn't we use the parallel axis theorem ... to compute the moment
of inertia? | {
"domain": "physics.stackexchange",
"id": 30524,
"lm_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, kinematics, rotational-dynamics, moment-of-inertia",
"url": null
} |
cosmology, spacetime, space-expansion, topology, cosmic-microwave-background
The CMB is arriving from all directions because we were inside the blob of matter which created the CMB. That blob of matter produced photons in all directions, not just directed to the outside. Instead, all the heat and events happening at that time created a fluid of photons from all points in that cloud to all directions (statistically speaking), so also to its own inside. Most of the photons will of course never arrive at where we are now because they are directed elsewhere. But some were already pointed exactly to the point in space where we are today (which is a point which was, at the time when the CMB was emitted, inside that area where the CMB happened; whether this point is today still inside that said area is rather a matter of reference). | {
"domain": "physics.stackexchange",
"id": 61324,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, spacetime, space-expansion, topology, cosmic-microwave-background",
"url": null
} |
U¡1 ˘UT. The diagonal elements of a triangular matrix are equal to its eigenvalues. If is an eigenvector of the transpose, it satisfies By transposing both sides of the equation, we get. jthen the eigenvectors are orthogonal. A symmetric matrix can be broken up into its eigenvectors. The non-symmetric problem of finding eigenvalues has two different formulations: finding vectors x such that Ax = λx, and finding vectors y such that yHA = λyH (yH implies a complex conjugate transposition of y). ��:��f�߮�w�%:�L>�����:~A�N(��nso*|'�ȷx�ح��c�mz|���z�_mֻ��&��{�ȟ1��;궾s�k7_A�]�F��Ьa٦vnn�p�s�u�tF|�%��Ynu}*�Ol�-�q ؟:Q����6���c���u_�{�N1?) Suppose S is complex. This is the story of the eigenvectors and eigenvalues of a symmetric matrix A, meaning A= AT. So our equations are then, and , which can be rewritten as , . Then, if $A$ is symmetric, $T$ must also be symmetric (and hence diagonal). It gives $x=0$ which is a contradiction with the vectors being linear independent. All the eigenvalues of a | {
"domain": "reliableairtulsa.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357561234474,
"lm_q1q2_score": 0.843476714039851,
"lm_q2_score": 0.861538211208597,
"openwebmath_perplexity": 381.93015762875825,
"openwebmath_score": 0.7964757680892944,
"tags": null,
"url": "https://reliableairtulsa.com/0t3u0l/19f33c-eigenvectors-of-symmetric-matrix-are-orthogonal-proof"
} |
object-oriented, design-patterns, go
object := PoolObject{p.NumberOfObjectsInPool() + 1}
p.active.PushBack(object)
return object
}
Any time an object is returned, it's removed from the active list and pushed in the idle list.
func (p *Pool) Receive(object PoolObject) {
p.idle.PushBack(object)
for e, i := p.active.Front(), 0; e != nil; e, i = e.Next(), i+1 {
if object == e.Value.(PoolObject) {
p.active.Remove(e)
return
}
}
} This loop doesn't loop:
for e, i := p.idle.Front(), 0; e != nil; e, i = e.Next(), i+1 {
if i == 0 {
object := e.Value.(PoolObject)
return object
}
}
On the first iteration, if there is a first iteration,
it will return the first value from the pool.
This should be written as a condition:
if e := p.idle.Front(); e != nil {
return e.Value.(PoolObject)
}
The variable i is not used in this loop: | {
"domain": "codereview.stackexchange",
"id": 27499,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, design-patterns, go",
"url": null
} |
thermodynamics, reversibility
Title: Significance of Reversible and Irreversible Process I would like to ask the following questions:
What is the significance of reversible and irreversible nature of thermodynamic process? (I understand that reversible processes are quasi-static, happening infinitesimally, but what is the direct outcome of being reversible and irreversible?)
What does the "reversible" work and heat flow (Wrev and Qrev) signify? It is hard to understand why there are things like "lost work" due to irreversibility of a process. | {
"domain": "physics.stackexchange",
"id": 20830,
"lm_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, reversibility",
"url": null
} |
algorithm, vba, excel
With statement blocks should be used so that you don't have to repeatedly requalify your ranges.
With ThisWorkbook.Worksheets("Sheet1")
For Each a in .Range ("A2:C7")
Dynamic Ranges and Relative References
Dynamic Ranges should be used when working with records. In this way, you will not have to rewrite you code every time a recorded is added or deleted.
This applies to both ranges
With ThisWorkbook.Worksheets("Sheet1")
With .Range("A2", .Range("A" & .Rows.Count).End(xlUp))
For Each a In .Cells
arr.Add a, a
Next
End With
End With
and formulas and FormulaArray
Range("F2").FormulaArray = "=IFERROR(INDEX(OFFSET($C1,1,0,COUNTA($A:$A)-1,1),MATCH(1,((OFFSET($A1,1,0,COUNTA($A:$A)-1,1)=$E2)*(OFFSET($B1,1,0,COUNTA($A:$A)-1,1)=F$1)),0)),"""")" | {
"domain": "codereview.stackexchange",
"id": 32634,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, vba, excel",
"url": null
} |
php, performance, sql, laravel
Getting data from the database, and returning the view is doing 2 things, and thus a violation of the Single Responsibility Principle. build your $champions array, and return it back to the controller, or whatever called the get_prediction method. The controller is what should link the Model-layer to the view. That's its job: the controller gets the request, decides what the Model-layer needs to do, and sends the output of the model layer back to the view. The model layer should be unaware of the view and vice-versa.
Performing that second query inside the loop is, in all likelihood, not the best way forward. Consider using JOIN, to get all data in one go.
Maintainability: if I were to be assigned your project some time in the future, I'd have to check the actual DB's, to see what you're getting from the sales table. even if you're getting all fields, specify them. | {
"domain": "codereview.stackexchange",
"id": 4310,
"lm_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, sql, laravel",
"url": null
} |
quantum-mechanics, angular-momentum, symmetry, group-theory
\end{matrix}\,\right)%$
So I did an exchange of $j_1$ with $j_3$ and since that operation is an exchange between two 3j symbols, does there also arise a symmetry factor
$(-1)^{something}$ ?
That is an example of three body coupling, where the first two states of the bra $j_1$ and $j_2$ are coupled to $J$ and then $J$ and the third state $j_3$ are coupled to $j$. In general, states with total angular momentum $J$ obtained from the triple couplings $j_1j_2j_3$ can be obtained in a number of ways.
A first is to couple $j_1j_2$ to $j_{12}$, and couple this to $j_3$ to get $j$, giving states symbolically denoted by $\vert (j_1j_2)j_{12}j_3;jM\rangle$. A second is to couple first $j_2j_3$ to $j_{23}$, and then $j_1$ to this to get $j$, with states denoted $\vert j_1(j_2j_3)j_{23};jM\rangle$.
The states $\vert j_1(j_2j_3)j_{23};JM\rangle$ are not linearly independent from the $\vert (j_1j_2)j_{12}j_3;JM\rangle$. In fact, the overlap is related to a $6j$ coefficient:
$$ | {
"domain": "physics.stackexchange",
"id": 58902,
"lm_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, angular-momentum, symmetry, group-theory",
"url": null
} |
c, socket, tcp
if(server == NULL) { // --- Check whether receive ip address of server
fprintf(stderr, "Assign IP\n");
exit(EXIT_FAILURE);
}
fd1 = socket(AF_INET, SOCK_STREAM, 0); // --- socket creates an endpoint for communication
if (fd1 == -1) {
perror("ERROR on creating Socket\n");
exit(EXIT_FAILURE);
}
fprintf(stderr, "%d\n", fd1);
fprintf(stderr, "socket created successfully.\n");
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
bcopy((char *) server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
(long unsigned int)server->h_length);
serv_addr.sin_port = htons((uint16_t)portno);
ret = setsockopt(fd1, IPPROTO_TCP, TCP_NODELAY,
(char *) &flag, sizeof(int)); // --- TCP_NODELAY used to disable nagle's algorithm
if (ret != 0) {
perror("Error in setsockopt");
close(fd1);
exit(EXIT_FAILURE);
} | {
"domain": "codereview.stackexchange",
"id": 31002,
"lm_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, socket, tcp",
"url": null
} |
lagrangian-formalism, differential-geometry, momentum, coordinate-systems, covariance
1) Vectors (or tangent vectors, or contravariant vectors):
Velocities are an important example. If a system has a trajectory $q_i(t)$, its velocity is $v_i(t)=\frac{dq_i}{dt}$. If you change coordinates, you get
$$v_i'=\frac{dq_i'}{dt}=\sum_j\frac{\partial q_i'}{\partial q_j}\frac{dq_j}{dt}=\sum_j \Lambda_{ij}v_j.$$
2) Co-vectors (or cotangent vectors, or one-forms, or covariant vectors):
The gradient of a function is an important example of this. If $f(q)$ is a function on configuration space, its gradient is $\nabla f_i=\frac{\partial f}{\partial q_i}$. Change coordinates to get
$$
(\nabla f)'_i=\frac{\partial f}{\partial q'_i}=\sum_j\frac{\partial q_j}{\partial q'_i}\frac{\partial f}{\partial q_j}=\sum_j \Lambda_{ji}^{-1}\nabla f_j.
$$
These two different transformation laws define the two different types of vector. We don't worry about this in Euclidean space, because there we often just do rotations, where the two concepts happen to coincide. | {
"domain": "physics.stackexchange",
"id": 16053,
"lm_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, differential-geometry, momentum, coordinate-systems, covariance",
"url": null
} |
python, python-3.x, search, binary-search
Title: Implementation and Testing of Exponential Search for scenario where we search the same array/list many times Exponential Search is an optimization over binary search.
Conceptually, when searching for a number target in a list of numbers nums, exponential search first finds into which power-of-two sized bucket nums[2**p: 2**(p+1)] the target falls into. E.g., if nums has a size of 30, then the buckets are nums[0:1], nums[1:2], nums[2:4], nums[4:8], nums[8:16], and nums[16:30]. After finding an appropriate bucket, say nums[lo:hi], then we do a standard binary search for target, but we limit our scope of search to just nums[lo:hi].
Here's my implementation of Exponential Search for a scenario where we want to search multiple/many targets within the same list of numbers:
from bisect import bisect_left, bisect_right
INF = float('inf') | {
"domain": "codereview.stackexchange",
"id": 43399,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, search, binary-search",
"url": null
} |
particle-physics, energy-conservation, standard-model, scattering
Title: Energy and Momentum conservation in Bhabha scattering I came across this question here which was asking my exact initial question (I even came from Griffiths problem 2.4 too!). But the given answer gave me a lot more questions which I think constitute too much content to fit in a comment, so I hope this warrants its own question here.
To summarize, we have Bhabha scattering (with time flowing left to right): | {
"domain": "physics.stackexchange",
"id": 88055,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, energy-conservation, standard-model, scattering",
"url": null
} |
java
preparedStatement.executeUpdate();
}
public void insertNewCar(Car car) throws SQLException {
preparedStatement = connection.prepareStatement("insert into car" + "(brand, productionYear, engineCapacity,dayPrice,available)" + "values(?,?,?,?,?)");
preparedStatement.setString(1, car.getBrand());
preparedStatement.setString(2, car.getProductionYear());
preparedStatement.setString(3, car.getEngineCapacity());
preparedStatement.setInt(4, car.getDayPrice());
preparedStatement.setString(5, car.getAvailable());
preparedStatement.executeUpdate();
} | {
"domain": "codereview.stackexchange",
"id": 31283,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
word-embeddings, word2vec
[1] Mikolov, T., Sutskever, I., Chen, K., Corrado, G., and Dean, J. (2013). Distributed Representations of Words and Phrases and their Compositionality. In Advances in Neural Information Processing Systems. | {
"domain": "datascience.stackexchange",
"id": 9696,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "word-embeddings, word2vec",
"url": null
} |
ros, ros-kinetic, cmake, c++11
#serial was added for serial comm to motor rotating lidar.
#labjackusb is the exodriver for the U3.
target_link_libraries(jimmycpp serial labjackusb ${catkin_LIBRARIES})
In the package that wants to use the jimmycpp library (the lidar_rotation.h & lidar_rotation.cpp) there is only one header file called lidar_motor_control.h. In this header file I declare my library, and a few variables. no classes, very simple:
/// my low level library
#include <jimmycpp/lidar_rotation.h>
//This is my handle for my library.
//jimmycpp::LidarRotation lidarMotorForRotationObj;
//lots more stuff
if I uncomment the line jimmycpp::LidarRotation lidarMotorForRotationObj; i get the error at the begining of this long (sorry) question. But if I comment the line out catkin_make completes with no errors (but I can't use my library). Here is the CMakeLists.txt for the second package:
# What version of CMake is needed?
cmake_minimum_required(VERSION 2.8.3) | {
"domain": "robotics.stackexchange",
"id": 34288,
"lm_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-kinetic, cmake, c++11",
"url": null
} |
java
Title: Printing the sums of numbers from 1 to 10 with only 1 loop The code below prints sum from 1 to 10:
\$1\$
\$1+2 =\$
\$1+2+3 =\$
\$1+2+3+4 =\$
\$......\$
\$1 + ... 10 = 55\$
public class Solution{
public static void print_sums(){
int sum = 0 ;
for(int i = 1 ; i <= 10 ; i++){
for(int j = 1 ; j <= i; j++ ){
sum = sum + j ;
}
System.out.println( sum) ;
sum = 0 ;
}
}
public static void main(String[] args)
{
print_sums() ;
}
} | {
"domain": "codereview.stackexchange",
"id": 8841,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
Veritas Prep Reviews
Kudos [?]: 17809 [1], given: 235
Intern
Joined: 12 Nov 2013
Posts: 44
Kudos [?]: 123 [0], given: 141
Re: In a certain business, production index p is directly proportional to [#permalink]
Show Tags
05 Oct 2015, 07:01
VeritasPrepKarishma wrote:
gettinit wrote:
Would p be directly proportional to i as well if e is proportional to p? I am thinking it should be, however the constant proportion will be different between p and e and e and i and thus entirely separate between p and i? thanks.
production index p is directly proportional to efficiency index e,
implies p = ke (k is the constant of proportionality)
e is in turn directly proportional to investment i
implies e = mi (m is the constant of proportionality. Note here that I haven't taken the constant of proportionality as k here since the constant above and this constant could be different) | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.8244619350028204,
"lm_q2_score": 0.8244619350028204,
"openwebmath_perplexity": 1564.8456925625587,
"openwebmath_score": 0.834241509437561,
"tags": null,
"url": "https://gmatclub.com/forum/in-a-certain-business-production-index-p-is-directly-proportional-to-63570.html"
} |
python, performance, cryptography
Yay! Only 3.2 seconds in mint().
Removing another 80%
But hashing is still not the most expensive part. It's now the computing of RandomData (0.5 + 0.2 seconds in base64 encoding, 0.4 seconds in urandom, and so on). @cHao is right, you only need to compute that RandomData once and find the count that provides the correct sha1 hash. Let's move it out of the while loop:
from os import urandom
from hashlib import sha1
import time
from math import ceil
def mint(name, bits):
t = time.strftime("%y%m%d")
out = " "
count = 0
digits = int(ceil(bits/4.0))
RandomData = urandom(8).encode("base64").replace("\n", "")
RandomData = 'AHZlx9LYMyo='
while out[:digits] != digits*"0":
data = "1:%d:%s:%s::%s:%s"%(bits, t, name, RandomData, format(count, 'x'))
out = sha1(data).hexdigest()
count += 1
return data
print mint("email_address", 15) | {
"domain": "codereview.stackexchange",
"id": 5749,
"lm_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, cryptography",
"url": null
} |
beginner, c, io
untitled.c: In function ‘getline’:
untitled.c:54:16: warning: conversion to ‘char’ from ‘int’ may alter its value [-Wconversion]
s[i] = c;
^
untitled.c:56:16: warning: conversion to ‘char’ from ‘int’ may alter its value [-Wconversion]
s[i] = c;
^
Compilation failed. | {
"domain": "codereview.stackexchange",
"id": 32327,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, io",
"url": null
} |
formal-languages, regular-languages, automata, pumping-lemma
Could someone clearify which one here is the correct explanation? First, for the sake of preciseness, note that the Lemma says that for every regular language $L$, there exists a constant $m\ge 1$, such that for every word $w\in L$... [what you wrote]. That is, the statement of the lemma is not "after" you have a language and a word.
As for your questions, basically everything you wrote is correct. To be slightly more specific:
The second condition indeed follows from the fact that we can bound the length of the run before a loop occurs. This follows from the pigeonhole principle. Interestingly, by the way, this condition can be changed to require that we can find a loop from whichever index we start from (as long as there are enough letters remaining). But this is beside the point. | {
"domain": "cs.stackexchange",
"id": 20366,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, regular-languages, automata, pumping-lemma",
"url": null
} |
nomenclature
Title: How should you name the solid-solution compound ScY(SeO4)3? How should you name the compound $\ce{ScY(SeO4)3}$? There are 2 cations, and I know that $\ce{SeO4}$ is a polyatomic ion with $-2$ charge. However, I am unsure how to proceed. This is similar to a double salt, but because of the chemical similarities between scandium and yttrium, $\ce{ScY(SeO4)3}$ is a solid solution in this case. And the answers is you just name the cations in alphabetical order, then the anions like any normal salt. Thus the name is scandium yttrium selenate.
If the ratio between cations had a large difference such as $\ce{Sc_{1.9}Y_{0.1}(SeO4)3}$ It might be called yttrium-doped scandium selenate, but could still correctly be called just scandium yttrium selenate too. | {
"domain": "chemistry.stackexchange",
"id": 10619,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nomenclature",
"url": null
} |
waves, electromagnetic-radiation, astrophysics, telescopes, radio-frequency
Here comes the second set of assumptions...
The universe is filled with objects that give off massive amounts of radio signals, quasars are a good example. So if we're going to find the ones from the aliens, we have to look for ones with some sort of special quality.
One of the qualities these background sources have is that tend to be broadband, so if we point our telescope at it we see signal across a wide band. So, if we're going to be able to detect it, the alien signal would have to be narrowband. Really narrow.
And while we think that signal would be in the water hole, that's still a lot of bandwidth to cover if the signal is really narrow. So if you're going to break that signal down into "channels" and examine each one, you're going to need a whole lot of signal to work with, otherwise there's just not enough signal left in each channel. | {
"domain": "physics.stackexchange",
"id": 45557,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, electromagnetic-radiation, astrophysics, telescopes, radio-frequency",
"url": null
} |
physical-chemistry, kinetics
https://www.ems.psu.edu/~brune/m532/meteo532_ch7_stratospheric_chemistry_files/image018.jpg
What actually happens in the ozone layer is a bit more complicated than the two step process you show, see for example https://www.ems.psu.edu/~brune/m532/meteo532_ch7_stratospheric_chemistry.htm | {
"domain": "chemistry.stackexchange",
"id": 11998,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, kinetics",
"url": null
} |
beginner, bash, linux
Just tell grep to take its input from $name directly:
grep psk= "$name"
We don't even need a loop, as we can pass all the filenames to grep in one go.
Simplified code
#!/bin/bash
exec grep 'psk=' /etc/NetworkManager/system-connections/*
Yes, that's the whole program. Since we only execute one command, we don't need set -e, and as we use no variables, neither do we need set -u. | {
"domain": "codereview.stackexchange",
"id": 31293,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, bash, linux",
"url": null
} |
python
The code explained: We start at the goal and give its pixel the value 1. Then we check for any neighbor pixels that have the value 0 (0 = not a wall). These get the value 2. Any neighbors of them that are not walls get value 3, and so on until we reach the center of the maze. Once we have reached the center, we just connect pixels in reverse value until we reached the goal, which gives us the shortest path between the start and the goal.
The algorithm works fine, but it takes around 2 seconds for the 100x100 pixel maze. To make it practical, I would need to go 10x faster. Any suggestions for improvement are very welcome. I have attached the original 100x100 maze below. The start position is the center of the maze. Code Style:
There are a few minor issues:
indentation should be 4 spaces, not 2, to be PEP-8 compliant
the code can only run once; write a function to find the path from any arbitrary starting point to any arbitrary goal | {
"domain": "codereview.stackexchange",
"id": 44210,
"lm_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",
"url": null
} |
ros, navigation, costmap-2d, voxel-grid
Originally posted by seanarm on ROS Answers with karma: 753 on 2018-01-05
Post score: 0
Original comments
Comment by jayess on 2018-01-05:
What tutorials are you referring to?
You could do this using octomap, it's designed to update the map with point clouds from sensors but you could add a single point cloud containing your map at the start then keep this initial map for the duration of your experiment.
What format have you got the 3D map in that you want to display in rviz?
Originally posted by PeteBlackerThe3rd with karma: 9529 on 2018-01-05
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 29665,
"lm_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, navigation, costmap-2d, voxel-grid",
"url": null
} |
astrophysics, astronomy, stars, galaxies, milky-way
Thus when we look around us, the stars nearby are hugely dominated by Pop I stars by about 200:1 (here my definition is that Pop II stars are metal-poor; we cannot tell the age of a star by just looking at it!). Extrapolation of this using estimates of the density distribution of metal-poor stars suggests that halo population II contributes only a few percent of the stellar mass of the Galaxy. In turn, this suggests the formation epoch of population II stars lasted much less than 1 billion years. I'm trying to pin this number down a bit better, but the interpretation is confused by what is classified as Pop II, what metallicity cut-off is used, and also by the possibility that our Galaxy halo might include populations due to a number of merger and accretion events, not all of which are metal-poor. Finally there is the question of the bulge. Roughly 20-25% of the stellar mass is here and it probably formed rapidly (about billion years) at the beginning of the Galaxy. For the reasons I | {
"domain": "physics.stackexchange",
"id": 17976,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, astronomy, stars, galaxies, milky-way",
"url": null
} |
c++, game-of-life
for(int i = 0; i < row; i++){
for(int k = 0; k < col; k++){
ary[i][k].a=0;
ary[i][k].b=0;
}
}
}
void clearArr(int which){
cout<<"clear arr"<< endl;
if(which == 0){
for(int i = 0; i < rows; i++){
for(int k = 0; k < cols; k++){
ary[i][k].a=0;
}
}
}else{
for(int i = 0; i < rows; i++){
for(int k = 0; k < cols; k++){
ary[i][k].b=0;
}
}
}
} | {
"domain": "codereview.stackexchange",
"id": 12234,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, game-of-life",
"url": null
} |
electromagnetism, tensor-calculus, maxwell-equations, covariance
Note that in the equation $\epsilon^{\mu\nu\rho\sigma} \partial_\nu F_{\rho\sigma} = 0$, $\mu$ is a free index (not summed over), so this is actually four equations, one for each value of $\mu$. If you take the $\mu = 1$ part for instance, then the remaining indices can only vary over permutations of 2,3,4. | {
"domain": "physics.stackexchange",
"id": 68676,
"lm_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, tensor-calculus, maxwell-equations, covariance",
"url": null
} |
satisfiability, propositional-logic, sat-solvers, 2-sat
I don't think that 4SAT is so difficult problem.
When you turn out the middle disjunction to conjunction in each clause, you get 2CNF formula and the turing machine can deterministic-ally build the implications graph for it in polynomial time.
If the turing machine doesn't find contradiction circle, then the original 4CNF
formula is satisfiable.
But if the turing machine did find contradiction circle, then the turing machine will have to modify the graph, so there is no contradiction circle in the graph.
If there is a way to do this modification, so there is no contradiction circle in the graph, then the 4CNF formula is satisfiable, even though the given 2CNF formula isn't.
But if the turing machine proves that does not exist such modification to the implications graph, so every contradiction circle can be resolved, then the original 4CNF formula is unsatisfiable. | {
"domain": "cs.stackexchange",
"id": 9374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "satisfiability, propositional-logic, sat-solvers, 2-sat",
"url": null
} |
gazebo
Title: Best way to repeat simulations
Hi all,
I am currently working on a simple fetch and carry scenario in a simulation using ros gazebo. it's an almost complete mobile manipulator system with kinect and laser scanners.
I would like to do something this:
1: launch environment and related objects
2: run the fetch and carry node
3: reset the environment (robot and object back to initial position)
4: iterate 2 and 3 for a few hundred or thousand times.
My question is, is there a good way for repeating the simulations?
EDIT: I guess it's best to describe an example. Say that I would like to run the fetch and carry scenario 100 times. Each time it runs, an object will be thrown on the floor. In that 100 runs, how many times the mobile manipulator collide / bump into the new object.
I'm actually imagining a big for loop that resets the simulation environment and runs the fetch and carry package again. How expensive will that be!! | {
"domain": "robotics.stackexchange",
"id": 12202,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo",
"url": null
} |
performance, sql, postgresql
Query Plan
Output from EXPLAIN ..., given the above example with actual values and run on a database instance with only 1 profile, which is not a venue.
QUERY PLAN
---------------------------------------------------------------------------------------------------
Limit (cost=8248.43..8248.51 rows=31 width=40)
CTE enumerated
-> WindowAgg (cost=8211.05..8227.32 rows=651 width=317)
-> Sort (cost=8211.05..8212.67 rows=651 width=309)
Sort Key: (('-1'::integer)::double precision), p.name, p.id
-> Hash Join (cost=17.88..8180.62 rows=651 width=309)
Hash Cond: ("*SELECT* 1".profile_id = p.id)
-> Append (cost=0.00..8154.51 rows=651 width=105)
-> Subquery Scan on "*SELECT* 1" (cost=0.00..0.00 rows=1 width=105) | {
"domain": "codereview.stackexchange",
"id": 45213,
"lm_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, postgresql",
"url": null
} |
sex, homosexuality
I there are some species where sexes are very difficult to tell apart so they may just go around having sex with anything that looks like the right species because the mating is relatively low cost so doesn't matter if the partner was male or female. This is one such example in sea snails: | {
"domain": "biology.stackexchange",
"id": 973,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sex, homosexuality",
"url": null
} |
You want $$1-\left(\frac{364}{365}\right)^r \geq \frac{1}{2}.$$ Rearrange this inequality to obtain $$\frac{1}{2}\geq \left(\frac{364}{365}\right)^r.$$ Take $\log$ of both sides: $$-\log(2) \geq r\log\left(\frac{364}{365}\right),$$ so $$r \geq -\frac{\log(2)}{\log\left(\frac{364}{365}\right)},$$ which by wolfram alpha equals 252.7.
The number of people actually is $253$, not $252$. One way to see this is because calculation with logarithms (as shown in another answer) says $r \geq 252.65$. Another way is to use an accurate calculator to show that \begin{align} 1-(364/365)^{252} &\approx 0.4991, \\ 1-(364/365)^{253} &\approx 0.5005. \end{align} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130563978901,
"lm_q1q2_score": 0.8062755759688819,
"lm_q2_score": 0.815232489352,
"openwebmath_perplexity": 148.92915874885642,
"openwebmath_score": 0.8414190411567688,
"tags": null,
"url": "https://math.stackexchange.com/questions/1751394/birthday-paradox"
} |
magnetic-fields
Using the symbols defined in the diagram is the resistance of the circuit is $R$ then the electrical power produced is $\dfrac{(Blv)^2}{R}$ whilst the mechanical power needed to keep the wire moving at constant velocity is $Fv = BIl\,v$.
As $I = \dfrac{Blv}{R}$ the mechanical power input is $\dfrac{(Blv)^2}{R}$ which is exactly equal to the electrical power output.
So it is not the magnetic field doing the work, it is you who is doing the work to generate the electrical energy. | {
"domain": "physics.stackexchange",
"id": 38389,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields",
"url": null
} |
cc.complexity-theory, np-hardness, circuit-complexity, minimization
Given a truth table $T$ and integer $k$, is there a DNF of size at most $k$ whose truth table is $T$?
MIN DNF is known to be NP-complete (see [1] and works cited by it). Since the problem in the post generalizes MIN DNF, the problem in the post is also NP-hard.
To see that it is also NP-complete, observe that it is in NP because, given a DNF, one can verify that the DNF is consistent with the input by checking that (i) for every clause in the DNF, the number of assignments satisfying the clause is at most the number of rows in the given partial table, and each such assignment is one of those rows, and (ii) each row with value 1 is covered in this way by some clause in the DNF. $~~~\Box$
[1] Allender, E., Hellerstein, L., McCabe, P., Pitassi, T., & Saks, M. (2008). Minimizing Disjunctive Normal Form Formulas and AC^0 Circuits Given a Truth Table. SIAM Journal on Computing, 38(1), 63-84. https://doi.org/10.1137/060664537 | {
"domain": "cstheory.stackexchange",
"id": 5288,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, np-hardness, circuit-complexity, minimization",
"url": null
} |
javascript, game, css, ecmascript-6, vue.js
function mapping(position) {
var y = playerIndex == 0 ? 0 : 2;
if (position > 4 && position < 13) {
y = 1;
}
var x =
y == 1
? position - 5
: position <= 4 ? 4 - position : 4 + 8 + 8 - position;
return {
x: x,
y: y,
player: playerIndex,
key: playerIndex + "_" + position,
position: position
};
}
for (var i = 0; i < arrayCopy.length; i++) {
arrayCopy[i] = mapping(arrayCopy[i]);
}
return arrayCopy;
} | {
"domain": "codereview.stackexchange",
"id": 32689,
"lm_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, game, css, ecmascript-6, vue.js",
"url": null
} |
algorithm-analysis, asymptotics, runtime-analysis
$$
T(n) \leq T(m) \leq Cm\log m \leq 2Cn \log n + O(n) = O(n\log n).
$$
Suppose now that there is a data structure such that the first $n$ operations take time at most $Cn$ whenever $n$ is a power of $2$. If we let $T(n)$ denote the maximal time that $n$ operations take, then $T$ satisfies the conditions stated above (in particular, monotonicity is built-in), and so the amortized time per operation is indeed $O(1)$. Your case is a bit more complicated since different operations have different amortized running times, but the conclusion should be the same. | {
"domain": "cs.stackexchange",
"id": 7632,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm-analysis, asymptotics, runtime-analysis",
"url": null
} |
thermodynamics, astrophysics, acoustics, plasma-physics, interstellar-matter
Speed of sound in the primordial soup
Everything was very smooth, no galaxies or anything like that had formed. Stuff was still slightly clumpy, though, and the clumps grew in size due to gravity. But as a clump grows, pressure from baryons and photons increase, counteracting the collapse, and pushing baryons and photons outwards, while the dark matter tends to stay at the center of the overdensity, since it doesn't care about pressure. This creates oscillations, or sound waves with tremendously long wavelengths.
For a photon gas, the speed of sound is
$$
\begin{array}{rcl}
c_\mathrm{s} & = & \sqrt{p/\rho} \\
& = & \sqrt{c^2/3} \\
& \simeq & 0.58c,
\end{array}
$$
where $c$ is the speed of light, and $p$ and $\rho$ are the pressure and density of the gas. In other words, the speed of sound at that time was more than half the speed of light (for high temperatures there is a small correction to this of order $10^{-5}$; Partovi 1994). | {
"domain": "physics.stackexchange",
"id": 28842,
"lm_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, astrophysics, acoustics, plasma-physics, interstellar-matter",
"url": null
} |
is merely an algebraic number (a root of ${4x^2-2}$). For the purposes of this post, we will adopt the concrete (but somewhat artificial) perspective of viewing algebraic numbers and integers as lying inside the complex numbers ${{\bf C}}$, thus ${{\mathcal A} \subset \overline{{\bf Q}} \subset {\bf C}}$. (From a modern algebraic perspective, it is better to think of ${\overline{{\bf Q}}}$ as existing as an abstract field separate from ${{\bf C}}$, but which has a number of embeddings into ${{\bf C}}$ (as well as into other fields, such as the completed p-adics ${{\bf C}_p}$), no one of which should be considered favoured over any other; cf. this mathOverflow post. But for the rudimentary algebraic number theory in this post, we will not need to work at this level of abstraction.) In particular, we identify the algebraic integer ${\sqrt{-d}}$ with the complex number ${\sqrt{d} i}$ for any natural number ${d}$. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9905874104123901,
"lm_q1q2_score": 0.8075590360644194,
"lm_q2_score": 0.8152324848629214,
"openwebmath_perplexity": 4622.61496713103,
"openwebmath_score": 1.0000090599060059,
"tags": null,
"url": "https://terrytao.wordpress.com/category/mathematics/mathnt/page/2/"
} |
php
First, the specification for your operations should be embedded with the code as a comment. Having to look up a specification that may or may not be the same as the one you used when programming it, is not useful... and changing between screens/pages to inspect the code vs. the specification is also not much fun. Something like:
// Input data is 4 bytes with following bit-specification:
// Byte0 (least significant)
// 0-5 : minutes
// 6 : reserved
// 7 : valid
// Byte1
// 0-4 : hours
// ........ | {
"domain": "codereview.stackexchange",
"id": 5287,
"lm_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",
"url": null
} |
python, beginner, algorithm, object-oriented, sorting
Title: Shell Sort, Insertion Sort, Bubble Sort, Selection Sort Algorithms (Python)
There is a follow-up question available:
shell-sort-insertion-sort-bubble-sort-selection-sort-algorithms-python. | {
"domain": "codereview.stackexchange",
"id": 36050,
"lm_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, algorithm, object-oriented, sorting",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.