text stringlengths 1 1.11k | source dict |
|---|---|
thermodynamics, energy, water, physical-chemistry
There have been indeed attempts to use molecular motion as nano-motors, ratchets, etc. - see, e.g. Brownian Ratchets: From Statistical Physics to Bio and Nano-Motors. A classical example of a molecular motor (although from a rather big molecule) is Kinesin transporting ATP in cells: | {
"domain": "physics.stackexchange",
"id": 97999,
"lm_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, energy, water, physical-chemistry",
"url": null
} |
machine-learning, deep-learning
For the second image, the model may say the logit values are 1.004 for a cat and 0.709 for a dog. So once again, our model says we the image contains a cat. The correct answer is once again a cat, so the model worked again!
Now we want to compare the two result. One way to do this is to normalise the scores. That is, we normalise the logits! Doing this we gain some insight into the confidence of our model.
Let's using the softmax, where all results sum to 1 and so allow us to think of them as probabilities:
$$\sigma (\mathbf {z} )_{j}={\frac {e^{z_{j}}}{\sum _{k=1}^{K}e^{z_{k}}}} \hspace{20mm} for \hspace{5mm} j = 1, …, K.$$
For the first test image, we get
$$prob(cat) = \frac{exp(16.917)}{exp(16.917) + exp(0.772)} = 0.9999$$
$$prob(dog) = \frac{exp(0.772)}{exp(16.917) + exp(0.772)} = 0.0001$$
If we do the same for the second image, we get the results:
$$prob(cat) = \frac{exp(1.004)}{exp(1.004) + exp(0.709)} = 0.5732$$ | {
"domain": "datascience.stackexchange",
"id": 10994,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning",
"url": null
} |
ros, ros-kinetic, rospy, tf-conversions, transformations
Are you able to do the calculations in quaternion or rotation matrix form first, then turn them back into Euler angles? And does this give the answer you expect?
Comment by SnShines on 2019-03-30:
I don't think so. One Odom values (ground truth with local velocities) are from the gazebo simulator and another one are from my estimator. Everything is software and everything gives outputs as expected. Except for this transformation.
I tried those two links posted in question where they used quaternions and still the output is the same as mine. But different than what I wanted.
I think you need to apply the transformation in the reverse direction.
import tf
import tf2_geometry_msgs
from geometry_msgs.msg import TransformStamped, Vector3Stamped | {
"domain": "robotics.stackexchange",
"id": 32777,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic, rospy, tf-conversions, transformations",
"url": null
} |
concurrency, go, tcp
ds := newDataStore()
for {
conn, err := l.Accept()
if err != nil {
fmt.Printf("Error accepting: %v\n", err)
os.Exit(1)
}
msg, err := bufio.NewReader(conn).ReadString('\n')
if err != nil {
fmt.Printf("Error reading: %v\n", err)
}
response, err := ds.handleMsg(msg)
if err != nil {
fmt.Printf("fail to handle message: %v\n", err)
}
conn.Write([]byte(response + "\n"))
conn.Close()
}
}
type Message struct {
command string
pkg string
comment string
}
type DataStore struct {
pkgInfo map[string]string
pkgRef map[string]uint
}
func newDataStore() *DataStore {
return &DataStore{
pkgInfo: make(map[string]string),
pkgRef: make(map[string]uint),
}
} | {
"domain": "codereview.stackexchange",
"id": 28388,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "concurrency, go, tcp",
"url": null
} |
cc.complexity-theory, time-complexity, np
Title: $\mathsf{DTime}(O(n^k)) \subseteq \mathsf{NTime}(g)$ for some $g \in o(n^k)$? Can this statement be confirmed or disproved:
$\mathsf{DTime}(O(n^k)) \subseteq \mathsf{NTime}(g)$ for some $g \in o(n^k)$ | {
"domain": "cstheory.stackexchange",
"id": 1661,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, time-complexity, np",
"url": null
} |
c, sorting, memory-management, memory-optimization, variant-type
size_t total_size = num * size;
if (total_size / size != num) {
// TODO: introduce error code for "invalid argument (due to overflow)"
return your_library_failure;
}
char *arr = base;
char *left, *current, *right;
right = (char *) arr + total_size;
while (right > arr) {
left = (char *) arr;
current = left + size;
while (current < right) {
if (compar(left, current) > 0) {
memswap(left, current, size);
}
left += size;
current += size;
}
right -= size;
}
return your_library_success;
}
(Caveat: not tested.) | {
"domain": "codereview.stackexchange",
"id": 17015,
"lm_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, sorting, memory-management, memory-optimization, variant-type",
"url": null
} |
structural-engineering, structural-analysis, structures
ADD: A cross-section is said to be symmetrical when the mirror image exists on the centroidal axis. In the graph below, the cross-section on the upperrow is said to be "doubly symmetrical", while the cross-sections in the lower row are said to be "singularity symmetrical about y-axis", for which, the equation for $I_x$ in the sketch is not applicable without modification. | {
"domain": "engineering.stackexchange",
"id": 4628,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "structural-engineering, structural-analysis, structures",
"url": null
} |
c++, strings, file, image, opencv
Title: Batch extracting differences between two images with enhancement using opencv I am attempting to extract the absolute differences image between two input images and then enhance the intensity (brightness) channel in HSV color space with the given times. The workflow is like below. | {
"domain": "codereview.stackexchange",
"id": 41966,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, strings, file, image, opencv",
"url": null
} |
fft
Title: Should you scale the FFT bins by $1/N$ where $N$ is the number of points in a transient signal? I am going over the following tutorial. In section 2.1 the author says
To calculate the $N$ point FFT the Matlab algorithm 1 can be used. Here, after taking the FFT, its magnitude is calculated and the bins are scaled by $1/N$.
Now the author doesn't explain as to why the bins are scaled by $1/N$. At first glance it looks like some kind of normalisation -- but why?
I did some further research and it seems there different ways to define the power in a signal, depending on what you are looking at. See slide 3 of this. | {
"domain": "dsp.stackexchange",
"id": 7673,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft",
"url": null
} |
energy
https://en.wikipedia.org/wiki/Compressed_air_energy_storage
I get total of 0.7MJ for a 5L cylinder.
Could someone explain how they worked out the 0.1MJ/L value?
and
Do they consider total volume of air (1500L) or only the compressed air volume (5L) with the 0.1MJ/L value.
Thanks. Since $PV=1\times 1500=300\times 5$ is constant, this implies the compression is isothermal, so the temperature of the gas does not change in this process. The internal energy an ideal gas is
$$U=c_VnT$$
where $c_V$ is the constant-volume molar heat capacity in units of J/(mol K). As such, since neither the number of particles nor the temperature of the gas changes during the compression, the total internal energy of the gas also does not change. So, using $c_V=20.8$ J/(mol K), $n=67$ mol (the amount of air in $1500$ L, and $T = 300$ K, we have that $U=418$ kJ. The energy density
$$u = \frac{U}{V} = \frac{c_VnT}{V}$$ | {
"domain": "physics.stackexchange",
"id": 41827,
"lm_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",
"url": null
} |
earth-like-planet, titan
For example, according to this NASA image comparison, some lake features have features that are similar to groundwater based salt pans on Earth. Image below: | {
"domain": "astronomy.stackexchange",
"id": 12,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "earth-like-planet, titan",
"url": null
} |
java, datetime, formatting, rags-to-riches
private static String append(long value, ChronoUnit unit) {
return String.format("%d %s", Long.valueOf(value),
value == 1 ? singular(unit) : unit).toLowerCase();
}
private static String singular(ChronoUnit unit) {
String toString = unit.toString();
return toString.substring(0, toString.length() - 1);
}
private static String replaceLast(String input, String target, String replacement) {
int lastIndex = input.lastIndexOf(target);
return lastIndex == -1 ? input : input.substring(0, lastIndex) + replacement
+ input.substring(lastIndex + 1);
}
}
DurationFormatterTest
public class DurationFormatterTest { | {
"domain": "codereview.stackexchange",
"id": 14746,
"lm_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, datetime, formatting, rags-to-riches",
"url": null
} |
The bounds of the 1st plot drawn by plotimplicit(..) are set according to the bounds of the solutions of fun. Most often they are (much) narrower than x_grid and y_grid bounds.
plotOptions
List of plot() line-styling options used when plotting the solutions curves.
### Description
plotimplicit(fun, x_grid, y_grid) evaluates fun on the nodes (x_grid, y_grid), and then draws the (x,y) contours solving the equation fun or such that fun(x,y) = 0.
When no root curve exists on the considered grid, plotimplicit yields a warning and plots an empty axes.
plotimplicit(..) can be used in a subplot. plotimplicit(..) can be called several times for the same axes, to overplot the solutions of several implicit equations (and show their possible intersections). Before returning, plotimplicit bundles all plotted curves into a graphical compound addressable as gce().children. If no solution exists, gce() is set to gca().
### Examples | {
"domain": "scilab.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.974434788304004,
"lm_q1q2_score": 0.8448698020329531,
"lm_q2_score": 0.8670357546485408,
"openwebmath_perplexity": 14033.922136150228,
"openwebmath_score": 0.5431338548660278,
"tags": null,
"url": "https://help.scilab.org/docs/6.1.0/pt_BR/plotimplicit.html"
} |
electromagnetic-radiation
$VSWR={{1+|\Gamma|}\over{1-|\Gamma|}}$
Similarly, for reflected power to full power (rather than voltage) the Standing Wave Ratio SWR can be expressed as
$SWR={{1+\sqrt{P_r/P_f}}\over{1-\sqrt{P_r/P_f}}}$.
For monochromatic waves the power is proportional to the photon flux, so I would say that one would practically use the power ratios or the SWR as an engineering (not physics) equivalent of the quantum efficiency. For modulated signals and wide frequency bands one would have to integrate over the time and/or frequency domain to arrive at an average figure. | {
"domain": "physics.stackexchange",
"id": 27897,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation",
"url": null
} |
• Hi, is your last sentence a general statement? Since if infimum =1/2; it follows min = 1/2? And I am correct in my assumption max and sup = 1? Mar 30 '16 at 1:51
• The infimum is 1/2, but there is no minimum here. And yes, the max is 1, so the sup is also 1.
– Ian
Mar 30 '16 at 1:52
• Okay, so if the max and min exist then it is the sup inf, but there is no max or min then the sup inf is just the result of the limit? Mar 26 '20 at 0:38
• @ErockBrox In general "the limit" needn't even make sense; not every set of real numbers is countable, and those that are aren't necessarily given in the form of a sequence. For a set with no max or min, there is no cleaner way to describe the sup and inf than just the definition of sup and inf (as least upper bound and greatest lower bound respectively).
– Ian
Mar 26 '20 at 1:02
As Ian pointed out, the difference can only appear with infinite sets. Here is the definition of minimum and infimum: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668706602658,
"lm_q1q2_score": 0.8764856049205918,
"lm_q2_score": 0.893309416705815,
"openwebmath_perplexity": 144.64653524328335,
"openwebmath_score": 0.9378753304481506,
"tags": null,
"url": "https://math.stackexchange.com/questions/1719659/what-is-the-difference-between-a-supremum-and-maximum-and-also-between-the-infi/1719681"
} |
OPEN DISCUSSION OF THIS QUESTION IS HERE: which-of-the-following-fractions-has-a-decimal-equivalent-159322.html
_________________
Non-Human User
Joined: 09 Sep 2013
Posts: 9427
Re: Which of the following fractions has a decimal equivalent th [#permalink]
### Show Tags
30 Jul 2018, 18:02
Hello from the GMAT Club BumpBot!
Thanks to another GMAT Club member, I have just discovered this valuable topic, yet it had no discussion for over a year. I am now bumping it up - doing my job. I think you may find it valuable (esp those replies with Kudos).
Want to see all other topics I dig out? Follow me (click follow button on profile). You will receive a summary of all topics I bump in your profile area as well as via email.
_________________
Re: Which of the following fractions has a decimal equivalent th &nbs [#permalink] 30 Jul 2018, 18:02
Display posts from previous: Sort by | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9511422186079557,
"lm_q1q2_score": 0.8084434697677583,
"lm_q2_score": 0.849971175657575,
"openwebmath_perplexity": 3407.6476573323876,
"openwebmath_score": 0.8216300010681152,
"tags": null,
"url": "https://gmatclub.com/forum/which-of-the-following-fractions-has-a-decimal-equivalent-th-80687.html"
} |
beginner, objective-c, ios
Rather than the if else block. But even if it isn't the case that _venueData will always be nil when there's an error, we should STILL call the completion block in this manner.
And why? Because everyone will use the completion block just as you are. It's going to start with if (!error). We're going to do this error check in our completion block. If you want to check it before you dispatch the completion block, then don't offer it as an argument to the completion block--it will be double checked every time. | {
"domain": "codereview.stackexchange",
"id": 7549,
"lm_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, objective-c, ios",
"url": null
} |
fourier-transform, sampling, zoh
If $x(t)$ is a continuous-time signal bandlimited to $\left(-\frac{1}{2T}, \frac{1}{2T}\right)$, that is, its Fourier transform $X(f)$ has the property that $X(f) = 0$ for all $|f| \geq \frac{1}{2T}$,then it can be reconstructed from its samples spaced $T$ seconds apart. So, let's consider the signal $x(t)\operatorname{sinc}\left(\frac{t}{T}\right)$ where
$$\operatorname{sinc}(t) = \begin{cases}\frac{\sin(\pi t)}{\pi t},& t \neq 0,\\1, & t = 0.\end{cases}$$ | {
"domain": "dsp.stackexchange",
"id": 7355,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, sampling, zoh",
"url": null
} |
javascript, html, game, ecmascript-6, dom
const levelBounds = {
top : -35.0,
right : 17.0,
left : -17.0,
bottom : 0.0
};
const bricks = {
rows : 11,
columns : 11,
distanceFromEdges : 1.0,
distanceFromTop : 13.0,
spacing : 0.2,
color : 0xff00ff,
depth : 1.0
};
const lights = [
new THREE.AmbientLight(0xffffff, 0.5),
new THREE.PointLight(0xffffff, 0.5)
];
// Game
let renderer = createFullScreenRenderer("game-window", settings);
let scene = new THREE.Scene();
let camera = createCamera();
scene.add(camera);
paddle.mesh = createMeshAtPosition({
geometry : new THREE.BoxGeometry(paddle.width, paddle.depth, paddle.height),
material : new THREE.MeshLambertMaterial({ color : paddle.color })
}, paddle.startPosition);
scene.add(paddle.mesh); | {
"domain": "codereview.stackexchange",
"id": 31749,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, html, game, ecmascript-6, dom",
"url": null
} |
ros
apt: Failed to detect successful installation of [python-catkin-pkg]
apt: Failed to detect successful installation of [python-rosdep]
apt: Failed to detect successful installation of [libpython2.7-stdlib]
apt: Failed to detect successful installation of [libogre-1.8] | {
"domain": "robotics.stackexchange",
"id": 22854,
"lm_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
} |
kinematics, vectors, velocity, rotational-kinematics, angular-velocity
I wonder that how the unit vector $\hat{?}$ is equal to $\hat{\theta}$. When I try to figure it out, I can't. Can you explain it, please? Your first equation works when you have already isolated the plane of rotation. It treats $\omega$ as a scalar. Sometimes we can't isolate it into a 2d case like this, such as if there are angular accelerations or other considerations. To handle the full 3d case, we define rotation using a vector, $\vec{\omega}$. This vector is defined to have a magnitude equal to the $\omega$ from the first equation, and a direction which is is at right angles to the rotation. | {
"domain": "physics.stackexchange",
"id": 65014,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, vectors, velocity, rotational-kinematics, angular-velocity",
"url": null
} |
javascript, html
tilemap.setPosition(0, 0);
tilemap.create();
sprites.createSprites(spriteSet);
sprites.setPosition(0, 235, 240);
sprites.show(0);
function loadResources(){
const img1 = 'https://georgec0stanza.github.io/2DgraphicsEngine/images/ferns.jpg';
const img2 = 'https://georgec0stanza.github.io/2DgraphicsEngine/images/tulips.jpg';
const img3 = 'https://georgec0stanza.github.io/2DgraphicsEngine/images/water.jpg';
const sprite0 = 'https://georgec0stanza.github.io/2DgraphicsEngine/images/daffodil.jpg';
const sprite1 = 'https://georgec0stanza.github.io/2DgraphicsEngine/images/eagle.jpg'; | {
"domain": "codereview.stackexchange",
"id": 38208,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, html",
"url": null
} |
java, beginner, object-oriented, file, git
final int SECONDS_FROM_MIDNIGHT = 60 * 60 * 3; // Should always do at 3am
int secondsUntilMidnight = Seconds.secondsBetween(getCurrentTime(), new LocalTime(23, 59, 59)).getSeconds();
return secondsUntilMidnight + SECONDS_FROM_MIDNIGHT; //
} | {
"domain": "codereview.stackexchange",
"id": 16686,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, object-oriented, file, git",
"url": null
} |
My Question
Is this a valid way to answer this question? This is just what makes sense to me, but I'm not sure if more explicit reasoning is needed.
-
You should state explicitly and prove the following general lemma. Your post shows that you are perfectly aware of it.
Lemma: Let $p_1,p_2,\dots, p_k$ be distinct primes, and let $m=p_1p_2\cdots p_k$. Let $n$ be a positive integer. Then $[n]=[m]$ iff there exist positive integers $a_1,a_2,\dots,a_k$ such that $n=p_1^{a_1}p_2^{a_2}\cdots p_k^{a_k}$.
After that, all of the specific cases are immediate consequences of the lemma.
-
A perfect answer. Thank you. – Mike Sep 7 '12 at 16:21
Hint $\,$ Assume $\rm\,x\sim y.\,$ Prime $\rm\, p\:|\:x\:|\:y^n\:\Rightarrow\:p\:|\:y.\:$ By symmetry $\rm\:p\:|\:y\:\Rightarrow\:p\:|\:x,\:$ so $\rm\:p\:|\:x\!\iff\!p\:|\:y.\:$ Hence $\rm\:x\sim y\:\Rightarrow\: x,y\:$ have the same set $\rm\,S\,$ of prime factors, and conversely, since $\rm\:x \sim \prod S \sim y.$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429101136843,
"lm_q1q2_score": 0.8592996047557353,
"lm_q2_score": 0.8723473829749844,
"openwebmath_perplexity": 260.1152020681857,
"openwebmath_score": 0.9999809265136719,
"tags": null,
"url": "http://math.stackexchange.com/questions/192395/verifying-prime-factorization-equivalence-class/192453"
} |
filters, computer-vision, noise, opencv, morphology
I drew all my explanations from a book P. Soille: Morphological Image Analysis, but since it's a book, not an article, I didn't find a readily accessible PDF copy. | {
"domain": "dsp.stackexchange",
"id": 565,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, computer-vision, noise, opencv, morphology",
"url": null
} |
c++, algorithm, matrix, homework, pathfinding
There is no reason to have int max; declared beforehand. It is just more code and risking usage of max before initialization.
Another example:
int elevChange2 = abs(Map[currentRow][currentCol] - Map[currentRow][currentCol + 1]); | {
"domain": "codereview.stackexchange",
"id": 22155,
"lm_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, matrix, homework, pathfinding",
"url": null
} |
quantum-field-theory, gauge-theory, group-theory, representation-theory, quantum-anomalies
$$\sum_i q_i^2 = \sum_j q_j^2,$$
where $i$ indexes left-moving charge carriers and $j$ indexes right-moving charge carriers.
The $SU(2)$ triplet has a charge $+2$ and a charge $-2$ carrier, the doublet has a $+1$ and a $-1$, and the singlet has no charge carriers. So the anomaly cancellation condition is
$$8 N(1_L) = 2 N(1/2_R).$$
Note that this technique works for any connected compact gauge group, since the Chern-Simons levels are determined by their maximal torus. Thus, the chiral anomaly in 1+1D always comes down to a number of $U(1)$ anomalies (plus the gravitational part) which must be checked. | {
"domain": "physics.stackexchange",
"id": 50365,
"lm_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, gauge-theory, group-theory, representation-theory, quantum-anomalies",
"url": null
} |
ros
Title: How can I use "RepoHeader" syntax when creating tutorial page?
Hello, I am a beginner to ROS documentation.
I am trying to create ros page which contains simple source code. (Stacks and packages)
There is quite convenient macro "RepoHeader" on ROSwiki.
I faced this message
"Once you've created your own *-ros-pkg repository, you can document your stacks and packages on ROS.org. Start by submitting your repository to be added to our index. You can do this by e-mailing ros-users."
I don't understand "You can do this by e-mailing ros-users". This means e-mailling to ros-users@code.ors.org with what contents?
Our repository is "bzr branch lp:cyphy" and is it possible to be indexed and use "RepoHeader"? | {
"domain": "robotics.stackexchange",
"id": 6661,
"lm_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
} |
javascript
Title: Modernized Javascript randomULID() Generator - Smaller and Optimized I've finally finished these 2 scripts and would like to get some feedback.
Seeking feedback on a modernized ULID (Universally Unique
Lexicographically Sortable Identifier) generator in Javascript.
Reduced size compared to examples on GitHub.
Code includes functions for encoding BigInt as Base32, decoding
timestamps, and generating ULIDs.
Looking for code review and optimization suggestions if it isn't
already compliant.
As you can see, Monotonic fills the Set almost twice as fast from sheer uniqueness.
See you later UUID?
Test Results - randomULID()
- Processor.....: Intel Xeon W-1390P @ 3.5GHz 32GB RAM
- Duration......: 2.7 sec @ 366,032/s @ 366/ms
- Iterations....: 1,000,000
- Collisions....: 0
- Set Bytes.....: 26,000,000 bytes
- Set Kilobytes.: 25,391 Kilobytes
- Set Megabytes.: 25 Megabytes
- Collision Test complete!
Test Results - randomMULID() | {
"domain": "codereview.stackexchange",
"id": 45089,
"lm_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",
"url": null
} |
javascript, performance, jquery, html5, canvas
// Resize the canvas by calling SetupCanvas().
SetupCanvas();
// Redraw all the ships.
DrawAllShips();
});
// Listen for key-down and key-up events. Set the corresponding key to
// true or false depending on which key is pressed.
$(window).keydown(function(e) {
keyStates[e.keyCode || e.which] = true;
}).keyup(function(e) {
keyStates[e.keyCode || e.which] = false;
});
/* ----------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------- */
/* Functions */
/* ----------------------------------------------------------------------------------------------------- */ | {
"domain": "codereview.stackexchange",
"id": 15063,
"lm_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, performance, jquery, html5, canvas",
"url": null
} |
Preview Activity $$\PageIndex{2}$$: Review of Congruence Modulo $$n$$
1. Let $$a, b \in \mathbb{Z}$$ and let $$n \in \mathbb{N}$$. On page 92 of Section 3.1, we defined what it means to say that $$a$$ is congruent to $$b$$ modulo $$n$$. Write this definition and state two different conditions that are equivalent to the definition.
2. Explain why congruence modulo n is a relation on $$\mathbb{Z}$$.
3. Carefully review Theorem 3.30 and the proofs given on page 148 of Section 3.5. In terms of the properties of relations introduced in Preview Activity $$\PageIndex{1}$$, what does this theorem say about the relation of congruence modulo non the integers?
4. Write a complete statement of Theorem 3.31 on page 150 and Corollary 3.32.
5. Write a proof of the symmetric property for congruence modulo $$n$$. That is, prove the following:
Let $$a, b \in \mathbb{Z}$$ and let $$n \in \mathbb{N}$$. If $$a \equiv b$$ (mod $$n$$), then $$b \equiv a$$ (mod $$n$$). | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474896314054,
"lm_q1q2_score": 0.8088652490125506,
"lm_q2_score": 0.8175744695262775,
"openwebmath_perplexity": 65.98629465601634,
"openwebmath_score": 0.9633486270904541,
"tags": null,
"url": "https://math.libretexts.org/Bookshelves/Mathematical_Logic_and_Proof/Book%3A_Mathematical_Reasoning_-_Writing_and_Proof_(Sundstrom)/7%3A_Equivalence_Relations/7.2%3A_Equivalence_Relations"
} |
javascript, jquery, validation, form, e-commerce
$addresses.after(message);
$addresses.keyup(function () {
var $value = $(this).val();
if(/p\.?o/i.test($value)) {
$(this).siblings('.message').removeClass('hidden');
} else if ($value === '') {
$(this).siblings('.message').addClass('hidden');
}
});
}(jQuery));
See: http://jsfiddle.net/6RnxG/7/ | {
"domain": "codereview.stackexchange",
"id": 22414,
"lm_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, validation, form, e-commerce",
"url": null
} |
hilbert-space, mathematical-physics, fermions, grassmann-numbers, coherent-states
Title: Where do fermionic coherent states live? Although there have been a couple of questions on fermionic coherent states, I don't think any has answered the question "on what space do fermionic coherent states live?", or at least not to my understanding. Hopefully, someone with more knowledge can clarify the situation.
The usual "explanation" is that coherent states $|\psi\rangle = \exp(-\psi a^*) |0\rangle$ live on a space "larger" than the usual fermionic Fock space $\mathscr{F}$ (or the exterior algebra of the single-particle Hilbert space $\mathscr{H}$), where Grassman variables $\psi$ are the coefficients. | {
"domain": "physics.stackexchange",
"id": 75760,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "hilbert-space, mathematical-physics, fermions, grassmann-numbers, coherent-states",
"url": null
} |
c++, ai, chess
if (from.rank != to.rank || from.file != to.file) {
if (piece != nullptr) {
if (piece->color == this->color) {
if (piece->moveTo(to) == true) {
this->opponent->removePiece(destinationPiece);
if (this->isUnderCheck() == false) {
if (this->opponent->isUnderCheck() == true) {
if (this->opponent->isUnderCheckmate() == true) {
this->errorDelegate->error("Checkmate!");
} else {
this->errorDelegate->error("Check!");
}
}
return true;
} else {
piece->undoMove();
this->addPiece(destinationPiece); | {
"domain": "codereview.stackexchange",
"id": 19291,
"lm_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++, ai, chess",
"url": null
} |
My questions to you are:
• What other reasons are there for us to know that $\frac{1}{18}$ is correct? (I am pretty sure there must be a few (at least technical) reasons and this is why I posted this question)
• Is there some basic argument against assuming that we cannot distinguish between the dice at all?
• If we assume that we cannot distinguish between the dice and have no way to check the probability empirically, is $P(A) = \frac{1}{21}$ even correct or did I overlook something?
Thank you for taking your time to read my question and I hope it is specific enough. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771786365549,
"lm_q1q2_score": 0.8445343783231644,
"lm_q2_score": 0.8558511451289038,
"openwebmath_perplexity": 220.2446653340933,
"openwebmath_score": 0.944078266620636,
"tags": null,
"url": "https://stats.stackexchange.com/questions/225552/how-do-we-know-that-the-probability-of-rolling-1-and-2-is-1-18"
} |
c#, xml, null
MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup[0].eHistory12.PN != "8801015") // None reported value (NEMSIS)
{
string PertinantNegatives = MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup[0].eHistory12.PN;
if (PertinantNegatives == "8801019" || PertinantNegatives == "8801023")
{
// Add a new XML serializable boolean to the CDA object
BL MyBL = new BL();
MyBL.nullFlavor = "NI";
MyCurrentlyOnMedicationObservation.value.Add(MyBL);
}
else
{
MyCurrentlyOnMedicationObservation.value.Add(new BL(true));
}
}
else
{
MyCurrentlyOnMedicationObservation.value.Add(new BL(false));
} | {
"domain": "codereview.stackexchange",
"id": 9021,
"lm_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#, xml, null",
"url": null
} |
biochemistry, dna, terminology, pcr, biotechnology
Here DNA cloning has been used to mean DNA replication in general.
Question: Which author's view is correct, or at least provides the most accepted definitions? Short answer
The Oxford English Dictionary is quite clear on this. For the verb clone there are two meanings:
Biology To propagate (an organism or cell) as a clone.
Molecular Biology To make copies of (a DNA sequence or gene).
The latter definition clearly encompasses PCR.
History lesson
Most of the information below is taken from the Oxford English Dictionary.
The term clone has a long history, first as a noun and more recently as a verb. The evolution of the meaning and use of the word suggests that we shouldn't be too precious about this. | {
"domain": "biology.stackexchange",
"id": 7090,
"lm_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, terminology, pcr, biotechnology",
"url": null
} |
machine-learning, neural-network, convolutional-neural-network
Does a convolution neural network make sense for this problem?
Note: The convnet that I was going to use for this problem is the same as in my previous question This problem is not complex enough to justify a large convolutional network. However, if you are determined to use a CNN, then you could, just try to keep the architecture very simple. Just one convolutional layer (probably SAME/padded), no pooling or dropout, only a few feature maps (e.g. no more than 4, maybe just 2 will do) - and a softmax fully-connected layer for the output.
Bear in mind that it can take more epochs, and perhaps more tuning of hyper-params, in order to get a more complex model to fit a simple problem. If you follow the plan in your earlier problem, and train against the whole population of valid states and moves, then you don't need to worry about over-fitting. | {
"domain": "datascience.stackexchange",
"id": 1512,
"lm_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, neural-network, convolutional-neural-network",
"url": null
} |
# Friction: Two Blocks Sliding
Q. Two blocks are sliding across a table pushed by a force F from the left equal to 23 N. The force of friction from the table on m1 is 4 N and the force of friction on m2 is 12 N. m1 = 2 kg and m2 = 6 kg.
a) What is the magnitude acceleration of the entire system?
I figured this part out. Turns out to be 0.88 m/s2
But need help with the following parts.
b) What is the magnitude of force from m1 on m2?
c) What is the magnitude of acceleration of only m1?
d) What is the magnitude of force from m2 on m1?
Thanks,
Naeem
Doc Al
Mentor
Start by identifying (labeling) the forces on each block. Then apply Newton's laws to one of the blocks and see what you can deduce.
I found out that the acc, for part c is 0.88 m/s2, but please help me with setting up
part b and d.
Thanks,
Doc Al
Mentor
Start by doing what I suggested in my last post. Pick a block (m1, say) and identify all the forces on it.
I tried setting up but no use.
all I know is F= ma
and | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9621075733703927,
"lm_q1q2_score": 0.801747908208049,
"lm_q2_score": 0.8333245994514084,
"openwebmath_perplexity": 1601.6900894810367,
"openwebmath_score": 0.6082935929298401,
"tags": null,
"url": "https://www.physicsforums.com/threads/friction-two-blocks-sliding.48954/"
} |
2,351 views
Consider the following c fragment :
void DAA(n)
{
int i,j,k,x=0;
for (i=1 ; i <=n ; i++)
for (j=1 ; j <= i * i ; j++)
{
if ( j mod i == 0 )
for ( k = 1 ; k <= j ; k++)
x=x+10;
}
}
Find the time complexity of above code in terms of input size n.
### 1 comment
Answer would be $O(n^4)$
Answer would be $O(n^4)$
To understand this you have to understand this how many times this condition (C1)
if ( j mod i == 0 )
will be true.
Lets take i = 5, then max value of j will be 25, it means that C1 will be true 5 times (when j = 5,10,15,20,25).
Similarly take i = 7, then max value of j will be 49, this time C1 will be true 7 time (when j = 7,14,21,28,35,42,49).
It means that condition C1 will be true for $\frac{j^2}{i}$ times.
Hence inner loop run only $O(n)$ rimes.
Therefore we get time complexity of $O(n^4)$.
by
### 1 comment
Thank you, Answer was given O(n^5) hence I got confused earlier, your explanation helps. | {
"domain": "gateoverflow.in",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9591542840900507,
"lm_q1q2_score": 0.8054344345122627,
"lm_q2_score": 0.83973396967765,
"openwebmath_perplexity": 2499.1563327674667,
"openwebmath_score": 0.6637222170829773,
"tags": null,
"url": "https://gateoverflow.in/47725/analysis-fragment-complexity-practice-booklet-volume-question"
} |
organic-chemistry, synthesis, aromatic-compounds
Does anyone have any ideas? I assume "DCM" represents dichloromethane, if so...
There is an old paper that describes the formation of a low molecular weight polymer from the double Friedel-Crafts alkylation of benzene by dichloromethane. That's probably what's happening in your reaction as a minor pathway. The dissolved polymer and tar is what's producing your black solution.
I actually ran that reaction once, I wanted to prepare that polymer. It didn't work for me, but at the end, after the aluminum chloride had been removed, I did have a dark solution. | {
"domain": "chemistry.stackexchange",
"id": 2695,
"lm_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, synthesis, aromatic-compounds",
"url": null
} |
recursion, rust
I know passing around the Method enum is a bit ugly but it was the best way I could come up with to get the app to work with stdin properly. I'm interested in feedback on the design of the recursion pattern specifically. Does it seem about right or is there a simpler way to represent this that I haven't thought of yet? I'd also appreciate any more general feedback you can offer, but the recursion bit is where I'm trying to learn right now.
Where clauses go on separate lines; easier to see them as they change the functionality so much.
Move the actual argument skipping near to the comment.
There's no need to call eq; use == instead.
String::as_str can often be avoided, just take a reference via &.
The code always builds the failure string, even when it doesn't fail! To avoid this, use unwrap_or_else, which allows access to the specific error as a closure argument.
Similarly, the code always gets Path::display, even when there is no failure. | {
"domain": "codereview.stackexchange",
"id": 23628,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "recursion, rust",
"url": null
} |
c++, c++11, c++14
////////////////////////////////////////////////////////////////////////////////
template<typename T, typename U>
auto forward_as( U&& u ) -> std::conditional_t<
std::is_reference<T>::value,
std::remove_reference_t<U>&,
std::remove_reference_t<U>&&>
{
return static_cast<std::conditional_t<
std::is_reference<T>::value,
std::remove_reference_t<U>&,
std::remove_reference_t<U>&&>>(u);
} | {
"domain": "codereview.stackexchange",
"id": 10391,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, c++14",
"url": null
} |
material-science
The acceptor level - which is the hole, has a higher energy than the valence electrons as it is above the valence band. But why does the hole have greater energy than the valence electrons? Shouldn't it have the same energy as an electron as it is simply the broken bond that an electron leaves behind (when the electron gets promoted)?
The text I was studying from also stated that a hole is a place where an electron can be promoted to, but why and how? Holes energy is measured down from valence band top because of their positive charge.
Remember that in real world there are no holes. This is quasi-particle introduced in order to describe movement of valence electrons, which is very hard due to high concentration of them. Huge amount of valence electrons is thus replaced by moderate amount of holes.
My advice is to read classic solid state books, for example, Kittel or (and) Aschcroft and Mermin, they step-by-step explain everything from the origins. | {
"domain": "engineering.stackexchange",
"id": 4855,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "material-science",
"url": null
} |
neural-networks
That would be trivial.
More difficult, but not hard, would be to take a 14 hour video of someone and create a new video with them saying something they have never said previously. Here is a demonstration, from the BBC YouTube channel, titled: "Fake Obama created using AI video tool - BBC News".
The University of Washington demonstrates, using a variety of clips and only audio from an impersonator, that they can create realistic videos of the former president saying anything they want.
It's possible to sketch out an idea and let AI create a finished product of excellent quality.
The YouTube channel ACMSIGGRAPH has a video titled: "Technical Papers Preview: SIGGRAPH 2018", which is discussed on the webpage: "Could These Be The Next High-Tech Tools That Animators Use Daily?".
What you have asked about was possible long ago and not particularly difficult to do. | {
"domain": "ai.stackexchange",
"id": 764,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks",
"url": null
} |
sedimentology, groundwater, pressure, stress
Compaction and consolidation of soils will reduce the volume (size) of pore spaces. Foundation loadings will only affect the soil beneath them.
Because soil particles do not lie directly on top of each other, one particle may lie above two or more particles, the stress exprienced by the upper soil particle will be transferred to the other particles. Providing the soil is deep enough, the affect of this is the to, over depth, transfer vertical stresses to horizontal stresses.
Ultimately, if a soil profile is deep enough, the stress the lower reaches of the soil experience due to urban development will be small and will not affect ground water movement. | {
"domain": "earthscience.stackexchange",
"id": 1907,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sedimentology, groundwater, pressure, stress",
"url": null
} |
Reference: Problem-Solving Strategies by Arthur Engel; available on Amazon India
Concept of order in math and real world | {
"domain": "madhavamathcompetition.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795098861572,
"lm_q1q2_score": 0.8928715436550383,
"lm_q2_score": 0.9046505370289057,
"openwebmath_perplexity": 396.8077610602914,
"openwebmath_score": 0.8531870245933533,
"tags": null,
"url": "https://madhavamathcompetition.com/category/nature-of-mathematics/page/2/"
} |
quantum-field-theory, particle-physics, feynman-diagrams, virtual-particles
\begin{align}
e^2j^\mu(p)\frac{\eta_{\mu\nu}}{k^2+i\epsilon}j^\nu(p')\sim\frac{e^2}{|p-p'|} \times \text{stuff}
\end{align}
where we won't be bothered explicitly writing what the $js$ are. Note the $\frac{\eta_{\mu\nu}}{k^2+i\epsilon}$ is the virtual photon line, and the $js$ come from the initial and final states of the electron/positron. But the leading contribution to the scattering amplitude in nonrelativistic quantum mechanics is given by the Born rule, which says basically
\begin{align}
T_{p'p}=-\tilde{V}(q)(2\pi)\delta (E_f-E_i)
\end{align}
where $T_{pp'}$ is the matrix element of the scattering matrix. So by comparison we see $\tilde{V}(p-p')=-e^2/|p-p'|$ i.e. an attractive Coulomb interaction$^3$. | {
"domain": "physics.stackexchange",
"id": 53643,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, feynman-diagrams, virtual-particles",
"url": null
} |
energy, momentum, solar-sails
Back to photons. The solar spectrum is dominated by visible light. If we make the assumption that all the solar photons are visible, with a wavelength of 500 nm, then each photon carries $4 \times 10^{-19}$ J. The Sun must therefore emit approximately $9.6 \times 10^{44}$ of these per second. At a distance $r$ from the Sun, the sail intercepts a fraction $A/4\pi r^2$ of these photons and receives a momentum $2E/c$ from each one.
Using $A=6.4\times 10^{5}$ m$^2$ and $r=1.5\times10^{11}$ m again, I get that the exchanged momentum per second ($F_{sail}$) is $5.8$ Newtons, as before. | {
"domain": "physics.stackexchange",
"id": 22384,
"lm_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, momentum, solar-sails",
"url": null
} |
lo.logic, dependent-type
hit the Burali-Forty paradox, define a non-terminating function, and inhabit False. In fact, much less is needed and is included in the standard Coq library under Pardoxes.BuralliForti_ex, see theorem Burali_Forti : False. | {
"domain": "cstheory.stackexchange",
"id": 2632,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lo.logic, dependent-type",
"url": null
} |
c++, object-oriented, qt, ssh
Make sure to match file open and close
In the case that the find routine finds a duplicate entry, it leaves the file open. If it adds a new entry, it leaves the file closed. This makes it impossible for the calling program to know whether the file is open or closed at the end of the call. To fix that, (and using the previous suggestions), you could refactor like this:
void SSHConfigFile::registerIP(const QString &ip)
{
QString fileData = read();
if (!find( ip, fileData))
{
// this is new ip, add it to config file
addIP( ip, fileData );
} else {
file.close();
}
}
OOP design
Simply stated, in Object Oriented Programming, the nouns in a description become objects and the verbs become methods. In this case the description is "reads an SSH config file and checks whether an IP exists. If the IP does not exist, the class adds a block for that IP address." so the relevant nouns are:
SSH config file
IP address
block (for IP address)
Verbs are: | {
"domain": "codereview.stackexchange",
"id": 16460,
"lm_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, qt, ssh",
"url": null
} |
inorganic-chemistry, acid-base
The difference is that the hydration of sodium oxide is essentially irreversible. One program I used estimated $K_{eq}=10^{39}$ for sodium oxide hydration. In contrast the hydration of carbon dioxide is reversible, with $K_{eq}\approx1.5\times10^{-3}$.
The reaction that you are wondering about, $\ce{CO2 +2NaOH⟶Na2O +H2CO3}$, is essentially the dehydration of sodium hydroxide by $\ce{CO2}$ to form sodium oxide and carbonic acid, that is, it is reaction 2 minus reaction 1. But the equilibrium constants I just mentioned show that sodium oxide has an "affinty" for water that is about 42 orders of magnitude greater than carbon dioxide's affinity for water. So that reaction is very unfavorable. The reverse reaction would be extremely favored: Sodium oxide would be a powerful reagent for $\ce{CO2}$ removal prior to air liquefaction, at least as powerful as sodium hydroxide. | {
"domain": "chemistry.stackexchange",
"id": 2954,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, acid-base",
"url": null
} |
orbit, earth, satellite, the-moon
About half of these are in a low earth orbit (LEO). Satellites in LEO have a period of between 90 minutes and 130 minutes. But you would not expect a satellite to follow the same path in the sky in two orbits, as the earth will have moved between orbits of the satellite. So it is very unlikely that you will see the same satellite pass in front of the moon twice.
Satellites in LEO are moving fast! They will cross the moon's disc in less than a second, and transits are rare, as each is a path only 7km wide. at any one time, a transit is visible from less than 100th of 1% of the Earth's surface. To obtain the awesome photo that you have linked, the astrophotographer would have had to use some orbital prediction software to calculate the exact time of a solar transit by the ISS and travel to a carefully calculated position (and prayed for clear skies). You could be observing the moon all year and never see a transit. | {
"domain": "astronomy.stackexchange",
"id": 1091,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit, earth, satellite, the-moon",
"url": null
} |
electrochemistry, home-experiment, crystal-structure
Some alternate preparations would be to follow paths to copper patina (see this site, which discusses three paths for the home chemists which includes an embodiment of the ammonia prep, and, with the addition of vinegar, would convert the basic copper carbonate to copper acetate. | {
"domain": "chemistry.stackexchange",
"id": 13421,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry, home-experiment, crystal-structure",
"url": null
} |
quantum-mechanics, condensed-matter, second-quantization
where $g_{ij}^a$ and $g_{ij}^c$ are sometimes called the quantum metric for bosons and fermions respectively. In matrix forms, they are given by
$$g^a=\mathrm{i}\left[\begin{matrix}0&\mathbb{1}_{n\times n}\\-\mathbb{1}_{n\times n}&0\end{matrix}\right] \qquad g^c=\left[\begin{matrix}\mathbb{1}_{n\times n}&0\\0&\mathbb{1}_{n\times n}\end{matrix}\right],$$
with $\mathbb{1}_{n\times n}$ being the $n\times n$ identity matrix. So to preserve the algebraic relations among the creation/annihilation operators is to preserve the quantum metric. General linear transformations of the operators $a_i$ and $c_i$ take the form of
$$a_i\to \sum_{j}W_{ij}^a a_j\qquad c_i\to \sum_{j}W_{ij}^c c_j,$$
where the transformation matrix elements $W_{ij}^a, W_{ij}^c\in\mathbb{R}$ must be real, in order to ensure that the operators $a_i$ and $c_i$ remain Hermitian after the transformation. Then to preserve the quantum metric is to require
$$W^a g^a W^{a\intercal}= g^a\qquad W^c g^c W^{c\intercal}= g^c.$$ | {
"domain": "physics.stackexchange",
"id": 37762,
"lm_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, condensed-matter, second-quantization",
"url": null
} |
qiskit, quantum-gate, density-matrix
npt.assert_array_almost_equal(op_auto.data, op_manual.data)
Is there a way to force the layout to match the ordering of my choice? I did look into the layout parameter of the Operator.from_circuit method but I do not understand how to use it, there isn't any relevant documentation attached to the interface document either. Any leads would be helpful. Instead of using numpy's Kronecker product, you can use Operator's tensor product. (Not better, just another way to do it):
oneone : Operator = Operator(np.array([[0, 0], [0, 1]]))
zerozero : Operator = Operator(np.array([[1, 0], [0, 0]]))
eye : Operator = Operator(np.identity(2))
unitary : Operator = Operator(np.array([[0, 1], [1, 0]]))
cx_UGate : UnitaryGate = zerozero.tensor(eye) + oneone.tensor(unitary)
qc2 = QuantumCircuit(2)
qc2.append(cx_UGate, [0, 1])
op_manual = Operator.from_circuit(qc2)
print(op_manual) | {
"domain": "quantumcomputing.stackexchange",
"id": 4971,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "qiskit, quantum-gate, density-matrix",
"url": null
} |
php, mysql, pdo
// Connect to database
try {
$db = new PDO("mysql:host=".HOST.";dbname=".NAME.";charset=utf8", "".USER."", "".PASS."");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// PDO fetch docs: http://php.net/manual/en/pdostatement.fetch.php
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
// User friendly page to show on connection error
include 'includes/sql-error.php';
die();
}
// Simple function to handle PDO prepared statements
function sql($db, $q, $params, $return) {
$stmt = $db->prepare($q);
$stmt->execute($params);
if ($return == "rows") {
return $stmt->fetchAll();
}
elseif ($return == "count") {
return $stmt->rowCount();
}
}
?>
The usage of this function would look something like this
<?php
// With SELECT
// Call function
$rows = sql($db, "SELECT * FROM table WHERE id = ?", array($id), "rows");
// Get results
foreach($rows as $row) {
echo $row['field1'].' '.$row['field2']; //etc...
} | {
"domain": "codereview.stackexchange",
"id": 14410,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, mysql, pdo",
"url": null
} |
software
Since you are installing IRAF using the 2nd approach, let me give you some basic background on how that should work. To compile a C++ project, you need:
A C++ compiler. For example, GCC, Visual Studio, CLang, ...
A makefile (or many sub-makefiles) to orginize all the source and header files. It could be a Makefile file, or a CMakeLists.txt. The makefile could be either written by hand, or generated automatically using some scripts.
The way to compile IRAF, from its readme, is:
Generate a makefile using ./install. After this step you should see a Makefile generated.
Run make linux64 to compile if you are on Linux64. Then, run make sysgen 2>&1 | tee build.log to build. If this step is successful, you will see binary files generated as outputs. In IRAF, these files would be generated in the directory of ./bin and ./bin.linux64. In my case, these files are: | {
"domain": "astronomy.stackexchange",
"id": 5411,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "software",
"url": null
} |
#### Klaas van Aarsen
##### MHB Seeker
Staff member
Ah ok!!
So, since the variance of A is bigger than that of B, it becomes clear that according to A's estimates, there will be larger fluctuations as eith the estimation of B. Thus, the estimate of B is better, isn't it?
Yep.
#### mathmari
##### Well-known member
MHB Site Helper
Ok! Thank you very much!! | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9902915246646303,
"lm_q1q2_score": 0.8119334260423168,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 733.596048834762,
"openwebmath_score": 0.9828346967697144,
"tags": null,
"url": "https://mathhelpboards.com/threads/expected-values-and-variances.24037/"
} |
homework-and-exercises, electric-circuits, electrical-resistance, capacitance
Below is the Laplace Transformed circuit (s-domain or frequency domain). Notice that the voltage across the capacitor, $V_C(s)$, is a combination of the voltage drop across the $\frac{1}{sC}$ impedance plus the voltage source representing the initial cap voltage. | {
"domain": "physics.stackexchange",
"id": 72987,
"lm_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, electric-circuits, electrical-resistance, capacitance",
"url": null
} |
a sine function with a certain frequency, but it didn't seem to show the right curve. The smaller the wave length the higher the frequency, so the further the dots will be from the DC value. By using this website, you agree to our Cookie Policy. The Phase of Sine Wave is an angular measurement that specifies the position of the sine wave relative to a reference. Find more Mathematics widgets in Wolfram|Alpha. Hence it is known as a "phase factor. 414 times its ef¬ fective value. These sine waves each have a frequency and amplitude. Amplitude, Period, Phase Shift and Frequency. One wavelength of the wave is highlighted in red. Ptolemy’s identities, the sum and difference formulas for sine and cosine. So recapping, this is the wave equation that describes the height of the wave for any position x and time T. Step 1: a sin (bx +c) Let b=1, c=0, and vary the values of a. What is the wavelength of sine wave? Given frequency, distance and time. 151 x QRSV2) - (0. One way of showing this is a | {
"domain": "wattonweb.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429604789206,
"lm_q1q2_score": 0.8318515387880796,
"lm_q2_score": 0.8459424353665382,
"openwebmath_perplexity": 596.3331284839677,
"openwebmath_score": 0.8392153978347778,
"tags": null,
"url": "http://wattonweb.it/mvv/sine-wave-equation.html"
} |
ros, packages, dependencies
96) ros-hydro-rqt-image-view [Not Installed]
97) ros-hydro-rqt-robot-plugins [Not Installed]
98) ros-hydro-rqt-rviz [Not Installed]
99) ros-hydro-rviz [Not Installed]
100) ros-hydro-rviz-plugin-tutorials [Not Installed]
101) ros-hydro-rviz-python-tutorial [Not Installed]
102) ros-hydro-simulators [Not Installed]
103) ros-hydro-stage [Not Installed]
104) ros-hydro-stage-ros [Not Installed]
105) ros-hydro-stereo-image-proc [Not Installed]
106) ros-hydro-theora-image-transport [Not Installed]
107) ros-hydro-vision-opencv [Not Installed]
108) ros-hydro-visualization-tutorials [Not Installed]
109) ros-hydro-viz [Not Installed]
110) tk8.5-dev [Not Installed] | {
"domain": "robotics.stackexchange",
"id": 16327,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, packages, dependencies",
"url": null
} |
ros, ros2, moveit-commander
Originally posted by v4hn with karma: 2950 on 2023-05-26
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 38933,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros2, moveit-commander",
"url": null
} |
ruby, ruby-on-rails, search
render json: search.autocomplete.to_json
end
end
Lib
class SearchesCatalog
attr_reader :options
def initialize(options = {})
@options = HashWithIndifferentAccess.new(options)
@resources = [ :questions, :answers, :links, :events, past_events, :reviews ]
end
def results
term = options[:term]
Tire.search @resources do
query { string "#{term}" }
end.results
end | {
"domain": "codereview.stackexchange",
"id": 2867,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, ruby-on-rails, search",
"url": null
} |
ros, sicklms, sicktoolbox-wrapper
EDIT: apparently those changes are only in the Fuerte version of the toolbox (thanks @Chad Rockey). For Electric, you could do a checkout of the package and apply the specific patches yourself, backporting them. Be sure to checkout the appropriate version of the sources.
Originally posted by ipso with karma: 1416 on 2012-07-10
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by allenh1 on 2012-07-10:
How do I configure the delay?
Comment by ipso on 2012-07-10:
Looks like it is just a parameter, so add it to the list of parameters of the node in your launch file?
Comment by Chad Rockey on 2012-07-10:
The parameter for the pioneers and the sick toolbox has only been released for Fuerte.
Comment by allenh1 on 2012-07-10:
We cannot use fuerte because the p2os driver doesn't exist for fuerte yet. Due to that limitation, how should we proceed? | {
"domain": "robotics.stackexchange",
"id": 10139,
"lm_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, sicklms, sicktoolbox-wrapper",
"url": null
} |
I hope that simple example explains all the details in the question.
Now, the question is: What is the probability that the $100^{th}$ ball you pick is black?
I'm not looking for the final answer, but for the way of solving such questions, as what makes this question complicated for me is that the probability for picking a black ball changes in each pick.
• It does.. I have edited this, thank you. – johni May 2 '15 at 12:30
Let $B_n$ be the event of picking a black ball on the $n$-th turn.
Let $a_n = 4+4n$ be the total count of balls available on the $n$-th turn. Four new balls are always added to the bag each turn.
Let $p_n$ be the probability of picking a black ball on the $n$-th turn. $p_1=5/8$
Then the count of black balls available on the $n$-th turn is $a_np_n$. Eg $a_1p_1= 5$.
Now use the Law of Total Probability.
\begin{align} p_{n+1} & = P(B_{n+1}) \\ & = P(B_{n+1} \mid B_{n})P(B_{n}) + P(B_{n+1}\mid \neg B_{n})(1-P(B_{n})) \end{align} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850827686585,
"lm_q1q2_score": 0.812728026203926,
"lm_q2_score": 0.8267117876664789,
"openwebmath_perplexity": 301.601913251716,
"openwebmath_score": 0.8702939748764038,
"tags": null,
"url": "https://math.stackexchange.com/questions/1261849/probability-that-the-100th-ball-you-pick-is-black-given-the-details-inside"
} |
biophysics, electrophysiology
Verkerk, Arie O., et al. "Pacemaker current (If) in the human sinoatrial node." European heart journal 28.20 (2007): 2472-2478.
Might I suggest you read up on the papers mentioned above?
You might also be interested in this:
Noma, Akinori. "Ionic mechanisms of the cardiac pacemaker potential." Japanese heart journal 37.5 (1996): 673-682. | {
"domain": "biology.stackexchange",
"id": 3856,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biophysics, electrophysiology",
"url": null
} |
Join the webinar and learn time-management tactics that will guarantee you answer all questions, in all sections, on time. Save your spot today! Nov. 14th at 7 PM PST | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9674102477171955,
"lm_q1q2_score": 0.8582908071280985,
"lm_q2_score": 0.8872045847699185,
"openwebmath_perplexity": 10509.071517360848,
"openwebmath_score": 0.2825273871421814,
"tags": null,
"url": "https://gmatclub.com/forum/jennifer-can-buy-watches-at-a-price-of-b-dollars-per-watch-which-she-193399.html"
} |
java, performance, algorithm, strings
Just a snippet to get you started:
private int distinctChars;
private int[] counts = new int[Character.MAX_VALUE+1];
private void addCharacter(char c) {
if (counts[c] == 0) {
distinctChars++;
}
counts[c]++;
}
private void removeCharacter(char c) {...}
public int maximumLength(String str, int limit) {
...
for (int i=0, j=0; j<len; ) {
if (distinctChars <= limit) {
max = Math.max(max, j-i);
addCharacter(str[j++]);
} else {
removeCharacter(str[i++]);
}
}
...
} | {
"domain": "codereview.stackexchange",
"id": 14628,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, algorithm, strings",
"url": null
} |
gazebo-plugin, ros-kinetic, gazebo-7
Finally, on my cuadrubot.gazebo:
<!-- Gazebo Mimic Joints Plugin -->
<xacro:macro name="mimic_joint_plugin_gazebo" params="name_prefix parent_joint mimic_joint has_pid:=false multiplier:=1.0 offset:=0 sensitiveness:=0.0 max_effort:=1.0 robot_namespace:=''">
<gazebo>
<plugin name="${name_prefix}mimic_joint_plugin" filename="libroboticsgroup_gazebo_mimic_joint_plugin.so">
<joint>${parent_joint}</joint>
<mimicJoint>${mimic_joint}</mimicJoint>
<xacro:if value="${has_pid}"> <!-- if set to true, PID parameters from "/gazebo_ros_control/pid_gains/${mimic_joint}" are loaded -->
<hasPID />
</xacro:if>
<multiplier>${multiplier}</multiplier>
<offset>${offset}</offset>
<sensitiveness>${sensitiveness}</sensitiveness> <!-- if absolute difference between setpoint and process value is below this threshold, do nothing; 0.0 = disable [rad] --> | {
"domain": "robotics.stackexchange",
"id": 4473,
"lm_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-plugin, ros-kinetic, gazebo-7",
"url": null
} |
quantum-mechanics, hilbert-space, vacuum
Title: What is the difference between $|0\rangle $ and $0$? What is the difference between $|0\rangle $ and $0$ in the context of $$a_- |0\rangle =0~?$$ $|0\rangle$ is just a quantum state that happens to be labeled by the number 0. It's conventional to use that label to denote the ground state (or vacuum state), the one with the lowest energy. But the label you put on a quantum state is actually kind of arbitrary. You could choose a different convention in which you label the ground state with, say, 5, and although it would confuse a lot of people, you could still do physics perfectly well with it. The point is, $|0\rangle$ is just a particular quantum state. The fact that it's labeled with a 0 doesn't have to mean that anything about it is actually zero. | {
"domain": "physics.stackexchange",
"id": 85756,
"lm_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, hilbert-space, vacuum",
"url": null
} |
visible-light, scattering, thermal-radiation, atmospheric-science, sun
If you observe the Sun at lower altitudes you multiply the extinction at zenith in magnitudes (roughly) by $\sec z$, where $z$ is the angle from zenith, to account for the number of air masses the light travels through. (NB a better approximation is needed as $z$ approaches 90 degrees.)
At bluer wavelengths the extinction is higher - maybe 0.3 magnitudes/airmass at 400 nm and becomes very large of course as you head towards the UV. This wavelength dependence is largely attributable to Rayleigh scattering. At redder wavelengths it is lower maybe 0.06 magnitudes/airmass.
The presence of aerosols, dust and pollutants all can increase the extinction. At sea level in a city, there could easily be 1 magnitude of extinction meaning 60% of the direct light is absorbed or scattered. | {
"domain": "physics.stackexchange",
"id": 90046,
"lm_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, scattering, thermal-radiation, atmospheric-science, sun",
"url": null
} |
universe, time-dilation
the star (kids, don't try this at home), the less the time dilation. Only if you compress the star, so as to squezze it into a neutron star of a black hole, will you get a larger time dilation. For instance, at the "surface" of a black hole, time stops (but again, only wrt. an external observer; for the person at the surface, time evolves as expected) | {
"domain": "astronomy.stackexchange",
"id": 951,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "universe, time-dilation",
"url": null
} |
biochemistry, cardiology, fat-metabolism
There has never been a study wherein AFib accompanied by symptoms of chest pain was treated by Omega 3 Polyunsaturated Fatty Acids and there never will be, because N3PUFA does not cardiovert arrhythmias nor does it effect heart rate in AFib.
No medical body of any kind would support such a study.
Finally, there is no convincing evidence that N3PUFAs decrease the incidence of AFib, and this has been studied often, because eating 4-5 servings of fish per week has been shown to have a beneficial effect on A Fib. That gives reason to hope that N3PUFA supplements might be similarly beneficial. However: | {
"domain": "biology.stackexchange",
"id": 3028,
"lm_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, cardiology, fat-metabolism",
"url": null
} |
lines Heat equation is used to simulate a number of applications. [Graphics:heateq2gr4. Specify Dirichlet boundary conditions at the left and right ends of the domain. For Dirichlet boundary condi-. The temperature that satisifies the above equations will be found in two steps. trarily, the Heat Equation (2) applies throughout the rod. 1) This equation is also known as the diffusion equation. of boundary conditions, and their incorporation into the discretization of the PDE can be performed as stated above for the three cases. ONE-DIMENSIONAL HEAT CONDUCTION EQUATION IN A FINITE INTERVAL 67 4. In this paper I present Numerical solutions of a one dimensional heat Equation together with initial condition and Dirichlet boundary conditions. Al-ternatively, we could specify a heat flux, (2. m and Neumann boundary conditions heat1d_neu. Boundary Conditions (BC): in this case, the temperature of the rod is affected. We consider the linear heat equation on a bounded domain, which has two | {
"domain": "muse-deutsch.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9924227578357059,
"lm_q1q2_score": 0.8270102868898517,
"lm_q2_score": 0.8333245891029456,
"openwebmath_perplexity": 492.8236940831988,
"openwebmath_score": 0.8473877906799316,
"tags": null,
"url": "http://tnzj.muse-deutsch.de/heat-equation-with-dirichlet-boundary-conditions.html"
} |
java, validation
I get a feeling that you are trying to mimic Java streams with the validator. But you end up loading responsibilities about converting and processing the input into the validator. This requires you to maintain state in the validator. All this makes the validator unnecessarily complex and may case loss of reusability. Is the ability to make your code look like stream operations worth it? Can you efficiently use the validator as part in a regular Java stream processing?
Defining each validation criteria as a predicate helps in testing but at the moment each component that requires validation has to know the correct combination of predicates in order to successfully validate an object. You're better of creating a single composite predicate for each class, in which case having the ability to define the validation as a list of predicates becomes a bit useless. | {
"domain": "codereview.stackexchange",
"id": 42400,
"lm_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, validation",
"url": null
} |
newtonian-mechanics, momentum, conservation-laws, collision, approximations
Title: conservation of momentum? At hyperphysics I got this image, with the same description in text as is in this image | {
"domain": "physics.stackexchange",
"id": 27938,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, momentum, conservation-laws, collision, approximations",
"url": null
} |
machine-learning, deep-learning, optimization, convergence
Is it a valid claim that, in deep learning (incl. nonlinear architectures), plateaus are more likely than local minima? And if so, is there a (possibly mathematical) intuition behind it?
Is there anything particular about deep learning and saddle points? This is simply trying to convey my intuition, i.e. no rigor. The thing with saddle points is that they are a type of optimum which combines a combination of minima and maxima. Because the number of dimensions are so large with deep learning, the probability that an optimum only consists of a combination of minima is very low. This means 'getting stuck' in a local minimum is rare. At the risk of oversimplifying, it's harder to 'get stuck' in a saddle point because you can 'slide down one of the dimensions'. I think the Andrew Ng video you refer to comes from the Coursera course on Deep Learning by him. | {
"domain": "datascience.stackexchange",
"id": 2970,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, optimization, convergence",
"url": null
} |
newtonian-gravity, coulombs-law
Title: 'Generalized' Universal Gravitation & Coulomb's Law? It is said that Coulomb's 'inverse-square' law (and Gauss's Law) are empirical facts. I'm wondering how do we know that Coulomb's law is inverse-square, and what are the possible consequences if it's not an inverse-square law. Suppose I write out the 'generalized' Coulomb's law for a point charge of the form:
$$
\vec{E}=\frac{1}{4\pi\epsilon_0}\cdot\frac{q}{r^{2+\delta}}
$$
and the gravitational field of the form:
$$
\vec{g}=\frac{GM}{r^{2+\delta}}
$$
where $\delta$ represents a deviation from the inverse square. What are the implications in each case if $\delta\neq0$?
I have an example in Coulomb's case, but I'm not pretty sure how can I explain that:
Imagine two isolated concentric spherical conducting shells charged with total charges Qa and Qb and radii a and b such that a > b. If we connect the two shells with a thin conducting wire, if $\delta\neq0$, there will be some charge left on the inner shell. | {
"domain": "physics.stackexchange",
"id": 71684,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-gravity, coulombs-law",
"url": null
} |
Suppose an operator $$\mathcal{T}$$ defined on a n-dimensional linear space $$V$$ has $$t$$ different eigenvalues $$\lambda_1,...,\lambda_t$$, and the characteristic polynomial has the form$$P_\mathcal{T}(\lambda)=(\lambda-\lambda_1)^{n_1}...(\lambda-\lambda_t)^{n_t}.$$Then for each eigenvalule $$\lambda_i(1\leq i\leq t)$$, a subspace $$\text{Null}(\mathcal{T}-\lambda_i \mathcal{I})^{n_i}$$ was formed by a zero vector and all of the generalized eigenvectors with respect to $$\lambda_i$$, which has $$n_i$$ dimensions.
Now I'm getting quite unsure about the description of generalized eigenspace. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773708052400943,
"lm_q1q2_score": 0.8364839192867831,
"lm_q2_score": 0.8558511414521923,
"openwebmath_perplexity": 96.89500313340825,
"openwebmath_score": 0.9418841600418091,
"tags": null,
"url": "https://math.stackexchange.com/questions/3846064/confusion-about-the-description-of-generalized-eigenspace"
} |
c#, exception-handling
if(result != DialogResult.Retry)
break;
}
private boolean TryTableFill(myDataTable, out string errorMessage)
{
errorMessage = string.Empty;
try
{
oleDbDataAdapter1.Fill(myDataTable);
return true;
}
catch (Exception ex) {
errorMessage = ex.Message;
return false;
}
}
or alternatively (I like this way but I'm not sure if it's better. Added just to provide an alternative):
private boolean TryTableFill(myDataTable, out string errorMessage)
{
errorMessage = string.Empty;
try
{
oleDbDataAdapter1.Fill(myDataTable);
}
catch (Exception ex) {
errorMessage = string.Format("Error occured: {0}", ex.Message);
}
return !string.isNullOrEmpty(errorMessage);
} | {
"domain": "codereview.stackexchange",
"id": 2711,
"lm_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#, exception-handling",
"url": null
} |
filters, convolution, linear-systems
At this stage, the integration seems impossible by hand (e.g., integration by parts).
I also tried moving to wave space by taking Fourier transforms and instead using multiplication:
\begin{align*}
\mathscr{F}\{\phi(x)*h(x)\} &= \mathscr{F}\{\phi(x)\} \cdot \mathscr{F}\{h(x)\} \\
\end{align*}
I get the Fourier transform of sine as $\sqrt{\pi/2} i (\delta(k - 1) - \delta(k + 1)$, but am not sure how to multiply this with the exponential and how the inverse Fourier transform will work. | {
"domain": "dsp.stackexchange",
"id": 7943,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, convolution, linear-systems",
"url": null
} |
Here is a solution using less machinery than in Will Jagy's answer.
As Daniel Robert-Nicoud noted in comments, the fact that $3^a+7^b\equiv(-1)^a+(-1)^b$ mod $4$ implies $a$ and $b$ must have opposite parity in order for the (even) sum $3^a+7^b$ to be a perfect square. So we seek to show that $(a,b)=(1,0)$ is the only solution in the (odd,even) case and $(a,b)=(2,1)$ is the only solution in the (even,odd) case.
If $a$ is odd and $b=2m$ is even, then we can rewrite $3^a+7^b=n^2$ as $3^a=(n+7^m)(n-7^m)$. This implies $n+7^m$ and $n-7^m$ are each powers of $3$, say $3^c$ and $3^d$ with $c+d=a$. But then $2\cdot7^m=3^c-3^d$, so we must have $d=0$ and $c=a$, since $3\not\mid2\cdot7^m$. One solution to $2\cdot7^m=3^a-1$ is $(a,m)=(1,0)$. It remains to show there are no solutions with $m\gt0$. For this it suffices to note that $3^a\equiv1$ mod $7$ if and only if $6\mid a$, which contradicts the assumption that $a$ is odd. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754488233528,
"lm_q1q2_score": 0.8464038212254912,
"lm_q2_score": 0.8596637487122111,
"openwebmath_perplexity": 138.42189810388928,
"openwebmath_score": 0.8869752883911133,
"tags": null,
"url": "https://math.stackexchange.com/questions/2465086/for-what-pair-of-integers-a-b-is-3a-7b-a-perfect-square"
} |
The cylindrical coordinates r, θ, and z describe the motion of a point P in the xyz space as shown in Fig. The radial (r) and tangential (t) derivatives are the components of the gradient in polar coordinates: ∇f = (df/dr, 1/r df/dt). This cylindrical coordinates calculator will allow you to convert Cartesian to cylindrical coordinates, as well as the other way Divergence and Curl calculator. Then cylindrical, and if you get that, spherical. 1. 3 Resolution of the gradient The derivatives with respect to the cylindrical coordinates are obtained by differentiation through the Cartesian coordinates, @ @r D @x @r @ @x DeO rr Dr r; @ @˚ D @x @˚ @ @x DreO ˚r Drr ˚: Nabla may now be resolved on the Cylindrical coordinate system Vector fields. Plot basic graphs. Exercise 15: Verify the foregoing expressions for the gradient, divergence, curl, and Laplacian operators in spherical coordinates. The Curl(F) command computes the curl of the vector field F in R^3. 2 can be carried out using | {
"domain": "menubuddy.sg",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992422760300897,
"lm_q1q2_score": 0.8204475964078123,
"lm_q2_score": 0.8267117898012105,
"openwebmath_perplexity": 683.347574851877,
"openwebmath_score": 0.8974097967147827,
"tags": null,
"url": "http://menubuddy.sg/ls-swap-p4psh/lkgvx---curl-in-cylindrical-coordinates-calculator---du3s.html"
} |
c++, programming-challenge, functional-programming, c++20
Title: sum of multiples by 3 or 5 using ranges This program calculates the sum of all integers in the range \$[1, 1000)\$ which are multiples of either 3 or 5 or both.
Inspired by x86-64 Assembly - Sum of multiples of 3 or 5 the other day, and also drawing from some of what I learned through Calculate the centroid of a collection of complex numbers I decided to try to tackle this using C++20 ranges. By heavy use of constexpr, I had hoped to find a solution that would calculate everything at compile time, and indeed this does as you can see if you try it online.
This version is inspired by this talk C++20 Ranges in Practice - Tristan Brindle - CppCon 2020.
I'm interested in general improvements.
euler1.cpp
#include <iostream>
#include <concepts>
#include <ranges>
#include <iterator>
#include <functional>
#include <numeric> | {
"domain": "codereview.stackexchange",
"id": 40250,
"lm_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++, programming-challenge, functional-programming, c++20",
"url": null
} |
## Spherical Unit Vectors
$$\begin{cases} x = r\sin \theta \cos \phi \\y = r\sin \theta \sin \phi \\z = r\cos \phi \end{cases} \implies \begin{cases} F(r,\theta,\phi)=r^2-a^2 \\ \theta \in [0,\pi] \\ \phi \in [0,2\pi) \\ \end{cases} \implies \begin{cases} \nabla F=(2r,0,0) \\[2px] \|\nabla F\| =2r \end{cases} \\[40px] \bbox[5px,border:1px solid black] { \hat n =\hat r + 0 \, \hat \theta + 0\, \hat \phi = \hat r }$$
The problem is that the expression with spherical unit vectors does not take into account the coordinates of the point. In other words, $$\hat n=(1,0,0)$$ for every $$(r,\theta,\phi)$$. So, my second approach was calculate it via parametrization of the sphere.
## Using Parametric Equation (Cartesian) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551505674444,
"lm_q1q2_score": 0.8162119158469717,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 210.48338045624797,
"openwebmath_score": 0.927968442440033,
"tags": null,
"url": "https://math.stackexchange.com/questions/3836656/normal-unit-vector-of-sphere-with-spherical-unit-vectors-hat-r-hat-theta"
} |
2020 first shifting property of laplace transform | {
"domain": "fluencyuniversity.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534322330059,
"lm_q1q2_score": 0.8262126727841913,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 720.1639856093652,
"openwebmath_score": 0.6909707188606262,
"tags": null,
"url": "http://fluencyuniversity.com/m9o4am/b437h.php?cc98e9=first-shifting-property-of-laplace-transform"
} |
formal-languages
As you can see, finding a counterexample is often more creative then proving a statement, which can be quite mechanical. You just need to try a lot of things until something works.
The next step is to reflect on what we have shown. Is there any other operation on two languages which preserves the property of being right congruent? Is there an operation on one language? Indeed, there are: if $L$ is right congruent then so is $\overline{L}$; and if $L_1,L_2$ are right congruent then their symmetric difference $L_1 \triangle L_2$ is right congruent. See if you can prove these claims.
(In fact, right congruent languages are exactly the languages accepted by a DFA with at most two states. This leads to a complete classification of these languages, which I leave to the reader.) | {
"domain": "cs.stackexchange",
"id": 5499,
"lm_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",
"url": null
} |
c++, array, bitwise, iterator, container
private:
const value_type& data_;
size_t offset_;
};
value_type* data() {return data_.data();}
const value_type* data() const {return data_.data();}
proxy operator[](size_t i)
{
size_t i_ = i*Bits/value_bitwidth;
uint8_t offset = i * Bits % value_bitwidth;
return proxy(data()[i_], offset);
}
class iterator : public std::iterator<std::forward_iterator_tag, proxy>
{
public:
iterator(value_type* data, size_t i)
{
size_t i_ = i*Bits/value_bitwidth;
offset_ = i * Bits % value_bitwidth;
data_ = &data[i_];
}
proxy operator*() const {return proxy(*data_, offset_);}
iterator& operator++()
{
offset_ += Bits;
if (offset_ == value_bitwidth)
{
offset_ = 0;
data_++;
}
return *this;
} | {
"domain": "codereview.stackexchange",
"id": 9581,
"lm_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++, array, bitwise, iterator, container",
"url": null
} |
relationship between the … The method of least squares is a very common technique used for this purpose. The method encompasses many techniques. And thus the method of least squares and regression became somewhat synonymous. Statistics - least squares fitting and calibration methods UMBCChemistry. Recommended Articles. A careful analysis of the proof will show that the method is capable of great generaliza-tions. It is what most people mean when they say they have used "regression", "linear regression" or "least squares" to fit a model to their data. Monday, February 25, 2008. Least Square Method fit a straight line by the method of least squares is important information accompanied by photo and HD pictures sourced from all websites in the world. A "circle of best fit" But the formulas (and the steps taken) will be very different! Our least squares solution is the one that satisfies this equation. This idea can be used in many other areas, not just lines. Basic Statistics; Business | {
"domain": "lmat-d.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307668889047,
"lm_q1q2_score": 0.8127840980935073,
"lm_q2_score": 0.8354835452961425,
"openwebmath_perplexity": 684.8661110582966,
"openwebmath_score": 0.49459317326545715,
"tags": null,
"url": "http://www.lmat-d.net/munchkin-quacked-pgzej/page.php?id=d53ff6-method-of-least-squares-statistics"
} |
programming, qiskit, vqe
molecule = 'H .0 .0 -{0}; Li .0 .0 {0}'
distances = np.arange(0.5,4.25,0.25)
vqe_energies = []
hf_energies = []
exact_energies = []
for i,d in enumerate(distances):
print('step', i)
#set up the experiment
driver = PySCFDriver(molecule.format(d/2), basis='sto3g')
fermionic_transformation = FermionicTransformation(
transformation=FermionicTransformationType.FULL,
qubit_mapping=FermionicQubitMappingType.JORDAN_WIGNER,
two_qubit_reduction=False,
freeze_core=False)
qubit_op, aux_ops = fermionic_transformation.transform(driver)
#VQE
optimizer = SLSQP(maxiter=1000)
initial_state = HartreeFock(fermionic_transformation.molecule_info['num_orbitals'],
fermionic_transformation.molecule_info['num_particles'],
qubit_mapping=fermionic_transformation.qubit_mapping, | {
"domain": "quantumcomputing.stackexchange",
"id": 2370,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming, qiskit, vqe",
"url": null
} |
universe, distances, space-time
Title: Why is the observable Universe larger than its age would suggest? The age of the Universe is estimated at 13.8 billion years, and current theory states nothing can exceed the speed of light, which can lead to the incorrect conclusion that the universe can't have a radius of more than 13.8 billion light years.
Wikipedia deals with this misconception as follows:
This reasoning would only make sense if the flat, static Minkowski spacetime conception under special relativity were correct. In the real Universe, spacetime is curved in a way that corresponds to the expansion of space, as evidenced by Hubble's law. Distances obtained as the speed of light multiplied by a cosmological time interval have no direct physical significance. → Ned Wright, "Why the Light Travel Time Distance should not be used in Press Releases" | {
"domain": "astronomy.stackexchange",
"id": 4680,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "universe, distances, space-time",
"url": null
} |
graphs
Title: How to build a graph of people where node connections are determined by name and age? I was given the following question (please don't mind the programming language semantics, it's a language-agnostic question):
Given a list of Persons, and two arbitrary Persons out of that list, we need to find the minimum nth-degree relationship between them.
Here are the definitions of Person and a "relationship":
A Person is defined as having 2 properties: Name and Age:
class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
A relationship between two Persons is defined as follows:
Two Persons are considered to be in a 1st-degree relationship if they have either the same name or the same age.
Two Persons are considered to be in a nth-degree relationship if they have n people of 1st-degree connecting them.
Example input:
Given the following list of Persons:
persons = [{ Name = "John", Age = 60 }, { Name = "John", Age = 50 }, { Name = "Ted", Age = 50 }] | {
"domain": "cs.stackexchange",
"id": 16994,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs",
"url": null
} |
performance, mysql, sql
"lot_album" is a table where you can have lots of images, but also
none. But only one image per lot will have order 1 so that image will
be the "image_featured". This should be a little better. I believe joins are faster than nested selects, and that if with nested select may or may not select twice or use cached response. I can't think of a good way of getting rid of the one nested select. Otherwise, maybe you could write it as a stored procedure or virtual table. (Note* any spelling mistakes of table or column names are a result of autocorrect)
SELECT lote.ordem as lote_ordem,
lote.titulo as lote_titulo,
lote.codigo as lote_codigo,
lote.codigo_leilao,
GREATEST(
(SELECT lance
FROM lance
WHERE lote.codigo = lance.codigo_lote
ORDER BY lance.data DESC
LIMIT 0,1),
lote.lance_minimo
) AS lance2,
youtube,
youtube,
-- lance.codigo_cadastro,
lote_album.caminho_imagem as imagem_destaque,
FROM lote
LEFT JOIN lote_album | {
"domain": "codereview.stackexchange",
"id": 1946,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, mysql, sql",
"url": null
} |
photons, wave-particle-duality, photoelectric-effect
it seems to me that higher intensity light is capable of emiting electrons even below the frequency threshold
The photoelectric effect work functions are measured on cold metal surfaces. A heated solid , by definition of heat , will have a distribution of kinetic energy and for high temperatures of thermionic emission it is the high energy tail of the distributions that will provide enough kinetic energy to overcome the work function of the material studied ( note that the temperature of the material affects the work function ( example).
Light, classical electromagnetic waves, is composed out of a large number of photons, elementary particles in the mainstream standard model. | {
"domain": "physics.stackexchange",
"id": 89175,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photons, wave-particle-duality, photoelectric-effect",
"url": null
} |
forces
Title: Is there a way to calculate wind speed based on the horizontal movement or force of a falling object at one instant? Say I have the mass of an object, and the speed of its horizontal movement (and some other information, please continue reading), is there a way of calculating (horizontal) wind speed based on these things?
Just for clarification: The horizontal movement of the object is 2 m/s, the vertical movement is 14m/s and the mass of the object is 0.3 kg, and assume that the forces aren't changing and that the speed isn't changing.
I felt like it was wrong to assume that wind speed = lateral speed, so I calculated the horizontal force for my object: 0.754 newtons, so assume the horizontal force of the unknown wind speed against the object is equal to 0.754 newtons and that the vertical force is 9.81*0.3 = 2.943 Newtons, ignoring air resistance (for vertical force)). But I have no idea how to convert this into wind speed because nothing feels quite right. | {
"domain": "physics.stackexchange",
"id": 77283,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces",
"url": null
} |
the-moon, gravity
So, tidal forces are ultimately what causes this to happen.
Also, there is a Wikipedia article on tidal forces:
Tidal acceleration is an effect of the tidal forces between an orbiting natural satellite (e.g. the Moon), and the primary planet that it orbits (e.g. the Earth). The acceleration causes a gradual recession of a satellite in a prograde orbit away from the primary, and a corresponding slowdown of the primary's rotation. The process eventually leads to tidal locking of first the smaller, and later the larger body. The Earth–Moon system is the best studied case. | {
"domain": "astronomy.stackexchange",
"id": 8,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "the-moon, gravity",
"url": null
} |
planetary-formation
I suspect that normal ideas of minerals would not exist under that kind of pressure, even if carefully allowed to cool. But can elements other than H and He still compress their volume in the same way, or would a rocky world be able to reach sizes of millions of miles?
What about more exotic cases, like the "puffy" planet I heard of that has the density of styrofoam? Puffy planets tend to be Jupiter or Saturn like, probably lower mass than Jupiter, perhaps lower metalicity but the most important factor is heat. Either close to the sun or recently formed. Heat expands gas planets. You're correct that as you add more mass the planet of Jupiter mass tends not to grow larger, but if there's enough internal heat, gas giant planets can get a bit larger than Jupiter. Planets as much as 2 Jupiter Radii have been observed (though there's some inaccuracy in those estimates), but growing larger than Jupiter is largely a factor of high temperature. | {
"domain": "astronomy.stackexchange",
"id": 1604,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planetary-formation",
"url": null
} |
python, performance, graph, complexity, community-challenge
What follows is a sub-optimum solution with less than n-1 edges.
from numpy.random import randint
from collections import defaultdict
import copy
def create_sample(source_count=5000, sink_count=200):
diff = -1
while diff < 0:
sinks = [["b" + str(i), randint(source_count)] for i in range(sink_count)]
sources = [["a" + str(i), randint(sink_count)] for i in range(source_count)]
sink_sum = sum([x[1] for x in sinks])
source_sum = sum([x[1] for x in sources])
diff = sink_sum - source_sum
avg_refill = diff // source_count + 1
weights_match = False
while not weights_match:
for i in range(source_count):
if not diff:
break
rnd = randint(avg_refill * 2.5) if diff > 10 * (avg_refill) else diff
diff -= rnd
sources[i][1] += rnd
weights_match = sum([x[1] for x in sources]) == sum([x[1] for x in sinks])
return sources, sinks | {
"domain": "codereview.stackexchange",
"id": 36075,
"lm_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, graph, complexity, community-challenge",
"url": null
} |
soil, geospatial
Title: European soil texture dataset according to USDA classification I'm looking for a dataset (in pretty much any format) of soil texture according to USDA classification (by U.S. Department of Agriculture). Is there anything that would cover the entirety of Europe? | {
"domain": "earthscience.stackexchange",
"id": 953,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "soil, geospatial",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.