text stringlengths 1 1.11k | source dict |
|---|---|
python, python-3.x, natural-language-processing
if next_is_vowel and not last_was_vowel and syllab:
syllabs.append(syllab)
syllab = ""
keep_index = let_ind
elif next_is_vowel and word[let_ind] not in self.vowels and syllab:
syllabs.append(syllab)
syllab = ""
keep_index = let_ind
syllab += word[let_ind]
if word[let_ind] in self.vowels:
last_was_vowel = True
else:
last_was_vowel = False | {
"domain": "codereview.stackexchange",
"id": 31908,
"lm_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, natural-language-processing",
"url": null
} |
wavelet, time-frequency, visualization, cwt, scattering
Pseudocode
Unoptimized implementation is fairly straightforward; showing only up to spin up, unaveraged:
# first order time scattering
U1 = []
for p1t in psi1_t:
U1.append(abs(conv(x, p1t)))
# joint scattering
U2 = []
for p2t in psi2_t:
# second order time scattering
U2_tm = []
for u1 in U1:
U2_tm.append(conv(u1, p2t))
U2_tm = array(U2_tm) # shape == (freq, time)
# frequential scattering
for p1f in psi1_fr_up:
U2.append(abs(conv(U2_tm, p1f, axis=-2))) | {
"domain": "dsp.stackexchange",
"id": 10587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "wavelet, time-frequency, visualization, cwt, scattering",
"url": null
} |
ros, ros-melodic, raspberrypi, ros-ip, network-setup
Comment by hashirzahir on 2020-05-02:
Hi do you mind updating how the 150mb/s bandwidth was derived? I could see various 40mb/s topics in your terminal screenshot, but it is not clear which topics they were referring to. I'm guessing its mostly pointcloud2? For your real use case what topics would you need to use from each of the 6 cameras? The ROS network is setup such that the data will not be transferred over the network unless someone is "subscribing" to the data, in this case your rostopic bw command was subscribing. Otherwise, if you were to only subscribe to image feed without pointcloud, I'm guessing the network usage may not be so high. You can also configure the realsense-ros driver to not publish certain topics. That reduces the CPU usage.
Comment by darshb34 on 2020-05-13:
the 150mb/s was obtained by adding bw of /depth_img + /infra1_img + /pointcloud .
Yes I modified the driver to not published compressed, theora and compressedDepth, and infra2 image topic. | {
"domain": "robotics.stackexchange",
"id": 34850,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, raspberrypi, ros-ip, network-setup",
"url": null
} |
quantum-mechanics, particle-physics, nuclear-physics, weak-interaction, parity
a transition $2^+ \to 1^+$ is mostly “magnetic dipole,” $M1$, but winds up having strong contributions from “electric quadrupole,” $E2$.
You’ve probably also learned, studying the hydrogen atom, that the states with various quantum numbers are also energy eigenstates, whose energies are
$$ E_n = \frac{\alpha m c^2}{n^2}$$
where $\alpha$ is the fine-structure constant, $m$ is the reduced mass of your atom (the electron mass, to four significant figures), and $n$ is the principal quantum number.
Unfortunately for your intro quantum notes (but fortunately for life), the energy eigenstate thing is a lie.
The energy-time version of the uncertainty principle,
$$
\Delta E \Delta t \gtrsim \hbar
$$ | {
"domain": "physics.stackexchange",
"id": 74673,
"lm_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, particle-physics, nuclear-physics, weak-interaction, parity",
"url": null
} |
quantum-gate, quantum-advantage, google-sycamore
Is there any specific reason for not using text-book gates such as $\textrm{CZ}$ (controlled-Z) ?
Is it because of technical issues, such as the natural choice for transmon qubits not being these gates?
Or is it because of the complexity of the algorithm that is needed to
simulate these gates?
These are actually very, very good questions, and while the answer is subtle, the answer is in fact yes for all three questions.
I will start by pointing out that page 3 of the paper says:
The implementation of high-fidelity ‘textbook gates’ natively, such as
CZ or iSWAP, is work in progress.
Therefore the chips cannot yet do the text-book gates CZ or iSWAP with the high-fidelities demonstrated in the experiment to claim quantum supremacy.
The details about the reason for this, are buried all the way down to pages 15-16 of the Supplementary Information document. They say: | {
"domain": "quantumcomputing.stackexchange",
"id": 1532,
"lm_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-gate, quantum-advantage, google-sycamore",
"url": null
} |
space enclosed by some closed boundary, for example, the space that a substance (solid, liquid, gas, or plasma) or shape occupies or contains. For more tips, including examples you can use for practice, read on!. Spherical definition, having the form of a sphere; globular. How fast is the balloon's radius - Answered by a verified Math Tutor or Teacher We use cookies to give you the best possible experience on our website. An hexahedron is a six-sided polyhedron. The volume of a spherical hot air balloon expands as the air inside the balloon is heated. 7 years ago. To know how long it would take for the balloon to empty fully, first we have to find the volume of air in the ballon. So, volume of the spherical bubble at that instant = V = (4 / 3) * π * (r^3) And, outer surface area of the spherical bubble at that instant = A = 4 * π * (r^2). 101 3 - 100 3) cm 3 = 63487. Circumference to Volume Calculator. Write a formula for. Spherical definition, having the form of a sphere; globular. No | {
"domain": "rakumanu.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419690807408,
"lm_q1q2_score": 0.8303641861309318,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 448.4237867004272,
"openwebmath_score": 0.8477767109870911,
"tags": null,
"url": "http://wfab.rakumanu.it/spherical-balloon-volume-formula.html"
} |
ds.algorithms, graph-theory, graph-algorithms, planar-graphs, embeddings
Title: Fast deletion / contraction in combinatorial embedding I wonder if there is a sublinear algorithm to make deletion or contraction of an edge in a combinatorial embedding of, lets say, planar graph?
Since in combinatorial embedding we have to maintain vertices of G and G* at the same time, taking in account that contraction in the primal is deletion in the dual, it's sufficient only to make deletions, updating primal permutation according to dual and vice-versa. But obvious way to do it is just recompute them, which takes linear time. Can we do any better? | {
"domain": "cstheory.stackexchange",
"id": 1744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ds.algorithms, graph-theory, graph-algorithms, planar-graphs, embeddings",
"url": null
} |
share their knowledge, and build their careers. A unique aspect of Cartesian coordinates is that the unit vectors i and j always point in the same direction and are independent of each other. X,Y,Z Cartesian coordinates have an origin at the centre o f the ellipsoid. In many problems, spherical polar coordinates are better. For a list of properties, see PolarAxes Properties. ALWAYS use one of these three expressions of a position vector!! Note that in each of the three expressions above, we use Cartesian base vectors. Cartesian / Rectangular to Polar Conversion The java code converts the Cartesian coordinate values (x,y) into polar coordinatevalues (r,Θ). For example, x, y and z are the parameters that define a vector r in Cartesian coordinates: r =ˆıx+ ˆy + ˆkz (1) Similarly a vector in cylindrical polar coordinates is described in terms of the parameters r, θ and z since a vector r can be written as r = rrˆ+ zˆk. 980878°, \phi = 40. Obtain the corresponding wavefunction. Furthermore, | {
"domain": "clandiw.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683484150417,
"lm_q1q2_score": 0.8432972016158118,
"lm_q2_score": 0.853912747375134,
"openwebmath_perplexity": 486.12006461400983,
"openwebmath_score": 0.9364537000656128,
"tags": null,
"url": "http://clandiw.it/fvql/conversion-of-cartesian-coordinates-to-polar-coordinates-pdf.html"
} |
python, logging, meta-programming, color
xs_describe_flattened: DescribeResult(nobs=15, minmax=(4, 18), mean=11.0, variance=20.0, skewness=0.0, kurtosis=-1.210714285714286)
xs_shape: (5, 3)
xs_squared: array([[ 16, 25, 36],
[ 49, 64, 324],
[ 81, 100, 121],
[144, 169, 196],
[225, 256, 289]])
xs_squared_first_item: array([16, 25, 36])
xs_squared_len: 5
xs_squared_describe: DescribeResult(nobs=5, minmax=(array([16, 25, 36]), array([225, 256, 324])), mean=array([103. , 122.8, 193.2]), variance=array([ 6883.5, 8354.7, 14054.7]), skewness=array([ 0.51788093, 0.47995029, -0.19190912]), kurtosis=array([-1.08482927, -1.10598554, -1.39461119]))
xs_squared_describe_flattened: DescribeResult(nobs=15, minmax=(16, 324), mean=139.66666666666666, variance=9974.666666666668, skewness=0.4476084348250222, kurtosis=-1.0493737094260638)
xs_squared_shape: (5, 3)
ys: array([ 9.4, 10.4, 13.2])
ys_first_item: 9.4
ys_len: 3 | {
"domain": "codereview.stackexchange",
"id": 44363,
"lm_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, logging, meta-programming, color",
"url": null
} |
When $r=2,$ $$(2)^2\frac{dh}{dt}+2(2)(\frac{2}{100})(\frac{10}{100})=0$$ $$\frac{dh}{dt}=-0.002 \mathrm{m/sec}$$
But the answer given in my book is $-0.0005$ m/sec.
• How did I manage to misspell does as dis? – TRiG Jun 20 '17 at 14:37
The error in your method is that you found the height at the moment when $r=1$ and used it to find the change in height when $r=2$, however since the height is changing this doesn't work. It's easier to find a fixed value, i.e. the volume, as I've done below. We have
$$h = \frac{V}{\pi r^2} \implies \frac{dh}{dt} = -\frac{2V}{\pi r^3} \frac{dr}{dt}$$
substitute in $r=1$ and $\frac{dh}{dt} = -0.004$
$$-0.004 = -\frac{2V}{\pi (1)^3} 0.1 \implies \frac{2V}{\pi} = 0.04$$
now use this volume when $r=2$
$$\frac{dh}{dt} = -\frac{2V}{8 \pi } 0.1 = -\frac{2( 0.02\pi )}{8\pi}0.1 = -0.0005$$
The problem is that you took the thickness at r=1m and considered it the thickness at r=2m. You need to calculate the new thickness at r=2m from the volume. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018369215507,
"lm_q1q2_score": 0.8209499195023665,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 327.8852439973847,
"openwebmath_score": 0.8884116411209106,
"tags": null,
"url": "https://math.stackexchange.com/questions/2329750/how-fast-does-a-circular-disc-of-spilled-oil-spread"
} |
physical-chemistry, viscosity
I know that I should use the equations:
$$x^2 = 2Dt \tag{1}$$
$$D = \frac{kT}{6πηa} \tag{2}$$
Where if I plot $x^2$ against $t,$ I can calculate the viscosity from the slope $\displaystyle\frac{2kT}{6πηa}.$ However, what I don't understand is how to calculate $x^2.$
I tried taking the average of the two particles in direction $x$ and squaring the result, but that doesn't give me the right answer. I also tried taking the average of $x^2$ of the two particles, but once again I get the wrong answer.
How should I calculate $x^2?$ The basic idea here is that the spherical particles, each of radius a, are being bounced around via Brownian motion. So the two relevant equations are
$$r(t)^2 = 2Dt \tag{1}$$
$$D = \frac{kT}{6πηa} \tag{2}$$
Note that the first equation uses r(t) rather than x, to avoid needless confusion with the x and y cartesian coordinates of the spherical particles. | {
"domain": "chemistry.stackexchange",
"id": 14206,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, viscosity",
"url": null
} |
photons
Title: Photon-photon scattering threshold wiki says:
Photon–photon scattering limits the spectrum of observed gammas to a
photon energy below 80 TeV, that is, a wavelength of more than ~
1.5×10−20 m. The other photon is one of the many photons of the cosmic microwave background. In the frame of reference where the invariant
mass of the two photons is at rest, both photons are gammas with just
enough energy to pair-produce an electron–positron pair. | {
"domain": "physics.stackexchange",
"id": 50724,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photons",
"url": null
} |
general-relativity, black-holes, gravitational-waves, event-horizon, information
it seems the 2 BHs lost mass, and with it event surface area, entropy, and information. | {
"domain": "physics.stackexchange",
"id": 29165,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, black-holes, gravitational-waves, event-horizon, information",
"url": null
} |
vba, excel
.Range("B311") = vbNullString
End If
.Range("B312") = tDBGrabRecord.CustomerBSA
End With
Case Is = "OutGoingCM"
With DATAENTRY
.Range("B408") = tDBGrabRecord.CustomerName
.Range("B409") = tDBGrabRecord.CustomerAddress
.Range("B410") = tDBGrabRecord.CustomerCityStateZip
If tDBGrabRecord.CustomerHomePhone = 0 Then
.Range("B411") = Format(tDBGrabRecord.CustomerCellPhone, "(###) ###-####")
ElseIf tDBGrabRecord.CustomerCellPhone = 0 Then
.Range("B411") = Format(tDBGrabRecord.CustomerHomePhone, "(###) ###-####")
ElseIf tDBGrabRecord.CustomerHomePhone = 0 And tDBGrabRecord.CustomerCellPhone = 0 Then
.Range("B411") = vbNullString | {
"domain": "codereview.stackexchange",
"id": 37442,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
php
With minimal effort, you can make this function even more generic (and re-usable). It would suffice to pass the defaults as third argument, and you can use this function as a generic pseudo-recursive getter:
/**
* @param \stdClass $car
* @param array $properties
* @param array $defaults
* @return mixed|bool
* @throws \InvalidArgumentException
*/
function getSubProperty(stdClass $obj, array $properties, array $defaults)
{
//make sure the size of both arrays match
$j = count($properties);
if (!$j || $j > count($defaults))
throw new \InvalidArgumentException(
sprintf(
'Default argument should contain at least %d values, instead saw %d',
$j,
count($defaults)
)
);
//call array_values on array arguments, to ensure numeric indexes
$current = $obj;
for ($i=0, $j=0;$i<$j;++$i)
{
if (isset($current->{$properties[$i]}))//given property exists | {
"domain": "codereview.stackexchange",
"id": 8759,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php",
"url": null
} |
c#, linq
else if (column.Equals("Publisher")) products = from p in products where p.Publisher.ToLower().EndsWith(actionValue) == action.AddOrKill select p;
else if (column.Equals("PublisherCode")) products = from p in products where p.PublisherCode.ToLower().EndsWith(actionValue) == action.AddOrKill select p;
else if (column.Equals("Custom1")) products = from p in products where p.Custom1.ToLower().EndsWith(actionValue) == action.AddOrKill select p;
else if (column.Equals("Custom2")) products = from p in products where p.Custom2.ToLower().EndsWith(actionValue) == action.AddOrKill select p;
else if (column.Equals("Custom3")) products = from p in products where p.Custom3.ToLower().EndsWith(actionValue) == action.AddOrKill select p;
else if (column.Equals("EanCode")) products = from p in products where p.EanCode.ToLower().EndsWith(actionValue) == action.AddOrKill select p;
} | {
"domain": "codereview.stackexchange",
"id": 70,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, linq",
"url": null
} |
ros, catkin, package, ros-hydro
In this configuration, it is not possible to run "catkin_make", it will stop with the following error:
Project 'Package_B' tried to find library 'libmylibrary.so'. The library is neither a target nor built/installed properly. Did you compile project 'Package_A'?
Why doesn't catkin see the dependency and build the library first, so that the other package can find it?
My only workaround at the moment is to remove the dependencies, build the library stand-alone, put the dependency back in and then build the rest. What am I doing wrong?
Thanks for your answers
Originally posted by psei on ROS Answers with karma: 318 on 2014-02-18
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 16994,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, catkin, package, ros-hydro",
"url": null
} |
vcf, bash, linux
## Print header
print $outFileHandle "$outFileName\tChrom\tPosition\tRef\tAlt\tTumorReadCount\t" .
"TumorVariantAlleleCount\tTumorReferenceAlleleCount\tNormalReadCount" .
"\tNormalVariantAlleleCount\tNormalReferenceAlleleCount\tVAF\n";
## Read all lines of the input file
while (<$inFileHandle>) {
## Skip headers
next if /^#/;
## Get VCF fields
my ($chrom, $pos, $name, $ref, $alt, $qual,
$filter, $info, $format, $values) = split(/\t/);
$info=~s/[^;]+=//g;
my @infoFields = split(/;/, $info);
print $outFileHandle (join "\t", $outFileName, $chrom, $pos, $ref, $alt,
$infoFields[12],$infoFields[25],
$infoFields[12]-$infoFields[25],
$infoFields[13],$infoFields[26],
$infoFields[13]-$infoFields[26],
$infoFields[27]) . "\n";
}
} | {
"domain": "bioinformatics.stackexchange",
"id": 1215,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vcf, bash, linux",
"url": null
} |
Amy painted a dartboard over a square clock face using the "hour positions" as boundaries.[See figure.] If $t$ is the area of one of the eight triangular regions such as that between 12 o'clock and 1 o'clock, and $q$ is the area of one of the four corner quadrilaterals such as that between 1 o'clock and 2 o'clock, then $\frac{q}{t}=$
$\text{(A) } 2\sqrt{3}-2\quad \text{(B) } \frac{3}{2}\quad \text{(C) } \frac{\sqrt{5}+1}{2}\quad \text{(D) } \sqrt{3}\quad \text{(E) } 2$
Problem 18
Al and Barb start their new jobs on the same day. Al's schedule is 3 work-days followed by 1 rest-day. Barb's schedule is 7 work-days followed by 3 rest-days. On how many of their first 1000 days do both have rest-days on the same day?
$\text{(A) } 48\quad \text{(B) } 50\quad \text{(C) } 72\quad \text{(D) } 75\quad \text{(E) } 100$
Problem 19
How many ordered pairs $(m,n)$ of positive integers are solutions to $$\frac{4}{m}+\frac{2}{n}=1?$$ | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429614552197,
"lm_q1q2_score": 0.8062363366870641,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 455.1392954739548,
"openwebmath_score": 0.6483288407325745,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=1993_AHSME_Problems&diff=prev&oldid=68926"
} |
python, pyqt
Therefore the event onStateChange is triggered twice when you check check_box2, which is logical.
I think you did a copy paste and the last should be check_box3. But your naming conventions are not intuitive, give your objects some more meaningful names, otherwise how are you going to tell the difference from your code.
If what you want is mutually exclusive checkboxes the implementation could be more straightforward. Personally I prefer to use radio buttons like in plain HTML because this is more intuitive (it is immediately obvious that only one answer is allowed).
First approach: a generic method that loops on the checkboxes in your form and unchecks all of them except the sender. Then you can simplify code and get rid of if/elif
Second approach: use QT built-in features. You could wrap your checkboxes in a QButtonGroup container. | {
"domain": "codereview.stackexchange",
"id": 38192,
"lm_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, pyqt",
"url": null
} |
ros, gazebo, simulation, world, model
https://youtu.be/g0k68n2qNIA
https://youtu.be/lyT6lPNSK-Q | {
"domain": "robotics.stackexchange",
"id": 37409,
"lm_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, gazebo, simulation, world, model",
"url": null
} |
biochemistry, cell-biology, botany, plant-physiology, photosynthesis
So I basically want to ask: Why does it seem that in this process the principles of chemistry are violated? From the link given by @Kendall | {
"domain": "biology.stackexchange",
"id": 5136,
"lm_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, cell-biology, botany, plant-physiology, photosynthesis",
"url": null
} |
machine-learning, deep-learning, recurrent-neural-networks, attention
Title: Factors that causing totally different outcomes from an exactly same model and datasets Here is a model that trains time series data in (batch, step, features) way.
I have kept the random state for train test split function the same. Every parameter below the same, running the model training yields different outcomes every time and the outcomes are drastically different.
What may be the factors that led to this? Regularization? | {
"domain": "ai.stackexchange",
"id": 2582,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, recurrent-neural-networks, attention",
"url": null
} |
navigation, ros2, turtlebot2, turtlebot, mocap-optitrack
Originally posted by Mike Scheutzow with karma: 4903 on 2022-10-10
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by stevemacenski on 2022-10-11:
AMCL and other global localizer‘s provide the map to odometry frame transformation. So really, all you need to do here is provide the same thing. If you have globally accurate localization from an external source, you may use that. So just don’t launch a AMCL and create a note which publishes that transform using your motion capture system data. Depending on the quality of the data, it may be advantageous to use a kalmon filter, so RL can provide that. But if filtering is not required, that should be sufficient. But conveniently RL does provide that transformation automatically when setup to provide that data. | {
"domain": "robotics.stackexchange",
"id": 37989,
"lm_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, ros2, turtlebot2, turtlebot, mocap-optitrack",
"url": null
} |
beginner, rust
fn find(query: &str, start: &OsStr) -> io::Result<Vec<PathBuf>> {
let start = PathBuf::from(start);
let mut dirs = VecDeque::from(vec![start]);
let mut result = Vec::new();
while let Some(dir) = dirs.pop_front() {
for entry in dir.read_dir()? {
let path = entry?.path();
if path.is_dir() {
dirs.push_back(path.clone());
}
if let Some(name) = path.file_name() {
if query.is_empty() || query == name {
result.push(path.clone());
}
}
}
}
Ok(result)
}
fn main() -> io::Result<()> {
let mut args = std::env::args().skip(1);
let query = args.next().unwrap_or(String::new());
let start = args.next().map(OsString::from).unwrap_or(OsString::from("."));
for path in find(&query, &start)? {
if let Some(p) = path.to_str() {
println!("{}", p);
}
}
Ok(())
} | {
"domain": "codereview.stackexchange",
"id": 31487,
"lm_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, rust",
"url": null
} |
homework-and-exercises, coordinate-systems, rotation
$$φ = sin^{-1}A_y$$
I would expect, then, that if I plug in an arbitrary vector for A, the result should be
$$\begin{bmatrix}x''\\y''\\z''\end{bmatrix} = \begin{bmatrix}0\\0\\1\end{bmatrix}$$
since the z'' axis in the new coordinate system should be co-linear with A. I'm getting something completely different though, so I've done something wrong along the way. For example, I tried an A vector of [0.6, -0.7, 0.3873] and got:
$$\begin{bmatrix}x''\\y''\\z''\end{bmatrix} = \begin{bmatrix}0.5047\\-0.7710\\0.3884\end{bmatrix}$$
Is my approach fundamentally wrong or am I just making a silly computational error? Instead of working with angles (which are very easy to mess up in 3D), I would just go directly to a transformation matrix. I had to solve a very similar problem to this when tracking charged particles through magnetic fields and all the angles and rotations kept messing me up (probably due to subtle sign errors). So, I went with pure linear algebra. | {
"domain": "physics.stackexchange",
"id": 17521,
"lm_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, coordinate-systems, rotation",
"url": null
} |
I'll be teaching vector calculus to mechatronics engineers, and I'd like to provide them with industrially relevant examples, especially of the use of vector fields. Mathematics at Dartmouth. Explore our catalog of online degrees, certificates, Specializations, & MOOCs in data science, computer science, business, health, and dozens of other. Accumulation & Functions Defined by Integrals or Thoughts on , my favorite equation. 05 Applications of Double Integrals 2/24/16. The Fundamental Theorem of Calculus, Part 2 is a formula for evaluating a definite integral in terms of an antiderivative of its integrand. Calculus on the Web was developed with the support of the National Science Foundation COW is a project of Gerardo Mendoza and Dan Reich Temple University. View Application Of Calculus In Real Life PPTs online, safely and virus-free! Many are downloadable. How to use the Definition of the Derivative Practice Problems. As an example, we could have a chemical reaction in a beaker start | {
"domain": "1upload.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130593124399,
"lm_q1q2_score": 0.8711198220083848,
"lm_q2_score": 0.8807970873650401,
"openwebmath_perplexity": 1150.4617944075264,
"openwebmath_score": 0.49587282538414,
"tags": null,
"url": "http://zveg.1upload.de/application-of-calculus-ppt.html"
} |
at a rate of 4 cubic feet per second. The volume of a spherical balloon grows at a rate of $100\ cm^3/s\$,what is the growing rate when the radius measures $50cm$. (1) The volume of the balloon increases with time t seconds according to the formula t V d d = (2 1)2 1000 t , t 0. Answer and Explanation: To find how fast the radius of a spherical balloon increases when the volume increases at a rate of {eq}\displaystyle 6 \ \rm in^3/min, {/eq} and the radius is 3 in,. The volume of the balloon is also changing, so you need a variable for volume, V. the radius starts out at 2 cm and increases 3 cm every second that the balloon is being inflated. //Supply these methods: // void addAir(double amount) adds the given amount of air //See this link for formulas for volume and surface area:. Now, to find the volume of a sphere-- and we've proved this, or you will see a proof for this later when you learn calculus. Problem A meteorologist is inflating a spherical balloon with a helium gas. Where | {
"domain": "comefaretradingonlinebft.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308810508339,
"lm_q1q2_score": 0.8008592313124419,
"lm_q2_score": 0.8104789018037399,
"openwebmath_perplexity": 339.69184886938785,
"openwebmath_score": 0.865911602973938,
"tags": null,
"url": "http://zjvs.comefaretradingonlinebft.it/spherical-balloon-volume-formula.html"
} |
general-relativity, energy, spacetime
Kasner vacua, describing quaint expanding universes without matter. In Kasner universes the expansion can never be isotropic, in fact if the volume overall is expanding with time at least one spatial direction will be contracting. | {
"domain": "physics.stackexchange",
"id": 23927,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, energy, spacetime",
"url": null
} |
organic-chemistry, reaction-mechanism, hydrolysis
Title: Mechanism of hydrolysis of acyl chlorides The following mechanism for acyl chloride hydrolysis was given by my professor : | {
"domain": "chemistry.stackexchange",
"id": 15343,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, reaction-mechanism, hydrolysis",
"url": null
} |
amateur-observing, history, night-sky
This "precession" shift causes all stars in the sky to shift their position very slightly from year to year and it's mostly not enough to notice in a single human lifetime ... but it is easily noticed when measured across thousands of years.
There are other more subtle cycles, but Precession is noticeable across large amounts of time (thousands of years). The position of the Sun in the sky at the equinoxes changes every year and this causes the Sun to appear to be moving across the zodiac over thousands of years. | {
"domain": "astronomy.stackexchange",
"id": 5603,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "amateur-observing, history, night-sky",
"url": null
} |
optics, visible-light, electromagnetic-radiation, refraction, variational-principle
Wavefront propagation
Then again, in another sense we can meaningfully talk about the past leaving some imprint.
When describing propagation of a wavefront you have to take into account that light ariving at a particular location on a screen can arrive there from multiple different directions. That spatial aspect of wave propagation does make that the set of obstacles that the wavefront has negotiated can completely determine how the light illuminates the screen.
Anyway, whether the case is wave propagation or motion of a point mass, the phenomenon is fully described with a differential equation. The nature of a differential equation is that it describes motion that proceeds from instant to instant, down to infinitisimally short instants.
You asked in a comment to another answer about Hamilton's stationary action (often referred to as 'principle of least action'). Hamilton's stationary action does not change the fact that the phenomenon is fully described with a differential equation. | {
"domain": "physics.stackexchange",
"id": 70955,
"lm_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, visible-light, electromagnetic-radiation, refraction, variational-principle",
"url": null
} |
matlab, filters, dsp-core
So, when you integer multiply that coefficient times another value (like a signal or a state), the result will be $2^{14}$ times bigger than it should be. So you'll have to shift it 14 bits to the right to scale it with $2^{-14}$ and undo the scaling of the coefficient necessary to make it an integer. This shifting right causes 14 bits to fall offa the edge, which is quantization error. Noise shaping can help minimize the consequences of that quantization.
With 32 bits, the quantization error will be much smaller in effect.
So you have to deal with the range of your coefficients, so you know how much to scale them. For a biquad, we know the denominator coefficients will have absolute value of less than 2. So we can represent those coefficients well as Q2.30 fixed-point values. So using int32_t as your coefficients and int64_t as your accumulator, then after multiplying, you will have to shift the 64-bit value 30 bits to the right. | {
"domain": "dsp.stackexchange",
"id": 12371,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, filters, dsp-core",
"url": null
} |
algorithms, data-structures, hash-tables
Or in pseudocode:
func del(item i):
slot s = get_slot_of(i)
table[s] = null
fixup(s)
func fixup(slot s):
assert table[s] == null
slot t = s
while table[++t] != null:
if get_slot_of(table[t]) <= s:
table[s] = table[t]
table[t] = null
s = t | {
"domain": "cs.stackexchange",
"id": 6981,
"lm_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, data-structures, hash-tables",
"url": null
} |
acid-base, reference-request, molecular-structure, organosulfur-compounds
One of the opinions voiced in the discussion was that even the gas-phase molecule $\ce{TfOH}$ adopted a $C_\mathrm{3v}$ point group, the hydrogen being in the same axis as carbon and sulfur and somewhat centred between the three oxygens. This makes perfect sense when thinking about it. Therefore, my questions are:
Has the structure of trifluoromethanesulfonic acid or a structurally strongly related acid been studied in the gas phase? (Please provide a reference)
Does the experiment suggest equivalent or non-equivalent oxygens?
How well can that idea be extended? e.g. should one consider the structure of formic acid to be $C_\mathrm{2v}$ symmetric rather than $C_\mathrm{s}$?
Do (solid-state) crystal structures or other experiments exist that confirm a different structure for solid $\ce{TfOH}$? | {
"domain": "chemistry.stackexchange",
"id": 6373,
"lm_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, reference-request, molecular-structure, organosulfur-compounds",
"url": null
} |
+ ø/e) = 1 + 1/ø - (e/ø)(1/(ø + e)). Now, ø = (1 + sqrt(5))/2, so 1 + 1/ø = ø. Therefore, r(k + 1) = ø - (e/ø)(1/(ø + e), or, in other words, r(k + 1) = ø + f, where f = -(e/ø)(1/(ø + e)). For all e < -ø^3 or e > -ø, |f| < |e|, though we must make sure that -ø < e < ø for the geometric series trickery to work, and for the Fibonacci sequence in particular, the first real value for r is r(2) = 1, with e = ø - 1 falling well in this range and, subsequent differences being smaller, only produces more values in this range. Therefore, we can say that growth of the Fibonacci series is bounded between r(n) = 1 and r(n) = 2ø - 1. However, the sequence being bounded by 1^n isn't particularly useful, so we'll use the next two ratios of 2 and 3/2 to note that Cl·(3/2)^n ≤ F(n) ≤ Cr·2^n, where Cl and Cr are positive constants. In particular, F(n) ≥ Cl·(3/2)^n. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429609670702,
"lm_q1q2_score": 0.8062363319592819,
"lm_q2_score": 0.8198933271118222,
"openwebmath_perplexity": 419.70955972801505,
"openwebmath_score": 0.7907012701034546,
"tags": null,
"url": "https://math.stackexchange.com/questions/1102712/proof-the-fibonacci-numbers-are-not-a-polynomial"
} |
statistics, linear-regression
Title: How are residuals used as new phenotype? I'm a novice trying to wrap my head around with fancy jargons. If I search residual, I understand that it represents the difference between the observed value of the dependent variable (y) and the predicted value (ŷ).
I'm unable to follow then, how are these residuals used as new phenotype?
I found similar question in the forum: Adjusting phenotypes by regressing out covariates | {
"domain": "bioinformatics.stackexchange",
"id": 1069,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistics, linear-regression",
"url": null
} |
ros, sensor-msgs, depth
Original comments
Comment by skr_robo on 2016-07-21:
But just like float32 says that it is a 32 bit float type, doesn't uint8 say that it is an 8 bit int type?
I think you may be right about saying that four consecutive bytes correspond to one value in the depth image. But are you saying that the array is made of pointers, not actual data?
Comment by NEngelhard on 2016-07-21:
"say that it is an 8 bit int type" That's somehow correct. But there can be a difference in what you tell the compiler and how in fact the data is used.
Comment by skr_robo on 2016-07-21:
I have understood completely that the four bytes combine to form the 32 bit float information I am looking for. Thanks a lot for that. How can I know if this is a pointer or the actual depth information ? I am not able to understand why would you say it is an array of pointers? Sorry for being noob.
Comment by NEngelhard on 2016-07-22: | {
"domain": "robotics.stackexchange",
"id": 25299,
"lm_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, sensor-msgs, depth",
"url": null
} |
machine-learning, feature-selection, mutual-information, anova, spearmans-rank-correlation
##1. Pearson corr
df_1.corr()
df_2.corr()
##2. f_test
from sklearn.feature_selection import f_regression, mutual_info_regression
f_test, _ = f_regression(x.reshape(10, 1),y_1)
f_test
f_test, _ = f_regression(x.reshape(10, 1),y_2)
f_test
##3. Mutual reg
mutual_info_regression(x.reshape(10, 1),y_1,n_neighbors=1,random_state=123)
mutual_info_regression(x.reshape(10, 1),y_2,n_neighbors=1,random_state=123)
##4. Tree-based feature importance is also based on entropy reduction
##and is more reliable as KNN needs a good k value
We can observe that Mutual importance is able to catch the relation of x with not just y_1 when it is simple Linear bust also with y_2 when it is not linear(but has a strong relation)
You should use either MI if you are only looking for a filter-based method. Otherwise, Tree feature importance would be best for most of the cases.
Check this link -
F_test Vs MI | {
"domain": "datascience.stackexchange",
"id": 7711,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, feature-selection, mutual-information, anova, spearmans-rank-correlation",
"url": null
} |
c++, beginner, linked-list, pointers
template <class T>
bool SingleLinkedList<T>::search(const T &x) {
auto current = head.get();
while (current) {
if (current->data == x) {
return true;
}
current = current->next.get();
}
return false;
}
#endif /* SingleLinkedList_h*/
Here is the main.cpp file:
//
// main.cpp
// Data Structure - LinkedList
//
// Created by Morgan Weiss on 7/24/2018
// Copyright © 2018 Morgan Weiss. All rights reserved.
//
#include <algorithm>
#include <cassert>
#include <iostream>
#include <memory>
#include <utility>
#include <stdexcept>
#include <ostream>
#include <iosfwd>
#include <stdexcept>
#include "SingleLinkedList.h"
int main(int argc, const char * argv[]) { | {
"domain": "codereview.stackexchange",
"id": 31535,
"lm_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++, beginner, linked-list, pointers",
"url": null
} |
python, programming-challenge
if adjacents != 2:
continue
part_numbers = list()
# part numbers next to *
if curr_line[pos - 1].isdigit():
part_numbers.append(go_backwards(curr_line, end=pos))
if curr_line[pos + 1].isdigit():
part_numbers.append(go_forwards(curr_line, start=pos + 1)) | {
"domain": "codereview.stackexchange",
"id": 45235,
"lm_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",
"url": null
} |
c++, multithreading
// easier to read/write as
return !fuel_tanks.empty();
Its curious how you use completely different tests here:
current_tank.wait(lk, [this] {
return !fuel_tanks.empty();
});
if (!fuel_tanks.empty() || !disconnect) {
So the conditional variable will never exit if disconnect is set to true. So to cause the worker thread to exit you need to enter the destructor then add fuel.
I think you actuall need:
current_tank.wait(lk, [this] {
// Exit if fuel tank is empty
// or the disconnect has been set to true.
return !fuel_tanks.empty() && !disconnect;
});
if (disconnect) {
// If we disconnected we want the thread to exit.
// so force the exit with a return.
return;
}
// You only get here if there is fuel in the tank. | {
"domain": "codereview.stackexchange",
"id": 29054,
"lm_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++, multithreading",
"url": null
} |
c#, classes, serial-port, device-driver
_serialPort.Write(buffer, 0, buffer.Length);
Thread.Sleep(5);
var command = BitConverter.ToString(buffer);
if (!string.IsNullOrEmpty(command))
Console.WriteLine("Sent: '" + command.Remove(_serialPort.NewLine, "-") + "'");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
public void Send(string command)
{
try
{
if (!_serialPort.IsOpen)
_serialPort.Open();
_serialPort.WriteLine(command);
Thread.Sleep(5);
if (!string.IsNullOrEmpty(command))
Console.WriteLine("Sent: '" + command.Remove(_serialPort.NewLine) + "'");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
public string Receive()
{
string ret; | {
"domain": "codereview.stackexchange",
"id": 9558,
"lm_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#, classes, serial-port, device-driver",
"url": null
} |
image-classification, decision-trees
Title: Use of decision trees for classifying images I am new at Machine Learning and reading about it I wonder if it is possible (and convenient) to use decision trees to classify images.
For instance, to classify faces If you're looking to classify faces, you can use decision trees, however, they are not expected to provide extremely good results. Why?
Images, and especially faces heavily rely on local relationships between features (i.e. pixels close to each other). Decision trees do not take this into account, and therefore, results may not be great, or may be heavily affected by noise.
Also, trees are powerful, but typically, they are useful when concise, which requires features to be meaningful. However, images have some of the least meaningful features out there (pixels) | {
"domain": "datascience.stackexchange",
"id": 6470,
"lm_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-classification, decision-trees",
"url": null
} |
black-holes, quantum-entanglement, event-horizon
This means that the particle stays entangled with something as its partner crosses the horizon. This "thing" is whatever degrees of freedom the black hole has, those degrees of freedom that make up its entropy. When the black hole decays completely, the outgoing particles are determined by these microscopic variables, and at no point was there ever a loss of coherence in the entanglement.
This point of view requires that the information about the particle that fell through the horizon is also contained in the measurable outside state of the black hole. This is t'Hoofts holographic principle as extended into Susskind's black hole complementarity, the principle that the degrees of freedom of a black hole encode the infalling matter completely in externally measurable variables. This point of view is nearly universal today, because we have model quantum gravity situations where this is clearly what happens. | {
"domain": "physics.stackexchange",
"id": 41681,
"lm_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, quantum-entanglement, event-horizon",
"url": null
} |
electric-circuits
of contact would be equal and opposite, they would cancel - amounting to a zero potential. But of course, the electrical potential in the wires going back up to the transformer would also be zero, and so for any wires continuous with those. I cannot figure what would happen beyond the transformer, but would my neighbors lose power? Perhaps this thought experiment is just to conclude that the line volatges are, in fact, not out of phase, but I am curious to see what anyone might have to say. Thanks! You are forgetting current, which begins to flow the instant you touch the wires together. So, shorting together the two legs of your mains supply with a low resistance will suddenly allow a truly gigantic current to flow, converting the resistor into plasma. You'll be essentially holding an arc welder with your hands, which will be fried into wads of burnt meat and set your clothes and hair on fire. | {
"domain": "physics.stackexchange",
"id": 84624,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits",
"url": null
} |
java, beginner, algorithm
Title: Find Intervals with Most Overlaps Given a list of time intervals, I want to return the intervals with the most overlaps (i.e. most people free). My solution runs in \$O(n \log n)\$, but I made a bunch of "tracker" variables. How can I avoid creating all these variables?
Interval class:
public class Interval {
int start;
int finish;
public Interval(int start, int finish) {
this.start = start;
this.finish = finish;
}
}
Point class (used in my algorithm):
public class Point implements Comparable<Point> {
int time;
TimeType type;
public Point(int time, TimeType type) {
this.time = time;
this.type = type;
}
public int compareTo(Point p) {
if (time == p.time) {
if (!type.equals(p.type)) {
if (type == TimeType.Finish) {
return -1;
}
return 1;
}
return 0;
}
return time - p.time;
}
} | {
"domain": "codereview.stackexchange",
"id": 21437,
"lm_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, beginner, algorithm",
"url": null
} |
immunology, recombination
I would like to thank @swbarnes2 for pointing out the importance of RAG1 in V(D)J recombination. Also thank @MattDMo for introducing me to the community guidelines.
This question is not my homework. I am just curious why V(D)J recombination seems to be only discussed in the context of B and T cell development.
References:
[1] Kuo TC, Schlissel MS. Mechanisms controlling expression of the RAG locus during lymphocyte development. Curr Opin Immunol. 2009;21: 173–178.
[2] Borghesi L, Hsu L-Y, Miller JP, Anderson M, Herzenberg L, Herzenberg L, et al. B lineage-specific regulation of V(D)J recombinase activity is established in common lymphoid progenitors. J Exp Med. 2004;199: 491–502. | {
"domain": "biology.stackexchange",
"id": 11144,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "immunology, recombination",
"url": null
} |
c#, linq
&& partYard.YardNumber == yardNumber
select part;
}
}
else
{
if (commodityId > 0)
{
// Have model and commodity
parts = from part in context.Parts
join partModel in context.PartsByModels on part.PartNumber equals
partModel.PartNumber
join commodity in context.Commodities on part.CommodityId equals
commodity.CommodityID
where partModel.ModelNumber == modelNumber
&& commodity.CommodityID == commodityId
select part;
}
else
{
// Have model
parts = from part in context.Parts | {
"domain": "codereview.stackexchange",
"id": 998,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, linq",
"url": null
} |
assembly, covid-19, genome-sequencing, software-usage, virus
U11820.1 Prodigal:2.6 CDS 634 1983 . + 0 ID=EANIPDKN_00001;inference=ab initio prediction:Prodigal:2.6;locus_tag=EANIPDKN_00001;product=hypothetical protein
U11820.1 Prodigal:2.6 CDS 1995 5246 . + 0 ID=EANIPDKN_00002;eC_number=3.6.1.23;Name=dut;gene=dut;inference=ab initio prediction:Prodigal:2.6,similar to AA sequence:UniProtKB:Q2YRG4;locus_tag=EANIPDKN_00002;product=Deoxyuridine 5'-triphosphate nucleotidohydrolase
U11820.1 Prodigal:2.6 CDS 5239 5994 . + 0 ID=EANIPDKN_00003;inference=ab initio prediction:Prodigal:2.6;locus_tag=EANIPDKN_00003;product=hypothetical protein
U11820.1 Prodigal:2.6 CDS 6269 8830 . + 0 ID=EANIPDKN_00004;inference=ab initio prediction:Prodigal:2.6;locus_tag=EANIPDKN_00004;product=hypothetical protein | {
"domain": "bioinformatics.stackexchange",
"id": 1600,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "assembly, covid-19, genome-sequencing, software-usage, virus",
"url": null
} |
electromagnetism, visible-light, electromagnetic-radiation, photons, maxwell-equations
Title: If Maxwell's equations relate fields at the same point, how can waves propagate between different points? There are lots of posts about EM wave model of photons, but I haven't read one that covers the more specific question I am focusing on here.
Here How does energy transfer between B and E in an EM standing wave? david was concerned about the presence of a zero $E$ & $B$ field point in the wave, close, but that is not my concern.
An electromagnetic waves is propagated by the oscillations of the electric and magnetic fields. A changing electric field produces a changing magnetic field and a changing magnetic field produces a changing electric field. An electromagnetic wave is self propagating and does not need a medium to travel through.
But I can't overcome the idea that in order to achieve propagation an $\dot E$ or $\dot B$ in one place must be capable of inducing a $\dot B$ or $\dot E$ in a different place.
How do we understand a change in position to occur? | {
"domain": "physics.stackexchange",
"id": 52527,
"lm_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, visible-light, electromagnetic-radiation, photons, maxwell-equations",
"url": null
} |
python, genetic-algorithm
These methods exploit the properties of the matrices created above to calculate the cost associated with the timing of activities
def CalculateSessionLengthCosts(self):
sessionLengthsCosts = []
for i in self.sessionLengthsChronological:
if i < 18:
sessionLengthsCosts.append((18 - i) * 5)
else:
sessionLengthsCosts.append(0)
self.sessionLengthCosts = sessionLengthsCosts
self.sessionLengthCostsTotal = sum(sessionLengthsCosts) | {
"domain": "codereview.stackexchange",
"id": 35993,
"lm_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, genetic-algorithm",
"url": null
} |
php, optimization, mysql
Conclusion:
Besides the little changes of the statements and the use of OPTIMIZE inside your if-condition, there are no required improvements for exactly this script in my opinion. I strongly recommend to change the database engine when you make your changes for using PDO. This of course means more effort, as there are many variables which you can or should set to the InnoDB engine, but I think it is worth it. In fact, there aren't real advantages on using MyISAM, less then ever in performance. | {
"domain": "codereview.stackexchange",
"id": 2169,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, optimization, mysql",
"url": null
} |
quantum-information, linear-algebra, quantum-computer
Title: When is an operator subspace the span of Kraus operators? Let $A$ and $B$ be finite dimensional Hilbert spaces, and let $\mathcal{L}(A \to B)$ be the space of linear operators from $A$ to $B$. Say that a subspace $K \subseteq \mathcal{L}(A \to B)$ is a span of Kraus operators if there are operators $\{K_i\}$ such that $\sum_i K_i^\dagger K_i = I$ and $K = \textrm{span}_i\{K_i\}$.
Equivalently, $K$ is a span of Kraus operators if there is an ancillary Hilbert space $C$ and an isometry $J:A \to B \otimes C$ such that $K = \textrm{span}_{\left| \psi \right> \in C} \{ (I \otimes \left<\psi\right|) J \}$. | {
"domain": "physics.stackexchange",
"id": 11479,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-information, linear-algebra, quantum-computer",
"url": null
} |
The function $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$. So, from Rolle's Theorem there is a $c\in (a,b)$ such that $f'(c)=0 \Rightarrow 3c^2-1=0$.
How can we get a contradiction?
• Show that $$f'(x)>0$$ for all $x$ with $$1<x<2$$ – Dr. Sonnhard Graubner Mar 16 '18 at 21:17
• The discriminant of $x^3-x-1$ is $-23<0$ and $f(1)f(2)<0$, end of story. – Jack D'Aurizio Mar 16 '18 at 21:21
• @MaryStar Please remember that you can choose an answer among the given if the OP is solved, more details here meta.stackexchange.com/questions/5234/… – user Mar 17 '18 at 23:28
Without derivative:
Let $r$ be the root. Then the polynomial factorizes as
$$(x-r)(x^2+rx+r^2-1)$$ and there are other real roots iff
$$\Delta=r^2-4(r^2-1)\ge0,$$
$$|r|\le\frac2{\sqrt3}.$$
But $f\left(\dfrac2{\sqrt3}\right)<0$ implies $r>\dfrac2{\sqrt3}$, a contradiction. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964228644457,
"lm_q1q2_score": 0.8190885067359086,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 261.5128778559978,
"openwebmath_score": 0.8830399513244629,
"tags": null,
"url": "https://math.stackexchange.com/questions/2694289/prove-that-the-equation-x3-x-1-0-has-only-one-real-root"
} |
filters, convolution, terminology
The generalized expression that includes both feed-forward (FIR) and feed-back (IIR) components is the Generalized difference equation given as:
$$y[n] = \sum_{k=0}^{M-1}b_k x[n-k] - \sum_{k=1}^N a_k y[n-k]$$
Of practical interest, taking the z- transform of the Generalized Difference Equation as given above leads to the transfer function in the format commonly used in MATLAB, Octave and Python scipy.signal for IIR and FIR filters (where $b$ is the coefficients of the feed-forward FIR filter and $a$ is the feed-back coefficients of the IIR filter:
$$\frac{Y(z)}{X(z)} = H(z) = \frac{\sum_{k=0}^{M-1}b_k z^{-k}}{1+\sum_{k=1}^N a_k z^{-k}}$$ | {
"domain": "dsp.stackexchange",
"id": 11855,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, convolution, terminology",
"url": null
} |
newtonian-mechanics, rocket-science
We can see that initially, the rocket has some velocity v and a mass m.
After a small change in time, we denote $dt$. The rocket has expelled burnt fuel that has a mass $dm$ and a velocity $(v-v_{e})$ where $v_{e}$ is the velocity of the gas relative to the rocket. The rocket now has a mass of $(m-dm)$ and an increased velocity of $(v+dv)$
Since the net external force is not zero momentum is not conserved, however, we can do the following.
We can begin by showing that a small change in the momentum of the system is equal to a small change in the impulse. Since everything is happening in the same dimension we leave out the unit vector notation.
$$d\boldsymbol{\vec{p}} = d\boldsymbol{\vec{J}}$$
$$d\boldsymbol{\vec{p}} = p_{f} - p_{i}$$
$$d\boldsymbol{\vec{p}} = (m-dm)(v+dv)+dm(v-v_{e})-mv$$
After expanding and cancelling some terms ,
$$d\boldsymbol{\vec{p}} = m\hspace{0.2em}dv - v_{e}\hspace{0.2em}dm$$
Since the gravitational force is the net external force | {
"domain": "physics.stackexchange",
"id": 87617,
"lm_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, rocket-science",
"url": null
} |
php, mysql, authentication
if ($row['logins'] == 1) {
queryMysql("INSERT INTO leave_type (user, hours, leave_start, leave_end, leave_reason, leave_type)
VALUES ('$user', '24.00', '2016-01-08T06:30:00', '2016-01-09T06:30:00', 'Example Leave', 'Annual')
");
die("<br><br><script>setTimeout(function () {
window.location.href='FullscreenForm.php'; // the redirect goes here
}, 100); // 5 seconds</script>
<div class='alert alert-info text-center animated bounceInDown'>Hi. Since this is your first time logging in Please go to the <a href='FullscreenForm.php'>" .
"Edit Profile</a> page and input your information so the app will work correctly. Or just wait and you'll be redirected</div>");
} else {
die("<br><br><script>setTimeout(function () { | {
"domain": "codereview.stackexchange",
"id": 19437,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, mysql, authentication",
"url": null
} |
quantum-field-theory, condensed-matter, chirality, helicity
However, in some systems the spectrum of excitations in the solid body can be Dirac- or Weyl-like. This is the thing which happens for semimetals (3D case) and for graphene (2D case). In this case, you can effectively (i.e., near the corresponding Dirac and Weyl points) define the chirality. This is, of course, not the chirality defined by the Lorentz group representation.
As for helicity, its definition - the projection of the total angular momentum on the direction of motion - doesn't suffer from taking of the non-relativistic limit. However, there isn't clear relation of the helciity and effective chirality described above, unlike the case of massless representations of the Poincare group, for which helicity and chirality are the same up to the sign. | {
"domain": "physics.stackexchange",
"id": 43778,
"lm_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, condensed-matter, chirality, helicity",
"url": null
} |
python, performance, beginner, python-2.x, sudoku
This is saved as "sudoku_checker.py". I have the following lines in the bottom of the file.
board = [[1,2,3,4],[4,3,1,2],[2,1,4,3],[3,4,2,1]]
main_function(board)
board = [[9,4,2,7,6,1,8,5,3],[3,8,7,5,9,2,6,4,1],[6,1,5,8,3,4,2,9,7], \
[2,6,3,1,4,7,5,8,9],[8,7,1,9,2,5,3,6,4],[4,5,9,3,8,6,1,7,2], \
[7,9,6,2,1,8,4,3,5],[5,2,8,4,7,3,9,1,6],[1,3,4,6,5,9,7,2,8]]
main_function(board)
I'm using Spyder, with Python 2.7. The program is called by simply clicking "Run". To be honest, I don't know how to call if from the command prompt.
How can I improve this code. I'm a beginner in Python and I'm looking for any improvements. | {
"domain": "codereview.stackexchange",
"id": 20854,
"lm_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, beginner, python-2.x, sudoku",
"url": null
} |
condensed-matter, electrons, electrical-resistance, conductors, metals
Title: How do electrons in metals manage to have zero acceleration in constant $E$ field (as in a DC circuit)? From Newton's second law, a charged particle driven by a constant electric field should move with a constant acceleration. But electrons in a circuit acquire a steady average velocity which gives rise to a constant steady DC current. Of course, the electrons scatter with phonons and other defects leading to energy dissipation. But how does it explain zero average acceleration? What is the mathematical model which can be used to understand this? The simplest mathematical model would be a Newton's equation with viscous friction:
$$m\ddot{x} = -\nu\dot{x} -eE,$$
which is written in terms of position and velocity as
$$\dot{x} = v, \dot{v} = -\frac{\nu v}{m} -\frac{eE}{m},$$
and has a stationary solution for velocity:
$$v = -\frac{eE}{\nu}.$$
A bit more realistic model is obtained by adding a deltta-correlated random force:
$$m\ddot{x} = -\nu\dot{x} -eE + f(t),$$ | {
"domain": "physics.stackexchange",
"id": 79289,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, electrons, electrical-resistance, conductors, metals",
"url": null
} |
ros, plugin, gui, rqt
Title: How to connect a signal to a publisher
Hi,
I am using a rqt plugin made with the tutorial and I have made a simple GUI composed with a slider and a button. I would like to connect the button, to send the value of the slider to a message. This message which contents a integer, would be publish when the button is clicked. Then in another file I have made a "listener" based on the tutorial and I would like to see on my screen the integer.
I can't catkin_make it because I have many errors. I know that I am mixing GUI and ros things, and signals and messages, I am lost. Can someone helpme with that ?
This is my header file :
#ifndef rqt_mypkg__my_plugin_H
#define rqt_mypkg__my_plugin_H
#include <rqt_gui_cpp/plugin.h>
#include <rqt_mypkg/ui_my_plugin.h>
#include <QWidget>
#include <QString>
#include <QList>
#include <ros/ros.h>
#include "std_msgs/String.h"
#include <std_msgs/Int8.h>
namespace rqt_mypkg {
class MyPlugin
: public rqt_gui_cpp::Plugin
{
Q_OBJECT
public: | {
"domain": "robotics.stackexchange",
"id": 25168,
"lm_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, plugin, gui, rqt",
"url": null
} |
homework-and-exercises, newtonian-mechanics, momentum, conservation-laws, spring
The solution provided uses conservation of momentum to find $v_f$
$$m_1v_1+m_2v_2=(m_1+m_2)v_f$$
where solving for $v_f$ and plugging in the numbers yields $v_f=5.01\text{m/s}$
However my attempted solution goes as follows:
First write down equation of energy conservation for the instant where the two blocks have the same velocity.
$$ \frac{1}{2}m_1v_1^2 + \frac{1}{2}m_2v_2^2 = \frac{1}{2}kx^2 + \frac{1}{2}(m_1+m_2)v_f^2$$
We're missing one piece of information to solve for $v_f$ and that's $x$. However if we use block 2 as our reference frame, then we could use conservation of energy again to find $x$ and then plug in in our original equation to solve for $v_f$.
Using energy conservation for block 2 as our frame of reference, we get: $$\frac{1}{2}m_1v_{1,2}^2=\frac{1}{2}kx^2$$ where $v_{1,2}^2=v_1-v_2=7 \text{m/s}$ | {
"domain": "physics.stackexchange",
"id": 98032,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, momentum, conservation-laws, spring",
"url": null
} |
LET Ar fCn Is fCxdx IT EASILYEVALUATED E F YES NO. Absolute Convergence. 1: The Ratio Test. 1] p-Series Test Any homework problem is fair. Digital convergence, on screen menus, video, S-video and RGB inputs are stock, the component option is available on the NEC XG 852 models. Absolute Convergence Absolutely Convergent Describes a series that converges when all terms are replaced by their absolute values. Thus, you can't use the Alternating Series Test. 4 Absolute Convergence and the Ratio Test Due Nov 10, 2016 by 11:59pm; Points None; 8. We say a series is absolutely convergent if BOTH the series and absolute value of the series is convergent. To answer that question, you must investigate the positive series with a different test. Identify the following statements as true or false. In other words. For example, take s n = ( 1)n. a very nice and relatively simply test to determine uniform convergence of a series of real-valued functions called the Weierstrass M-test. Therefore, the | {
"domain": "amicidellacattolica.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587275910131,
"lm_q1q2_score": 0.8453744381198375,
"lm_q2_score": 0.8558511451289037,
"openwebmath_perplexity": 668.8494962363595,
"openwebmath_score": 0.8100463151931763,
"tags": null,
"url": "http://amicidellacattolica.it/vqwf/absolute-convergence-test.html"
} |
regular-languages, finite-automata
To built a very simple example, let's do the following:
$$A := \{aaa^nb^n \mid n \in \mathbb{N}\} \cup \{bw \mid w \in \{a,b\}^*\}$$
$$B := \{aba^nb^n \mid n \in \mathbb{N}\} \cup \{bw \mid w \in \{a,b,\}^*\}$$
Now we have that $A \cap B = b\{a,b\}^*$, which is clearly regular and infinite. | {
"domain": "cs.stackexchange",
"id": 21629,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages, finite-automata",
"url": null
} |
So we have three different methods to obtain a description of the column space of a matrix as the span of a linearly independent set. Theorem BCS is sometimes useful since the vectors it specifies are equal to actual columns of the matrix. Theorem BRS and Theorem CSRST combine to create vectors with lots of zeros, and strategically placed 1's near the top of the vector. Theorem FS and the matrix $L$ from the extended echelon form gives us a third method, which tends to create vectors with lots of zeros, and strategically placed 1's near the bottom of the vector. If we do not care about linear independence we can also appeal to Definition CSM and simply express the column space as the span of all the columns of the matrix, giving us a fourth description. | {
"domain": "ups.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808707404786,
"lm_q1q2_score": 0.8059762831879308,
"lm_q2_score": 0.8221891370573388,
"openwebmath_perplexity": 158.89485764123472,
"openwebmath_score": 0.9171851873397827,
"tags": null,
"url": "http://linear.ups.edu/fcla/section-FS.html"
} |
Counting up Read number whileand print the integers counting up to Write. The best GIFs are on GIPHY. That is, the correctness of a recursive algorithm is proved by induction. Although it looks like a simple game at a high level, implementing it in a programming language was a great experience. Only one disk can be moved at a time. Somewhere I placed some pseudocode for table-based traversal as an alternative to recursion, but I cannot re-find it. Quicksort Quicksort(A,p,r) { if (p r) { q - Partition(A,p,r) Quicksort(A,p,q) Quicksort(A,q+1,r) } } Partition(A,p,r) x - A[p] i - p-1 j - r+1 while (True) { repeat j. We will first store the graph below in the adjacency list representation. void preorder( BTREE__NODE_p_t node ) if ( node != NULL ) visit( node ) preorder( node->left ) preorder( node->right ). Pseudocode of Radix Sort Radix-Sort(A, d) //It works same as counting sort for d number of passes. In our previous tutorial we discussed about Linear search algorithm which is the most | {
"domain": "angolodeisaporifirenze.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799441350252,
"lm_q1q2_score": 0.8266996963081685,
"lm_q2_score": 0.8577681049901037,
"openwebmath_perplexity": 806.9678291076392,
"openwebmath_score": 0.4165516495704651,
"tags": null,
"url": "http://angolodeisaporifirenze.it/qjxw/recursion-pseudocode.html"
} |
type-theory, functional-programming, fixed-point, church-numerals
Using this naturality law with appropriately chosen p and f, one can show that the composition fix . unfix is a certain function of type C -> C that must be equal to \c -> (run c) fix.
However, further progress in the proof does not seem to be possible; it is not clear why this function must be equal to id.
Let us temporarily define the function m:
m :: (F C -> C) -> C -> C
m t c = (run c) t
Then the result I have is written as
fix . unfix = m fix
One can also show that unfix . fix = fmap (m fix).
It remains to prove that m fix = id. Once that is proved, we will have proved that F C ≅ C.
The same naturality law of c with different choice of p and f gives the strange identity
m fix . m (m fix . fix) = m (m fix . fix) | {
"domain": "cs.stackexchange",
"id": 17168,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "type-theory, functional-programming, fixed-point, church-numerals",
"url": null
} |
Another way to think about this (not following the OP's approach, but using compactness in a slightly different way):
To show that $f$ is continuous, it's enough to show that the restriction $f_{|I}: I \to \mathbb R$ is continuous for each closed interval $I \subset \mathbb R$; this is what we'll do.
Let $\Gamma_f \subset \mathbb R^2$ denote the graph of $f$, which is closed by assumption. Then $\Gamma_{f_{|I}} := \Gamma_f \bigcap (I \times \mathbb R)$, which is the graph of $f_{|I}$, is closed in $I\times \mathbb R$. The assumption that $f$ is bounded shows that it is also bounded, and so it is a compact subset of $I\times \mathbb R$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771778588347,
"lm_q1q2_score": 0.8157803331621776,
"lm_q2_score": 0.8267117962054049,
"openwebmath_perplexity": 61.07736039068336,
"openwebmath_score": 0.9774861335754395,
"tags": null,
"url": "https://math.stackexchange.com/questions/2051125/a-bounded-function-in-bbb-r-with-closed-graph-is-continuous"
} |
java, text-editor
}
} else {
saveFile(filename);
}
} else if(event.getSource() == pageSetup) {
job = PrinterJob.getPrinterJob();
format = job.pageDialog(job.defaultPage());
} else if(event.getSource() == printFile) {
job = PrinterJob.getPrinterJob();
if(job.printDialog()) {
try {
job.print();
} catch (PrinterException err) {
err.printStackTrace();
}
}
} else if(event.getSource() == exit) {
System.exit(0);
} else if(event.getSource() == undoEdit) {
try {
undo.undo();
} catch(CannotUndoException cu) {
cu.printStackTrace();
}
} else if(event.getSource() == redoEdit) {
try {
undo.redo();
} catch(CannotUndoException cur) { | {
"domain": "codereview.stackexchange",
"id": 31765,
"lm_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, text-editor",
"url": null
} |
general-relativity, differential-geometry, differentiation, vector-fields, covariance
Title: Killing equation manipulation Why does the killing equation $$K_{\mu;\nu}+ K_{\nu;\mu} = 0$$ equal $$K_{\mu,\nu}+ K_{\nu,\mu} -2\Gamma^{\rho}_{\mu\nu}K_{\rho} = 0 $$
when in general a covariant derivative
$V_{\beta;\alpha} = (\partial_\alpha V^\lambda + \Gamma_{\alpha \nu}^{\lambda}V^{\nu})g_{\lambda \beta}$?
Where does the opposite sign of the affine connection come from and why is there not another affine connection?
https://en.wikipedia.org/wiki/Killing_vector_field Your expression for the covariant derivative is wrong: it should be with a minus sign (plus sign for vectors=upper index, and minus sign for covectors=lower index):
$$
\begin{aligned}
\nabla v^\alpha\sim \partial v^\alpha\color{red}+\Gamma^\alpha v\\
\nabla v_\alpha\sim \partial v_\alpha\color{red}-\Gamma_\alpha v
\end{aligned}
$$ | {
"domain": "physics.stackexchange",
"id": 29205,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, differentiation, vector-fields, covariance",
"url": null
} |
ros, ide, eclipse
Title: Updating package under eclipse
I have added another source file in my package and run some commands like in the answer in this link (by running "make clean; make eclipse-project command and restart Eclipse"). However, the working package is not updated under eclipse.
I know that it will work out of the box, if I again go through the import package procedure, but, it is tiring doing it every time I add some new files in the package.
Is there any elegant way of doing it?
Originally posted by alfa_80 on ROS Answers with karma: 1053 on 2011-12-22
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 7712,
"lm_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, ide, eclipse",
"url": null
} |
ensembl, biomart, microarray
Go to the start page
Select H. sapiens Ensembl genes for your database; Human genes (GRCh38.p10) for your dataset
Click Filters in the left-hand column
Expand "REGION", scroll down to GENE and select "Input microarray probes/probesets ID list [Max 500 advised]"
Select AFFY HG U133 PLUS 2 probe ID(s) and either copy/paste or upload a list, one per line
Click Attributes in the left-hand column
Scroll through, uncheck what you don't want to see and choose what you do, for example Gene Stable ID, AFFY HuGene 1 0 st v1 probe and AFFY HG U133 Plus 2 probe
Finally click "Results" in the menu at the top of the left-hand column
And you should see a result like this (you'll need to click the "Results" button).
You should not expect that there be a one-to-one mapping, for two reasons:
Genes have multiple transcripts and probesets are mapped to each transcript
Some transcripts have more than one probeset: in this case, the HuGene IDs 8002301 and 8002303 map to transcripts for this gene | {
"domain": "bioinformatics.stackexchange",
"id": 10,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ensembl, biomart, microarray",
"url": null
} |
python, python-3.x, game, dice
#Defining global variables
i = 0
Player1Points = 0
Player2Points = 0
Player1Tiebreaker = 0
Player2Tiebreaker = 0
Winner_Points = 0
##################################################################################################################################
#Authorisation/Registration
#Login
def login():
#Defining function variables
x = 0
UserNumber = 1
login = False
found = False
placeholder = True
NoLowercase = True
NoUppercase = True
NoNumber = True
NoSymbol = True
NoSymbolPlaceHolder = False
#Function starts
while login == False:
while found != True:
player = input("Has User{} got an account? Y/N: ".format(UserNumber)) | {
"domain": "codereview.stackexchange",
"id": 36625,
"lm_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, game, dice",
"url": null
} |
turing-machines, computation-models
Title: Is computation independent of hardware? We use electronics to build computers and do computation. Is computation independent of the hardware we use? Would it be possible to do whatever a computer does with pen and paper? If computation is not dependent of how we make our computers, then does the same principle which apply to a computer apply to how brain works?
I want to know if computation is an abstract object which then is realized as computers. In other words, if we visit some alien civilization we expect that our mathematicians and physicists understand the alien physics and math. Is it the same as with the notion or concept of computation? | {
"domain": "cs.stackexchange",
"id": 7262,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines, computation-models",
"url": null
} |
kinematics, acceleration, estimation
the torque delivered by the car engine. This is a function of engine speed and the gear so the torque changes (discontinuously) as the car speed increases
the aerodynamic drag. This is approximately proportional to $v^2$, though only approximately.
the friction in the drive train. This is appoximately proportional to $v$, though once again only appoximately. | {
"domain": "physics.stackexchange",
"id": 99467,
"lm_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, acceleration, estimation",
"url": null
} |
ros, navigation, base-global-planner, base-local-planner
ken@ken:~$ rostopic echo /move_base/parameter_descriptions
dflt:
bools:
-
name: recovery_behavior_enabled
value: True
-
name: clearing_rotation_allowed
value: True
-
name: shutdown_costmaps
value: False
-
name: restore_defaults
value: False
ints: []
strs:
-
name: base_global_planner
value: navfn/NavfnROS
-
name: base_local_planner
value: base_local_planner/TrajectoryPlannerROS
Could anybody tell me the way to check which planner is selected if I'm wrong?
I think that a dflt means initial value.
Originally posted by Ken_in_JAPAN on ROS Answers with karma: 894 on 2014-04-14
Post score: 0
I'm sorry, it was simple. I can check them with a following topic. | {
"domain": "robotics.stackexchange",
"id": 17650,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, base-global-planner, base-local-planner",
"url": null
} |
Do you disagree with the assertion that the green points in the diagram are at a higher voltage than the red?
19. Nov 3, 2009
### ehild
Justin,
Before you speak about voltage, learn what it is.
Voltage is defined between two point in a conservative electric field. Note the term "conservative" and "electric".
When a point charge moves from point A to B, the work of the electric field is
$$W_A_B=q\int_A^B{\vector{E}\cdot\vctor{dr}}$$
Only if this work is independent of the path taken - the electric field is conservative - can we speak about electric potential $V(\vector{r})$. The electric field strength is the negative gradient of this potential function, $\vector{E(\vector{r})}=-\nabla{V(\vector{r})}$. In this case,
$$W_A_B=-q\int_A^B{\nabla{V(\vector{r})}\cdot\vector{dr}}=-q\int_A^B{dV}=q(V(A)-V(B))$$. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9539661028358093,
"lm_q1q2_score": 0.8010777386460438,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 353.3727182362937,
"openwebmath_score": 0.7045296430587769,
"tags": null,
"url": "https://www.physicsforums.com/threads/voltage-across-an-inductor.350749/"
} |
The probability of a crack crossing is $$\P(C) = 2 L / \pi$$.
Proof:
From symmetry and simple calculus it follows that $$\area(C) = 2 L$$. Of course $$\area(S) = \pi$$.
In the Buffon's needle experiment, vary the needle length $$L$$ with the scroll bar and watch how the event $$C$$ changes. Run the experiment with various values of $$L$$ and compare the physical experiment with the points in the scatterplot. Compare the relative frequency of $$C$$ to the probability of $$C$$.
The convergence of the relative frequency of an event (as the experiment is repeated) to the probability of the event is a special case of the law of large numbers.
Find the probabilities of the following events in Buffon's needle experiment. In each case, sketch the event as a subset of the sample space. | {
"domain": "uah.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992654173860152,
"lm_q1q2_score": 0.8356417483155697,
"lm_q2_score": 0.8418256532040708,
"openwebmath_perplexity": 232.93300214900108,
"openwebmath_score": 0.898608922958374,
"tags": null,
"url": "http://www.math.uah.edu/stat/buffon/Buffon.html"
} |
visible-light, everyday-life
Thus, it's not just a matter of indoor brightness vs. outdoor brightness. You should probably get an intuition by checking yourself (go out, check whether you can see your paintings or furniture or whatnot).
In the end, the simplest test is probably to dance around naked and watch people's reactions. | {
"domain": "physics.stackexchange",
"id": 67112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, everyday-life",
"url": null
} |
c#, game, mvc, winforms, chess
Piece capturedPiece = board.GetPieceAt(move.EndCoords);
if (IsEnPassant(board, move))
{
GhostPawn ghostPawn = board.GetSquareAt(move.EndCoords).GetGhostPawn();
Coords linkedPawnCoords = board.GetCoordsOfPiece(ghostPawn.LinkedPawn);
capturedPiece = ghostPawn.LinkedPawn;
board.GetSquareAt(linkedPawnCoords).Piece = null;
}
// Remove ghost pawns
board.RemoveGhostPawns();
if (IsDoublePawnMove(board, move))
{
Coords ghostPawnCoords = new Coords(move.StartCoords.X, move.StartCoords.Y + (move.EndCoords.Y - move.StartCoords.Y) / 2);
board.GetSquareAt(ghostPawnCoords).Piece = new GhostPawn(player, (Pawn)board.GetPieceAt(move.StartCoords));
}
else if (IsCastle(board, move))
{
int direction = move.EndCoords.X - move.StartCoords.X > 0 ? 1 : -1; | {
"domain": "codereview.stackexchange",
"id": 44851,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, game, mvc, winforms, chess",
"url": null
} |
entanglement, teleportation, superdense-coding
Title: What is the difference between quantum teleportation and quantum entanglement with dense coding? What is the actual difference between quantum teleportation and quantum entanglement with dense coding.
Wikipedia says:
Quantum teleportation is a technique for transferring quantum information from a sender at one location to a receiver some distance away,
and quantum entanglement as
the phenomenon in which two or more quantum particles can become correlated in such a way that their states are intrinsically linked, regardless of the distance between them. | {
"domain": "quantumcomputing.stackexchange",
"id": 5261,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "entanglement, teleportation, superdense-coding",
"url": null
} |
c#, object-oriented, role-playing-game
Notice that in your proposed design you have silently baked limitations of the game into the type system. A monster can have only one location; OK, that seems reasonable. That location is a room -- too restrictive. You should be able to put the dragon in a cage, and the cage in a room. A monster can only target characters? Too restrictive; a dragon should be able to attack a werewolf. (Again, we see that characters and monsters are really the same thing.) A monster can only target one opponent? Too restrictive; what if the dragon wants to claw one character and fire breathe on another?
Think about what limitations you are baking in when you design your class hierarchies, and make sure you are only baking in things that really have to be invariants, like having a single location. | {
"domain": "codereview.stackexchange",
"id": 21875,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, object-oriented, role-playing-game",
"url": null
} |
physical-chemistry, thermodynamics, melting-point
Title: Predicting melting points of substances based on their molecular/atomic structure Wouldn't it be great to be able to predict the melting point of a metal based on the atomic number and not by looking in some table for the value that was measured experimentally by someone else? Or to predict the same melting point for a simple salt like NaCl or KI by applying some formula to the atomic numbers of the 2 atoms involved?
Can you help me understand why is it so difficult to build a theoretical model for this particular physical property? Were there attempts made in the scientific world for such a model?
--EDIT--
Yes, this is part of my question: | {
"domain": "chemistry.stackexchange",
"id": 3385,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, thermodynamics, melting-point",
"url": null
} |
optics
So you can simply subtract the aberrations of one lens from the aberration imparted by the pair *as long as the excitation conditions for the measurement of the single lens on its own are the same as they would be if the lens were in a pair with the other lens the perfect (unaberrating) version of the actual second lens). In other words, the beamwidth and focus position of the lightfield at the input to the isolated tested lens must be the same as it would be if it were working in the pair.
Also, unless you are very, very careful, you can't practically expect to infer the tilt and pure defocus Zernike terms by this method. Switching lenses in and out of your test setup will always introduce a small amount of tilt and defocus. | {
"domain": "physics.stackexchange",
"id": 20768,
"lm_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",
"url": null
} |
newtonian-mechanics, rotational-dynamics, soft-question, inertia
Other problem, it seems that gravity does some work on the points that are not located on the axis. This work seems to be conpensated by the work done on each symmetric point, but is this enough to say that the sum of the forces acting in the direction of motion is equall to $0$? The "law of inertia" can be extended to systems of particles as well as individual particles. You can view your pencil as a system of particles (atoms in the wood, if you like), each of which is exerting a force on its neighbors in such a way that they always have the same distances from each other.
For a system of particles, it can be shown that the center of mass of the object obeys Newton's Second Law: if $M$ is the total mass of all the particles in the system, and $\vec{X}$ is the position of the mass, then
$$
\vec{F}_\text{ext} = M \ddot{\vec{X}}
$$ | {
"domain": "physics.stackexchange",
"id": 83481,
"lm_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, rotational-dynamics, soft-question, inertia",
"url": null
} |
the-sun, magnetic-field, white-dwarf
The heliosphere stays roughly the same in size as long as the Sun remains in its Main Sequence stage, as a star remains relatively stable during this time of its life. | {
"domain": "astronomy.stackexchange",
"id": 2509,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "the-sun, magnetic-field, white-dwarf",
"url": null
} |
• +1, I used to think like OP, and this is the sort of things that made the concept of surjectivity interesting. – Arnaud D. Jun 16 '17 at 8:25
• As I recall, this is fundamental in group theory and provides a basis for equivalence relations in A. – rrogers Jun 21 '17 at 13:47
"Some value $y$ depends deterministically on data $x$; is every prospective value $y$ an actual value?"
Two common formulations are:
• Let $Y$ be a set of prospective values (specified in advance by the context of an external question), $X$ the set of allowable inputs, and $f:X \to Y$ a mapping representing the dependence $y = f(x)$.
The question above means Is $f$ surjective?
• Let $Y \subset Z$ be a set of prospective values, $X$ the set of allowable inputs, and $f:X \to Z$ a mapping representing the dependence $y = f(x)$.
The question above means Is $Y \subset f(X)$?
Here's a selection of five examples, four of them kind of the same:
1. Is every real number the square of some real number? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575162853136,
"lm_q1q2_score": 0.8144800566567977,
"lm_q2_score": 0.8289388083214155,
"openwebmath_perplexity": 165.31622152722153,
"openwebmath_score": 0.9338002800941467,
"tags": null,
"url": "https://math.stackexchange.com/questions/2324433/what-is-the-purpose-of-a-function-being-surjective/2324441"
} |
c#, roslyn
public ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
{
get
{
return ImmutableArray.Create(Rule);
}
}
public ImmutableArray<SyntaxKind> SyntaxKindsOfInterest
{
get
{
return ImmutableArray.Create(SyntaxKind.CatchClause);
}
}
public void AnalyzeNode(SyntaxNode node, SemanticModel semanticModel, Action<Diagnostic> addDiagnostic, CancellationToken cancellationToken)
{
var clause = node as CatchClauseSyntax;
var exceptionType = clause.Declaration.Type;
var identifier = semanticModel.GetSymbolInfo(exceptionType);
var isGeneralException = identifier.Symbol.Name == typeof(Exception).Name;
var hasMultipleClauses = clause.Parent.ChildNodes().OfType<CatchClauseSyntax>().ToList().Count > 1; | {
"domain": "codereview.stackexchange",
"id": 8630,
"lm_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#, roslyn",
"url": null
} |
classical-mechanics
If the bucket has no lid, the water oozes up against the sides and runs out the open end. | {
"domain": "physics.stackexchange",
"id": 5120,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics",
"url": null
} |
java, performance, beginner, formatting, complexity
/* if voltage requested */
else if (Letter == 'v' || Letter == 'V') {
boolean flag = false;
Voltage Check=null;
/*check if it is in the list */
for (int i = 0; i <cir.getComponents().size();i++){
/* if that component is a voltage */
if(cir.getComponents().get(i) instanceof Voltage){
Check = (Voltage)cir.getComponents().get(i);
if (Check.getId() == Integer.parseInt(Number)){
/* if it is a voltage and in the list, remove it */
cir.getComponents().get(i).getNode1().disconnect(cir.getComponents().get(i));
cir.getComponents().get(i).getNode2().disconnect(cir.getComponents().get(i));
cir.getComponents().remove(i);
System.out.println("Removed component."); | {
"domain": "codereview.stackexchange",
"id": 33411,
"lm_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, beginner, formatting, complexity",
"url": null
} |
phase-kickback
here the state before the Controlled-NOT (CNOT) operation is:
$$\bigg(\dfrac{|0\rangle + |1\rangle}{\sqrt{2}} \bigg)\bigg(\dfrac{|0\rangle - |1\rangle}{\sqrt{2}} \bigg) = \dfrac{|00\rangle - |01\rangle + |10\rangle - |11\rangle}{2}$$
Hence
\begin{align} CNOT \bigg( \dfrac{|00\rangle - |01\rangle + |10\rangle - |11\rangle}{2} \bigg) &= \dfrac{|00\rangle - |01\rangle + |11\rangle - |10\rangle}{2}\\
&= \bigg( \dfrac{|0\rangle - |1\rangle}{\sqrt{2}} \bigg) \otimes \bigg( \dfrac{|0\rangle - |1\rangle}{\sqrt{2}} \bigg)
\end{align}
From here we can see that the controlled qubit started in the state $\dfrac{|0\rangle + |1\rangle}{\sqrt{2}}$ but ended in the state $\dfrac{|0\rangle - |1\rangle}{\sqrt{2}}$. Thus, it has picked up the overall phase of the state: $ -1 \bigg(\dfrac{|0\rangle - |1\rangle}{\sqrt{2}} \bigg) $ as its relative phase. | {
"domain": "quantumcomputing.stackexchange",
"id": 2134,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phase-kickback",
"url": null
} |
if the random number is odd. The first player to score 6 points wins. aWins and bWins count the number of wins Player A and Player B gets respectively. */ int main() { for (i = 0; i < n; i++) { cout << "\nNEW RUN-----------------------------------------\n"; play(); if (a == 6) aScores(); else { //b=4 cout << " B socres a point. \n A = " << a << "\n B = " << b << endl; play(); if (a == 6) aScores(); else { //b=5 cout << " B socres a point. \n A = " << a << "\n B = " << b << endl; play(); if (a == 6) aScores(); else { //b=6 cout << " B socres a point. \n A = " << a << "\n B = " << b << endl; bWins++; cout << " B wins.\n"; a = 5; b = 3; } } } } float aPer, bPer; // stores the percentage of winnings of both players. aPer = (aWins / n) * 100; bPer = (bWins / n) * 100; cout << "\nA wins " << aWins << " times. (" << aPer << ")\%" << endl; cout << "B wins " << bWins << " times. (" << bPer << ")\%" << endl; return 0; } void play() { r = rand(); cout << " Random no:" << r << endl; if (r % 2 == | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241956308277,
"lm_q1q2_score": 0.8238976224698505,
"lm_q2_score": 0.8499711718571774,
"openwebmath_perplexity": 295.9467945973229,
"openwebmath_score": 0.8728835582733154,
"tags": null,
"url": "https://math.stackexchange.com/questions/3017741/finding-the-probability-of-winning-an-interrupted-game"
} |
type-theory, dependent-type
Original source
Coq implementation.
Agda implementation.
The Coq source additionally describes the sufficient conditions for getting False. In short, we don't need U : U, it's enough to have two universes, where one is contained in the other, and both are closed under impredicative function types. | {
"domain": "cstheory.stackexchange",
"id": 5216,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "type-theory, dependent-type",
"url": null
} |
to use ap , gp and in this video all basic questions about sequence and series must be clear. If there are a small number of terms the sum is easy to find. Note: Substitute n = 6, a1 = −3, and r = 4 into the formula for sum of the first n terms of a geometric sequence. Sequences calculator overview: Whether you are using geometric or mathematical type formulas to find a specific numbers with a sequence it is very important that you should try using with a different approach using recursive sequence calculator to find the nth term with sum. A geometric sequence is one in which the ratio of consecutive terms is alwys the same number, a constant. ) Then a + dn is the value of the (n+1) th term. The common ratio can be positive or negative, an integer or a fraction. The sequence is 1, 7, 19, 37, 61, 91, 127, 169, 217, 271, 331 We can find the formula for the nth term by partitioning the hexagon into 3 parallelograms, plus the central spot. Remember, the common ratio is just the number we | {
"domain": "cyyy.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631675246404,
"lm_q1q2_score": 0.8282826483189709,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 211.30571646257576,
"openwebmath_score": 0.7763453722000122,
"tags": null,
"url": "http://jhkx.cyyy.pw/how-to-find-the-number-of-terms-in-a-geometric-sequence.html"
} |
python, beginner, web-scraping
poland = {
"poznan": {"city_id": 86470, "hotel_ids": [1711505, 163780, 932461, 1164703]},
"warszawa": {"city_id": 86484, "hotel_ids": [1503333, 93311, 93181, 93268, 106958, 106956,
127649, 106801, 107386, 93245, 154078, 107032]},
"sopot": {"city_id": 95266, "hotel_ids": [228481, 164126, 922891]},
"gdansk": {"city_id": 86490, "hotel_ids": [102961, 1008151, 102944, 1503323]},
"krakow": {"city_id": 86473, "hotel_ids": [931575, 925925, 102937, 148894, 125181, 930571,
114768, 125763, 106926, 102947, 131257]},
"wroclaw": {"city_id": 86485, "hotel_ids": [122767, 123690, 2873646, 1300328, 1511989, 121719]},
"ilawa": {"city_id": 110111, "hotel_ids": [2728378]},
"bydgoszcz": {"city_id": 86475, "hotel_ids": [936931]},
"kolobrzeg": {"city_id": 114376, "hotel_ids": [1288624, 1393804, 3185658, 1217228]},
"mikolajki": {"city_id": 110236, "hotel_ids": [2873760]}, | {
"domain": "codereview.stackexchange",
"id": 11591,
"lm_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, web-scraping",
"url": null
} |
python, python-3.x, programming-challenge, time-limit-exceeded
So we need to evaluate n+1 ... twice ... per direction iteration. Hundreds of thousands of adding 1 to n, to get exactly the same value. Ouch.
Compiled languages can do data flow analysis, and move constant expressions outside of loops. As Python is interpreted, (insert technobabble here), it cannot. So you end up doing an expensive n+1 addition each iteration. Why expensive? Because, integers are objects, and adding one to a large integer requires allocating a new integer object for the result. Since it is not saved in a variable, this newly created integer becomes unreferenced and then discarded from the heap, only to be computed again (including allocation & freeing) a microsecond later. Hundreds of thousands of times!
Should we store n + 1 in a local variable? Sure, that would work. But so would changing the sub-expression to:
not (0 < r_q_temp <= n) or not (0 < c_q_temp <= n) | {
"domain": "codereview.stackexchange",
"id": 36659,
"lm_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, programming-challenge, time-limit-exceeded",
"url": null
} |
In the example where $n=4$, the probability of winning by switching is $\frac{4-1}{4(4-2)}=\frac{3}{8}$.
-
I do realize this is the math site but I'm not actually very good at math. I do enjoy a brain teaser like this though and also enjoy trying to make it easy for people to understand. Here is how I think of this problem.
If you get 100 chances to take this test you will choose correctly 33 times (1 out of 3) and incorrectly 67 times. By switching you win 67 out of 100 times. Simple.
As others have noted, for four doors the odds are even better for switching if you eliminate all but two doors. Your initial guess will be right 25% of the time and wrong 75% of the time.
And the odds only get better as the number of doors increases... :)
-
## protected by Ragib ZamanDec 18 '13 at 11:32 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.983342957061873,
"lm_q1q2_score": 0.8318515378070829,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 765.8667170314341,
"openwebmath_score": 0.7283174395561218,
"tags": null,
"url": "http://math.stackexchange.com/questions/608957/monty-hall-problem-extended/609797"
} |
sequence-alignment, samtools, bwa, nextflow
[M::mem_pestat] analyzing insert size distribution for orientation FR...
[M::mem_pestat] (25, 50, 75) percentile: (248, 322, 429)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (1, 791)
[M::mem_pestat] mean and std.dev: (345.17, 129.22)
[M::mem_pestat] low and high boundaries for proper pairs: (1, 972)
[M::mem_pestat] skip orientation RF as there are not enough pairs
[M::mem_pestat] analyzing insert size distribution for orientation RR...
[M::mem_pestat] (25, 50, 75) percentile: (485, 777, 1315)
[M::mem_pestat] low and high boundaries for computing mean and std.dev: (1, 2975)
[M::mem_pestat] mean and std.dev: (961.60, 569.27)
[M::mem_pestat] low and high boundaries for proper pairs: (1, 3805)
[M::mem_pestat] skip orientation FF
[M::mem_pestat] skip orientation RR
[M::mem_process_seqs] Processed 700000 reads in 275.897 CPU sec, 39.910 real sec
[M::process] 0 single-end sequences; 700000 paired-end sequences | {
"domain": "bioinformatics.stackexchange",
"id": 2096,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sequence-alignment, samtools, bwa, nextflow",
"url": null
} |
filter-design, digital-filters, butterworth, bilinear-transform
Design a $N$-th order lowpass prototype of the analog Butterworth filter and you get an all-pole filter with poles
$$
p_{a, n} = e^{j\pi(2n-1+N)/2N}, \ \ \ n=1,\ldots, N \tag{1}
$$
Apply bilinear transform to convert the zeros and poles to a digital lowpass filter.
$$
s = \frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}} = 2f_s\frac{1-z^{-1}}{1+z^{-1}} \tag{2}
$$
Each pole is mapped to
$$
p_{d, n} = \frac{2f_s+p_{a, n}}{2f_s-p_{a,n}} \tag{3}
$$
and all zeros at $z_{a, n}=\pm\infty$ are mapped to $z_{d, n} = -1$.
Then normalize the gain at DC, i.e., let $s=0$ and $z=1$
$$
k_a \frac{1}{\prod_{n=1}^N{(s-p_{a, n})}}\Bigg|_{s=0} = k_d \frac{\prod_{n=1}^N(z-z_{d, n})}{\prod_{n=1}^N(z-p_{d, n})} \Bigg|_{z=1} \tag{4}
$$
and calculate $k_d$ from the equation above. | {
"domain": "dsp.stackexchange",
"id": 11308,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filter-design, digital-filters, butterworth, bilinear-transform",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.