text stringlengths 1 1.11k | source dict |
|---|---|
c++, c++11, queue, pointers
// In the case I would expect q2 to be a copy of q1 before we add 2.
// I would expect the two lists to be independent (If I wanted the
// to represent the same queue I would have used a reference).
// Your class both objects refer to the same underlying list. Thus
// at the end both lists have two elements in them. | {
"domain": "codereview.stackexchange",
"id": 23913,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, queue, pointers",
"url": null
} |
# Using the series expansion of e^KX, evaluate 2^-3.4 accurate to 3 dp?
1. Dec 12, 2011
### solve
1. The problem statement, all variables and given/known data
Using the series expansion of e^KX and the fact that a^X=e^Xlna, evaluate 2^-3.4 accurate to 3 dp?
2. Relevant equations
3. The attempt at a solution
So a^X=e^Xlna. Basically we need to expand e^-3.4ln(2).
e^x=1+X+(X^2)/2!+(X^3)/3!...
e^-3.4ln(2)= 1-3.4ln(2)+(-3.4ln(2))^2/2+(-3.4ln(2))^3/6… See any errors in the expansion? The answer is supposedly 0.095 Can't seem to get it right.
Thank you.
2. Dec 12, 2011
### vela
Staff Emeritus
Looks fine to me. How many terms did you use in the expansion? Because x is relatively large, you'll have to use about 12 terms to get the accuracy you want.
3. Dec 12, 2011
### solve
When I google the expansion it gives me -0.761 when the answer is supposed to be 0.095
4. Dec 12, 2011
### vela | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9615338090839606,
"lm_q1q2_score": 0.8153496723876974,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 439.7994242123216,
"openwebmath_score": 0.675100564956665,
"tags": null,
"url": "https://www.physicsforums.com/threads/using-the-series-expansion-of-e-kx-evaluate-2-3-4-accurate-to-3-dp.559559/"
} |
A = {1,4,-3, "bob"}
B = {2,1,-3,"jill"}
assert union(A,B) == ({-3, 1, 2, 4, 'bob', 'jill'}, 6)
### Exercise 1.2
A function inclusion_exclusion that first deterimines $|A|$, $|B|$, $A\cap B$, and $|A\cap B|$, and then uses the inclusion-exclusion formula to determine $|A\cup B|$. Output the tuple $(|A|, |B|, |A\cap B|, |A\cup B|)$.
* **Sample run:** *
A = {1, 2, 3}
B = {3, -6, 2, 0}
print inclusion_exclusion(A, B)
print "notice: 3 + 4 - 2 == 5"
* **Expected Output:** *
(3, 4, 2, 5)
notice: 3 + 4 - 2 == 5
def inclusion_exclusion(A, B):
# inputs: A and B are of type 'set'
# output: a tuple of four integers
union_set = A.union(B)
intersect_set = A.intersection(B)
return (len(A), len(B), len(intersect_set), len(union_set))
A = {1, 2, 3, 4, 5}
B = {0, 2, -6, 5, 8, 9}
assert inclusion_exclusion(A, B) == (5, 6, 2, 9)
## Exercise 2
The inclusion-exclusion principle says that for three sets $A$, $B$ and $C$, | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9959298628277302,
"lm_q1q2_score": 0.8047782668475065,
"lm_q2_score": 0.8080672112416737,
"openwebmath_perplexity": 2965.8285864684954,
"openwebmath_score": 0.958166241645813,
"tags": null,
"url": "https://goodboychan.github.io/python/edx/data_science/statistics/probability/2020/09/09/01-Counting.html"
} |
c#, wpf, mvvm, system.reactive, reactive-programming
The d: xml namespace is ignored at runtime, but the xaml designer will use it - by doing that you no longer need to set the view model in the constructor.
<Button Content="Go"/>
It's pretty rare that a simple string suffices as the Content of a Button control. Even when all I need is a caption, I find it easier to maintain when the content is expressed in a more verbose manner:
<Button>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Go" />
</StackPanel>
</Button> | {
"domain": "codereview.stackexchange",
"id": 19424,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, wpf, mvvm, system.reactive, reactive-programming",
"url": null
} |
quantum-mechanics, solid-state-physics, electronic-band-theory
The functions
$
\newcommand{\bfr}{\mathbf{r}}
\newcommand{\bfR}{\mathbf{R}}
\newcommand{\bfk}{\mathbf{k}}
\newcommand{\bfK}{\mathbf{K}}
u_{n,\bfk}
$ are solutions to the third equation in the question. Everything in that equation, including $V$ and $u$, is assumed to be invariant under $\bfr\to \bfr+\bfR$ for lattice vectors $\bfR$. Therefore, for each value of $\bfk$, that equation defines an eigenvalue problem on a compact manifold (specifically a torus) consisting of points $\bfr$ modulo the vectors $\bfR$. Here's the key: for any given value of $\bfk$, the differential operator in that equation is self-adjoint and elliptic, and | {
"domain": "physics.stackexchange",
"id": 82157,
"lm_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, solid-state-physics, electronic-band-theory",
"url": null
} |
biochemistry, software
I have used cytoscape and it is ok, maybe too general also for your purposes. For very simple purposes I have used KEGG pathway in the past, which is in addition to the others. | {
"domain": "biology.stackexchange",
"id": 10460,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, software",
"url": null
} |
When x-1<=0; x<=1 --------> (2)
When x-1>=0; x>=1 --------> (3)
As both sides are +ve, we can square both the sides
(x-1)^2 < 7-x
x^2 -x -6<0
(x-3)(x+2)<0
-2<x<3 ------------>(4)
The answer to this problem is (x<3). I am not sure how to arrive at that from hereon. Could you please help me?
Re: Inequalities and Roots [#permalink] 25 Jul 2013, 10:39
Go to page 1 2 Next [ 25 posts ]
Similar topics Replies Last post
Similar
Topics:
Inequality 1 09 Oct 2010, 11:52
an inequality 1 04 Oct 2010, 02:36
2 Inequality 4 05 Jun 2010, 13:19
62 Laura sells encyclopaedias, and her monthly income has two 22 29 May 2008, 12:54
239 If x/|x|<x which of the following must be true about x? 90 15 Aug 2008, 03:06
Display posts from previous: Sort by | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9416541593883189,
"lm_q1q2_score": 0.8294062276352222,
"lm_q2_score": 0.8807970732843033,
"openwebmath_perplexity": 4824.547883777812,
"openwebmath_score": 0.6306199431419373,
"tags": null,
"url": "http://gmatclub.com/forum/inequalities-and-roots-118619.html?sort_by_oldest=true"
} |
quantum-field-theory, particle-physics, angular-momentum, quantum-spin
$|d^1_{01}|^2=\sin^2 \theta /2$, its maximum probability occurring at right angles to this direction; and, of course, also vanishing back-to-back.
I hope you now appreciate the presence of the Wigner d rotation matrices on the most useful page of the PDG booklet, the one with Clebsches, Spherical Harmonics, and d-functions--pure gold. | {
"domain": "physics.stackexchange",
"id": 71900,
"lm_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, particle-physics, angular-momentum, quantum-spin",
"url": null
} |
python, pandas
Title: Read CSV, with date filtering and resampling I have written the following function to read multiple CSV files into pandas dataframes. Depending on the use case, the user can pass optional resampling (frequency and method) and/or a date range (start/end). For both options I'd like to check if both keywords were given and raise errors if not.
My issue is that reading the CSV files can potentially take quite a bit of time and it's quite frustrating to get the value error 5 minutes after you've called the function. I could duplicate the if statements at the top of the function. However I'd like to know if there is a more readable way or a best practice that avoids having the same if/else statements multiple times.
def file_loader(filep,freq:str = None, method: str =None ,d_debut: str =None,d_fin: str =None):
df= pd.read_csv(filep,\
index_col=0,infer_datetime_format=True,parse_dates=[0],\
header=0,names=['date',filep.split('.')[0]])\ | {
"domain": "codereview.stackexchange",
"id": 42167,
"lm_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, pandas",
"url": null
} |
navigation, costmap, clear-costmap, amcl, move-base
EDIT:
Finally, it was a problem in costmap package. It has been fixed.
Originally posted by arenillas on ROS Answers with karma: 223 on 2014-10-14
Post score: 0
Original comments
Comment by dornhege on 2014-10-14:
Looks like a core dump and shouldn't happen. Do you use any non-standard plugins?
Comment by arenillas on 2014-10-14:
I don't think so.
It looks like you're running a source-built version of navigation, I assume there's a good reason to not use debs?
First step for diagnosing would be to set the log level to debug for move_base and post that output as well. | {
"domain": "robotics.stackexchange",
"id": 19723,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, costmap, clear-costmap, amcl, move-base",
"url": null
} |
In short: just "read off" what the linear transformation does to the $j$th vector of the basis by reading down the $j$th column of $A$.
If I understand correctly, this is not quite what I was looking for. Let's take my exercise as an example. For the inverse function, we have the transformation matrix \begin{pmatrix} 1 & -1 & 4\\ 0 & 1 & -4\\ 0 & 0 & 1 \end{pmatrix} From this I can see that $F^{-1}(1) = 1, F^{-1}(x) = x-1, F^{-1}(x^2) = x^2-4x+4$ and due to linearity (is the inverse map linear too?), I can find $F^{-1}(s(t))$ for all $s(t) \in \mathbb{R}_2[t]$. However, I'm looking for a "more" explicit expression, something like $F^{-1}: s(t) \mapsto ...$, if you understand me... – Huy Jun 29 '11 at 20:17 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795123755813,
"lm_q1q2_score": 0.8224742986461512,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 80.70848524741567,
"openwebmath_score": 0.9317293167114258,
"tags": null,
"url": "http://math.stackexchange.com/questions/48494/how-can-i-find-a-linear-map-which-has-given-transformation-matrix"
} |
electrons, atoms, periodic-trends, atomic-structure, atomic-radius
Title: Which atom is the smallest atom? Is hydrogen or helium the smallest atom? My teacher said that the smallest atom is the helium atom, but I think that the smallest atom is the hydrogen atom. It has a single electron and a single proton, whereas the helium atom has a pair of electrons, a pair of neutrons, and a pair of protons, which obviously occupy more space than the hydrogen atom.
My question is, which atom is the smallest atom of all? The behaviour of electrons in atoms is not well describes by the classical points and orbits model of the atom. a more accurate modle for electrons is using quantum physics, in the is system the electron aren't at a specific spot, instead they are described by a quantity called the wave function which gives the probability of the electron being in a specific position.
from statistics you can then work out the average position (the expectation value), this is the product of the position and how likely it is to be there (the probability) | {
"domain": "chemistry.stackexchange",
"id": 16092,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrons, atoms, periodic-trends, atomic-structure, atomic-radius",
"url": null
} |
diagonal matrix another diagonal matrix? Example sentences with "scalar matrix", translation memory. Maximum element in a matrix. a matrix of type: Lower triangular matrix. Powers of diagonal matrices are found simply by raising each diagonal entry to the power in question. Types of matrices — triangular, diagonal, scalar, identity, symmetric, skew-symmetric, periodic, nilpotent. Nonetheless, it's still a diagonal matrix since all the other entries in the matrix are . Is it true that the only matrix that is similar to a scalar matrix is itself Hot Network Questions Was the title "Prince of Wales" originally claimed for the English crown prince via a trick? Matrix algebra: linear operations Addition: two matrices of the same dimensions can be added by adding their corresponding entries. In this post, we are going to discuss these points. "Scalar, Vector, and Matrix Mathematics is a monumental work that contains an impressive collection of formulae one needs to know on diverse topics in | {
"domain": "netposition-international.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9901401426598159,
"lm_q1q2_score": 0.8957308162454254,
"lm_q2_score": 0.9046505415276079,
"openwebmath_perplexity": 769.1851159820291,
"openwebmath_score": 0.7704491019248962,
"tags": null,
"url": "https://netposition-international.com/50jfrs/1e0451-diagonal-matrix-and-scalar-matrix"
} |
acid-base, ph
Your teacher isn't wrong, the $\mathrm{p}$ does mean "power" (or even "potential").
However, $\mathrm{pH}$ is a number (it is dimensionless/unit-less...but not without meaning either), so your "sources" are correct too ;) | {
"domain": "chemistry.stackexchange",
"id": 8600,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, ph",
"url": null
} |
$$\square$$
So given a series $$\sum a_n$$ with both positive and negative terms, you should first ask whether $$\sum |a_n|$$ converges. This may be an easier question to answer, because we have tests that apply specifically to terms with non-negative terms. If $$\sum |a_n|$$ converges then you know that $$\sum a_n$$ converges as well. If $$\sum |a_n|$$ diverges then it still may be true that $$\sum a_n$$ converges---you will have to do more work to decide the question. Another way to think of this result is: it is (potentially) easier for $$\sum a_n$$ to converge than for $$\sum |a_n|$$ to converge, because the latter series cannot take advantage of cancellation. | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750507184356,
"lm_q1q2_score": 0.8118090366002171,
"lm_q2_score": 0.8221891327004133,
"openwebmath_perplexity": 175.8374803024278,
"openwebmath_score": 0.9614256620407104,
"tags": null,
"url": "https://math.libretexts.org/Bookshelves/Calculus/Map%3A_Calculus_-_Early_Transcendentals_(Stewart)/11%3A_Infinite_Sequences_And_Series/11.06%3A_Absolute_Convergence_and_the_Ratio_and_Root_Test"
} |
optics, differential-geometry, mathematics, calculus
$(1)$ There is no upper-bound, because the proportion grows arbitrarily close to $1$ and due to the density of the reals, there is no one number to grasp at. This is true.
$(2)$ The upper-bound is $1$, because the function is, mathematically, continuous over $r=0$. Its analogical description of physical reality however, ends at $r=0$. As such, viewing the function as a mathematical model of a physical transformation, the function is discontinuous at $r=0$, as an a priori truth following from the definition of a cone (it obviously can't be a cone if its radius is $0$).
If the answerer's intended interpretation was $(2)$, then this seems to me as a situation of someone conflating a mathematical analogy with the physical reality it is describing. Just because the math say that $r$ can be $0$, doesn't mean that physical reality allows $r=0$. | {
"domain": "physics.stackexchange",
"id": 87063,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, differential-geometry, mathematics, calculus",
"url": null
} |
ros, arduino, catkin, rosserial, ros-groovy
and make_libraries.py runs successfully (with no error messages). However, it does not generate the ros directory in the <sketchbook>/libraries/ros_lib folder. The consequence of this is that when my Arduino code attempts to load ros.h, the #include statement for ros/node_handle.h fails when I try to compile the "hello world" example in the Arduino IDE. Thus, I am unable to proceed further.
Here is the output of <sketchbook>/libraries/ros_lib$ ls after I run <sketchbook>/libraries/$ rosrun rosserial_arduino make_libraries.py .:
actionlib gazebo roscpp stereo_msgs
actionlib_msgs gazebo_msgs roscpp_tutorials tests
actionlib_tutorials gazebo_plugins rosgraph_msgs tf
ArduinoHardware.h geometry_msgs ros.h tf2_msgs
base_local_planner laser_assembler rospy_tutorials theora_image_transport
bond move_base_msgs rosserial_arduino topic_tools | {
"domain": "robotics.stackexchange",
"id": 13065,
"lm_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, arduino, catkin, rosserial, ros-groovy",
"url": null
} |
speed-of-light, reflection
Title: Would we see the past if we look to a mirror 1 light year away? What would we see if we place a mirror 1 light year away? Would we see the present or the past? The light from the observation point that hit the mirror and returned would be two years old by the time it returned to the observation point, but there is a very big problem with this set up. The mirror would have to be huge and curved to reflect enough light from the observation back again so that it could be seen. (Imagine tyring to brush your hair in a mirror 100 m away...).
More seriously, often in 'pump probe' laser experiments the positions of mirrors are moved to change the delay between two pulses of light that allows experiments to be performed with variable delays between two laser pulses. These experiments use exactly the principle that is relevant to your question.
So the further away you stand from the mirror - the younger you will look...! | {
"domain": "physics.stackexchange",
"id": 21248,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "speed-of-light, reflection",
"url": null
} |
KCET 2001 Mathematical Reasoning
## 15. The equation of the circle concentric with $x^2 + y^2 + 6x + 2y + 1 = 0$ and passing through the point (-2, -1) is
COMEDK 2007 Conic Sections
## 16. Coefficient of $t^{24}$ in $(1+t^2)^{12}) (1+t^{12}(1+t^{24})$ is
IIT JEE 2003 Binomial Theorem
## 17. The equation $x^{\frac{3}{4}(\log_2 x)^2+\log_2x-\frac{5}{4}=\sqrt2}$ has
IIT JEE 1989 Complex Numbers and Quadratic Equations
## 18. I f F and F are independent events such that $O < P(E) < 1$ and $O < P (F ) < 1$, then
IIT JEE 1989 Probability
## 19. Number of divisors of the form $(4n + 2), n\ge 0$ of the integer 240 is
IIT JEE 1998 Permutations and Combinations
## 20. Let $\omega=-\frac{1}{2}+i\frac{\sqrt 3}{2},$ then value of the determinant $\begin {vmatrix} 1 & 1& 1 \\ 1 & -1-\omega^2 & \omega^2 \\ 1 & \omega^2 & \omega \\ \end {vmatrix} is$
IIT JEE 2002 Complex Numbers and Quadratic Equations
## 21. The equation $\frac{x^2}{1-r}-\frac{y^2}{1+r}=1,|r|<1$ represents | {
"domain": "tardigrade.app",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9896718493084381,
"lm_q1q2_score": 0.8310610746673927,
"lm_q2_score": 0.8397339736884712,
"openwebmath_perplexity": 993.2062971299006,
"openwebmath_score": 0.5850305557250977,
"tags": null,
"url": "https://tardigrade.app/question/mathematics"
} |
beginner, c
// warning: conversion from 'time_t' {aka 'long int'} to 'unsigned int' may change value [-Wconversion]
srand(time(NULL));
Uninitialized values
temp_error_2[o] += 1 attempts to increment an int that have never been initialized.
int temp_error_2[OBSTACLES];
int temp_error = 1 + rand() % 100;
if (temp_error > 0 && temp_error < 6) {
temp_error_2[o] += 1; // Bad!!
Unneeded array
Array int temp_error_2[OBSTACLES]; not needed.
// Weak
int temp_error_2[OBSTACLES];
int temp_error = 1 + rand() % 100;
if (temp_error > 0 && temp_error < 6) {
temp_error_2[o] += 1;
if (temp_error_2[o] == 1) {
error[i] += 1;
}
}
Replaceable with
int temp_error = 1 + rand() % 100;
if (temp_error > 0 && temp_error < 6) {
error[i]++;
} | {
"domain": "codereview.stackexchange",
"id": 44380,
"lm_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",
"url": null
} |
windows, winapi, device-driver
HDEVINFO hDeviceInfo =
SetupDiGetClassDevsExA(
&guid,
NULL,
NULL,
DIGCF_PRESENT,
NULL,
NULL,
NULL);
if (hDeviceInfo == INVALID_HANDLE_VALUE) {
std::cerr << "ERROR: Could not obtain HDEVINFO.\n";
return EXIT_FAILURE;
}
SP_DEVINFO_DATA deviceInfoData;
deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
deviceInfoData.ClassGuid = guid;
BOOL deviceEnumerated =
SetupDiEnumDeviceInfo(
hDeviceInfo,
0,
&deviceInfoData);
if (!deviceEnumerated) {
std::cerr << "ERROR: Could not enumerate the SP_DEVINFO_DATA.\n";
return EXIT_FAILURE;
}
BOOL removeStatus =
SetupDiCallClassInstaller(
DIF_REMOVE,
hDeviceInfo,
&deviceInfoData); | {
"domain": "codereview.stackexchange",
"id": 44810,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "windows, winapi, device-driver",
"url": null
} |
c, reinventing-the-wheel, bitwise, integer
printf("%-11d * %-11d = %-11d (%s)\n", a, b, c, (equal ? "Success" : "Failure"));
if (!equal) {
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
int multiply(int a, int b) {
struct {
unsigned char index : 5;
} bit;
int c = INT_MAX & a, // remove sign bit
d = INT_MAX & b,
sign = (INT_MIN & a) ^ (INT_MIN & b), // sign of product
mask = 0x40000000,
prod = 0;
bit.index = 30; // keeping track of mask bit index
do {
prod += (mask & c ? d << bit.index : 0);
} while ((bit.index--) && (mask >>= 1)); | {
"domain": "codereview.stackexchange",
"id": 13595,
"lm_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, reinventing-the-wheel, bitwise, integer",
"url": null
} |
experimental-chemistry
Title: Uncertainties Calculation Recently I did an experiment on isolating casein and now that I am processing the results, I feel my method of uncertainty calculation is not feasible. The casein was isolated 3 times and the results are as follows: 2.386, 2.628 and 2.164 grams. The scale had an uncertainty of 3 decimal places. Furthermore, the casein was isolated from 100 mL of milk, measured using a measuring cylinder with an uncertainty of 1 mL. The mean uncertainty was found using the following formula:
$$Δx_\mathrm{avg} = \frac{Δx}{\sqrt{N}} = \frac{R}{2\sqrt{N}}$$
Hence, my calculations were:
$$\mathrm{Range} = 2.628 - 2.164 = 0.464$$
Thus the uncertainty for the average would be:
$$\frac{0.464}{2\sqrt{3}} = 0.133945262 = 0.2$$
This would result in a final value for the average amount of casein in the isolated milk of $\pu{2.4 ± 0.2 g}$. | {
"domain": "chemistry.stackexchange",
"id": 11944,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "experimental-chemistry",
"url": null
} |
python, beginner, file
print(positionlist)
wordvals = []
end=False
im = 0
while True:
try:
wordvals.append(uniqueword[im])
im+=1
except:
break
print(wordvals)
text_file = open("sentencemanip.txt", "w")#prints by line on new lines
for item in positionlist:
text_file.write("%s\n" % item)
text_file.close()
text_file = open("sentencemanip1.txt", "w")
for item in wordvals:
text_file.write("%s\n" % item)#whee
text_file.close()
print('the sentence has been printed to the text files sentencemanip.txt and sentencemanip1.txt') | {
"domain": "codereview.stackexchange",
"id": 22986,
"lm_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, file",
"url": null
} |
java, object-oriented, game, snake-game
The Food class uses these abbreviated names, img, rnd, etc. I'd
suggest writing them out and giving them some more descriptive names in
general.
The loop in generateLocation seems a bit bogus to me, why skip a
random number of random numbers before picking one? If you have
problems getting repeated numbers each run of the program you should
perhaps initialise it from a truly random source.
Snake has velX and velY - that's exactly where a Vector would
come in handy again. After all it's exactly that, a 2-tuple exactly
like what Coor is.
checkDeath could use a for (x : body) ... for the death check, plus,
once dead = true was set, a break would also be good. | {
"domain": "codereview.stackexchange",
"id": 35865,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, game, snake-game",
"url": null
} |
proteins, pharmacology
That's not actually so simple. It's a large, crowded market out there, and there is a lot of intellectual property floating around. A wise businesswoman told me that her company focuses on the middle-ground. A target that is too promising is probably already owned by Genentech, so they aim for the ones that are below the attention of the giants but still quite profitable. | {
"domain": "biology.stackexchange",
"id": 1307,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proteins, pharmacology",
"url": null
} |
ros, ros-kinetic, remote, joy
Originally posted by shoemakerlevy9 with karma: 545 on 2018-03-14
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by gvdhoorn on 2018-03-14:\
ROS2 provides better methods for dealing with unreliable networks, but if you aren't ready to make the switch
the ros2/ros1_bridge makes it so that you don't have to 'make the switch'. | {
"domain": "robotics.stackexchange",
"id": 30288,
"lm_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, remote, joy",
"url": null
} |
matrix-representation, stabilizer-state, clifford-group
distingiush between scalar multiples of a state vector, which is irrelevant
in quantum theory.
[1] https://arxiv.org/abs/quant-ph/0406196
[2] https://arxiv.org/abs/math/0001038
Cross-posted from MathOverflow I think data structures based on ZX-calculus (see [1] for an introduction) are able to do all the operations you require. ZX-calculus is a diagrammatic calculus that is complete for all unitaries [2] (that is to say, every unitary can be represented as a ZX-diagram, and every pair of diagrams that represent the same unitary can be proven equal using just the rules of ZX-calculus). First note that: | {
"domain": "quantumcomputing.stackexchange",
"id": 3673,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matrix-representation, stabilizer-state, clifford-group",
"url": null
} |
computability, turing-machines
In contrast, total Turing machines means the same for everybody. But the ambiguity hasn't disappeared – it is now not completely clear what is the language accepted by a total Turing machine. If the Turing machine has ACCEPT/REJECT annotation for its halting states, then you can define the language this way. Or you can define it via the output. You can even say that a total Turing machine accepts a language only if its output is always 0 or 1. It's really up to you.
Whatever definitions you use, as long as they are reasonable, the same basic theorems of computability theory will hold. In a sense, the exact definitions do not matter, and this is why there is such a great variety of them. Wikipedia presents one possible definition, but your course or textbook could be using another definition which is formally inequivalent but in practice completely equivalent, like two versions of C++. | {
"domain": "cs.stackexchange",
"id": 10216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, turing-machines",
"url": null
} |
diagenesis, sedimentology, carbonate
Title: Formation of flint & chert in limestones/chalk Chert and flint are commonly found in chalky deposits (and have obvious importance in human history as tools). What are the processes of diagenesis of these silica-rich nodules in otherwise silica-poor horizons? This is not really my specialism, but in the absence of other answers so far, I'll give it a go.
Firstly, to simplify the terms of the question a little bit, flint is a form of chert, so we don't need to distinguish the two terms: we can just talk about chert in general. Also, I'll ignore chert beds formed in siliceous oozes, since you're specifically asking how cherts form in carbonate beds. Nichols (2009) gives a concise explanation, and I don't think I can do better than to quote it: | {
"domain": "earthscience.stackexchange",
"id": 103,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "diagenesis, sedimentology, carbonate",
"url": null
} |
momentum, oscillators
Title: Period of a circular arc shaped pendulum
The period T is equal to $2\pi/w_n$ where the natural frequency can be found from $w_n^2{\theta}+\ddot{\theta} = 0$. Since $\tau = I\alpha $, as there is no net torque about point P because gravity acts at the center of mass and equals the normal force, $\ddot{\theta} = 0$ so $w_n = 0$. Does that mean the period is infinite? No. Gravity does not act at point $P$ because your CoM is not at point $P$. Your CoM is lower than point $P$. Therefore, gravity produces a torque.
Your normal force will not produce a torque, since it's applied at point $P$, so the torque about point $P$ due to the normal force is zero.
Lastly, I'd like to emphasize that force equilibrium does not imply torque equilibrium. (and this pendulum is not even in force equilibrium, because the CoM will accelerate). | {
"domain": "physics.stackexchange",
"id": 74583,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "momentum, oscillators",
"url": null
} |
fluid-dynamics, geometry, rocket-science
that would be really nice. The dimensions missing above are just examples, the blueprint does not have to include these exactly, similar ones are okay, too.
And do the same ratios and angles work on different scales as well? Or are there different ones depending on the actual size of the nozzle? This answer is taken from Aerorocket, which is a DeLaval nozzle analysis program and Wikipedia Delaval Nozzle
Rather than answer by trying to find tables showing the results of different ratios, angles and scaling effects, if instead you use the Aerorocket program, it seems to provide a large range of options to try out the performance of the nozzle, by adjusting the parameters you have listed in your question. | {
"domain": "physics.stackexchange",
"id": 96882,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, geometry, rocket-science",
"url": null
} |
scala, formatting, floating-point
Use Matchers
if.. else if.. else are too much from imperative style; matchers should be used instead:
private def dealWithSign2(s: String): ExponentTuple = {
def dropZeros(str : String) = str.dropWhile(_ == '0')
s.head match {
case '+' => (1, dropZeros(s.tail))
case '-' => (-1, dropZeros(s.tail))
case _ => (1, s)
}
} | {
"domain": "codereview.stackexchange",
"id": 16206,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scala, formatting, floating-point",
"url": null
} |
mechanical-engineering, motors, electric-vehicles
Is this some common size / shape that I'm not familiar with? Is there some specific part that it is supposed to mate with?
Barring that, how would you design a simple, cheap mount for this motor? I have some ideas, but I'm interested in seeing what others come up with.
I've also asked the supplier these questions but I don't have a lot of faith that I'll receive any feedback. The shaft is slightly undersized so it will fit into a 1" hole in a worst-case tolerance stackup (called a clearance fit). The fact that the flat does not extend all the way to the end of the shaft is because this will prevent the thing that has been set screwed onto the end of the shaft from flying all the way off the shaft if the setscrew works itself loose. | {
"domain": "engineering.stackexchange",
"id": 5099,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, motors, electric-vehicles",
"url": null
} |
python, python-3.x
class O(object):
defaults = {'A':None, 'B':0, 'C':0}
required = [key for (key, value) in defaults.items() if value == None]
ok = False
def __init__(self, **kwargs):
if not all([key in kwargs for key in self.required]):
print('problem, something required is missing')
setup = self.defaults.copy()
for (key, value) in kwargs.items():
if key in setup:
setup[key] = kwargs[key] # user specified overrides default
setup = self.fixem(setup)
if setup:
for (key, value) in setup.items():
setattr(self, key, value)
self.ok = True
else:
print('something did not work') | {
"domain": "codereview.stackexchange",
"id": 36691,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x",
"url": null
} |
c, memory-management, thread-safety, pointers
Is This Mutex Lock/Unlock Necessary?
You have a comment in SharedPtr_get() asking whether you need to lock when getting the raw pointer. The answer is yes, you do. Think of this case: You have 1 copy of a shared pointer left and there are 2 threads operating on the same copy. (Maybe this violates your design, but it's not enforced in the code.) It is the last copy left in the linked list. You call SharedPtr_free() on thread 1, and at the exact same time call SharedPtr_get() on thread 2. If you don't lock on thread 2, you may access the raw pointer just as it's being freed on the other thread.
Obviously, you shouldn't be using the same copy of a shared pointer on 2 different threads, but I don't know of a way (off the top of my head) to enforce that. You can easily allocate one on one thread and then pass it over to another thread. | {
"domain": "codereview.stackexchange",
"id": 26429,
"lm_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, memory-management, thread-safety, pointers",
"url": null
} |
c++, performance, numerical-methods, neural-network, eigen
Code
#include <math.h>
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <iterator>
#include <Eigen/Dense>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <sstream>
using Eigen::MatrixXd;
using Eigen::ArrayXd; | {
"domain": "codereview.stackexchange",
"id": 16229,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, numerical-methods, neural-network, eigen",
"url": null
} |
python, performance, python-2.x, image, multiprocessing
value = re.sub(' +',' ', thing[1])
if value: # If subject has a value, store it
try:
subRequirementsDict[str(name)] = str(designators[str(value)]) # Store value converted to designator in a dictionary with the subject as the key
except KeyError:
subRequirementsDict[str(name)] = str(value) # Store value in a dictionary with the subject as the key
except:
pass
RequirementsDict["requirement" + str(x)] = subRequirementsDict
ClassDict["requirements"] = RequirementsDict
AllCourseInfo = shlex.split(h.unescape(str(RawClassData[i]).replace(">", " "))) # sort into a list grouping string in quotes and getting rid of unnecessary symbols
for item in AllCourseInfo: # Go through list of class info
try: | {
"domain": "codereview.stackexchange",
"id": 26996,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-2.x, image, multiprocessing",
"url": null
} |
mole
why do the element's mass per mole do very rarely end up being integers?
No element other than carbon-12 will exactly be an interger. This is because masses of atoms depend upon number of protons, neutrons, electrons and binding energy.
In other words, considering that carbon-12 has an equal number of protons and neutrons (and electrons), other isotopes with a 1:1 proton/neutron ratio would have essentially integral atomic masses except for binding energy. For example cadmium 112 is 111.90 instead of exactly 112 because binding energy is slightly more than 0.1 amu, partially offest by a higher number of neutrons than protons, the neutron mass being slightly greater than the combined mass of an electron and proton.
As pointed out by Matt Black, the natural abundance atomic masses further deviate because they are weighted averages of the masses of isotopes of a given element, weighted by their abundance on Earth. | {
"domain": "chemistry.stackexchange",
"id": 1296,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mole",
"url": null
} |
GMAT Question of the Day - Daily to your Mailbox; hard ones only
It is currently 23 Feb 2019, 07:05
GMAT Club Daily Prep
Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
Events & Promotions
Events & Promotions in February
PrevNext
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
242526272812
Open Detailed Calendar
• FREE Quant Workshop by e-GMAT!
February 24, 2019
February 24, 2019
07:00 AM PST
09:00 AM PST
Get personalized insights on how to achieve your Target Quant Score.
• Free GMAT RC Webinar
February 23, 2019
February 23, 2019
07:00 AM PST
09:00 AM PST | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9549844683997677,
"lm_q1q2_score": 0.8411475233043832,
"lm_q2_score": 0.880797071719777,
"openwebmath_perplexity": 2946.3746060219573,
"openwebmath_score": 0.798043966293335,
"tags": null,
"url": "https://gmatclub.com/forum/the-perimeter-of-square-s-is-40-square-t-is-inscribed-in-square-s-167252.html"
} |
solar-system, planet, jupiter
Title: How did Jupiter form where it is? Since Jupiter is the biggest planet in our solar system and is made up of mostly hydrogen and helium, (the gases the Sun uses to create energy), how come it didn't form as far out as say Uranus or Neptune since when our star formed it took most of the gases around it to create? Just a little confused on this, thanks for the help! It's at Jupiter's distance and beyond that ices were able to form out of the disk of material surrounding the early sun. Go much further in and there is too much energy from the sun for them to stay as solids (and will sublimate into gases); this is why asteroids are principally rocks and metals. So at this distance more of the materials of the planetary disk can form the base planetesimals.
At this point, your question is answered largely by a geometric consideration (or two) and one of Kepler's laws. | {
"domain": "astronomy.stackexchange",
"id": 935,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solar-system, planet, jupiter",
"url": null
} |
heat, renormalization, interactions
http://prl.aps.org/abstract/PRL/v17/i14/p750_1
http://prl.aps.org/abstract/PRL/v17/i8/p433_1
A full text of Berk and Schrieffer:
http://books.google.cz/books?hl=en&lr=&id=YQU2bjfyKRgC&oi=fnd&pg=PA90&dq=berk+schrieffer&ots=VCX7dizdXg&sig=hcFJbKI-54TxRpYWjj9OF7ovuQE&redir_esc=y#v=onepage&q=berk%20schrieffer&f=false
Brinkman and Engelsberg discuss some limitations of the applicability of the log term in 1968:
https://doi.org/10.1103/PhysRev.169.417
Pethic and Carneiro with their Fermi liquid explanation came later.
1966 was before the Renormalization Group but it's not really needed for the calculations. The logarithmic corrections do arise from one-loop processes and similar corrections have been known in condensed matter physics and particle physics long before we knew about the right philosophical words linked to the Renormalization Group from the 1970s. | {
"domain": "physics.stackexchange",
"id": 2704,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "heat, renormalization, interactions",
"url": null
} |
python, programming-challenge, recursion, time-limit-exceeded, fibonacci-sequence
Lovely Lucky LAMBs
Being a henchman isn't all drudgery. Occasionally, when Commander
Lambda is feeling generous, she'll hand out Lucky LAMBs (Lambda's
All-purpose Money Bucks). Henchmen can use Lucky LAMBs to buy things
like a second pair of socks, a pillow for their bunks, or even a third
daily meal!
However, actually passing out LAMBs isn't easy. Each henchman squad
has a strict seniority ranking which must be respected - or else the
henchmen will revolt and you'll all get demoted back to minions again!
There are 4 key rules which you must follow in order to avoid a
revolt:
1. The most junior henchman (with the least seniority) gets exactly 1 LAMB. (There will always be at least 1 henchman on a team.)
2. A henchman will revolt if the person who ranks immediately above them gets more than double the number of LAMBs they do. | {
"domain": "codereview.stackexchange",
"id": 27246,
"lm_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, programming-challenge, recursion, time-limit-exceeded, fibonacci-sequence",
"url": null
} |
• Is it mod arithmetic; i.e., if $a_i$ is 1 is $a_{i+1}$ allowed to be 10, and if $a_i$ is 10, can $a_{i+1}$ be 1? – Mike Apr 18 '18 at 18:09
• No, that is not the case. – Tobi92sr Apr 18 '18 at 18:16
• Isn't condition i) redundant? – user251257 Apr 18 '18 at 18:17
• I think i) is saying $a_1$ has no restrictions on choice. ii) any following a_i is restricted in that it must be distinct from any of the previous iii) when combined with ii) says that all $a_1... a_k$ will be a block of consecutive letters and $a_{k+1}$ will be either be one less than the minimum or one more than the max. – fleablood Apr 18 '18 at 21:29
Some extensive hints:
1. By induction we have $$A_i := \{ a_1, \dotsc, a_i \} = \{ \min A_i, \min A_i + 1, \dotsc, \max A_i \}.$$ Thus, $a_{i+1} = \min A_i - 1$ or $\max A_i + 1$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668701095654,
"lm_q1q2_score": 0.848929199930779,
"lm_q2_score": 0.8652240773641087,
"openwebmath_perplexity": 172.11402410937208,
"openwebmath_score": 0.8483524918556213,
"tags": null,
"url": "https://math.stackexchange.com/questions/2743439/number-of-possible-sequences"
} |
mechanical-engineering, structural-engineering
Also I'm new to stackechange so I apologise if I messed up the format of the post or didn't conform to the rules of the forum. I am writing this as an answer to the comment about the superposition method. I started writing it in my original answer, but it was too long and confusing, so I opted to do another answer.
Superposition method.
Let's assume you have this problem. | {
"domain": "engineering.stackexchange",
"id": 4176,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, structural-engineering",
"url": null
} |
electromagnetism, waves, wavelength, dipole, antennas
to the line; waves that are to be in or from undesired direction be completely mismatched (reflected). Being resonant can help with impedance matching be achieved at a given frequency/direction. If wider bandwidth than that of a simple resonant curve is required then different radiators need be employed, for example, a horn that is being an aperture radiator can easier be made wider bandwidth. | {
"domain": "physics.stackexchange",
"id": 77982,
"lm_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, waves, wavelength, dipole, antennas",
"url": null
} |
python, python-3.x, console, shell
print ("EDIT")
print ("-------------")
print ("Note: Naming this current document the same as a different document will replace the other document with this one.")
directory = ("/media/GENERAL/Projects/files")
filename = input("Plese enter a file name.")
file = open(os.path.join(directory, filename), "w")
print ("FILE: " + filename+".")
lines = get_lines()
file.write('\n'.join(lines)) | {
"domain": "codereview.stackexchange",
"id": 12872,
"lm_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, console, shell",
"url": null
} |
observational-astronomy, data-analysis, gravitational-lensing, james-webb-space-telescope, image-processing
While the groups chose different algorithms for title selection ("unscrambling" vs "precision modeling") I wonder if they used similar variations on the same technique?
Question: How do they do this? How do astronomers unscramble or precision-model the undistorted image from an observed image gravitationally lensed by a complex (or at least lumpy) gravitational field. Is there an easy way to explain it as a straightforward algorithm, or is it more like solving a jigsaw puzzle - a long series of guesses and decisions and tests? I work in gravitational lensing, so maybe I can give you an idea.
In those JWST you have a massive galaxy cluster that is bending the light behind and acting as a true lens. If you have a temptative model of the mass distribution, including the dark matter halo of the cluster and the cluster galaxies, you can find the best mass distribution model by fitting the model to some observables. These observables are objects with multiple images. | {
"domain": "astronomy.stackexchange",
"id": 6650,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observational-astronomy, data-analysis, gravitational-lensing, james-webb-space-telescope, image-processing",
"url": null
} |
quantum-field-theory, standard-model, renormalization, perturbation-theory, asymptotics
$^1$ Is there actually a proof of this statement? This is only a problem when we're trying to use a perturbation series as a substitute for a nonperturbative definition of the theory.
For many quantum field theories, including QED and QCD, we have perfectly healty nonperturbative definitions based on lattice QFT. In lattice QFT, the challenge of finding a nonperturbative definition is replaced by the challenge of proving the existence of a nontrivial continuum limit, but that usually doesn't matter for physics because most QFTs aren't meant to be Theories of Everything. When people say things like "QED doesn't exist," they're referring to the non-existence of a nontrivial continuum limit. That's an issue for aesthetics, but it's not a problem for physics. | {
"domain": "physics.stackexchange",
"id": 79859,
"lm_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, renormalization, perturbation-theory, asymptotics",
"url": null
} |
electromagnetism, dimensional-analysis, si-units, unit-conversion
Title: Dimensional Analysis in Electromagnetism (SI vs Gaussian-cgs) Looking at Konopinski's formula for conjugate momentum (in the comment after equation 3 of "What the Vector Potential Describes"):
$\mathbf{p}= M \mathbf{v} + q\mathbf{A} /c$
it is plain enough that $M \mathbf{v}$ is the momentum, but if we naively take the usual notion of the magnetic vector potential $\mathbf{A}$to have dimensions of magnetic flux/length or, equivalently, momentum/charge (weber/meter = (kg $\cdot$ m/s)/coulomb) the following dimensional expression obtains for the right hand side of the $+$:
charge $\cdot$ ((mass $\cdot$ velocity)/charge)/velocity
So in a naive dimensional analysis this simplifies to mass; but this is not commensurable with momentum (mass $\cdot$ velocity) on the left side of the $+$.
Likewise, in that same comment, Konopinski describes the "interaction energy" as:
$$q[\phi-\mathbf{v}\cdot\mathbf{A}/c]$$ | {
"domain": "physics.stackexchange",
"id": 97103,
"lm_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, dimensional-analysis, si-units, unit-conversion",
"url": null
} |
ros, roboearth
Originally posted by moritz with karma: 2673 on 2013-01-29
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Mendelson on 2013-02-04:
thanks moritz! | {
"domain": "robotics.stackexchange",
"id": 12397,
"lm_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, roboearth",
"url": null
} |
electromagnetism, forces
$$E_{out}^{\perp}-E_{in}^{\perp}=\frac{\sigma}{\varepsilon_0}$$
To calculate the force I can use Maxwell's tensor $\hat{T}$ and the momentum theorem.
$$\vec{F} = \oint_{\partial V} \hat{T}\vec{dS}$$
Given the condition that all this is happening in vacuum so the only physical thing here is the cylinder itself, I should be free to choose the volume $V$ from the theorem as I wish, as long as it only encloses the half of the cylinder (per unit length) stated in the problem. So I choose a half cylindrical surface with the radius $R+dR$. So when I calculate the tensor in the surface integral from the theorem I use $\vec{E}_{out}$ for the curved part of $\partial V$ and $\vec{E}_{in}$ otherwise.
The other way to find the force is to directly calculate it from the general formula:
$$\vec{F} = \int \rho(\vec{r})\vec{E}(\vec{r})dV$$
Here it becomes:
$$\vec{F} = \int_S \sigma(\vec{r})\vec{E}(\vec{r})dS$$ | {
"domain": "physics.stackexchange",
"id": 87109,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, forces",
"url": null
} |
of Geometric Series Introduction: . The geometric sequence definition is that a collection of numbers, in which all but the first one, are obtained by multiplying the previous one by a fixed, non-zero number called the common ratio.If you are struggling to understand what a geometric sequences is, don't fret! For example: If I can invest at 5% and I want $50,000 in 10 years, how much should I invest now? Try the free Mathway calculator and What will the value of an automobile be after three years if it is purchased for $$4500$$ dollars? A geometric progression (GP), also called a geometric sequence, is a sequence of numbers which differ from each other by a common ratio. Therefore, the whole length of the line is equal to $$189$$cm. This paper will cover the study of applications of geometric series in financial mathematics. What will the house be worth in 10 years? At this rate, how many boxes will When r=0, we get the sequence {a,0,0,...} which is not geometric A geometric | {
"domain": "panchamukhahanuman.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399043329856,
"lm_q1q2_score": 0.8529832740670014,
"lm_q2_score": 0.8791467659263148,
"openwebmath_perplexity": 966.4103728825362,
"openwebmath_score": 0.44366544485092163,
"tags": null,
"url": "https://panchamukhahanuman.org/2xho27/article.php?id=application-of-geometric-progression-b49232"
} |
kinematics, forward-kinematics
In this case
$^0T1 = Rot(\theta_1)$.
Once you have all your transformations you multiply them togther, e.g.
$^0T_N = ^0T_1*^1T_2...^{N-1}T_N$.
Finally you can read the displacement vector out of the homogenous transform $^0T_N$ (i.e. $d = [^0T_{N,14}, ^0T_{N,24}, ^0T_{N,34}]^T$). Similarly you can read out the rotation matrix from $^0T_N$ to find the X-Y-Z angles. | {
"domain": "robotics.stackexchange",
"id": 114,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, forward-kinematics",
"url": null
} |
sorting
Title: What's a good way to sort a set of several correlated vectors? Let's say I have a bunch of lists of real numbers which we'll call a, b, c, etc. Moreover, let's say all of these vectors are correlated, in the sense that a[1] < a[2] implies that there's a better-than-even chance that b[1] < b[2]. I want to sort each one of these lists individually, returning a', b',... with the same elements as a, b, ... but ordered. How can I sort all of these lists simultaneously in a way that takes advantage of these correlations to speed up the sorting? Does the answer to this change if the lists might be either correlated or anticorrelated? (We can rule out relationships like b = x^2 -- let's say the relationship is monotonic, but not necessarily linear.) There are a variety of possible algorithms you could consider. It's hard to say which will be optimal without more details and analysis. Here are two ideas you could try out. | {
"domain": "cs.stackexchange",
"id": 18522,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sorting",
"url": null
} |
ros, rosdep, build-from-source, uvc-camera
Title: How to install yaml-cpp0.2.6-dev / How to install from source correctly
Hi Guys,
I'm not a total newbie to ROS and Ubuntu but I have a problem to install the yaml-cpp2.6-dev file.
I tried to make the uvc_camera Package and it complains about a missing dependencie of 'yaml-cpp' so i tried
$sudo apt-get yaml-cpp
but it unable to locate a package probably because of my armel architecture. Therefore i tried to compile it from source.
$ hg clone ttp://code.google.com/p/yaml-cpp/
$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=ON ..
$ make
$ sudo make install | {
"domain": "robotics.stackexchange",
"id": 9758,
"lm_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, rosdep, build-from-source, uvc-camera",
"url": null
} |
over intervals of time. How are exponential growth and decay present in the real world? Give at least 2 examples for exponential growth and 2 examples of exponential decay. This is an categorically easy. A model for growth of a quantity for which the rate of growth is directly proportional to the amount present. 10 +30% l, 60 -75% 0/0 Example 4: Given the following equations, find the percent growth/decay: y=24 First, find r, by using b—l - Now write the rate in percent form, and use + to indicate growth, and — to indicate decay. U-Substitution with Indefinite Integrals (6. Exponential Decay: It is possible to model a declining population using the exponential decay model. f(n) 5 1000 ? 1. The key to determining growth or decay depends on if the base, b, is less than one or greater than one. ©v K2u0y1 r23 XKtu Ntla q vSSo4f VtUweaMrneW yLYLpCF. 30 in 25 years. Exponential Decay B. 4 Growth and Decay Alg C. For example; V(t)= 100(1. Here are few Radioactive Isotopes and their half-life: | {
"domain": "reteomnes.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.988841966778967,
"lm_q1q2_score": 0.8130151233520805,
"lm_q2_score": 0.8221891370573388,
"openwebmath_perplexity": 1013.4247772213141,
"openwebmath_score": 0.47716018557548523,
"tags": null,
"url": "http://reteomnes.it/buca/exponential-growth-and-decay-test-answers.html"
} |
homework-and-exercises, general-relativity, cosmology, metric-tensor, notation
$$ \gamma : I \rightarrow \mathcal{M} $$
We might have a family of such curves, which is then called the congruence.
$$ \gamma : I\times J \rightarrow \mathcal{M},$$
where the $I$ is some parameter along the congruence and the $J$ distinguishes between the curves (it could be a Cartesian product of three intervals if you want to distinguish in three dimensions).
Now, the vector field tangent to the conguruence is defined as
$$ X(\gamma(t,s)) = \frac{\partial}{\partial t} \gamma(t, s) $$
Coming back to the example of the sphere, the observers moving in the azimuthal direction are collectively described by the $\partial_{\theta} $ vector field, and in the polar direction by $\partial_{\phi}$.
In your case, you have the congruence of curves (possible observers) defined by the vector field
$$ X = \frac{\partial }{\partial t}.$$
The integral curves of this vector field, in $(t, r, \theta, \phi) $ coordinates, are simply given by: | {
"domain": "physics.stackexchange",
"id": 82379,
"lm_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, general-relativity, cosmology, metric-tensor, notation",
"url": null
} |
ros, slam, navigation, follow-joint-trajectory, gmapping
Originally posted by NEngelhard with karma: 3519 on 2016-01-04
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Terry Su on 2016-01-04:
Because the lidar transmits the distance data to my ROS computer. Can the map_saver collect all the data of lidar and convert into the X,Y coordinate if the map? Thank you.
Comment by NEngelhard on 2016-01-04:
No it cannot. As it is clearly explained in the linked page...
Comment by Terry Su on 2016-01-05:
@NEngelhard, I saw it and I think I need to change the title because I need to transport the map which is just 0 or 1 signal or x,y location of the object and then feed that to the Non-ROS computer which is the controller let a robot know can really know the environment. But thanks anyway really. | {
"domain": "robotics.stackexchange",
"id": 23338,
"lm_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, slam, navigation, follow-joint-trajectory, gmapping",
"url": null
} |
0 and the value of the determinant will be as follows: Notice that we got the equation of a circle with the determinants equal to the coefficients A, B, C and D as follows; (x 2 + y 2) A + xB + yC + D = 0. Upenn Math 114 Finding The Equation Of A Plane Equidistant From Two. In the driving example above, the domain is the set of all possible speeds and the range is the set of resulting miles per gallon. Basically, I need to be able to pass a function the number of points that I would like to generate and get back an array of points. Substituting values of x and y in the equation for the coordinates of the points. Example 7 Find Vector Equation For Line 1 0 2 3 4 6. Two point form calculator This online calculator can find and plot the equation of a straight line passing through the two points. A trapezium is a quadrilateral that has one pair of parallel sides. 2 Translations and Shifts of Quadratic Functions ( discuss the effects of the symbol before the leading coefficient, the effect | {
"domain": "shantideva.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9910145696551569,
"lm_q1q2_score": 0.8423338188635793,
"lm_q2_score": 0.8499711756575749,
"openwebmath_perplexity": 236.3292171589137,
"openwebmath_score": 0.6133164763450623,
"tags": null,
"url": "http://gpuf.shantideva.it/find-an-equation-of-the-set-of-all-points-equidistant-from-the-points-calculator.html"
} |
newtonian-mechanics, forces
Huygens extended this to rotating and accelerating frames, by introducing non-active, or inertial, forces like the centrifugal force. Also g-forces. When you are in an accelerating car, you imagine a g-force pushing you back, but this is not a true force. There is only one active force, pushing you forwards. In a Newtonian frame, you are accelerating, there is no active force pushing you back. Instead one thinks of the g-force as an inertial force.
Einstein showed in general relativity that gravity is also an inertial force, not an active force. That is why it behaves the way it does. It is why we don't actually feel gravity pulling us down. We feel the surface we are standing on pushing us up, and imagine that this is counterbalanced by gravity. | {
"domain": "physics.stackexchange",
"id": 68337,
"lm_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",
"url": null
} |
optics, lenses, light-emitting-diodes
Is it possible to decrease the spot size further without decreasing light intensity (without closing down the aperture, moving aperture away from LED)?
Will using a lens with larger f (say f=75mm) for collimation have a significant effect (since bigger the collimated beam, smaller the focused dot) ? As S. Mcgrew stated, consider this as an imaging problem. If you collimate with an f=50 lens, and focus that with a f=100 mm lens, the nominal magnification is 2 (well, -2 if you were keeping track of signs). Hence a 1 mm aperture is imaged to a 2 mm image size. Some aberrations will increase that slightly.
If you increase focal length of the first lens to 75 mm, the magnication is now -(100/75) = 1.3, so the image will be 1.3 mm in diameter. (As images get smaller, aberrations may be a proportionately larger share of the actual spot size). | {
"domain": "physics.stackexchange",
"id": 49694,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, lenses, light-emitting-diodes",
"url": null
} |
c++, performance, multithreading, playing-cards
print(results);
return 0;
}
To compile it: g++ -std=c++17 -pthread count.cpp -o count
how can I improve the performance of my program?
A standard answer is use a better algorithm.
Trying to improve performance by shaving cycles while enumerating a 635 013 559 600 strong set is futile.
Consider instead enumerating subsets of valuable cards. There are merely \$2^{16} = 65536\$ of them; a trillion time acceleration. Given a popcount function, you may do something along the lines of
for (int value_cards = 0; value_cards < (1 << 16); value_cards++) {
if (popcount(value_cards) <= 13) {
hand_value = compute_hand_value(value_cards);
hands[hand_value] += choose((52 - 16), 13 - popcount(value_cards));
}
}
52 - 16 above is a number of a non-value cards in the deck. 13 - popcount(value_cards) is a number of non-value cards which could be dealt to the hand with a given number of value cards.
And of course, the choose shall be a precomputed array. | {
"domain": "codereview.stackexchange",
"id": 37642,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, multithreading, playing-cards",
"url": null
} |
formal-languages, reference-request, regular-languages, finite-automata
The class $\mathcal{PS}$ of languages recognized by a partial SDFA is of course larger than $\mathcal{S}$, but does not exhaust the class of all regular languages. Actually, one can show that if $L$ is in $\mathcal{PS}$, then the syntactic monoid of $L$ is an inverse monoid and in particular, its idempotents commute. This latter property is shared by the slightly larger class of reversible automata. See
J.-É. Pin, On the languages accepted by finite reversible automata, in 14th ICALP, Berlin, (1987), 237-249, LNCS 267, Springer Verlag | {
"domain": "cs.stackexchange",
"id": 1665,
"lm_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, reference-request, regular-languages, finite-automata",
"url": null
} |
perl, optimization, io
I am thinking I could break up the second loop into multiple concurrent threads so each time the outer-most loop finished, the second loop (checking the SOS clause against all other clauses) could be broken up into x groups that are executed concurrently.
Or, because on each pass of the outer loop, multiple clauses could be added to the SOS set, I could break that group up and check them against the other clauses concurrently, instead of sequentially.
Is there any reason one solution would be better than the other? I found the general style of your program hard to read. You use 8-space indentation but have so many levels that the most of your code isn't visible without scrolling. Other for indentation, you use very little spaces in your code, for example around operators. This line:
for(my $j=0; $j<=$#{@clauses[$i]}; $j++) {
Could be made more readable as
for(my $j = 0; $j <= $#{ @clauses[$i] }; $j++) { | {
"domain": "codereview.stackexchange",
"id": 7332,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "perl, optimization, io",
"url": null
} |
performance, assembly, x86
Use small instructions
Since we're writing in assembly language, it makes sense to use that to our advantage. One way to do that is to keep the code as small as possible to help facilitate caching. If the code is small enough to fit entirely within L1 cache, for example, (and this program is), it won't have to go back out to slower memory (L2, L3 caches and hard drive) as often. One way to keep the code small is by using smaller instructions. One could write, for example,
mov rdi, 0 ; this sets edi to zero with a 5-byte instruction
xor rdi, edi ; so does this but with a 3-byte instruction | {
"domain": "codereview.stackexchange",
"id": 31623,
"lm_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, assembly, x86",
"url": null
} |
# Birthday Problem for 3 people
I know that, in a room of 23 people, there is a 50-50 chance that two people have the same birthday. However, what I want to know is: How many people do you need to have a 50-50 chance that 3 people share the same birthday?
Note: Assume for this question, that birthdays are equally distributed | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676496254957,
"lm_q1q2_score": 0.862888407777744,
"lm_q2_score": 0.8807970826714614,
"openwebmath_perplexity": 554.935184358446,
"openwebmath_score": 0.9662566184997559,
"tags": null,
"url": "https://math.stackexchange.com/questions/485462/birthday-problem-for-3-people/485504"
} |
java
void logIntro(Entity attacker, Entity defender) {
append("attack begins");
append(attacker + " attacks " + defender);
append("--------");
append("");
}
void logDefendSucceeded() {
append("defender successfully avoided the attack");
}
void logDefendFailed() {
append("defender could not avoid the attack - time to take some damage....");
}
void logAttackFailed() {
append("attack was not successful (attacker missed)");
}
void logImpact(List<StatChange> impact) {
append("giving impact: " + impact);
}
}
Tests
AttackProcedureTest:
public class AttackProcedureTest {
private final AttackProcedure attackProcedure = new AttackProcedure(new TestFightRules());
private TestEntity attacker = new TestEntity("attacker"); | {
"domain": "codereview.stackexchange",
"id": 38379,
"lm_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
} |
java, performance, algorithm, multithreading, tcp
@SuppressWarnings("unused")
SelectionKey serverAcceptKey = serverSocketChannel.register(
selector, SelectionKey.OP_ACCEPT);
while (running) {
@SuppressWarnings("unused")
int keyCount = selector.select();
Set<SelectionKey> selectedKeys = selector.selectedKeys();
Iterator<SelectionKey> keyIterator = selectedKeys.iterator();
while (keyIterator.hasNext()) {
SelectionKey key = (SelectionKey) keyIterator.next();
if ((key.readyOps() & SelectionKey.OP_ACCEPT) == SelectionKey.OP_ACCEPT) {
ServerSocketChannel ssc = (ServerSocketChannel) key
.channel();
SocketChannel sc = ssc.accept();
sc.configureBlocking(false); | {
"domain": "codereview.stackexchange",
"id": 12066,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, algorithm, multithreading, tcp",
"url": null
} |
cc.complexity-theory, lower-bounds, circuit-complexity, boolean-functions, fourier-analysis
Remarks:
One possible path to a counterexample would be to "glue somehow" various IP$_2k$ on disjoint sets of variables but I don't see how to do it. Perhaps one should weaken the question and allow assigning some weights to the variables, but I don't see a clear way for doing it either. (So referring to these two matters is also part of what I am asking about.)
I would speculate that a positive answer to the question, (or to a successful variation) will apply also when you allow mod$_k$ gates. (So asking the question was motivated by Ryan Williams' recent impressive ACC result.)
For MAJORITY the F-distribution is large (1/poly) for every "level".
As shown by Luca, the answer to the question I asked is "no". The question that is left is to propose ways to find properties of the F distributions of Boolean functions that can be described by AND OR and mod 2 gates not shared by MAJORITY. | {
"domain": "cstheory.stackexchange",
"id": 427,
"lm_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, lower-bounds, circuit-complexity, boolean-functions, fourier-analysis",
"url": null
} |
brain, cognition
Title: Does the brain process sound in "clips" or "frames"? I've always been under the impression that our brains process images (relayed to it via the eyes) at a particular frequency or "framerate"; this is supported by lots of sources, such as this one.
I'm wondering how close this compares to the way our brains process sounds:
Do we sample "snippets"/clips of sound? If so, is there any evidence as to how long (duration-wise) these "clips" are? Do we "sample" at the millisecond level? Microsecond?; or...
Do we actually sample "sound frames" (much like we do with visual images)? If so, how does our brain process a "frame" that contains multiple noises occurring at the same time (say a dog is barking at the same time the television is on)? After all, a frame is all the input for an instantaneous point in time, versus a clip, which is all the input over a period of time.
Any ideas? It would seem that this 2014 publication adequately addresses your curiosity.
The abstract.. | {
"domain": "biology.stackexchange",
"id": 7686,
"lm_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, cognition",
"url": null
} |
ros, packages, dependencies
ros-hydro-message-filters{a} ros-hydro-message-generation{a}
ros-hydro-message-runtime{a} ros-hydro-mk{a} ros-hydro-mobile{a}
ros-hydro-move-base{a} ros-hydro-move-base-msgs{a}
ros-hydro-move-slow-and-clear{a} ros-hydro-nav-core{a}
ros-hydro-nav-msgs{a} ros-hydro-navfn{a} ros-hydro-navigation{a}
ros-hydro-nodelet{a} ros-hydro-nodelet-core{a}
ros-hydro-nodelet-topic-tools{a} ros-hydro-nodelet-tutorial-math{a}
ros-hydro-octomap{a} ros-hydro-opencv2{a} ros-hydro-openslam-gmapping{a}
ros-hydro-orocos-kdl{a} ros-hydro-pcl-conversions{a} ros-hydro-pcl-msgs{a}
ros-hydro-pcl-ros{a} ros-hydro-perception{a} ros-hydro-perception-pcl{a}
ros-hydro-pluginlib{a} ros-hydro-pluginlib-tutorials{a}
ros-hydro-polled-camera{a} ros-hydro-python-qt-binding{a}
ros-hydro-qt-dotgraph{a} ros-hydro-qt-gui{a} ros-hydro-qt-gui-app{a}
ros-hydro-qt-gui-core{a} ros-hydro-qt-gui-cpp{a}
ros-hydro-qt-gui-py-common{a} ros-hydro-random-numbers{a} | {
"domain": "robotics.stackexchange",
"id": 16327,
"lm_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, packages, dependencies",
"url": null
} |
cos(−α) = cos(α)
tan(−α) = −tan(α)
### Simplify sin, cos and tan by using π/2 or 90° phase shifts
By using the sum of angles identities it is easy to prove these identities:
• sin(x + π/2) = cos(x) or sin(x + 90°) = cos(x)
• cos(x + π/2) = −sin(x) or cos(x + 90°) = −sin(x)
• tan(x + π/2) = −1/tan(x) or tan(x + 90°) = −1/tan(x)
By using these identities repeatedly, it is possible to replace a sin, cos or tan of any angle, no matter how large, with a sin, cos or tan of an angle that lies between 0 and π/2 or between 0° and 90°. For example
sin(x + 270°) = cos(x + 180°) = −sin(x + 90°) = −cos(x).
These identities are an important part of the algorithms used by the Algebra Coach and by calculators and computers to evaluate the sin, cos, and tan functions.
## Simplifications involving complex numbers
### Express the square roots of negative numbers as imaginary numbers | {
"domain": "mathonweb.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750484894196,
"lm_q1q2_score": 0.8049402209202833,
"lm_q2_score": 0.8152324915965392,
"openwebmath_perplexity": 391.17433641898134,
"openwebmath_score": 0.8823364973068237,
"tags": null,
"url": "http://mathonweb.com/help_ebook/html/simplifying.htm"
} |
c, linked-list, pointers
}
curr=curr->next;
}
} It seems you can simplify this by quite a lot.
I added explanation of the algorithm inside the code,
that way it might be easier to follow:
void rem_odd(struct Node** head)
{
struct Node* curr = *head;
struct Node* l_even; | {
"domain": "codereview.stackexchange",
"id": 27893,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linked-list, pointers",
"url": null
} |
• First, you may want to know that in Mathjax, $f'(a)$ produces $f'(a)$ and $$f'(a)$$ produces $$f'(a)$$. – Surb Apr 25 '18 at 5:36
• So let $c$ be another local Maxima or Minima then so in that case $f'(c) = 0$ and $(c-b)(c-a) = 0$ solving this we get $c=b$ or $c=a$ which means only Maxima or Minima we can have is $a$ or $b$ and when $a \gt b$ $a$ is local minima and $b$ is local Maxima and when $b \gt a$ $a$ is Maxima and $b$ is minima(which I have proven in the answer). So in either case we have a unique Maxima and Minima – Apurv Apr 25 '18 at 8:07
• since $f'$ has only two roots (a,b) then those are the only possible maxima and minima points, and since there exists one of each there is exactly one of each. (basically what @Apruv said but less technically) – Jason Apr 25 '18 at 8:09 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105342148366,
"lm_q1q2_score": 0.8336840160071404,
"lm_q2_score": 0.8539127529517044,
"openwebmath_perplexity": 312.64899289648474,
"openwebmath_score": 0.9985724091529846,
"tags": null,
"url": "https://math.stackexchange.com/questions/2751801/if-fx-is-differentiable-in-mathbbr-a-b-in-mathbbr-a-neq-b-such"
} |
java, algorithm, tree, data-mining
return true;
}
}
return false;
}
/**
* Converts a number integer array into a
* {@link net.coderodde.datamining.lottery.LotteryRow}.
* @param numbers the raw number array in ascending order.
* @return the lottery row with exactly the same numbers as in
* {@code numbers}.
*/
private LotteryRow convertNumbersToLotteryRow(int[] numbers) {
LotteryRow lotteryRow = new LotteryRow(this.lotteryConfiguration);
for (int number : numbers) {
lotteryRow.appendNumber(number);
}
return lotteryRow;
}
private int[] getInitialNumbers() {
int lotteryRowLength = lotteryConfiguration.getLotteryRowLength();
int[] numbers = new int[lotteryRowLength];
for (int i = 0, number = 1; i < lotteryRowLength; i++, number++) {
numbers[i] = number;
}
return numbers;
} | {
"domain": "codereview.stackexchange",
"id": 38101,
"lm_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, algorithm, tree, data-mining",
"url": null
} |
java, enum
return null;
}
protected static String getLocalString(DataFlowEnum dataFlowType) {
String prefix = dataFlowType.equals(DataFlowEnum.RECO) ? DataFlowEnum.RECO.value() : DataFlowEnum.UNRECO
.value();
return prefix + LOCAL_STRING;
}
protected static String getRemoteString(DataFlowEnum dataFlowType) {
String prefix = dataFlowType.equals(DataFlowEnum.RECO) ? DataFlowEnum.RECO.value() : DataFlowEnum.UNRECO
.value();
return prefix + REMOTE_STRING;
}
private static final String LOCAL_STRING = ourlocation.toLocalString();
private static final String REMOTE_STRING = ourlocation.toRemoteString();
private static final String getHostNameOfServer() {
try {
return InetAddress.getLocalHost().getCanonicalHostName().toLowerCase();
} catch (UnknownHostException ex) {
// logging error
}
return null;
} | {
"domain": "codereview.stackexchange",
"id": 13473,
"lm_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, enum",
"url": null
} |
javascript, functional-programming, event-handling
The can_move flag can be eliminated and replaced with check of pieceMoves.length.
board[highlightPos.y][highlightPos.x] indexing is repeated multiple times and worth to be extracted into a variable:
let boardItem = board[elPos.y][elPos.x];
See the full optimized approach:
function getElPosition(e){
return {x: Math.floor(event.clientX / 60),
y: Math.floor(event.clientY / 60)};
} | {
"domain": "codereview.stackexchange",
"id": 36888,
"lm_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, functional-programming, event-handling",
"url": null
} |
Think of this as to the various kinds of triangular: exponents rules ; exponents calculator Simplify..., world-class education to anyone, anywhere truly be pictorial do on powers and we will use! For this concept the pattern: this problem has a table with various of. Terms, and other study tools a power you 'll always get 1 term parentheses! Sufficiency format exponent indicates repeated multiplication of the positive exponents, be sure include... At Polymathlove.com c ) ( 3 x 2 ) ( 3 ) nonprofit.! 8 worksheets found for this concept how to reassemble the properties of exponents match Up.docx their. Particular with exponents to discuss how to reassemble the properties ( MP3 ) any time you actually have to assistance. Provided space the values the user is asked to fill in the blanks with the same base, exponents... To review properties of integer exponents ) our mission is to provide a free world-class... = xn+m ⋅ x m = x 0. x 0 = 1 x. With assigned partners on property of exponents - | {
"domain": "trinitariasmallorca.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9621075701109192,
"lm_q1q2_score": 0.811917868435894,
"lm_q2_score": 0.8438951045175643,
"openwebmath_perplexity": 1270.9053218679683,
"openwebmath_score": 0.6059345602989197,
"tags": null,
"url": "http://trinitariasmallorca.org/bedspreads-and-xetifo/8aec1f-properties-of-exponents"
} |
computational-chemistry, density-functional-theory, dispersion-correction
Comparing un-corrected PBE, B3LYP, and ωB97X single-point energies to DLPNO-CCSD(T) illustrate a significant effect. The uncorrected median R2 values drop by ~0.12, and the median Spearman correlations drop by ~0.08. For example, the median R2 of B3LYP / TZ drops from 0.920 to 0.706 without the D3BJ dispersion correction.
The metric here is the correlation between a method (i.e. B3LYP) with the DLPNO-CCSD(T) energies.
I'll look to see if there's ever a case where the dispersion correction does worse. But there are many, many papers illustrating that conformer energetics are dominated by non-bonded interactions .. which are improved with dispersion-corrected density functional methods.
Your methodology seems solid, although if you want good energy evaluations of different conformers, I'd consider either RI-MP2 or DLPNO-CCSD(T) single-points. Our timings in the paper show that RI-MP2 can be about as fast as hybrid DFT methods, but more accurate at ranking conformers. | {
"domain": "chemistry.stackexchange",
"id": 13271,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-chemistry, density-functional-theory, dispersion-correction",
"url": null
} |
ros-humble, ros2-control, gazebo-ros2-control
Most notable is the following line: [gzserver-2] [WARN] [1710962514.824922049] [gazebo_ros2_control]: Skipping joint in the URDF named 'joint1' which is not in the gazebo model. I am assuming this is the reason why the JointStateBroadcaster and the JointTrajectoryController are not able to load. However, I am confused as to why Gazebo does not like my URDF. The fully-formed URDF that is generated at launch time is as follows:
<robot name="linear_slider">
<!-- World link -->
<link name="world"/>
<!-- ================== -->
<!-- Properties -->
<!-- ================== -->
<!-- ================== -->
<!-- Materials -->
<!-- ================== -->
<material name="alpha_black">
<color rgba="0.6 0.6 0.6 1"/>
</material>
<material name="red_v">
<color rgba="1 0 0 1"/>
</material>
<!-- ================== -->
<!-- Links -->
<!-- ================== -->
<!-- base_link -->
<link name="base_link">
<visual> | {
"domain": "robotics.stackexchange",
"id": 39074,
"lm_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-humble, ros2-control, gazebo-ros2-control",
"url": null
} |
All the ingredients are here, but the flow of the argument is not optimal. A smooth proof of the claim would begin with "Assume the set $S:=\gamma\cap{\mathbb Z}^2$ contains $100$ elements. Then $\ldots$", or it should begin with "Assume the radius of $\gamma$ is neither an integer nor $\sqrt{2}$ times an integer. Then $\ldots$".
The essential point (which does not come out clearly in your argument) is the following: The group of symmetries of $S$ is the dihedral group $D_4$, which is of order $8$. Since $100$ is not divisible by $8$ this action has nontrivial fixed points, i.e. points on the lines $x=0$, $y=0$, $y=\pm x$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534316905262,
"lm_q1q2_score": 0.8527130260838068,
"lm_q2_score": 0.8688267813328977,
"openwebmath_perplexity": 149.47178269752217,
"openwebmath_score": 0.957487940788269,
"tags": null,
"url": "http://math.stackexchange.com/questions/160723/radius-either-integer-or-sqrt2-cdotinteger"
} |
Life is very similar to a boxing ring.
Defeat is not final when you fall down…
It is final when you refuse to get up and fight back!
1 Kudos = 1 thanks
Nikhil
Retired Moderator
Joined: 10 May 2010
Posts: 823
### Show Tags
12 Aug 2013, 09:22
1
KUDOS
nikhil007 wrote:
EvaJager wrote:
rphardu wrote:
Is a > c?
(1) b > d
(2) ab2 – b > b2c – d
(1) and (2) together:
Adding the two inequalities side-by-side we obtain $$ab^2-b+b>b^2c-d+d$$ or $$b^2(a-c)>0$$, which means necessarily $$a-c>0$$ or $$a>c.$$
Sufficient.
I don't understand the solution beyond this part...$$b^2(a-c)>0$$
as per me by dividing both sides of equation by $$b^2$$ we are assuming value of B is not equal 0, else it will be 0/0 which is not defined. so how is this correct?
From (1) and (2) we see $$b^2(a-c)>0$$
Since LHS >0 we must have $$b =! 0$$ and$$a > c$$
as if $$b = 0$$ then LHS = 0 .
_________________
The question is not can you rise up to iconic! The real question is will you ? | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534344029238,
"lm_q1q2_score": 0.8692060441875746,
"lm_q2_score": 0.8856314662716159,
"openwebmath_perplexity": 3311.3609703447137,
"openwebmath_score": 0.8273312449455261,
"tags": null,
"url": "https://gmatclub.com/forum/is-a-c-137240.html"
} |
There is a combinatorial interpretation. Consider the collection of all binary sequences of length $$n+1$$ with at least one $$1$$ (call this set $$E$$). There are $$2^{n+1}-1$$ such sequences because only $$0...0$$ isn't. Now let $$E_j$$ be the set of binary sequences of length $$n+1$$ such that the first $$1$$ is in the $$j$$ th component for $$j=1,\dotsc, n+1$$. Then $$|E_j|=2^{n+1-j}$$. Then the $$(E_j)$$ partition $$E$$ and we have that $$1+2+2^2+\dotsb+2^n=\sum_{j=1}^{n+1}2^{n+1-j}=2^{n+1}-1.$$ Alternatively consider the telescoping sum: $$\sum_{k=0}^n 2^{k}=\sum_{k=0}^n (2^{k+1}-2^k)=2^{n+1}-1.$$
Another famous approach is to count the $$2$$-player games to determine a winner among $$2^{n+1}$$ people. It's $$2^{n+1}-1$$, the number of people to eliminate. It's also $$2^n$$ people eliminated in the first round, halving each round until we reach the final.
• Very beautiful and efficient proof ! – projetmbc Oct 23 '20 at 9:57 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429147241161,
"lm_q1q2_score": 0.8540674336977512,
"lm_q2_score": 0.8670357615200475,
"openwebmath_perplexity": 413.88806344814725,
"openwebmath_score": 0.7393096685409546,
"tags": null,
"url": "https://math.stackexchange.com/questions/1990137/the-idea-behind-the-sum-of-powers-of-2/1990146"
} |
ros, husky, build-from-source
Edit: In response to your comment.
It is probably best to install the core ROS system from APT, and then checkout only the ones you need to customize from source in an overlay. In catkin, you should not manually modify the environment variables like ROS_PACKAGE_PATH / LD_LIBRARY_PATH, but rather make sure you have sourced your underaly (the core install in /opt/ros/hydro/setup.bash) before invoking catkin_make on your overlay with the source packages for the first time. Even if you want to build everything from source, I would still advice to install the core pacakges in an underlay workspace, then create a second overlay workspace for development. Else configuratoin/compilation will be slow and you cannot use catkin_make due to some non-catkin packages.
You should follow the tutorial at http://www2.isr.uc.pt/~embedded/events/HRATC2014/Simulator.html. Which packages on top of the three in the hratc2014_framework.rosinstall do you want to install from source exactly?
Edit 2: | {
"domain": "robotics.stackexchange",
"id": 17507,
"lm_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, husky, build-from-source",
"url": null
} |
c#
I feel like there could be a better way to merge implementations
It is absolutely fine to combine them this way, although it could be generalized to an Enumerable to be able to log to any amount of ILogger implementations, not just two.
public class MultiLogger : ILogger
{
private IEnumerable<ILogger> Loggers;
public MultiLogger(IEnumerable<ILogger> loggers) {Loggers = loggers;}
public void Log(LogType type, string message) {
foreach (var logger in Loggers) logger.Log(type, message);
}
} | {
"domain": "codereview.stackexchange",
"id": 37348,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#",
"url": null
} |
electromagnetism, everyday-life
(image from this question)
Each horizontal reluctance models a paper clip. Unlike typical electrical circuits, magnetic circuits are "leaky": magnetic flux doesn't remain confined to the paper clips. Magnetic field lines leak out and return to the magnet through the air. This is modeled by the vertical reluctances in the figure.
As you can imagine, as you add more paper clips to the chain, the magnetic flux in the last paper clips gets lower because of leakage flux. The force on the last paper clip is related to the flux in the last link. More accurately, the force is related to how much the total magnetic energy (outside the permanent magnet) increases as you add another paper clip. This energy is analogous to electrical power dissipated in the ladder. The longer the chain, the lower the change in energy and the lower the force on the last paper clip. | {
"domain": "physics.stackexchange",
"id": 72631,
"lm_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, everyday-life",
"url": null
} |
c++, strings, c++20
constexpr drop_last_while_view(V base, Pred pred)
requires std::ranges::bidirectional_range<V>
: _begin{std::ranges::begin(base)}
, _end{std::ranges::end(base)}
{
while ((_end != _begin) and std::invoke(pred, *std::ranges::prev(_end)))
--_end;
}
// Forward iterator version left as an exercise for the reader!
//constexpr drop_last_while_view(V base, Pred pred) { ??? }
constexpr auto begin() const { return _begin; }
constexpr auto end() const { return _end; }
private:
std::ranges::iterator_t<V> _begin;
std::ranges::iterator_t<V> _end;
};
template <typename R, typename Pred>
drop_last_while_view(R&&, Pred) -> drop_last_while_view<std::views::all_t<R>, Pred>;
Same idea for drop_suffix_view. Then your function is:
auto rtrim(std::string& str, std::string_view pattern) -> std::string&
{
auto const is_space = [](auto c) { return std::isspace(c); } | {
"domain": "codereview.stackexchange",
"id": 45252,
"lm_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++, strings, c++20",
"url": null
} |
javascript, react.js
render(){
console.log('hi')
return(
<div className="calendar-container">
<Arrows {...this.props}{...this.state} grabCityState={this.grabCityState} getCustForm={this.props.getCustForm} getForm={this.props.getForm} increaseDays={this.increaseDays} decreaseDays={this.decreaseDays} />
<div className="routeInfo">
{this.state.fiveDayView.map(function(days, i){
return <div className="days" key={i}>
<div>
<div className='month'>
<div id='day-title-one'><h3>{format(days, 'ddd')}</h3></div>
<div id='day-title-two'><p>{format(days, 'D')}</p></div>
</div>
{this.pickupDeliveryMatchDate().map(function(day, j){ | {
"domain": "codereview.stackexchange",
"id": 36282,
"lm_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, react.js",
"url": null
} |
error-correction, fault-tolerance, terminology-and-notation
...
Emphasis mine. The Raymond Laflamme code is highlighted as being fault tolerant. What does fault tolerant mean? I thought all error correction schemes were meant to make a quantum computer fault tolerant. But the grammar in this sentence makes it sound like "fault tolerant" is being used in some technical way to apply to error correcting codes. If so, what is the definition of a fault tolerant quantum error correction code? And what are examples of non-fault-tolerant and fault-tolerant error correction codes? Fault-tolerance isn't really a property of the code, more of the operations that perform encoded logic and syndrome measurement. A good working definition of fault-tolerance for a circuit implementing either of those is
one for which a single operational error can only
produce one error within a single encoded block | {
"domain": "quantumcomputing.stackexchange",
"id": 4891,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "error-correction, fault-tolerance, terminology-and-notation",
"url": null
} |
algorithms, dynamic-programming
My attempt:
Let $ A = [ a_1,a_2,...,a_n ] $ be our initial list where for all $ 1 \leq i \leq n $, $i$ is the $ith$ person and $ A[i] $ is the number of chocolates the $ ith $ person has.
Denote $ chocolate_{list} = [ 1,2,5] $. | {
"domain": "cs.stackexchange",
"id": 18911,
"lm_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
} |
black-holes, ads-cft
3) Define new null coordinates in order to avoid the coordinate singularity in the event horizon;
4) Reparametrize the null coordinate in order to put it in a finite diagram.
In the case of AdS-Schwarzschild spacetime it is a little bit of hard work:
1) We have a metric of type $g_{\mu \nu }= (-f, f^{-1},r^2,r^2\sin^2 \theta )$ and $ f = 1- \frac{2m}{r} + c^2r^2$, $c$ meaning the inverse of the AdS curvature radio.
Now, as long as $f$ has always a real positive and two imaginary roots, we have
\begin{eqnarray}
r_* = \int \frac{1}{f}dr = \frac{(2r_+^2 + 4p)\arctan \left(\frac{r_++2r}{\sqrt{4p-r_+^2}}\right) + r_+ \sqrt{4p-r_+^2} \ln \left( \frac{(r-r_+)^2}{r^2+r_+r+p} \right)}{2c^2(2r_+^2+p)\sqrt{4p-r_+^2}} + constant
\end{eqnarray}
in which $r_+$ is the event horizon ($f(r_+)=0$) and $p=r_+^2+\frac{1}{c^2}= \frac{2m}{c^2r_+}$. (Assume: $constant \equiv C$).
2) The usual null-coordinates, $u$ and $v$ written as
\begin{eqnarray}
du=dt-dr_* \\
dv=dt+dr_*
\end{eqnarray}
lead the metric to | {
"domain": "physics.stackexchange",
"id": 81465,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-holes, ads-cft",
"url": null
} |
image-processing, opencv, hough-transform
if (abs(center2.x - x) < 10 && abs((center2.y - y) < 10) && abs(radius - radius2) < 20) color = Scalar(0, 255, 0);
circle(circleImage, center2, 3, color, -1, 8, 0);
circle(circleImage, center2, radius2, color, 3, 8, 0);
circle(origImg, center2, 3, color, -1, 8, 0);
circle(origImg, center2, radius2,color, 3, 8, 0);
} | {
"domain": "dsp.stackexchange",
"id": 4863,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, opencv, hough-transform",
"url": null
} |
ros, c++, ros-melodic, print
Value 2: (gtsam::Pose2)
(2, -3.02085e-12, -7.54546e-13)
Value 3: (gtsam::Pose2)
(4, -3.9288e-11, 1.5708)
Value 4: (gtsam::Pose2)
(4, 2, 3.14159)
Value 5: (gtsam::Pose2)
(2, 2, -1.5708)
Originally posted by Spyros with karma: 51 on 2021-02-26
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by hunterlineage1 on 2023-07-21:
Is there a way to send gtsam::Values object, in your case the variable result, as a ROS message between nodes? I looked at creating custom ROS messages but I am confused on how to do this with gtsam::Values object and gtsam::NonlinearFactorGraph objects. | {
"domain": "robotics.stackexchange",
"id": 36139,
"lm_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, c++, ros-melodic, print",
"url": null
} |
c++, recursion, lambda, c++20
Let’s look at those 3 “tricky”, starting with the easiest.
something_something_result_t<Range, F>
In your existing 3 functions, the result types are as follows:
Template parameters
decltype(input)
Result
<class T, std::size_t S>
array<T, S>
array<R, S>
<template<class...> class Container, class... Ts>
Container<Ts>
Container<R>
<class T>
boost::multi_array<T::element, N>
boost::multi_array<T::element, N>
And your type trait pretty much writes itself:
template <typename F, typename T>
struct something_something_result;
template <typename F, typename T, std::size_t S>
struct something_something_result<std::array<T, S>, F>
{
using type = std:::array<
std::indirect_result_t<F, std::iterator_t<std::array<T, S>>>,
S
>;
}; | {
"domain": "codereview.stackexchange",
"id": 40197,
"lm_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++, recursion, lambda, c++20",
"url": null
} |
c++, performance, search, binary-search, time-limit-exceeded
int n,q,vec[100000];
int inicio,final,medio,busca;
int cont;
int busquedabinaria()
{
//busqueda binaria
std::sort(vec,vec+n);
inicio=0;
final=n-1;
medio=(inicio+final)/2;
while(inicio<=final)
{
if(vec[inicio]==busca)
return inicio;
if(vec[medio]==busca)
return medio;
if(vec[final]==busca)
return final;
medio = (inicio + final) / 2;
if (vec[medio] > busca)
final = medio - 1;
else if (vec[medio] < busca)
inicio = medio + 1;
// found
}
return -1;
}
int main()
{
freopen("in.txt", "rt",stdin);
freopen("out.txt", "wt",stdout);
while (scanf("%d %d\n",&n,&q)!=EOF && (n!=0 || q!=0) )
{
for (int i=0;i<n;i++)
{
scanf("%d\n",&vec[i]);
}
printf("CASE# %d:\n",cont+1);
cont++;
while(q--)
{
scanf("%d\n",&busca); | {
"domain": "codereview.stackexchange",
"id": 4814,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, search, binary-search, time-limit-exceeded",
"url": null
} |
species-identification, mushroom
Title: Garden Mushroom Identification
Could someone please identify this mushroom?
Found in a garden situated in a mild Western European country. Looks like shaggy ink cap, Coprinus comatus, to me.
Blacksmith37's answer suggests that shaggy mane is the usual common name. I hadn't heard that name until I looked at the Wikipedia page. In the U.K. it is shaggy ink cap, inkytop, inkhorn or lawyer's wig.
Update
This is a good general source of information. Also comatus (Latin) means hairy. | {
"domain": "biology.stackexchange",
"id": 7419,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "species-identification, mushroom",
"url": null
} |
digital-communications, power-spectral-density, random-process, stationary
Title: Converting a non-stationary random process into a WSS process by adding a random phase Here is an example where this method has been implemented.
We were trying to calculate the spectrum of a transmitted signal(Random signal/weighted pulse)
The auto correlation function of the pulse which is not WSS because it is dependent on t:
We associated a random variable(which is the delay) with an uniform PDF with the signal:
PDF of the delay/the variable is:
I was unable to grasp the concept behind it, probably my basics are a bit rusty. | {
"domain": "dsp.stackexchange",
"id": 7032,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "digital-communications, power-spectral-density, random-process, stationary",
"url": null
} |
ros-melodic
But it is able to detect tags that are not required.
[ WARN] [1689749511.600538788]: Requested description of standalone tag ID [26], but no description was found...
My config files:
tags.yaml
standalone_tags:
[
{id: 0, size: 0.4},
{id: 1, size: 0.4},
{id: 2, size: 0.4},
{id: 3, size: 0.4},
{id: 4, size: 0.4},
{id: 5, size: 0.4},
{id: 6, size: 0.4},
{id: 7, size: 0.4},
{id: 8, size: 0.4},
{id: 9, size: 0.4},
{id: 10, size: 0.4},
{id: 11, size: 0.4},
{id: 12, size: 0.4},
{id: 13, size: 0.4},
{id: 14, size: 0.4},
{id: 15, size: 0.4},
{id: 16, size: 0.4},
{id: 17, size: 0.4},
{id: 18, size: 0.4}
] | {
"domain": "robotics.stackexchange",
"id": 38460,
"lm_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
} |
3 ) nonprofit organization 's Formula the. Domains *.kastatic.org and *.kasandbox.org are unblocked ( \log_ { e \sin... So if I 'm taking the indefinite integral, would n't it just be equal to this derivatives! Substitution is the chain rule rule that you remember from, or hopefully remember, from differential.! Enable JavaScript in your browser be if we just do the reverse procedure differentiating. Antiderivative of f integrand is the counterpart to the power of a function the 80/20 rule, it 's to... A rule of thumb, whenever you see a function the indefinite integral, would n't just... G ' ( x ) ) g ' ( x ) dx=F ( g ( x dx=F. Seeing this message, it 's hard to get too far in calculus such.... At z and ending at t, multiplying derivatives along each path rule of.! Gives us a way to find integrals of functions 1 Carry out each of the rule... 'S hard to get too far in calculus functions such as u = 9 - 2. Be equal to this Madas created by T. Madas created by T. Madas created T.... Well | {
"domain": "com.br",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971992481016635,
"lm_q1q2_score": 0.8141603003994349,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 765.4364274888999,
"openwebmath_score": 0.9885673522949219,
"tags": null,
"url": "http://www.blog.formica.com.br/vegan-express-vbdch/dc6a0e-integration-chain-rule"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.