text stringlengths 1 1.11k | source dict |
|---|---|
As for the second, what do you mean with $A^{\ast} A$? Would it be $A^t A$?
nein, I meant A squared, I just don't know how to do it with Latex...sorry
#### Fantini
MHB Math Helper
Oh, you meant $A \ast A$ as $A \cdot A = A^2$. Well, try writing $A^2 = - I$ and taking the determinant. It follows that $\det (A^2) = (\det A)^2 = \det(-I) = (-1)^n \det I = (-1)^n$. This equation will be true if and only if $n$ is even, because the determinant takes on real values and there are no real numbers whose square is negative.
Don't know about the third, sorry.
#### awkward
##### Member
Let A be an nXn real matrix
(a) show that if the transpose of A equals -A, and n is odd, then the determinant of A is 0.
(b) show that if (A*A)+I=0, then n must be even.
(c) if all the values of A are either 1 or -1, show that the determinant of A is divisible by $$2^{n-1}$$.
these are hard questions, I have no clue of to even start them...a solution to any of the questions will be appreciated ! | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513926334712,
"lm_q1q2_score": 0.8062522148549746,
"lm_q2_score": 0.8175744828610095,
"openwebmath_perplexity": 234.77518261044173,
"openwebmath_score": 0.7787701487541199,
"tags": null,
"url": "https://mathhelpboards.com/threads/determinants.1762/"
} |
slam, navigation, kinect, slam-gmapping, gmapping
Original comments
Comment by dornhege on 2013-01-30:
Actually I think if you are doing indoors stuff the short range of the kinect isn't really that much of a problem in comparison to the very limited field of view (55 deg vs. 180-270 deg of common lasers).
Comment by Jon Stephan on 2013-01-31:
Ok, that makes sense. It seems to do a good job building a map when it sees two walls in the same field of view, but not when it has to rotate from one wall to the other.
Comment by Jon Stephan on 2013-02-05:
Yep, tried again making sure I always had a corner in view, and it does much better. Unfortunately, I think that means it probably won't be able to autonomously build a map, without some heavy-duty programming.
Comment by Jon Stephan on 2013-02-05:
It would really help if I could save the map half-way through and use that as the initial map when restarting because it takes so long to map the house and it often screws up half-way through. I think I'll open a new question. | {
"domain": "robotics.stackexchange",
"id": 12630,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, kinect, slam-gmapping, gmapping",
"url": null
} |
organic-chemistry, nomenclature, stereochemistry, cis-trans-isomerism
The first atom in branches, marked as blue and as orange , have two hydrogen and one carbon each.So, there is nothing to clearly distinguish between the two branches.
So, we look at the only distinguishing feature between the two branches , which is the substituents on the carbon atom(marked as 2) attached to the carbon atom(marked as 1) on both sides.
We can see that the carbon atom marked as 2 on orange marked side has two carbon atoms and one hydrogen atom attached to it. This is of higher priority than the carbon on the blue marked side which has one carbon atom and two hydrogen atom attached to it.
Hence the Z-nomenclature as answered in the book. | {
"domain": "chemistry.stackexchange",
"id": 6650,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature, stereochemistry, cis-trans-isomerism",
"url": null
} |
ros, navigation, odometry, base-link, map-to-odom
Title: Fixing TF between base_link and odom
Hey , i am in the process of porting my robot from simulation to real world .
Finished URDF (robot_description) , which publishes the tf
Finished with the most essential stack such as robot_nav , robot_viz , robot_movebase
My Real Robot can now listen to cmd_vel and will responds correctly to it . I have written a script which accepts cmd_vel and publishes odom .
As you can see above the tf between odom and base_link is not yet published , what could be the reason for the same ?
"header:
seq: 40
stamp:
secs: 1517994494
nsecs: 929254055
frame_id: odom
child_frame_id: base_link
...."
As you can see the child_frame_id of the odom topic is base_link .
Originally posted by chris_sunny on ROS Answers with karma: 47 on 2018-02-07
Post score: 0
It is not sufficient, to publish this as an odometry Topic.
You Need to use a tf broadcaster to send the actual transformation via the tf tree. | {
"domain": "robotics.stackexchange",
"id": 29969,
"lm_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, odometry, base-link, map-to-odom",
"url": null
} |
At step 3 Alice radiates another segment from the angle vertex, thus she creates potential for two triangles. Bob counters the two triangles and eliminates another k-3 points. After step 3, 3k-1-2-3 points are eliminated.
This continues to step k+2 when Alice created potential for k+1 triangles. Bob can only block k triangles. If the game reaches this point then Bob looses.
However, after step k+1 Bob has eliminated $$k(k+1)-(1+2+...+k+1)=k(k+1)-\frac{(k+1)(k+2)}{2}=\frac{(k-2)(k+1)}{2}$$ points.
The points needed still in the game (for Alice to win) are one for the vertex plus k+2 to overcome k hops, that is k+3.
Now we have an inequation to determine k against n: $$\frac{(k-2)(k+1)}{2}+k+3\le n$$
$$k^2+k\le 2n-4$$
With n sufficiently large compared to k, Alice always wins for any value of k that satisfies the inequation. Otherwise Bob always wins. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303419461302,
"lm_q1q2_score": 0.8092600189374751,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 528.0850529715191,
"openwebmath_score": 0.7429024577140808,
"tags": null,
"url": "https://math.stackexchange.com/questions/3063167/a-simple-game-with-n-points-in-3d-space-red-triangle-wins/3666935"
} |
java, performance, beginner, game, role-playing-game
14, 14, 14, 14 },
{ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 6, 5, 7, 8, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14 },
{ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1, 0, 0, 2, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14 },
{ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1, 0, 0, 2, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14 },
{ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 10, 4, 4, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14 },
{ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14 },
{ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14 }, | {
"domain": "codereview.stackexchange",
"id": 35692,
"lm_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, game, role-playing-game",
"url": null
} |
python, algorithm, python-3.x, file
This means that it's in the correct scope, meaning we don't have to look out for it being used elsewhere.
It also means that you can remove dummy.clear().
Personally I would merge your two if statements together, to reduce the arrow anti-pattern.
It looks like dummy and your for loop can be replaced with str.maketrans and str.translate.
untested
file_name = "test.v"
test = ".test"
tezt = ".tezt"
trans_table = str.maketrans({'(': '(/*', ')': '*/)'})
with open(file_name, "r+") as f:
lines = f.readlines()
f.seek(0)
f.truncate()
for line in lines:
if ((test in line or tezt in line)
and line[line.index('(') + 1] != '/'
):
line = line.translate(trans_table)
f.write(line) | {
"domain": "codereview.stackexchange",
"id": 34878,
"lm_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, algorithm, python-3.x, file",
"url": null
} |
formal-languages, turing-machines, proof-techniques
For simplicity we'll write $\mapsto$ instead of $\mapsto_M$, note the following:
Lemma 1: $X^kq_00^nY^k1^m \mapsto^* X^{k + 1}q_00^{n - 1}Y^{k + 1}1^{m - 1}$ for $k, n, m \in \mathbb{N}; n,m \geq 1$ using only states $q_0, q_1, q_2 \notin F$.
This can be proven by applying the definitions of $\mapsto$ and $M$.
A corollary of Lemma 1 is that for $n \geq m$
$$X^kq_00^nY^k1^m \mapsto^* X^{k + m}q_00^{n - m}Y^{k + m}$$
and for $m \geq n$
$$X^kq_00^nY^k1^m \mapsto^* X^{k + n}q_0Y^{k + n}1^{m - n}$$
using only transitions through $q_0, q_1$ and $q_2$.
From this it follows that for all $n \in \mathbb{N}; n \geq 1$
$$\underbrace{q_00^n1^n}_{=\ X^0q_00^nY^01^n} \mapsto^* X^nq_0Y^n \mapsto X^nYq_3Y^{n - 1} \mapsto^* X^nY^nq_3B \mapsto X^nY^nBq_4B$$
with $q_4 \in F$, so by definition $0^n1^n \in L(M)$.
Now assume that $w \in \Sigma^*; w \notin \{0^n1^n : n \geq 1\}$, then one of the following cases must be true: | {
"domain": "cs.stackexchange",
"id": 21855,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, turing-machines, proof-techniques",
"url": null
} |
beginner, html5, css3
<TD CLASS="unliked"><A HREF="/colorliker/like_color_21/">No</A></TD>
</TR><TR>
<TD CLASS="color_name">orange</TD>
<TD CLASS="unliked"><A HREF="/colorliker/like_color_22/">No</A></TD>
</TR><TR>
<TD CLASS="color_name">purple</TD>
<TD CLASS="unliked"><A HREF="/colorliker/like_color_23/">No</A></TD>
</TR><TR>
<TD CLASS="color_name">red</TD>
<TD CLASS="unliked"><A HREF="/colorliker/like_color_24/">No</A></TD>
</TR><TR>
<TD CLASS="color_name">silver</TD>
<TD CLASS="unliked"><A HREF="/colorliker/like_color_25/">No</A></TD>
</TR><TR>
<TD CLASS="color_name">teal</TD>
<TD CLASS="unliked"><A HREF="/colorliker/like_color_26/">No</A></TD>
</TR><TR>
<TD CLASS="color_name">white</TD> | {
"domain": "codereview.stackexchange",
"id": 9604,
"lm_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, html5, css3",
"url": null
} |
the sawtooth's Fourier series. The top graph shows a function, xT (t) with half-wave symmetry along with the first four harmonics of the Fourier Series (only sines are needed because xT (t) is odd). In mathematics, a Fourier series decomposes periodic functions or periodic signals into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines (or complex exponentials). Fourier analysis is the study of how general functions can be decomposed into trigonometric or exponential functions with deflnite frequencies. where, as before, w0 is the base frequency of the signal and j = √-1 (often seen elsewhere as i ) The relationship between this bases and the previous. 2 that its Fourier series contains a constant 1 2 and sine terms. Another application of this Fourier series is to solve the Basel problem by using Parseval's theorem. where a0 models a constant (intercept) term in the data and is associated with the i = 0 cosine term, w is the. In mathematics, | {
"domain": "arcivasto.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474904166246,
"lm_q1q2_score": 0.8697816371789948,
"lm_q2_score": 0.8791467564270271,
"openwebmath_perplexity": 733.4239598063035,
"openwebmath_score": 0.860872745513916,
"tags": null,
"url": "http://arcivasto.it/zmhn/exponential-fourier-series-of-sawtooth-wave.html"
} |
waves
No. At radio frequencies we can produce signals on wires that contain all the frequency and phase information present in the free-space wave over a similar band. We aren't limited to representing only the amplitude or total energy impinging on an antenna.
At optical frequencies we can use various optical filters to isolate particular bands. We can also use detectors that are sensitive only to specific bands. More esoterically we can use nonlinear optical devices to manipulate optical signals and determine the phase of an optical signal.
I know that this is not true otherwise we would not be able to have radios,
In a conventional radio, the "detector" (actually the antenna) collects all the signals across a wide band of frequencies and produces an output voltage or current signal that contains all of those signals. Then mixers and filters are used on that signal to isolate the desired band on which a particular sender is found.
In comments you added: | {
"domain": "physics.stackexchange",
"id": 99077,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves",
"url": null
} |
c#, object-oriented
delay.Start();
var t = 0;
foreach (var lightState in delay.Iter(1)) {
var lightItems = lightState.Lights.Select(i => $"{i.Value.Name}: {i.Value.Status}");
Console.WriteLine(string.Join(", ", lightItems));
if (t++ == 100) {
break;
}
}
delay.Stop();
Console.ReadLine();
}
}
} Without a deep understanding of the logic of this challenge here are some general ideas about the code.
fields & properties
class DelayItem
{
public object[] Data;
public DelayTypes Type;
public DelayItem(DelayTypes type, object[] data)
{
Type = type;
Data = data;
}
}
Public mutable fields are generally a bad practice. You should use properties (if possible read-only) (immutable objects are easier to debug):
public DelayTypes Type { get; }
inheritance | {
"domain": "codereview.stackexchange",
"id": 25530,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, object-oriented",
"url": null
} |
python, python-3.x, networking
def __bytes__(self):
return self._bytes
def __setattr__(self, name, value):
self.__dict__[name] = value
# Actually, it's superflous to recalculate the WHOLE bytes object but
# it's the easiest to implement.
# TODO: ELIDE THIS INEFFICIENCY!
self.__dict__["_bytes"] = self._calc_bytes()
def __repr__(self):
return _repr(self)
class UserData:
def __init__(self, data):
self._data_str = "" | {
"domain": "codereview.stackexchange",
"id": 18379,
"lm_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, networking",
"url": null
} |
python, algorithm, computational-geometry
class Rectangle(object):
def __init__(self, left, right, bottom, top):
self. left = left
self.bottom = bottom
self.right = right
self.top = top
def overlap(r1, r2):
hoverlaps = True
voverlaps = True
if r1.left > r2.right or r1.right < r2.left:
hoverlaps = False
if r1.top < r2.bottom or r1.bottom > r2.top:
voverlaps = False
return hoverlaps and voverlaps
I need to compare rectangle in listA to listB the code goes like this which is highly inefficient - comparing one by one
for a in it.combinations(listB) :
for b in it.combinations(listA):
if a.overlap(b):
Any better efficient method to deal with the problem? Dec. 10, 2018
The simple answer is to use a 2-d segment tree. | {
"domain": "codereview.stackexchange",
"id": 22949,
"lm_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, algorithm, computational-geometry",
"url": null
} |
step to an even better another day, and also learning won't only end when the school bell rings. pdf: File Size: 163 kb: File Type: pdf: Download File. The exponential decay is a model in which the exponential function plays a key role and is one very useful model that fits many real life application theories. Answer: The exponential function is f(t) = 80 e. Exponential Growth And Decay College Algebra. a) Exponential growth or decay: b) Identify the initial amount: c) Identify the growth/decay factor: d) Write an exponential function to model the situation: e) “Do” the problem: 2. +250% Growth or decay e. Quiz #4 Exponential. Is the secret to getting rich winning the lottery? No! Compound interest and patience are!. 02)^t, y = (0. Math 0983 Learning Centre Exponential & Logarithmic Equations Until now, the equations you’ve been asked to solve have looked like x² − x + 6 = 0, where x has been in the base of any exponential expressions. U5D5 VIDEO. indd 313 22/5/15 7:50 AM/5/15 7:50 AM. | {
"domain": "lasalsese.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986151386528394,
"lm_q1q2_score": 0.8130442718361258,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 1259.2407936317254,
"openwebmath_score": 0.37754592299461365,
"tags": null,
"url": "http://ixda.lasalsese.it/exponential-growth-and-decay-math-lib-answer-key.html"
} |
statistical-mechanics, physical-chemistry, gas
Title: How can all of the virial coefficients be found for a gas that obeys the van der Waals equation of state? For a gas that obeys the van der Waals equation of state,
$ \left(p+\frac{an^2}{V^2}\right)(V-nb) = nRT $
what are all of the virial coefficients $B_1$, $B_2$,... in the Virial Expansion?
$ pV = nRT \left[1+B_1\frac{n}{V} + B_2 \left(\frac{n}{V}\right)^2 + \cdots \right] $ This feels a bit like a homework question, so you will only get half of the answer and need to do the final part. Make sure you understand what is going on though, so you can finish fast!
You need to try and write the VdW equation in the form suggested, and then find terms $\sim n/V$ or $\sim n^2 / V^2$ and identify the coefficients ($B_1$ and $B_2$ in this case).
You can start by rewriting
$$(p+{an^2 \over V^2})(V-nb) = nRT$$
as
$$pV-pnb+{an^2\over V}-{abn^3\over V^2} = nRT$$
so that
$$p(V-nb)=nRT+{an^2\over V}+{abn^3\over V^2}$$ | {
"domain": "physics.stackexchange",
"id": 81304,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, physical-chemistry, gas",
"url": null
} |
machine-learning, python, keras, cnn, image-classification
conv6 = Conv2D(64, kernel_size=(3,3), activation='relu',strides=(1, 1), padding='valid')(pool2)
conv7 = Conv2D(64, kernel_size=(3,3), activation='relu',strides=(1, 1), padding='valid')(conv6)
bat3 = BatchNormalization()(conv7)
conv7 = ZeroPadding2D(padding=(1, 1))(bat3)
pool3 = MaxPooling2D(pool_size=(1, 1))(conv7)
conv8 = Conv2D(128, kernel_size=(3,3), activation='relu', padding='valid', kernel_regularizer=regularizers.l2(0.01))(pool3)
conv9 = Conv2D(128, kernel_size=(2,2), activation='relu', strides=(1, 1), padding='valid')(conv8)
bat4 = BatchNormalization()(conv9)
pool4 = MaxPooling2D(pool_size=(1, 1))(bat4)
conv10 = Conv2D(256, kernel_size=(3,3), activation='relu', padding='valid', kernel_regularizer=regularizers.l2(0.02))(pool4)
conv11 = Conv2D(256, kernel_size=(3,3), activation='relu', padding='valid', kernel_regularizer=regularizers.l2(0.02))(conv10)
bat5 = BatchNormalization()(conv11)
pool5 = MaxPooling2D(pool_size=(1, 1))(bat5)
flat = Flatten()(pool5) | {
"domain": "datascience.stackexchange",
"id": 6011,
"lm_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, python, keras, cnn, image-classification",
"url": null
} |
geotechnical-engineering
Where backfill is used for the remediation of subsidence it's generally loose rock fill, because it's the cheapest form of backfill and excavations aren't going to be established against the backfill, particular in civil situations. In mining, the subsidence backfill can be loose rock, sand or tailings, or cemented rock, sand or tailings; depending on circumstance, what materials are available and how much the company is prepared to pay. | {
"domain": "engineering.stackexchange",
"id": 98,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geotechnical-engineering",
"url": null
} |
For $t=\sqrt2/2$ the three points will be collinear and it will automatically give a straight line. This must produce the same result as Yves Daoust's answer above, but using different interpretation. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363535858372,
"lm_q1q2_score": 0.8793169226804927,
"lm_q2_score": 0.8933094053442511,
"openwebmath_perplexity": 602.6528295535471,
"openwebmath_score": 0.7763229608535767,
"tags": null,
"url": "https://math.stackexchange.com/questions/1849134/what-equation-can-produce-these-curves"
} |
ros, documentation, services, wiki, messages
Originally posted by raul.perula on ROS Answers with karma: 71 on 2015-06-11
Post score: 1
Basically the MsgSrvDoc macro is naive and always try's to go reference the package and .msg from the latest ROS distribution, in this case Jade. Since your package is not released for anything but Hydro, it does not find the file needed to generate the documentation.
The easiest work around for this would be to release your package for Jade (and while you're at it Indigo). This doesn't take very much time and should fix your issue.
However, this is a pretty serious limitation of the macro, I would recommend you open an issue against our roswiki repository:
https://github.com/ros-infrastructure/roswiki/issues
I won't guarantee that we'll get around to addressing it in the near future, but at least the limitation will be captured and maybe someone else (maybe even yourself) can contribute a better macro. | {
"domain": "robotics.stackexchange",
"id": 21886,
"lm_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, documentation, services, wiki, messages",
"url": null
} |
runtime-analysis
Title: Can you substitute functions in Big-$\Theta$ notation? Say we have some function $f(n)=\Theta(\log n)$ and another function $g(n)=\Theta(n+\log n)$. Is it valid to substitute $f(n)$ for $\log n$, giving us $g(n) = \Theta(n + f(n))$? This seems obvious to me but I'm not sure if there is a weird edge case where this isn't true. Bit $\Theta$ gives big possibilities. Let's write down what we have, assuming appropriate conditions on constants and infinity neighbourhood:
$$f(n)=\Theta(\log n) \Leftrightarrow a_1 \log n \leqslant f \leqslant a_2 \log n$$
$$g(n)=\Theta(n+\log n) \Leftrightarrow b_1 (n+\log n) \leqslant g \leqslant b_2 (n+\log n)$$
Now we combine from above inequalities
$$ c_1 (n+f) \leqslant b_1n+\frac{b_1}{a_2}f\leqslant g \leqslant b_2 n + \frac{b_2}{a_1}f \leqslant c_2 (n+f) $$
which gives $g(n) = \Theta(n + f(n))$. | {
"domain": "cs.stackexchange",
"id": 17952,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "runtime-analysis",
"url": null
} |
physical-chemistry, thermodynamics
Title: Excluded Volume in van Der Waals equation I was just reading over the EOS topic when where I stumbled upon excluded volume.
Although the pictorial representation of the hard sphere model clearly shows that the excluded volume is 4 times the volume occupied by molecules, but what i am not unable to understand is that why do we take the sphere with diameter equal to one of the molecules in the first place.
So, my question is that why do we have to take the whole spehere.. | {
"domain": "chemistry.stackexchange",
"id": 12170,
"lm_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",
"url": null
} |
algorithms, optimization, mathematical-programming, packing
Title: ordered uniform distribution We are given $n$ objects with individual weights $w_1 , w_2 , \ldots , w_n$ and $m$ buckets in which these objects are to be inserted but in order. Here order means if object $i$ goes in bucket $m_i$ and if object $j$ goes in bucket $m_j$ then if $i < j$ then $m_i \le m_j$.
Objective of the problem is the minimize the weight (sum of weight of objects in the bucket) of the bucket which has the maximum weight (amongst all buckets) in such a distribution. Here is a solution for the decision version of your problem, where you give all bins a maximum total weight they can hold.
You go through your objects in order and assign them to the bins. There is no reason to move one object to the next bin if it fits into the actual bin. So always fill the current bin as much as possible before go over to the next bin. This greedy strategy will always be optimal. | {
"domain": "cs.stackexchange",
"id": 6769,
"lm_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, optimization, mathematical-programming, packing",
"url": null
} |
c++, constant-expression
template<bool CoefficientTest>
constexpr const char* returnName(const char* name)
{
static_assert(CoefficientTest, "coefficient does not exist");
return name;
}
int main()
{
static_assert(coefficientExists("VERSION"), "should exist");
static_assert(coefficientExists("TEST") == false, "should not exist");
static_assert(COEFF("ADAPTIVE") == "ADAPTIVE", "should return name");
COEFF("CHANNELS");
// data.modifyCoefficient(COEFF("ADAPTIVE"), 1);
return 0;
}
https://godbolt.org/z/kpGcMS With C++20's consteval this is now possible without static_assert or macro's.
Solution based on C++20 to eliminate runtime bugs and Compile-time format string checks.
#include <algorithm>
#include <array>
#include <string_view>
using namespace std::string_view_literals;
constexpr auto COEFFICIENTS = std::array{ "VERSION"sv, "CHANNELS"sv, "POWER"sv };
struct CoefficientName
{
std::string_view str; | {
"domain": "codereview.stackexchange",
"id": 43104,
"lm_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++, constant-expression",
"url": null
} |
photometry, angular-diameter
Figure 4 shows in the top panel the relation between the angular diameter predicted by the SB-relation versus radial variation, and in the bottom panel the angular diameter as a function of phase.
The SB-relation they're talking about is the one you cite in your question. So your process should be to take your list of $V-K$ colors over time and convert them to angular size using the surface brightness relation, then fit a function to that (via cubic spline, least squares, etc.) and determine the total angular variation over time.
I will note also that the $\theta$ vs $V-K$ relation you've cited here is equation 10 in the linked paper which is not a result of that paper. Their result is listed in equation 9 with equations 10 and 11 being results from other, previous work for the reader to compare. You should sure of which equation you want to use and cite the appropriate source. | {
"domain": "astronomy.stackexchange",
"id": 1765,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photometry, angular-diameter",
"url": null
} |
organic-chemistry, stereoselectivity, separation-techniques
Title: How to separate a racemic mixture of 1,2-diols [upjohn dihydroxylation]2I want to ask that i synthesise R-substituted-1,2-Diol with (ee=1:1) ratio of R-, S- with the help of Upjohn Dihydroxylation. i try to seprate it by different mobile phasese but failed to separate, then i try -OTBS at primary alcohol by wish that may it work and make two seprate points at TLC but i failed, i need both R- and S- enantiomers of Diol. | {
"domain": "chemistry.stackexchange",
"id": 13032,
"lm_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, stereoselectivity, separation-techniques",
"url": null
} |
thermodynamics
And another point I am confused is that what is the system here? The cycle? or $T_1$, $T_2$ and surroundings? According to the inequalities in the picture and your definitions, the system is the cycle engine. Heat flows from hot bath to the system, thus it is positive, heat flows out of the system to cold bath thus it is negative, work is done by the system on surrounding thus it is negative.
The arrows in the picture correctly describe energy flow and next to them is value of the energy transferred in the direction of the arrows. Since $q_2$ and $w$ are defined to flow into the system, i.e. against the drawn arrows, energy transferred in the direction of the arrows will be with minus sign.
To expand on the arrows:
The $q_2$ is defined to be heat that flows into the engine from cold bath. Because heat in fact flows the other way around, it is negative. This is given before you even draw the picture. | {
"domain": "physics.stackexchange",
"id": 70408,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics",
"url": null
} |
javascript, memory-management, backbone.js, garbage-collection
function setTimeout(fn, msec, App) {
var id = window.setTimeout(function () {
fn();
destructor.removeReference = null;
}, msec),
destructor = {
removeReference: function () { window.clearTimeout(id); }
};
App.once.push(destructor);
} | {
"domain": "codereview.stackexchange",
"id": 1698,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, memory-management, backbone.js, garbage-collection",
"url": null
} |
ros
Title: rostopic pub /topic_name sensor_msgs/JointState [arguments]
Hi !
I run this command line:
rostopic pub servo sensor_msgs/JointState '{header: {seq:0, stamp: {secs:0, nsecs:0}, frame_id:""}, name:["art1"],position:[150.0], velocity:[0.0], effort:[0.0]}' --once
and i get the following error:
emilio@emilio-N61Vg:~/catkin_ws$ rostopic pub servo sensor_msgs/JointState '{header: {seq:0, stamp: {secs:0, nsecs:0}, frame_id:""}, name:["art1"],position:[150.0], velocity:[0.0], effort:[0.0]}' --once
Usage: rostopic pub /topic type [args...]
rostopic: error: Argument error: while scanning a plain scalar
in "<string>", line 1, column 11:
{header: {seq:0, stamp: {secs:0, nsecs:0}, ...
^
found unexpected ':'
in "<string>", line 1, column 14:
{header: {seq:0, stamp: {secs:0, nsecs:0}, fr ...
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details. | {
"domain": "robotics.stackexchange",
"id": 22441,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
complexity-theory, graphs, np-complete, reductions, shortest-path
The second path will be the complement path, i.e., it will go threw the lower part of each component with an index in $I$, and threw the upper part of each component with an index not in $I$. Therefore, its weight will be $\sum_{i\not \in I}x_i=\sum_{i=1}^n x_i - \sum_{i\in I}x_i=M$ as well.
Thus, the two paths are edge disjoint and bounded by $M$ as required.
Now, assume that we are given a pair of edge disjoint paths between $s$ and $t$, so that the weights of each is at most $M$. By the construction, the weight of each is exactly $M$. Let $I=\left\{ {i_1,\ldots,i_k} \right\}$ be the components with an upper part traveled by the first path. Obviously, $I$ partitions the $x_i$'s properly. | {
"domain": "cs.stackexchange",
"id": 3234,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, graphs, np-complete, reductions, shortest-path",
"url": null
} |
-
I'm a little confused. Do you mean an $a\in\mathbb{R}^m$ instead of $\in\mathbb{R}^n$? – Neal Mar 17 '12 at 0:18
Yes, I misspelled, it is, in fact, $a\in\mathbb{R}^m$. – Marra Mar 17 '12 at 0:24
Let $g:\mathbb{R}^n\to\mathbb{R}^m$ be defined by the rule $g(x)=Tx+a$ for all $x\in\mathbb{R}^n$ and let $f:\mathbb{R}^n\to \mathbb{R}^m$ be a differentiable function such that $f'(x)=T$ for all $x\in\mathbb{R}^n$.
If $h=f-g$, then prove that $h'(x)=0$ for all $x\in\mathbb{R}^n$. Finally, prove that this implies $h(x)=c$ for all $x\in\mathbb{R}^n$ and some $c\in\mathbb{R}^m$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759615719876,
"lm_q1q2_score": 0.8236748590710499,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 196.7134355642203,
"openwebmath_score": 0.9844304919242859,
"tags": null,
"url": "http://math.stackexchange.com/questions/121139/derivative-is-a-constant"
} |
logic, proof-techniques, first-order-logic, induction
Here the Refl data constructor corresponds to your first rule, and the Trans data constructor corresponds to your second rule. R represents $\to$, so Star R corresponds to $\to^*$. The induction rule corresponds to the eliminator for the data type, i.e. roughly the fold on that type (though things are a bit more complicated in a dependently typed language).
ind : {A : Set}{R : A → A → Set}{P : A → A → Set}
→ ({a : A} → P a a) → ({a b c : A} → P a b → R b c → P a c)
→ {a b : A} → Star R a b → P a b
ind r t Refl = r
ind r t (Trans s x) = t (ind r t s) x | {
"domain": "cs.stackexchange",
"id": 8821,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "logic, proof-techniques, first-order-logic, induction",
"url": null
} |
reference-request, fl.formal-languages, dc.distributed-comp, concurrency
to be 0 if they are identical, and $d(\sigma, \sigma') = 2^{-j}$ otherwise, where $j$ is the length of the longest common prefix on which they agree. With this metric, the safety property can be characterized as closed sets topologically. | {
"domain": "cstheory.stackexchange",
"id": 2523,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, fl.formal-languages, dc.distributed-comp, concurrency",
"url": null
} |
c++, library, mongodb, constructor
// You should be able to use any combination of options
// in any order.
//
// The reason to do this is to avoid an explosion in constructors
// with different parameters in different orders.
//
// With Only 4 options there are 8 different constructors needed.
// With other commands (like Find) the number of options is 16
// Which would lead to thousands of constructors. | {
"domain": "codereview.stackexchange",
"id": 40477,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, library, mongodb, constructor",
"url": null
} |
organic-chemistry, physical-chemistry
It has been shown that the log P of a compound can be determined by the sum of its non-overlapping molecular fragments (defined as one or more atoms covalently bound to each other within the molecule). Fragmentary log P values have been determined in a statistical method analogous to the atomic methods (least squares fitting to a training set). In addition, Hammett type corrections are included to account of electronic and steric effects. This method in general gives better results than atomic based methods, but cannot be used to predict partition coefficients for molecules containing unusual functional groups for which the method has not yet been parameterized (most likely because of the lack of experimental data for molecules containing such functional groups). | {
"domain": "chemistry.stackexchange",
"id": 24,
"lm_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, physical-chemistry",
"url": null
} |
and return either 0 or 1 based on the flip. If for some reason, the coin being flipped has probabilities that are not 50/50 ( like those trick coins they sell in magic store where one side is heavier than the other), then this is considered a biased coin. Consider a coin with bias B, i. Then the probability - where nH is the number of heads turned up during. Algorithm A applied to the MC may be viewed as doing the following: 1. Modify the event handler in the Coin Flip app to use random fraction instead of random integer. 36 What is the probability that it will come down tails both time? Is it 1 - 0. Consider a coin with probability B (for bias) of flipping heads. Heads 30 Coo 30 L/. While win remains equal to zero, the players continue to flip the coin. Visualize the relationship of a coin’s bias to its entropy with this code snippet. With the coin being flipped, the result of whether the coin coming up "heads" or "tails". If we had some weird biased coin that had both sides being | {
"domain": "rdswatersports.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018347594027,
"lm_q1q2_score": 0.814765078294547,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 446.46583073311524,
"openwebmath_score": 0.7222005128860474,
"tags": null,
"url": "http://zynh.rdswatersports.it/biased-coin-flip.html"
} |
clustering, k-means, unsupervised-learning
Both procedures can lead to indefinite running time, but if the number of this kind of adjustments is finite (and usually it is) that it will converge with no problem. To guard yourself from infinite running time you can set an upper bound for the number of adjustments.
The procedure itself is not practical if you have a huge data set a a large number of clusters. The running time can became prohibitive.
Another procedure to decrease the chances for that to happen is to use a better initialization procedure, like k-means++. In fact the second suggestion is an idea from k-means++. There are no guarantees, however.
Finally a note regarding implementation. If you can't change to code of the algorithm to make those improvements on the fly, your only option which comes to my mind is to start a new clustering procedure where you initialize the centroid positions for non-stale clusters, and follow procedures for stale clusters. | {
"domain": "datascience.stackexchange",
"id": 627,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "clustering, k-means, unsupervised-learning",
"url": null
} |
python, python-3.x, random, numpy, vectorization
As of now, only the 2-dimensional case is viewable. I can implement something similar for the 1-dimensional and 3-dimensional cases, but I am more concerned with the methods rather than the graph (for now). That said, one can run this algorithm in 10-dimensional space without the graph.
Here is an example call:
np.random.seed(327) ## reproduce random results
## initial position
# pos = (50, 50, 50, 50, 50, 50, 50, 50, 50, 50) ## 10-D
pos = (50, 50) ## 2-D
## number of steps to travel
nsteps = 100
## random number distribution
## average = 50, spread=10
## positive step if random number > 50
## negative step if random number < 50
## no step if random number = 0
distribution = 'normal'
kwargs = {'mu' : 50, 'sigma' : 10} # 'threshold' : 50}
## boundary conditions
max_edges = np.array([60 for element in pos])
min_edges = np.array([40 for element in pos])
edge_type = None
# edge_type = 'pacman'
# edge_type = 'bounded' | {
"domain": "codereview.stackexchange",
"id": 33624,
"lm_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, random, numpy, vectorization",
"url": null
} |
javascript, optimization
We return what is essentially (but not exactly) Math.floor (~~) of 2 to the power of the input - the value we previously found. That = the amount of subnets
*/
function onBits(bits) {
// Turns the CIDR into 1s and 0s
var one = "1",
two = "0";
// Adds "1"s or "0"s until we've added as many as there are bits (CIDR)
for (var i = ""; i.length < bits;) {
i += one;
}
// Same, but in reverse so we can count the off bits
for (var v = ""; v.length < (32 - bits);) {
v += two;
}
var binarystring = i + v;
// Inserts a period after every 8th character
return binarystring.replace(/\B(?=(\d{8})+(?!\d))/g, ".");
} | {
"domain": "codereview.stackexchange",
"id": 8296,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, optimization",
"url": null
} |
c++, algorithm, template, c++20
Propose idct3_detail and idct3 template functions implementation.
Why a new review is being asked for?
If there is any possible improvement, please let me know. Use std::uint8_t instead of BYTE
I see you are declaring a type alias BYTE. However, I think that is a bad idea. If you really wanted to talk about an opaque byte, then since C++17 there is std::byte. However, you cannot do any arithmetic with std::bytes. Instead, you want to treat bytes as 8 bit integers. There is already a perfect type for this: std::uint8_t. I recommend you use that instead of declaring your own type alias, as it is less confusing for someone who doesn't know what you mean by BYTE without looking up how it is declared.
Avoid macros
There is no reason to make is_size_same() a macro, you can just make it a function:
constexpr void assert_size_same(const auto& x, const auto& y) {
assert(x.getWidth() == y.getWidth());
assert(x.getHeight() == y.getHeight());
} | {
"domain": "codereview.stackexchange",
"id": 42637,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, template, c++20",
"url": null
} |
homework-and-exercises, newtonian-mechanics, rotational-dynamics, friction
Please give appropriate explanation and point out any faults in any of the explanation mentioned above. Any suggestions are massively appreciated. This is indeed a tricky concept. Consider a perfectly rigid cylinder on a perfectly rigid horizontal plane moving in a direction perpendicular to its axis. Let the radius of the cylinder be $R$, its velocity be $v$ and its angular velocity by $\omega$.
If there is no friction between the cylinder and plane, the cylinder will continue with constant $v$ and $\omega$ forever. It is not necessary for $v=R\omega$. $v$ and $\omega$ are independent of each other.
If there is sufficient friction between the cylinder and plane and $v \neq R\omega$, friction will act such that the cylinder ends up with $v=R\omega$. At this point, once $v=R\omega$, there will be no friction at all. The cylinder will continue with $v=R\omega$ forever. The velocity of the point of contact with respect to the plane is zero. | {
"domain": "physics.stackexchange",
"id": 98294,
"lm_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, rotational-dynamics, friction",
"url": null
} |
python, object-oriented, python-3.x, finance, sqlite
subject = 'Authorization code'
body = 'Authorization code: {}\n \
Use the authorization code when setting your pin for the first time'.format(auth_code)
email_user = 'testpython79@gmail.com'
email_send = 'testpython79@gmail.com'
email_pass = 'Liverpool27'
msg = MIMEMultipart()
msg['From'] = email_user
msg['To'] = email_send
msg['Subject'] = subject | {
"domain": "codereview.stackexchange",
"id": 33753,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented, python-3.x, finance, sqlite",
"url": null
} |
c#, .net, unit-testing
var actual = input.Abbreviation();
Assert.AreEqual(expected, actual);
}
}
All the tests pass at the moment. I would define API a little bit different. Let’s go with couple types: SizeUnit and DataSize, so they can be used as:
using static SizeUnit;
using static Console;
class Program
{
static void Main(string[] args)
{
double one = 1.0;
DataSize size = one.In(Kilobyte);
WriteLine(size); // 1 kB
SizeUnit unit = Byte;
DataSize size2 = size.To(unit);
WriteLine(size2); // 1024 B
WriteLine(one.In(Byte) + one.In(Kilobyte)); // 1025 B
WriteLine(one.In(Bit) + one.In(Byte)); // 9 b
}
}
Where library code (a little bit simplified just to demonstrate api):
public class SizeUnit
{
public static readonly SizeUnit Bit = new SizeUnit("b", 0.125);
public static readonly SizeUnit Byte = new SizeUnit("B", 1);
public static readonly SizeUnit Kilobyte = new SizeUnit("kB", 1024);
// etc... | {
"domain": "codereview.stackexchange",
"id": 21779,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, .net, unit-testing",
"url": null
} |
strings, formatting, go
Title: Go string formatting I'm very new to Go, and am trying to get some experience by re-writing some of my Python code in Go. Below is a function that takes an IP address (ipv4) in integer form and returns the string version. From 572779703 to 34.35.236.183 for example.
func int2ip(num int) (string) {
result := [4]int{}
for i, n := range []uint{24, 16, 8, 0} {
result[i] = (num >> n) & 255
}
return fmt.Sprintf("%d.%d.%d.%d", result[0], result[1], result[2], result[3])
} | {
"domain": "codereview.stackexchange",
"id": 9198,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, formatting, go",
"url": null
} |
function to be integrated is known only at a finite set of discrete points Parameters under control – the degree of. In the case that the independent variables of the experimental data are distributed uniformly, this method reduces to the well-known Simpson's Rule for numerical quadrature. The Database Research Group is motivated to invent new database technology to power the next generation of Internet scale open data initiative. modes of a numerical model are physically meaningless, should be insignificantly small, but are potentially lightly-damped, and can dominate the errors in numerical integration. Learn vocabulary, terms, and more with flashcards, games, and other study tools. They are indeed responsible for a nonlinear instability arising from the amplification of aliasing errors that come from the evaluation of the products of two or more variables on a finite grid. So, if I multiply these values, would it be correct to integrate only that final value with some rule of | {
"domain": "cbeu.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982287698185481,
"lm_q1q2_score": 0.8053711333692151,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 661.7691727436978,
"openwebmath_score": 0.6184567809104919,
"tags": null,
"url": "http://luxu.cbeu.pw/numerical-integration-of-discrete-data.html"
} |
ros2
It determines the --root by looking for known names in the path hierarchy, namely include, src, test. If you are using the latest release of ROS 2 (Ardent) this will likely not work for you. There was recently a fix for this logic (see https://github.com/ament/ament_lint/pull/94). You might want to consider to use a newer version of this package from source to make this work for your use case.
It also looks for the root of a git repository in case your code is using that. I guess that is not the case for you though.
Originally posted by Dirk Thomas with karma: 16276 on 2018-03-17
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by dennis.bergin on 2018-03-24:
Thank you for the information. I updated my version of ament. The problem has been alleviated. | {
"domain": "robotics.stackexchange",
"id": 30317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
## Solution 7 (Casework)
For ascending, if the $1$ goes in anything but the first two slots, the rest of the numbers have to go in ascending from $2$, which are $4$ cases if there are $6$ cards. If $1$ goes in the second spot, then you can put any of the rest in the first slot but then the rest are determined, so in the case of $6$ cards, that gives $5$ more. If $1$ goes in the first slot, that means that you are doing the same problem with $n-1$ cards. So the recursion is $a_n=(n-2)+(n-1)+a_{n-1}$. There's $a_1=1$ and $a_2=2$, so you get $a_3=2+3=5$, $a_4=5+5=10$, $a_5=7+10=17$, and $a_6=9+17=26$. Or you can see that $a_n=(n-1)^2+1$. We double to account for descending and get $\boxed{052}$.
~ahclark11
## Solution 8 (Symmetry and Case Study)
First, we know that ascending order and descending order are symmetrical to each other (namely, if we get 132456 where after we take out 3, it will be one scenario; and if we flip it and write 654231, it will be another scenario) | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9895109078121008,
"lm_q1q2_score": 0.8525014504521667,
"lm_q2_score": 0.8615382040983515,
"openwebmath_perplexity": 282.7314736892491,
"openwebmath_score": 0.778374433517456,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2020_AIME_I_Problems/Problem_5&diff=next&oldid=149207"
} |
c++, beginner, linked-list, reinventing-the-wheel, c++17
// Accessors
reference front();
const_reference front() const;
reference back();
const_reference back() const; | {
"domain": "codereview.stackexchange",
"id": 36513,
"lm_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, reinventing-the-wheel, c++17",
"url": null
} |
ros2
like how xacro does this, you mean ? ;)
Comment by gvdhoorn on 2019-07-12:
As an example of using empy, see the way (the) O(S)R(F) created the worlds and parts for the ARIAC challenge: osrf/ariac/src/osrf_gear/worlds/gear.world.template. It's just one example, but does illustrate the idea.
Comment by ChuiV on 2019-07-12:
Correct. I've used Jinja2 in the past to create urdfs where each sensor type (gps, imu, camera, etc) was it's own template. When I needed to test a new sensor configuration, I could just include that template, and pass it the correct parameters of where to mount the sensor, frequency to publish data, topic to publish on, noise parameters, etc. It worked quite well.
Comment by gvdhoorn on 2019-07-12:
Which again is exactly how it works with xacro :)
Not saying using something else cannot be beneficial, just making sure it's clear that that is not much different from how xacro works. See ubi-agni/human_hand/model/human_hand.urdf.xacro for an example. | {
"domain": "robotics.stackexchange",
"id": 33398,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
astrophysics, collision, sun, estimation, jupiter
Instead I put forward a couple of scenarios where the large amount of accreted energy and/or angular momentum certainly do have an effect on the Sun and/or the radiation the Earth receives from the Sun.
Scenario 1: The scenario where Jupiter just drops into the Sun from its current position would certainly have short-term effects. But short-term here means compared with the lifetime of the Sun, not hundreds of years.
The kinetic energy of Jupiter at the Sun's surface would be of order $GM_{\odot}M_\mathrm{Jup}/R_{\odot} \sim 4\times 10^{38}$ joules.
The solar luminosity is $3.83 \times 10^{26}\ \mathrm{J/s}$. | {
"domain": "physics.stackexchange",
"id": 48451,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, collision, sun, estimation, jupiter",
"url": null
} |
python, performance, numpy, statistics
What this suggests is that there is a "sweet spot" for sample_size * len(m1) (perhaps related to the computer's cache size) and so you'll get the best results by processing the samples in chunks of that length.
You don't say exactly how you're testing it, but different results are surely to be expected, since scipy.stats.gaussian_kde.resample "Randomly samples a dataset from the estimated pdf". | {
"domain": "codereview.stackexchange",
"id": 6307,
"lm_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, numpy, statistics",
"url": null
} |
safety, solvents
Title: How hazardous are peroxide-able ethers if stored properly? This question is directed towards laboratory scientists and technicians who actually deal with ethers that can develop peroxides upon concentration (e.g. diethyl ether, THF, dioxane). I am already very familiar with the literature, the normal precautions (dispose of after 1 year, test for peroxides, etc.), how to remove peroxides (shake with ferrous salt or metabisulfate).
My question is how hazardous are peroxides in reality if stored properly. If a peroxide-able ether upon concentration is stored in a cool dark cabinet, is rarely opened, has an inhibitor (BHT or ethanol), and argon is used above the headspace, it is likely that the ether can be used for longer than a year? | {
"domain": "chemistry.stackexchange",
"id": 1841,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "safety, solvents",
"url": null
} |
at the University of Pennsylvania. Before this, the construction of M was by way of a highly nonassociative algebra $$B$$, the Griess algebra, of dimension 196,883. As such, every course that I teach includes cooperative assignments completed in and out of the classroom. Interests; Publications; Students; New Events; Personal . Randolph mathematics professor Michael Penn recently published an article in the International Journal of Mathematics. Giving an introverted student the opportunity to speak up and contribute in a setting which is often less intimidating than the class as a whole. I aim to foster a supportive community of students as they continue to develop the collaborative problem solving skills that are not only important for the learning of mathematics but are essential for understanding and contributing to our changing world. | {
"domain": "przywidz.pl",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924745261419,
"lm_q1q2_score": 0.8035576424387001,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 1740.0628830725352,
"openwebmath_score": 0.2367328256368637,
"tags": null,
"url": "https://przywidz.pl/blog/be5d0f-michael-penn-math"
} |
javascript, jquery, html, css, game
for (x = 0; x < width; x++) {
if (x && x % 5 === 0) {
$("<td/>").addClass("nonogram_separation_column").appendTo(tr);
}
$("<td/>")
.attr("id", this._idOfColumnDefinition(x))
.addClass("nonogram_definition nonogram_column_definition")
.html(this._columnDefinitionToHTML(this._model.getColumnDefinition(x)))
.appendTo(tr);
}
tr.appendTo(table);
for (y = 0; y < height; y++) {
// Separate groups of five rows
if (y && y % 5 == 0) {
$("<tr/>")
.addClass("nonogram_separation_row")
.append($("<td colspan='" + (width + width - 1) + "'/>"))
.appendTo(table);
}
// Create new row
tr = $("<tr/>").addClass("nonogram_row"); | {
"domain": "codereview.stackexchange",
"id": 4460,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, html, css, game",
"url": null
} |
computer-architecture, cpu-cache, memory-access
First thing that came to my mind was, how to calculate the transfer time using the given access time. During a miss, a block of data is moved from main memory to cache. Then CPU will access it. So, wouldn't be access time > transfer time ?
Then I thought, lets assume access time = transfer time & do the calculation.
Now first question. The question already states there is a miss in L1, so I will not consider L1 access time. Since there is a miss in L1 & hit in L2, a entire block from L2 has to be moved to L1. L2 block size is 16 words, but data bus size is 4 words.
So we have to move 4 words * 4 times.
To transfer 4 word it takes 20 ns. To transfer 4 words, its 80ns. Isn't it the time transferred from L2 to L1 ? The question does not say anything about accessing L1 after moving the data. But 80ns is not in the option !
Similar case with second question also.
Time to move main memory to L2 = 4 words * 4 times = 4 * 200 = 800ns
Time to move L2 to L1 = 80ns [earlier calculation] | {
"domain": "cs.stackexchange",
"id": 5873,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computer-architecture, cpu-cache, memory-access",
"url": null
} |
javascript, xml
expect.tagname=false;
expect.textend=false
}else if(expect.tag){//closure <.../*>
textend()
}
}else if(reserve.curchar===">"||reserve.curchar==="="||reserve.curchar===" "||reserve.curchar===" "){
textend()
}
}else{
if(expect.textend){
reserve.textf+=reserve.curchar
}else{
reserve.textf=reserve.curchar;
expect.textend=true
}
}
text=text.substring(1)
};
expect=null;
textend=null;
text=null;
reserve=null;
return tree
} | {
"domain": "codereview.stackexchange",
"id": 19040,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, xml",
"url": null
} |
c, virtual-machine
void vm_exec(struct vm_cpu *const vm)
{
uint64_t b, a;
double da, db;
static const void *dispatch[] = {
&&exec_nop,
&&exec_push, &&exec_pop, &&exec_pushsp, &&exec_popsp,
&&exec_add, &&exec_fadd, &&exec_sub, &&exec_fsub,
&&exec_mul, &&exec_fmul, &&exec_idiv, &&exec_fdiv, &&exec_mod,
&&exec_jmp, &&exec_lt, &&exec_gt, &&exec_cmp,
&&exec_jnz, &&exec_jz,
&&exec_inc, &&exec_dec, &&exec_shl, &&exec_shr, &&exec_and, &&exec_or, &&exec_xor, &&exec_not,
&&exec_cpy, &&exec_swap, &&exec_load, &&exec_store,
&&exec_call, &&exec_ret,
//&&exec_z,
&&exec_halt
}; | {
"domain": "codereview.stackexchange",
"id": 26273,
"lm_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, virtual-machine",
"url": null
} |
quantum-mechanics
What is wrong here? This problem is rooted in the way we derive quantum mechanics from the classical theory. Basically a quantum theory is a more complex object than a classical theory, so you will need to specify more information about it in order to it to be well defined. Thus after you have defined the hilbert space and it's operators you will need to choose an ordering prescription that will generalize your operators in the case of non commuting objects and that will reduce to the classical case when $\hat{x}$ and $\hat{p}$ (and so on) are not operators. So a possible choice for $\hat{H}$ is $$ \hat{H}=\frac{\omega}{2}(\hat{x}\hat{p}+\hat{p}\hat{x})$$ is the symmetrized ordering (also called weyl quantization) but really it's kinda aribtrary as long as $\hat{H}$ is hermitian (since it's observable) and reduces to it's classical analogue when: $$\hat{p}\rightarrow p\\\hat{x} \rightarrow x$$ A method to deal with those cases was developed by Weyl, Wigner and others and has generated | {
"domain": "physics.stackexchange",
"id": 20806,
"lm_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",
"url": null
} |
robotic-arm, kinect
Originally posted by ahendrix with karma: 47576 on 2013-09-17
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by DrBot on 2014-10-31:
I recently tried openni and freenect without success on a Radxa Rock board. though lsusb sees the Kinect, no data is getting published. The openni roslaunch gives a USB device not supported! message. I am thinking this a Radxa kernel module issue.
Comment by ROS_Portland_State_University_Robot on 2014-12-14:
ROS's libfreenect drivers do NOT work: they are defective and crash the Kinect. Your error report (output) is exactly what you get with those defective "drivers".
The only always working drivers are Avin2
Comment by ahendrix on 2014-12-14:
I've had no trouble with the libfreenect drivers, and no trouble with the USB ports on any of my many ASUS boards. Please try to stay on-topic and be constructive with your criticism. | {
"domain": "robotics.stackexchange",
"id": 15354,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robotic-arm, kinect",
"url": null
} |
• I don't know why this received a downvote. Nov 20 '17 at 17:05
• Yes, you should correct them. Arbitrary means an implicit quantifier in a way that random doesn't. Nov 20 '17 at 17:09
• You are right that they are wrong. Whether you are right in correcting them is a completely different question, and depends, among other things, on the students' age / cognitive level. Although if they are writing proofs, they are probably far enough along that you should correct them. Nov 20 '17 at 17:10
• @Arthur, I'd say no matter the age, it is the right thing to do to point that there is difference in meaning. What depends on age/cognitive level is how deeply one should go in explaining the difference and how insisting one should be that the students use those phrases correctly. Nov 20 '17 at 17:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.927363293639213,
"lm_q1q2_score": 0.8426188935909183,
"lm_q2_score": 0.9086179055936797,
"openwebmath_perplexity": 337.14570033917676,
"openwebmath_score": 0.6907694935798645,
"tags": null,
"url": "https://math.stackexchange.com/questions/2529446/arbitrary-vs-random/2529701"
} |
robot-state-publisher
</robot>
The Python file (based on the publisher tutorial):
#!/usr/bin/env python
# license removed for brevity
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import JointState
import tf
br = tf.TransformBroadcaster();
def get_param(name, value=None):
private = "~%s" % name
if rospy.has_param(private):
return rospy.get_param(private)
elif rospy.has_param(name):
return rospy.get_param(name)
else:
return value | {
"domain": "robotics.stackexchange",
"id": 29319,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robot-state-publisher",
"url": null
} |
ros, ros-groovy, pandaboard, transform
from /opt/ros/groovy/lib/libroscpp.so
#6 0x4004b8f8 in tf::TransformListener::dedicatedListenerThread() ()
from /opt/ros/groovy/lib/libtf.so
#7 0x4004b654 in boost::detail::thread_data, boost::_bi::list1 > > >::run() () from /opt/ros/groovy/lib/libtf.so
#8 0x403c6602 in thread_proxy () from /usr/lib/libboost_thread.so.1.46.1
#9 0x40099ed2 in start_thread ()
from /lib/arm-linux-gnueabihf/libpthread.so.0
#10 0x4035df18 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#11 0x4035df18 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?) | {
"domain": "robotics.stackexchange",
"id": 15169,
"lm_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-groovy, pandaboard, transform",
"url": null
} |
c#, asp.net, overloading
Now, that's a little better... but I'd warmly recommend you consider implementing validation using the tools the framework is giving you; validation is a solved problem, no need to implement your own framework for it - that switch block smells like you're working at a much lower level of abstraction than that of the tools the framework is putting in your hands. You probably don't need that switch block at all. | {
"domain": "codereview.stackexchange",
"id": 22162,
"lm_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#, asp.net, overloading",
"url": null
} |
navigation, mapping, ros-kinetic, 2dlidar, hector-mapping
This time all frames are connected, no error, but it only shows the scanning data, not the map, could you advise what the problem is? (tf tree placed in question)
Comment by IvyKK on 2018-10-10:
Delb, Thank you! There is no more error showing now, however the map is still not showing...
The tf tree now has map connected to -> odom->base_footprint->base_link->laser_frame
and also map->scanmatcher_frame...(I also put the summary in the terminal if you would like to have a look)
Comment by IvyKK on 2018-10-10:
I tried to put in | {
"domain": "robotics.stackexchange",
"id": 31883,
"lm_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, mapping, ros-kinetic, 2dlidar, hector-mapping",
"url": null
} |
c++, beginner, collections, vectors, set
--sz;
}
void erase(std::initializer_list<T> lst)
{
for (auto& obj: lst) this->erase(obj);
}
void erase(iterator position)
{
alloc.destroy(position);
while (position != end()-1) {
*position = *(position+1);
++position;
}
--sz;
}
void erase(iterator first, iterator last) //erase a range of elements
{
int shift = 0;
for (iterator i = first; i != last; ++i) {
alloc.destroy(i);
++shift;
}
for (iterator i = first; i != end()-shift; ++i) {
*i = *(i + shift);
}
sz -= shift;
}
void clear()
{
for (size_type i=0; i<sz; ++i) alloc.destroy(&elem[i]); //destroy but keep memory allocated
sz = 0;
}
bool contain(const T& arg)
{
return std::binary_search(elem, elem+sz, arg, functor);
} | {
"domain": "codereview.stackexchange",
"id": 27363,
"lm_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, collections, vectors, set",
"url": null
} |
biochemistry, dna, molecular-genetics
Title: DNA base pair heading Does it make ANY difference to which strand of DNA double helix base pair heads? I mean, could base pair AT and base pair TA makes any difference when interpreted by biochemical mechanisms which use DNA?
Double helix has two strands, right? So does pair Adenine on the first and Thymine on the second strand make any difference with Adenine on the second and Thymine on the first?
I am a novice in biochemistry, so please excuse me my ignorance if the question is ridiculous. Absolutely yes, is the short answer.
All genes are encoded in a 5-prime $\rightarrow$ 3-prime manner on each of the 2 DNA strands of the double helix.
Here's an example of a stretch of the genome from a bacteria that I work on in my PhD: | {
"domain": "biology.stackexchange",
"id": 7372,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, dna, molecular-genetics",
"url": null
} |
python, beginner, wordle
This prints a tuple containing a string, and a list of ints referencing each color used for displaying guesses. Note that this use of print is just for demonstration, the actual output is handled in curses (that's what the numbers are for).
Here clear_yellow_letters() does what I just described. Without it compare_word() would return the int that maps to l in our string as 2 (yellow). While this works as it is, I feel there must be a simpler way to do it, as that section is a bit difficult to follow, even with all the comments. | {
"domain": "codereview.stackexchange",
"id": 43694,
"lm_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, wordle",
"url": null
} |
python, mathematics, numpy, vectorization
zarray[k] = (w1 + w2 + w3 + w4) * parray[k] - (w1 * parray[k1] + w2 * parray[k2] + w3 * parray[k3] + w4 * parray[k4])
I want to know if there is a way to vectorize this loops, because I think that exists a kind of "convolution" for zarray.
U and V are arrays representing 2D matrices with 512x512 elements, and parray is also a 2D representation with 512x512 elements.
In a previous post vectorization was recommended, but now I can not figure out how to vectorize when I have different indices operations. I was the one who recommended vectorizing. I think the first approach would be to convert your code to using 2D indexes. I think this will make the vectorizing clearer:
for j in range(rows):
for i in range(cols):
i1 = i+1 if i<cols-1 else i-1
i2 = i-1 if i>0 else i+1
j1 = j+1 if j<rows-1 else j-1
j2 = j-1 if j>0 else j+1 | {
"domain": "codereview.stackexchange",
"id": 14256,
"lm_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, mathematics, numpy, vectorization",
"url": null
} |
fl.formal-languages, context-free-languages
Adendum -- here are two languages that definitely concatenate to $a^*$ and are almost certainly not context-free:
$\{a^{n-i}:i = \lfloor \sqrt n \rfloor\}$
$\{a^{n+i}:i = \lfloor \sqrt n \rfloor\}$
If for some reason, those turn out CF, use an even stranger function than $ \sqrt x $ | {
"domain": "cstheory.stackexchange",
"id": 1371,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fl.formal-languages, context-free-languages",
"url": null
} |
$$\arctan^2\left(x\right)=\left(\frac{i}{2}\cdot\ln\left(\frac{1-xi}{1+xi}\right)\right)^2=-\frac{1}{4}\cdot\ln^2\left(\frac{1-xi}{1+xi}\right)\tag2$$
For the integral we get, then:
$$\mathscr{I}:=\int\arctan^2\left(x\right)\space\text{d}x=-\frac{1}{4}\cdot\int\ln^2\left(\frac{1-xi}{1+xi}\right)\space\text{d}x\tag3$$
Let $\text{u}:=\frac{1-xi}{1+xi}$:
$$\mathscr{I}=-\frac{2i}{4}\cdot\int\frac{\ln^2\left(\text{u}\right)}{\text{u}^2+2\text{u}+1}\space\text{d}\text{u}=-\frac{i}{2}\cdot\int\frac{\ln^2\left(\text{u}\right)}{\left(1+\text{u}\right)^2}\space\text{d}\text{u}\tag4$$
Let $\text{v}:=1+\text{u}$:
$$\mathscr{I}=-\frac{i}{2}\cdot\int\frac{\ln^2\left(\text{v}-1\right)}{\text{v}^2}\space\text{d}\text{v}\tag5$$
Using integration by parts: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668739644686,
"lm_q1q2_score": 0.8359078656284417,
"lm_q2_score": 0.8519528000888387,
"openwebmath_perplexity": 202.18757760108622,
"openwebmath_score": 0.9951183199882507,
"tags": null,
"url": "https://math.stackexchange.com/questions/2428653/indefinite-integral-int-arctan2-x-dx-in-terms-of-the-dilogarithm-function"
} |
just become a y to the first Power first! Turn to some radical expressions square is the … now let us turn to some expressions! To expressions with variable radicands [ /latex ] to multiply radical expressions term by another algebraic term get... Square root and the denominator when the denominator that contain only numbers us turn to some radical expressions to using! Multiplying three radicals with variables can divide an algebraic term to get rid of it, 'll... Be left under the radical because they are now one group be into... ] can influence the way you write your answer of radical expressions contain... Being multiplied expressions is to break down the expression is simplified contain quotients with variables ( Basic no! The division of the quotient property of radical expressions \cdot \sqrt { \frac { \sqrt { 18 } \sqrt... Arrive at the same ideas to help you figure out how to simplify using the following video, present! { \frac { 48 } } first, before multiplying similar rule | {
"domain": "gob.mx",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924777713886,
"lm_q1q2_score": 0.8495964911947484,
"lm_q2_score": 0.8740772286044095,
"openwebmath_perplexity": 972.4474741957093,
"openwebmath_score": 0.8463869094848633,
"tags": null,
"url": "http://gob2018.morelia.gob.mx/when-was-vfa/viewtopic.php?cd7297=how-to-divide-radical-expressions-with-variables"
} |
quantum-gate, qiskit, ibm-q-experience
Title: Is there a physical definition of barrier operation in qiskit? As far as I know, we can use barrier method in qiskit to split circuits into two sets to prevent the optimization. However, is there any physical meaning of the barrier? Like a delay operation or buffer gate? If we insert a barrier in the middle of the circuit, the second gate set will begin to be executed until the gates from the first set finishing their executions. What causes the waiting time for the second gate set? TL;DR There is no "physical" meaning for a barrier. It takes literally no time. The barrier is annotation for the transpiler and for the pulse scheduler. The scheduler waits the duration of the operations before the barrier and then executes the operations after the barrier. In this sense, it is similar to the delay instruction, but "dynamic". This is, you dont have to known how long the instructions before the barrier are but that is "dynamically" calculated for you. | {
"domain": "quantumcomputing.stackexchange",
"id": 2533,
"lm_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, qiskit, ibm-q-experience",
"url": null
} |
strings, vba, excel
Exit Sub
errorHandler:
MsgBox "Error has occurred.", _
vbCritical, "Error!"
End Sub
I apply the trim-function on every cell-value. So I ask myself:
What is better?
Doing unnecessary executions of the trim-function or checking if it has to be applied? Checking would cost me an additional if-then.
UPDATE
The above algorithm contains an error.
Concerning a table with the following structure:
First | Second |
Alpha | Beta | Gamma |
One |
The result would be:
lastRow: 3
lastColumn: 1
Reason: It searches in the last row for the most right column.
But what is needed is the most right column overall.
Now I determine lastRow and lastColumn this way:
lastRow = Range("A1").SpecialCells(xlCellTypeLastCell).row
lastColumn = Range("A1").SpecialCells(xlCellTypeLastCell).column It's faster to just trim a value than it is to try and figure out if it needs trimming in the first place.
However, that's not where your performance bottleneck is. | {
"domain": "codereview.stackexchange",
"id": 18913,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, vba, excel",
"url": null
} |
% Sigma \left[ \begin{array}{cc} \mathbf{S}_{\rho\times \rho}^{-1} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \end{array} \right] % U \left[ \begin{array}{cc} \color{blue}{\mathbf{U}_{\mathcal{R}}}^{*} & \color{red}{\mathbf{U}_{\mathcal{N}}}^{*} \end{array} \right] % \end{align} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130554263733,
"lm_q1q2_score": 0.8644737889185687,
"lm_q2_score": 0.8740772269642948,
"openwebmath_perplexity": 810.1609672143261,
"openwebmath_score": 1.0000098943710327,
"tags": null,
"url": "https://math.stackexchange.com/questions/1971211/pseudo-inverse-of-a-matrix-that-is-neither-fat-nor-tall"
} |
viscosity
Title: Why is viscous force directly proportional to velocity gradient My textbook says that viscous force is directly proportional to the velocity gradient (du/dz). But I am finding this a bit against my logic. What I understand is that viscous force tries to resist the laminar flow of a fluid. My textbook also explains that we can imagine the fluid flow as flow of different laminas of fluid over one another. This means that a layer of liquid is retarded by the layer below it and is accelerated by the layer above it. So we know that difference in velocity of two adjacent layers at a distance of dz is du. But here is the point where I have my doubt. If we are to say viscous force is greater, won't that retard the flow and cause a lesser value of du for the same dz. But if we imagine two fluids, one which has more velocity difference between two consecutive layers(more du) and one which has less velocity difference(less du) for two consecutive layers(that is same dz), we know that the | {
"domain": "physics.stackexchange",
"id": 73033,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "viscosity",
"url": null
} |
java, design-patterns
private Types(RandomGenerator generator) {
this.generator = generator;
}
public RandomGenerator getGenerator() {
return generator;
}
}
The main difference here is that you have deferred the creation of the random value to the callers end. The calling code will also be required to either use generics too:
RandomGenerator<Double> g = Types.DOUBLE.getGenerator();
Double d = g.getRandom();
Or generate warnings and cast the result:
RandomGenerator g = Types.DOUBLE.getGenerator();
Double d = (Double)g.getRandom();
Finally, you say you have read about the factory pattern, that is ultimately what you are playing with here.
Note. I think Enum naming should use the singular (Type) rather than the plural (Types), you are not selecting an Object of type Types as your Object (Types.DOUBLE) represents just one type. | {
"domain": "codereview.stackexchange",
"id": 4501,
"lm_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, design-patterns",
"url": null
} |
energy, temperature, mass-energy, adiabatic, exchange-interaction
Redefine your temperature so that it takes into account the nuclear degrees of freedom.
Use the ideal gas temperature, and model the nuclear decay process as heating. That is, model your system as not isolated, and model the nuclear decay process as heating from external sources. The problem here is that you might also need to introduce chemical potentials if the nuclear decay is one in which there is transmutation, i.e. where you are changing the numbers of constituent particles. | {
"domain": "physics.stackexchange",
"id": 34534,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, temperature, mass-energy, adiabatic, exchange-interaction",
"url": null
} |
Here's a diagram illustrating the objects described in the proof in the case where $n=3$ and $n-1=2$. Apologies for the low quality (I made it in MS Paint), but note that the bottom of the red plane, $P$, comes out towards the viewer, in front of the blue plane, and the top half of $P$ is behind the blue plane. The points ${\bf x}_{0,n-1}$, ${\bf x}_{1,n-1}$, and ${\bf x}_{2,n-1}$ are in in the $x_{1}x_{2}$-plane, with ${\bf x}_{1,n-1}$ in front of $P$ and ${\bf x}_{2,n-1}$ behind $P$.
2. A hypersurface is a generalization of a hyperplane in the context of manifolds. I'm not sure the question about octants would make sense in that context since a manifold need not be in ${\Bbb R}^{n}$ (though it has a map to ${\Bbb R}^{n}$ in a neighborhood of each point). Maybe there's a way to reformulate the question to apply in that context... | {
"domain": "gtmath.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303413461358,
"lm_q1q2_score": 0.8582182952826629,
"lm_q2_score": 0.8670357529306639,
"openwebmath_perplexity": 105.21813795780214,
"openwebmath_score": 0.9379755258560181,
"tags": null,
"url": "http://www.gtmath.com/2015/04/the-plane-in-r3.html?showComment=1430268957485"
} |
electromagnetism, condensed-matter, magnetic-monopoles, superfluidity
But the connection is only formal, there's nothing to do with real EM fields, and no cosmological/HEP/... implications (it just says that Dirac did the math correctly). But of course, that's not how they present that in the abstract, if you want to be published to Nature... | {
"domain": "physics.stackexchange",
"id": 11635,
"lm_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, condensed-matter, magnetic-monopoles, superfluidity",
"url": null
} |
turing-machines, reductions
$A \leq_m B$ means that the language $A$ is easier to decide than the language $B$.
To show hardness, you reduce "YOUR_HARD_LANGUAGE $\leq_m$ SOME_NEW_LANGUAGE". To show computability, you can reduce in the other direction, but usually it's simpler to just construct a TM that solves the given problem.
A reduction $L \leq_m L'$ takes an instance $x \in \{ 0,1\}^*$ and does the following with it: If $x \in L$, you make sure that the reduction $f(x) \in L'$. If $x \not \in L$, then the reduction maps $f(x) \not \in L'$. So - if you prove hardness, you transform a known hard problem into the unknown problem.
It is a contradiction in the sense of "If I could solve the new problem, then I can solve the hard problem, which cannot be, since it is proven to be hard". This contradiction is hidden in the Theorem above and you just slap it (implicitly) on every reduction you do. | {
"domain": "cs.stackexchange",
"id": 2438,
"lm_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, reductions",
"url": null
} |
cool math games, online graphing calculators, geometry art, fractals, polyhedra, parents and teachers areas too. In order to use inverse trigonometric functions, we need to understand that an inverse trigonometric function “undoes” what the original trigonometric function “does,” as is the case with any other function and its inverse. Step 1: Enter any function in the input box i.e. Conclude from here that the row A is not left invertible. How to Find the Inverse of a Function. Functions involving roots are often called radical functions. This problem has been solved! f\left( x \right) = {\log _5}\left( {2x - 1} \right) - 7. Find the inverse of the following matrix. Understanding and Using the Inverse Sine, Cosine, and Tangent Functions. Hyperbolic Functions: Inverses. I hope you can assess that this problem is extremely doable. The hyperbolic sine function, \sinh x, is one-to-one, and therefore has a well-defined inverse, \sinh^{-1} x, shown in blue in the figure.In order to invert | {
"domain": "dichthuatvananh.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407206952993,
"lm_q1q2_score": 0.8233056216828452,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 556.0672590880906,
"openwebmath_score": 0.6816763877868652,
"tags": null,
"url": "http://dichthuatvananh.com/strike-it-ftduluo/35b799-find-all-left-inverses"
} |
gazebo, moveit, ros-melodic
Originally posted by PeteBlackerThe3rd with karma: 9529 on 2019-06-10
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by lbajlo on 2020-01-09:
Hi Peter,thanks for answer. This part with increasing tolerance was helpful. Sorry for accepting answer so late but I didn't notice that you answered on my question here.
Comment by PeteBlackerThe3rd on 2020-01-09:
No problem, glad it helped.
Comment by ryanc on 2020-11-23:
Hi @PeteBlackerThe3rd and @lbajlo, how can I decrease the tolerance?
Edit: to change the path tolerance, open the controller and next to the joint you'll see {trajectory: __, goal: ___} to change the path tolerance change the trajectory value and goal tolerance with the goal value | {
"domain": "robotics.stackexchange",
"id": 33145,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, moveit, ros-melodic",
"url": null
} |
c#, algorithm, interview-questions
Recently, the peer asked me not to do whiteboard testing during the mock interview, because the peer was happy about my coding. After the mock interview I spent over one hour to using Visual Studio and tried to find one simple mistake to mix two variable names, actually the bug can easily be found in less than five minutes through the whiteboard testing. Through the instance I learn that the whiteboard testing is such a simple habit to build and a savior for me as a mediocre programmer. It should have saved me hundreds of hours through the career if I build the habit the first day as a programmer.
k-SUM algorithm optimal solution study | {
"domain": "codereview.stackexchange",
"id": 30383,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, algorithm, interview-questions",
"url": null
} |
neuroscience, neurophysiology, action-potential, synapses
Clearly, we can see that the dendrite has multiple 'endings'. I was under the impression that a synapse can happen at any such 'ending'. Assuming that a synapse happens at one ending of the dendrite, is it viable that anything happens to a neighbouring neuron that is connected with a dendrodendritic synaptic connection to the other ending of the dendrite? I'm not sure if you are asking if an axon that sends a signal to a dendrite would then be released from that dendrite to another dendrite?
I don't see how this is possible seeing as the dendrite is already paired with the axon and downstream of said dendrite there would be a neuron.
A dendrodenritic synapse is two dendrites of two different neurons in contact with each other. For there to be a signal an action potential must have been reached.
Synapse is a junction between two neurons where chemical signaling occurs, but it is not the definition of a signal occurring. If that makes sense. | {
"domain": "biology.stackexchange",
"id": 4748,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, neurophysiology, action-potential, synapses",
"url": null
} |
waves
Let's try an economic analogy, although as a warning analogies are prone to breaking down. My analogy is that we could say that an economy is the transfer of goods and services. If the exports and imports into a country balance out, there is still trade occurring and therefore an active economy, even though the net trade is zero. The economy is different from the state where no trade of any kind is occuring. | {
"domain": "physics.stackexchange",
"id": 89716,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves",
"url": null
} |
localization, kalman-filter
1 & 0 & \frac{υ_{t}}{ω_{t}}(-cos {μ_{t-1,θ}} + cos(μ_{t-1,θ}+ω_{t}Δ{t})) \\
0 & 1 & \frac{υ_{t}}{ω_{t}}(-sin {μ_{t-1,θ}} + sin(μ_{t-1,θ}+ω_{t}Δ{t})) \\
0 & 0 & 1
\end{bmatrix}$.
Does the same apply when using the odometry motion model (described in the same book, page 133), where robot motion is approximated by a rotation $\hat{\delta}_{rot1}$, a translation $\hat{\delta}$ and a second rotation $\hat{\delta}_{rot2}$ ? The corresponding equations are:
$\begin{bmatrix} x \\ y \\ \theta \end{bmatrix}' = \begin{bmatrix} x \\ y \\ \theta \end{bmatrix} + \begin{bmatrix} \hat{\delta}\text{cos}(\theta + \hat{\delta}_{rot1}) \\ \hat{\delta}\text{sin}(\theta + \hat{\delta}_{rot1}) \\ \hat{\delta}_{rot1} + \hat{\delta}_{rot2} \end{bmatrix}$.
In which case the Jacobian is
$G_{T}= \begin{bmatrix}
1 & 0 & -\hat{\delta} sin(θ + \hat{\delta}_{rot1}) \\
0 & 1 & -\hat{\delta} cos(θ + \hat{\delta}_{rot1}) \\
0 & 0 & 1
\end{bmatrix}$. | {
"domain": "robotics.stackexchange",
"id": 118,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "localization, kalman-filter",
"url": null
} |
quantum-mechanics, quantum-field-theory, virtual-particles
I didn't notice but energy depends on mass too, I forget this. Then virtual photon actually changes energy(and hence constant magnetic field changes energy)? Changing momentum does not necessarily mean changing energy. It is possible for a virtual particle to change a particles momentum without changing its energy: Momentum is mass times velocity, but velocity is direction as well as speed. If momentum changes then by definition there has to be a force: F=dp/dt. So the virtual particle has then to exert a force. However, provided that force acts to change momentum only by changing the direction of motion of the particle; neither speeding it up or slowing it down, then no work is done on the particle; therefore no energy is transferred to or from it. | {
"domain": "physics.stackexchange",
"id": 51601,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, virtual-particles",
"url": null
} |
By design, $$f$$ looks like $$f_1$$ to the left of $$c$$ and like the reversal of $$f_2$$ to the right of $$c.$$
The spike at the mode might bother you, but notice that it was never assumed or required that $$f$$ must be continuous. Most examples will be discontinuous. However, every distribution $$f$$ meeting your specifications can be constructed this way (by reversing the process: split $$f$$ into two halves, which obviously determine the $$f_i$$).
To demonstrate how general the $$f_i$$ can be, here is the same construction where the $$f_i$$ are (inverse) Cantor functions (as implemented in binary.to.ternary at https://stats.stackexchange.com/a/229561/919). These are not continuous anywhere. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130596362788,
"lm_q1q2_score": 0.8575096981110226,
"lm_q2_score": 0.8670357683915538,
"openwebmath_perplexity": 750.3634441688756,
"openwebmath_score": 0.8477863669395447,
"tags": null,
"url": "https://stats.stackexchange.com/questions/507040/how-to-create-a-continuous-distribution-on-a-b-with-textmean-textmo?noredirect=1"
} |
c, multithreading, sudoku
void* startThread(void* args){
while(1){
Task task;
pthread_mutex_lock(&mutexQueue);
task = taskQueue[0];
int i;
for(i = 0; i < taskCount; i++){
taskQueue[i] = taskQueue[i + 1];
}
taskCount--;
pthread_mutex_unlock(&mutexQueue);
checkTask(&task);
if(taskCount == 0){
break;
}
}
}
void submitTask(Task task){
pthread_mutex_lock(&mutexQueue);
taskQueue[taskCount] = task;
taskCount++;
pthread_mutex_unlock(&mutexQueue);
pthread_cond_signal(&condQueue);
}
int main(void){
//
// input example
//
int arrayIn[][square] = {
{1,-1,-1,2},
{2,-1,1,-1},
{0,3,-1,-1},
{1,-1,-1,0}
};
input = malloc(square * sizeof(int*));
for(int i = 0; i < square; i++){
input[i] = malloc(square * sizeof(int));
for(int j = 0; j < square; j++){
input[i][j] = arrayIn[i][j];
}
} | {
"domain": "codereview.stackexchange",
"id": 41896,
"lm_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, sudoku",
"url": null
} |
image-processing
there are public datasets (e.g. this one for object classification) that also organize annual challenges where you can test your new ideas against many peoples new ideas (but that's way bigger than topcoder :D)
if you get decent results, that's good. If you get better results than state-of-the art using some of your new ideas, double check them. Then triple check them. And then publish a fancy article ;) | {
"domain": "dsp.stackexchange",
"id": 337,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing",
"url": null
} |
AM
11. Jan 30, 2005
### Gokul43201
Staff Emeritus
Since the question asks for the escape velocity rather than the root sqaure excess velocity, you must use R and not 2R. I concur with AM.
$$KE(in) + PE(in) = E(fin) = 0$$
$$\frac{1}{2}mv_{esc}^2 - \frac{GMm}{R} = 0$$
That's all there is to it.
If you add the existing KE to the PE to get _GMm/2R, you are then only finding the extra KE required. This is not what's asked.
How did you go from additional KE to escape velocity ?
12. Jan 30, 2005
### dextercioby
Okay,Gokul,which part didn't u understand??This one:
Please explain to me how would you keep a geostationary satellite in orbit 42000Km (from the Earth's center) MOTIONLESS... :uhh:
Daniel.
13. Jan 30, 2005
### da_willem
Read the EDIT one line below...
14. Jan 30, 2005
### Andrew Mason
Not exactly. The additional velocity is $(\sqrt{2}-1) \times 3075 = 1274 m/s.$
AM
15. Jan 30, 2005
### Andrew Mason | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290963960278,
"lm_q1q2_score": 0.8028438817019917,
"lm_q2_score": 0.8267117983401363,
"openwebmath_perplexity": 2164.3662059235953,
"openwebmath_score": 0.7052435278892517,
"tags": null,
"url": "https://www.physicsforums.com/threads/find-the-minimum-velocity.61747/"
} |
c, file
return contents;
} Don't Reinvent The Wheel
It might be better to use built-in functions that already do what you want. You can use stat() to get the size of a file. You don't even need read or write permission to the file. You need to #include <sys/stat.h> and pass it a path to a file and a pointer to a struct stat. (On Windows you can use _stat() et al.) It would look something like this:
#include <sys/stat.h>
long get_file_size(const char *file_path) {
/* Debug: checking the input arguments. */
assert(file_path != NULL);
struct stat status;
int err = stat(file_path, &status);
long size = -1;
if (err == -1)
{
LOG("Error: can't get the of the file. The "
"reason: \"%s\".\n", strerror(errno));
}
else
{
size = status.st_size;
}
return size;
} | {
"domain": "codereview.stackexchange",
"id": 30879,
"lm_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, file",
"url": null
} |
For an invertible , a solution exists if and only if the above process produces an integer result:
Use SmithDecomposition to compute the extended GCD of two integers and :
Let be the column matrix with entries and :
The Smith decomposition gives , with the unique positive , unimodular matrix:
Hence First[u].mFirst[r]:
But as the first row of is the and the left-hand side of the equation is , the foregoing equation is Bézout's identity. This means the extended GCD is:
Compare to ExtendedGCD:
Use SmithDecomposition to compute the right-extended GCDs of two matrices and :
Let be the matrix formed from the rows of and :
The matrix in the Smith decomposition will be a matrix:
Let and be the top-left and top-right quarters of :
The matrix and thus the matrix are, like , matrices:
Let denote the top half of :
The matrices and have integer entries:
Hence is a right divisor of both and :
Since the determinants of , , and obey , is in fact a right GCD: | {
"domain": "wolfram.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180690117799,
"lm_q1q2_score": 0.8035893885622711,
"lm_q2_score": 0.8152324826183822,
"openwebmath_perplexity": 2215.6297413509205,
"openwebmath_score": 0.8185828924179077,
"tags": null,
"url": "https://reference.wolfram.com/language/ref/SmithDecomposition.html"
} |
quantum-field-theory, quantum-information, specific-reference
$$ S= \int d^4x L_1(\phi) + L_2(\chi) + \phi(x)\chi(x+\Delta)$$
Where the L's are some translationally invariant local actions for $\phi$ and $\chi$, and the interaction mixes $\phi$ and $\chi$ at displaced points. This is clearly ridiculous-- the field $\chi$ has been misplaced, the correct local field associated with a given point x is $\chi(x+\Delta)$, not $\chi(x)$, but the point is that you can define an algebra of observables using this completely wrong localization, and then microcausality obviously fails, because $\chi$ and $\phi$ are at the wrong point. But because there is a change of variables which makes microcausality work, there is no signalling for objects in the theory, intrinsically (although for an external agent capable of making local measurements of $\phi(x)+\chi(x)$, no signalling would fail). So the question should be better stated "Does there have to be some collection of field variables which obey microcausility for no-signalling to work". | {
"domain": "physics.stackexchange",
"id": 1697,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, quantum-information, specific-reference",
"url": null
} |
Thanks!
Tomer.
2. Originally Posted by aurora
Here's the problem (regarding groups, but nothing too complex):
I'm told that a and b are elements in G, which is a group.
I'm also told that b<>e (where e is the unit element - thus e*a = a, etc...), and that o(a) = 5 (meaning: a^5=e, and 5 is the smallest natural number that satisfies that).
I'm told that: aba^-1 = b^2
I need to find o(b).
This looks pretty innocent at first (and maybe it really is), but I've spent too much time on this question... tried every trick I know...
I've proved, some excercises before, that o(aba^-1)=o(b), so I tried using that a lot, but it didn't really get me much.
Of course I tried to do "^5" to both sides, and many many other things, playing with the inverses etc....
Best I could get, with much effort, is that o(ba) = 5.
I just don't know what to do :-\
Thanks!
Tomer.
that's a good question! i'll prove a more general result first: | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815513471368,
"lm_q1q2_score": 0.828558212764533,
"lm_q2_score": 0.837619961306541,
"openwebmath_perplexity": 986.5994063540367,
"openwebmath_score": 0.910256028175354,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/42254-solved-getting-crazy-excerice.html"
} |
visible-light, geometric-optics
As for your original question regarding image formation, the image of an object at infinity can be produced using a curved lens( such as the eyes) or curved mirror, as these have the property to focus light. They can refract parallel rays of light to pass through a single point. But on a plane mirror, which does not bend light, no virtual image would be formed. Keep in mind that there are many reasons why you can't see an actual object at infinity, but optics is more about approximation. For example, we can treat very far objects as infinitely away. | {
"domain": "physics.stackexchange",
"id": 53623,
"lm_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, geometric-optics",
"url": null
} |
fixed-point, floating-point, numerical-algorithms
Thinking in dB
An interesting perspective since many of us often work in the world of dB units is that we can express a magnitude quantity in dB as either:
$$dB(x) = 20\log_{10}(x)$$
or
$$dB(x) = 6\log_2(x)$$
since $\log_{10}x = \log_2(x)/\log_{2}(10)$.
We see how this results in a simple dB computation as well, and with that we see that using Equation \ref{6} directly could have an error of up to 6 dB (or +/-3 dB if we added the 1/2). This would be unacceptable in most applications, but with Equation \ref{7} the error in dB is reduced to 0.3 dB which would then have wider appeal. A simple one or two more orders of curve fit for the mantissa term would improve this accuracy substantially.
BOTTOM LINE - FIXED POINT | {
"domain": "dsp.stackexchange",
"id": 12122,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fixed-point, floating-point, numerical-algorithms",
"url": null
} |
matlab
0.0025574 -4.5129 2148.4
0.002114 -3.3457 2195.6
0.0015383 -2.6023 1682.9 Based on what you share, this is the best answer I can give.
I see two methods:
Method #1,
Instead of making N polynomials (if N is the number of ribs), you could fit a curve for all the ribs at once. Of course, for that, you will need to have a common (0,0) coordinate, in other word, stack them one over the other on your image. Since you are able to make a distinction between the ribs, that means that you can already isolate them, so that shouldn't be an issue.
Or if you prefer, you can generate a new cloud of points with the polynomials you already found.
coeffs = [0.0010126, -1.5981, 1074.8; 0.0024871, -3.3327, 1866.3];
x = linspace(0,1000,1000); % fictives points
merged_x = [x x];
merged_y = [ polyval(coeffs(1,:), x), polyval(coeffs(2,:),x)];
coeffs_final = polyfit(merged_x, merged_y, 2);
figure
hold on
plot(polyval(coeffs(1,:), x), 'red') | {
"domain": "dsp.stackexchange",
"id": 6841,
"lm_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",
"url": null
} |
javascript, css, xml, library, tex
htmlText += "<table class='algotype-code-row-table'>\n" +
" <tbody class='algotype-code-row-tbody'>\n" +
" <tr class='algotype-algorithm-line'>\n" +
" <td class='algotype-algorithm-line-number'>" +
state["lineNumber"] +
" </td> " +
" <td class='algotype-line-number-space' width='" +
(Algotype.INDENTATION_WIDTH * state["indentation"] +
Algotype.DISTANCE_BETWEEN_LINE_NUMBER_AND_CODE) +
"px'></td>\n" +
" <td class='algotype-text algotype-keyword'>" +
elseIfIdTextBegin + "else if " +
conditionTeX + ":" + elseIfIdTextEnd +
(comment ? comment : "") +
" </td> " +
" </tr>\n" +
" </tbody>\n" +
"</table>\n";
var saveIndentation = state["indentation"]; | {
"domain": "codereview.stackexchange",
"id": 26692,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, css, xml, library, tex",
"url": null
} |
c++, c++20, stl
// Note: handled_ *must* be the first data member of `other`
// that we touch. We set it to true immediately, and save
// its actual value. That way, if any other thread is
// checking the original object, it will not try to run the
// callback that has been moved-from.
//
// The only problem with this arises if the callback is not
// no-fail movable. In that case, we may mark the callback
// handled in `other`, then try to move the callback, and
// fail... but there is no way to recover the original value
// of handled in `other`. There is nothing we can do to fix
// this, so maybe you might want to ban functions with
// throwing move-ops. Or simply say that if the move does
// throw, the callback may just never be called.
//
// (Well, it is *possible* to deal with callbacks with
// throwing move-ops, but... *EXTREMELY* complicated.)
constexpr alarm(alarm&& other) | {
"domain": "codereview.stackexchange",
"id": 45124,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++20, stl",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.