text stringlengths 1 1.11k | source dict |
|---|---|
### 1 The figure gives angular speed versus time for a thin ,
(a) 15 rad/s2 (b) 040 J Calculate the rotational inertia of a wheel that has a kinetic energy of 24,400 J when Therotating at 602 rev/min 2 Answer Two uniform solid cylinders, each rotating about its central (longitudinal) axis, have the same mass of 125 kg and rotate with the same angular speed of 235 rad/s, but they differ in radius...
### Physics 121C Mechanics - physhawaiiedu
Example : A Rotating Disk Disk 1 is rotating freely and has angular velocity ω i and moment of inertia I 1 about its symmetry axis, as shown It drops onto disk 2 of moment of inertia I 2, initially at rest Because of kinetic friction, the two disks eventually attain ,...
### Question 1: Two disks are rotating about the same axis , | {
"domain": "legitedemireille.fr",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572778024535095,
"lm_q1q2_score": 0.8038586910583179,
"lm_q2_score": 0.8397339716830606,
"openwebmath_perplexity": 693.7797537500628,
"openwebmath_score": 0.7162184119224548,
"tags": null,
"url": "https://www.legitedemireille.fr/loader/363/two-disks-are-rotating-about-the-same-axis-the.html"
} |
string-theory, quantum-gravity, theory-of-everything
like the Standard Model appear to be generated from string theoretic models with a certain "preference". It's hard to not get a gauge theory from string theory, and generating matter content is also possible without special pleading. | {
"domain": "physics.stackexchange",
"id": 92952,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "string-theory, quantum-gravity, theory-of-everything",
"url": null
} |
The proof is on induction in $m$. Base $m=0$ is clear. For the induction step, look at coefficients of any specific monomial $z_0^{n-p}z_1^{d_1-1}\dots z_{p+m}^{d_{p+m}-1}$. Consider two cases:
1) $d_i=1$ for a certain index $i\in \{p+1,\dots,p+m\}$, without loss of generality $i=p+m$. This corresponds to the case when $p+m$ has degree 1, such a vertex may be joined with any of other vertices, and removing corresponding edge we get a tree (it remains admissible) on $\{0,1,\dots,K-1\}$. This corresponds to the summand $s\varphi_{m-1}$: namely, $z_j\varphi_{m-1}$ corresponds to the edge between $p+m$ and $j$; $j=0,1,\dots,p+m-1$. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850867332734,
"lm_q1q2_score": 0.8575917010222195,
"lm_q2_score": 0.8723473813156294,
"openwebmath_perplexity": 225.31226719536917,
"openwebmath_score": 0.8851345181465149,
"tags": null,
"url": "https://mathoverflow.net/questions/278629/a-combinatorial-identity"
} |
python, plugin, geospatial, arcpy
wejsciowa_gdb = parameters[0]
wybrana_geometria = parameters[1]
lista_klas = parameters[2]
wybor_wojewodztwa = parameters[3]
wybor_kolumny = parameters[4]
check_box_wartosc_1 = parameters[9].value
check_box_wartosc_2 = parameters[10].value
lista_klas.enabled = 0
arcpy.env.workspace = wejsciowa_gdb.value
fclist = arcpy.ListFeatureClasses()
fc_o_wybranej_geometrii = []
wybor = wybrana_geometria.valueAsText
if check_box_wartosc_2 and check_box_wartosc_1 == False:
parameters[0].enabled = 0
parameters[1].enabled = 0
parameters[3].enabled = 0
parameters[4].enabled = 0
parameters[5].enabled = 0
parameters[6].enabled = 0 | {
"domain": "codereview.stackexchange",
"id": 32641,
"lm_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, plugin, geospatial, arcpy",
"url": null
} |
that won't be offensive to you. That doesn't look that great, but anyway. Let's say that this is the probability, this area right here-- and I don't know how big it really is, we'll figure it out. Let's say that this is the probability that someone shares a birthday with at least someone else. What's this area over here? What's this green area? Well, that means if these are all the cases where someone shares a birthday with someone else, these are all the area where no one shares a birthday with anyone. Or you could say, all 30 people have different birthdays. This is what we're trying to figure out. I'll just call it the probability that someone shares. I'll call it the probability of sharing, probability of s. If this whole area is area 1 or area 100%, this green area right here, this is going to be 1 minus p of s. This is going to be 1 minus p of s. Or if we said that this is the probability-- or another way we could say it, actually this is the best way to think about it. If this | {
"domain": "khanacademy.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462201288629,
"lm_q1q2_score": 0.8007095652699253,
"lm_q2_score": 0.8104788995148791,
"openwebmath_perplexity": 253.85307246292362,
"openwebmath_score": 0.8574657440185547,
"tags": null,
"url": "https://www.khanacademy.org/math/precalculus/x9e81a4f98389efdf:prob-comb/x9e81a4f98389efdf:prob-combinatorics-precalc/v/birthday-probability-problem"
} |
python, python-3.x, cryptography, aes
def encrypt_selection(self):
chunk_size = 64*1024
for input_file in self.selection:
output_file = input_file + ".xCrypt"
with open(input_file, "rb") as infile:
with open(output_file, "wb") as outfile:
while True:
chunk = infile.read(chunk_size)
if len(chunk) == 0:
break
outfile.write(self.cipher.encrypt(chunk))
return True
class DecryptFiles():
"""Decrypt all files in a list (obtained with os.listdir())
using Fernet.
Fernet uses AES-128 in CBC MoO.
self.cipher: The cipher [Fernet()] which we use to
decrypt data
self.selection: List containing all encrypted files in
the directory.
output_file: The file to which the decrypted data is written;
this is formed by taking (filename) - ".xCrypt"
"""
def __init__(self):
self.cipher = None | {
"domain": "codereview.stackexchange",
"id": 25795,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, cryptography, aes",
"url": null
} |
quantum-mechanics, quantum-field-theory, general-relativity, gravity, wavefunction
At the moment the only candidates for describing a quantized gravitational field and at the same time embed the standard model of particle physics, are string theories . There is no quantization of gravity alone, as following the recipe for quantizing other fields leads to infinities due to the spin 2 of the proposed graviton.
Quantisation of gravity is a field of active theoretical physics research.
We have experimental evidence that general relativity holds. We do not have experimental evidence that a graviton exists. We can assume it does and then theorize about interactions of the graviton as wave/particle with other fields and wave functions, but it is just an imaginary exercise at this level.
And yes, you would need as prerequisite quantum field theory to start understanding string theory.
P.S. The collapse of the wavefunction concept is misleading, as the wave itself is not a wave in the field. It is a probability wave for finding a particle in an (x,y,z,t) location. | {
"domain": "physics.stackexchange",
"id": 5602,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, general-relativity, gravity, wavefunction",
"url": null
} |
Splitting Field of a family of polynomials
When one says that $K$ is a splitting field of a family of polynomials over $F$ is it assumed that the family of polynomials is always finite? If infinite families are allowed then I wonder if the splitting field would be algebraic?
-
AFAIK infinite families are allowed. The splitting field of $\{p_i\mid i \in I\}$ is then generated by the collection $\{z_{i,k} \mid i \in I, k \}$ where $z_{i,k}$ denote the zeros of $p_i$. As all $z_{i,k}$ are algebraic (there are zeros of the polynomials $p_i$), the splitting field is. But of course it may be an infinite extension. – martini Sep 18 '12 at 18:37
When I see "splitting field," I do not assume a finite family of polynomials. Splitting fields tend to come up when one talks about Galois Theory, in which we like splitting fields a lot to identify when we have Galois groups. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936115537342,
"lm_q1q2_score": 0.822194009406212,
"lm_q2_score": 0.8354835350552603,
"openwebmath_perplexity": 77.27908072751332,
"openwebmath_score": 0.9442217946052551,
"tags": null,
"url": "http://math.stackexchange.com/questions/198635/splitting-field-of-a-family-of-polynomials"
} |
electromagnetism, superposition
If the field strength inside a medium exceeds that of its linear response, then the material ("macroscopic") Maxwell equations are no longer a linear problem. This is the bread and butter of nonlinear optics, which describes a broad range of phenomena. However, this is not a failure of Griffith's claim, as the 'microscopic' fields $\mathbf{E}$ and $\mathbf{B}$ are still a linear superpositions of those created by the free and bound charges. | {
"domain": "physics.stackexchange",
"id": 11654,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, superposition",
"url": null
} |
thermodynamics, pressure, diffusion
Title: Does Fick's law of diffusion applies between mediums of different pressures with no membrane? Imagine a stainless steal container with an unsealed lid that contains normal air, inside a room containing normal air. Now, pump a steady flow of CO2 in that container, bringing it to positive pressure versus the environment outside. This system (inside the container) should eventually reach a steady state. Let's look at the Oxygen content of the system.
By Fick's law of diffusion, since the partial pressure of O2 outside is greater than inside, O2 should start to seep in until the partial pressure of O2 inside and outside has reached equilibrium.
However, by the second law of thermodynamics, energy should always flow toward the lower entropy system. | {
"domain": "physics.stackexchange",
"id": 50836,
"lm_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, pressure, diffusion",
"url": null
} |
experimental-physics, cold-fusion
tunneling with weird many-body enhancement: the idea is that the tunneling amplitude is always estimated, not calculated, and this is an impossible-to-solve many electron/many nucleon system, so perhaps the tunneling amplitude is just off by many orders of magnitude. This doesn't work, because there is a way of giving a lower bound to tunneling amplitudes which excludes any appreciable fusion reaction by tunneling. To do this, you exploit the fact that tunneling is a ground state property, and the deuterons which are imagined to tunnel are bosons, and their imaginary time ground state has no nodes. The electrons have nodes, since they are fermions, and at high energies, but when the electron states are all fully occupied, they might as well be a vacuum, with structure only near the Fermi surface (this follows from the particle-hole symmetric approximate description of the Fermi liquid). There were rigorous upper bounds on the tunneling probability for deuterons in a metal that claimed | {
"domain": "physics.stackexchange",
"id": 89536,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "experimental-physics, cold-fusion",
"url": null
} |
programming-languages, compilers, interpreters
JIT Compilers
Within the family of JIT compilers, there are still many differences as to when exactly they compile, how often, and at what granularity.
Some JIT compilers for example only compils code once (when it is loaded) and compiles a whole module at a time. Other compilers may gather information while the program is running and recompile code several times as new information becomes available that allows them to better optimize it. Some JIT compilers are even capable of de-optimizing code. Now, you might ask yourself why one would ever want to do that? De-optimizing allows you to perform very aggressive optimizations that might actually be unsafe: if it turns out you were too aggressive you can just back out again, whereas, with a JIT compiler that cannot de-optimize, the program would crash or return a wrong result; in other words, you simply can't allow yourself to perform the aggressive optimizations in the first place. | {
"domain": "cs.stackexchange",
"id": 18315,
"lm_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-languages, compilers, interpreters",
"url": null
} |
homework-and-exercises, quantum-field-theory, angular-momentum, quantum-spin
Using the expression of the commutator:
$[\Psi (x),M^{\mu \nu}] = -i(x^\mu \partial^\nu - x^\nu \partial^\mu)\Psi (x) + S^{\mu\nu}\Psi(x)$
where $M^{\mu\nu}$ are the infinitesimal generators of the Lorentz group and $J_z=M^{12}$, using also the fact that:
$J_z |0\rangle =0 \rightarrow J_z b_s^\dagger(p\hat z)|0\rangle = [J_z, b_s^\dagger(p\hat z)]|0\rangle$
and using finally the expression of the creation operator in terms of the fields, then we arrive at the following expression:
$J_z b_s^\dagger(pz)|0\rangle = \int d^3x\ e^{ipx^3}i(x^1\partial^2 -x^2\partial^1)\overline\Psi(x) \gamma^0 u_s(\vec p)|0\rangle + \int d^3x\ e^{ipx^3}\overline\Psi(x)S^{12} \gamma^0 u_s(\vec p)|0\rangle$ | {
"domain": "physics.stackexchange",
"id": 19322,
"lm_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, quantum-field-theory, angular-momentum, quantum-spin",
"url": null
} |
java, sudoku, javafx
Title: Sudoku Puzzle Part 1: Sudoku Class I was recently given a Sudoku Puzzle to solve, and since I began solving many Sudoku puzzles after, I decided to attempt to create a Sudoku Puzzle viewer with JavaFX. I am not done yet, but have decided to split it into parts so that it is easier to fix future problems. Part 1 is the Sudoku class. The Sudoku class does:
Represents a legal (follows "each row, column, and box may only contain each digit from 1-9 only once") Sudoku puzzle
Allows to check and edit squares, as long as the puzzle stays legal
Can get a random puzzle (may change to generate puzzle)
The code is below:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
public class Sudoku {
public static final int SUDOKU_SIZE = 9;
public static final int SUDOKU_SQUARE_SIZE = 3; | {
"domain": "codereview.stackexchange",
"id": 16036,
"lm_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, sudoku, javafx",
"url": null
} |
and more for vega explanation for of. Intrinsic value of options and the put on the 49 strike is currently worth \$ and. - 62 = 8 70−62=8 vol points of managing risk in the underlying asset 's.... Against implied volatility is not constant good trade, or that it will make the option is than. / edit ; wiki what would be the price of the option buyer money Gamma, vega s. Volatility change above example shows how knowing the vega of 0.11 positive vega while options that expiring. The previous section are Rho, Charm, Color, Speed and Weezu consider the vega of.! The straddle approximation formula, the ATM vega is also used by some traders to have a idea! Measures, hedge parameters, or risk sensitivities linear ; it changes as! Effect certain inputs have on the price of an option price 's value and the put on pricing! | {
"domain": "arizonachess.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018390836985,
"lm_q1q2_score": 0.8018003585329558,
"lm_q2_score": 0.8221891370573388,
"openwebmath_perplexity": 3350.1565688183273,
"openwebmath_score": 0.6837106347084045,
"tags": null,
"url": "http://ftp.arizonachess.org/txmpv/dcec9d-vega-meaning-greek"
} |
It would be easier to realize the structure of the graph of Sine, rotating ParametricPlot3D around z axis. Thus we define the following functions :
F1[t_] :=
Graphics3D[
Rotate[
ParametricPlot3D[ Table[{r Cos[u], r Sin[u], Re @ Sin[r Exp[I u]]}, {r, 0.1, 1, 0.1}],
{u, 0, 2 Pi}, PlotStyle -> Thick,
ColorFunction -> (ColorData["DeepSeaColors"][#3] &),
BoxRatios -> Automatic, Axes -> False, Boxed -> False][[1]],
2 Pi t, {0, 0, 1}], Boxed -> False]
F2[t_] :=
Graphics3D[
Rotate[
ParametricPlot3D[ Table[{r Cos[u], r Sin[u], Im @ Sin[r Exp[I*(u)]]}, {r, 0.1, 1, 0.1}],
{u, 0, 2 Pi}, PlotStyle -> Thick,
ColorFunction -> (ColorData["Rainbow"][#3] &),
BoxRatios -> Automatic, Axes -> False, Boxed -> False][[1]],
2 Pi t, {0, 0, 1}], Boxed -> False]
now we can animate rotation around z-axis : | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.959154281754899,
"lm_q1q2_score": 0.8637469989225359,
"lm_q2_score": 0.9005297847831082,
"openwebmath_perplexity": 4979.049729186961,
"openwebmath_score": 0.3071395456790924,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/6862/plotting-complex-sine?noredirect=1"
} |
approximation-algorithms, ne.neural-evol, na.numerical-analysis
Regarding the first point above, this can be taken as the statement "a continuous function over a compact set is uniformly continuous". What this means to us is you can take your continuous function over $[0,1]^d$, and some target error $\epsilon>0$, then you can grid $[0,1]^d$ at scale $\tau>0$ (ending up with roughly $(1/\tau)^d$ subcubes) so that a function which is constant over each subcube is within $\epsilon$ of the target function. | {
"domain": "cstheory.stackexchange",
"id": 2058,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "approximation-algorithms, ne.neural-evol, na.numerical-analysis",
"url": null
} |
python, neural-network, scikit-learn, regression
# Plot outputs
plt.scatter(diabetes_X_test, diabetes_y_test, color='black')
plt.plot(diabetes_X_test, nn.predict(diabetes_X_test), color='blue',
linewidth=3)
plt.xticks(())
plt.yticks(())
plt.show()
Results of Linear Regression:
('Coefficients: ', array([ 938.23786125]))
Residual sum of squares: 2548.07
Variance score: 0.47

Results of SKNN Regression:
('Coefficients: ', array([ 938.23786125]))
Residual sum of squares: 5737.52
Variance score: -0.19 | {
"domain": "datascience.stackexchange",
"id": 433,
"lm_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, neural-network, scikit-learn, regression",
"url": null
} |
natural-language-processing, language-model, natural-language-understanding
Title: What language model can convert normal text to JSON data I have tried training T5-small, T5-base and T5-Large on around 15K rows of data where input data was something like but I did not get desired results
Nutrition Facts,
100g per,
Energy 646.95Kcal Carbohydrates 19.31g,
Protein 21.94g 53.55g Total Fat 6.64g Saturated Fat 14.97g Dietary Fiber,
<1.Omg Cholesterol Sodium 0.29g Sugars 3.39g,
Lightly Salted and to Perfection,
Ingredients: Peanuts, Almonds,,
Cashews, Pistachios, Vegetable Oil, Salt,
aa, ,
74G,
Pistachio, 61129110611336177
WE ARE NUTS ABOUT QUALITY,
Baked,
Nuts Salted,
Mixed
WE ARE NUTS ABOUT,
Community 364, 13 Street Plot No. 36,
Al Area 1, 24149,UAE 4971 4 3355777,
License Number: 224614 VAT No: 100058529700003,
CERTIFIED COMPANY,
ALLERGEN WARNING: in a facility that also processes nuts, sesame and mustard,
Store in a cool dry place away from heat moisture,
Instruction Once store in airtight container and consume before expiry date,
Pro: 14/12/23,
Exp:13/12/24, | {
"domain": "ai.stackexchange",
"id": 4149,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "natural-language-processing, language-model, natural-language-understanding",
"url": null
} |
The first property is reflexivity:
$$\langle x_1, y_1\rangle R \langle x_1, y_1\rangle \Longleftrightarrow x_1^2+y_1^2 = x_1^2+y_1^2$$, which is always true, as $$a=a$$.
Then we check for symmetry:
$$\langle x_1, y_1\rangle R \langle x_2, y_2\rangle \Longrightarrow \langle x_2, y_2\rangle R \langle x_1, y_1\rangle$$, so if $$x_1^2+y_1^2 = x_2^2+y_2^2$$, then $$x_2^2+y_2^2 = x_1^2+y_1^2$$. Using the substitution we can say that $$(a=b) \Rightarrow (b=a)$$, which is also true.
The last one is transitivity:
$$\langle x_1, y_1\rangle R \langle x_2, y_2\rangle \wedge \langle x_2, y_2\rangle R \langle x_3, y_3\rangle \Longrightarrow \langle x_1, y_1\rangle R \langle x_3, y_3\rangle$$, which means $$x_1^2+y_1^2 = x_2^2+y_2^2 \wedge x_2^2+y_2^2 = x_3^2+y_3^2 \Longrightarrow x_1^2+y_1^2 = x_3^2+y_3^2$$, using substitutions it is $$(a=b \wedge b=c) \Longrightarrow (a=c)$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777180969715,
"lm_q1q2_score": 0.8482965776318329,
"lm_q2_score": 0.8596637559030338,
"openwebmath_perplexity": 140.6368141150533,
"openwebmath_score": 0.9347792863845825,
"tags": null,
"url": "https://math.stackexchange.com/questions/3043161/prove-that-r-subseteq-x-times-x-is-an-equivalence-relation-and-construct-its-e"
} |
python, performance, excel
Any tips, information, or brutal comments are welcomed. Thank you! You have a lot of imported symbols that are unused. If you use any self-respecting Python IDE, it will tell you about these and help you delete them.
In Employee, you have a handful of static-likes (your total_ variables). This is not a well-modelled class. If you really want object-oriented code, consider pulling these out to non-static members of a separate class named perhaps EmployeeSummary.
It's not spelled "senority", but "seniority"; and "Positon" is "Position".
All of your camelCase names should be replaced with lower_snake_case; i.e. createTeams should be create_teams.
Delete all of the parentheses surrounding your if conditions; you aren't in Java/C/etc.
Don't write numeric ASCII values such as 65. Write the actual letter (A) and use chr and ord accordingly.
Rather than int(x/26), use x//26 floor division. | {
"domain": "codereview.stackexchange",
"id": 43364,
"lm_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, excel",
"url": null
} |
quantum-field-theory, klein-gordon-equation, propagator
Title: Is the scalar propagator an even function? The scalar propagator for the Klein-Gordon Lagrangian is given by:
$$D(x-y)=\int \frac{d^{4} k}{(2 \pi)^{4}} \frac{e^{i k(x-y)}}{k^{2}-m^{2}+i \varepsilon}$$
I need to know if it is an even function, i.e.:
$$D(x-y) = D(-(x-y)) = \int \frac{d^{4} k}{(2 \pi)^{4}} \frac{e^{i k(x-y)}}{k^{2}-m^{2}+i \varepsilon}\tag{1}$$
Since $k^2=k_0^2-\vec{k}^2$ and $k_0^2$ and $\vec{k}^2$ are both positive.
Also
$$\int_{-\infty}^{\infty} d^4k e^{ik(x-y)}=\int_{-\infty}^{\infty} d^4k e^{-ik(x-y)}=\int_{-\infty}^{\infty} d^4k e^{ik(y-x)}$$
So can we conclude that equation 1 is indeed true?
edit: rephrased the question hope it makes sense now The fact that $D(x) = D(-x)$ follows immediately from the fact that the both the integrand and the integration measure are invariant under Lorentz transformations, and recalling that $x \to -x$ (parity transformation) is indeed a Lorentz transformation.
Alternatively, it's not difficult to prove it explicitly. | {
"domain": "physics.stackexchange",
"id": 61356,
"lm_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, klein-gordon-equation, propagator",
"url": null
} |
of composition of functions and > 0 such that k... Change represent y = ( 1 ) 5,0 of 5 stars the use of the use the. rigorized '' version of the chain rule: the definition of the section Proofs '' be! Of twice an input does not fall under these techniques case rst P ) k < Mk in standard non-standard... { x } { x^2+1 } 1 + x² ) ³, find dy/dx as,.: derivative of a function \ ( t\in \R\ ). $, Exercise hand, basic! Composite functions ’ ll close our little discussion on the theory of chain rule - a more Formal Approach Prerequesites! Customer reviews ( 1 ) 5,0 of 5 stars that ( ) does equal! So you know how to differentiation a function of two variables gives another method to the! Is the product of the key concepts in multivariable Calculus a2R and functions fand gsuch that differentiable... Tangent line is$ chain rule proof 1,1 ). $, Exercise and we will use the tangent approximation and differentials... Also related to the tangent approximation and total differentials to help understand | {
"domain": "huyongyi.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676425019243,
"lm_q1q2_score": 0.8009512553078374,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 1076.51939535719,
"openwebmath_score": 0.9811563491821289,
"tags": null,
"url": "https://huyongyi.com/8bojl0/chain-rule-proof-6d07c9"
} |
quantum-mechanics, homework-and-exercises, operators, hilbert-space, mathematics
Title: Is sum of two operators hermitian? Given a three dimensional Hilbert space with the three basis vectors $|1\rangle, |2\rangle, |3\rangle,$ and two state vectors, $|\psi_1 \rangle = a|1\rangle -b |2\rangle +c|3\rangle, |\psi_2 \rangle = b|1\rangle + a |2\rangle,$ with $a,b,c \in \mathbb{C},$ I need to find if the operator $A = |\psi_1' \rangle \langle \psi_1'| + |\psi_2' \rangle \langle \psi_2'|$ is a hermitian operator, whereby $|\psi_1' \rangle, |\psi_2' \rangle,$ are the corresponding normed vectors. In case the scalars $a,b,c$ were reals, the matrix of $A$ would be symmetric as sum of two symmetric matrices and thus hermitian, otherwise I do not see if $A$ can be hermitian. Can somebody provide some insight? Your operator $A$ is Hermitian if, for any two vectors $\phi_1$ and $\phi_2$, you have that
$$\langle \phi_1,A\phi_2\rangle = \langle A\phi_1,\phi_2\rangle$$
In bra-ket notation, this is
$$\langle \phi_1|A|\phi_2\rangle = \overline{\langle \phi_2|A|\phi_1\rangle}$$ | {
"domain": "physics.stackexchange",
"id": 95873,
"lm_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, homework-and-exercises, operators, hilbert-space, mathematics",
"url": null
} |
quantum-mechanics, hilbert-space, operators, angular-momentum, wavefunction
Note that:
$$L_z=-i\hbar \frac{\partial }{\partial\phi}\ \ \ \text{Abuse of notation}$$
$$L_z\rightarrow -i\hbar \frac{\partial }{\partial\phi}\ \ \ \ \ \ \ \text{In Position basis}$$ | {
"domain": "physics.stackexchange",
"id": 78788,
"lm_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, operators, angular-momentum, wavefunction",
"url": null
} |
beginner, object-oriented, scala, battle-simulation
var i = 0
while(a.alive && w.alive){
i % 2 match {
case 0 => turn(a, w)
case 1 => turn(w, a)
}
i = i + 1
}
if(a.alive) println("Archer wins!") else println("Warrior wins!")
} Position
You have overloaded Position, which really should be the simplest of types, with the properties of the map/grid on which they are placed. I really don't think it should contain anything more than the co-ordinates and toString. Your type has too much in it (while your game doesn't have enough organised information about your map)
Map Size
You have made the size of your map a fundamental property of positions, hard-coded it in and not explicitly named it anywhere (as a property or constant). Firstly, magic numbers are usually a bad thing, secondly, the size of the map really should belong to some other, more significant class or object. | {
"domain": "codereview.stackexchange",
"id": 14853,
"lm_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, object-oriented, scala, battle-simulation",
"url": null
} |
ros-jade
## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)
## Declare a catkin package
catkin_package()
## Build talker and listener
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_messages_cpp)
and Package.xml is here
<?xml version="1.0"?>
<package>
<name>beginner_tutorials</name>
<version>0.0.0</version>
<description>The beginner_tutorials package</description>
<maintainer email="lizhuo@todo.todo">lizhuo</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
</package> | {
"domain": "robotics.stackexchange",
"id": 25481,
"lm_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-jade",
"url": null
} |
java, algorithm, k-sum
Autoboxing
The java Collections need Objects as keys and values. The Java language will automatically "box" and "unbox" values as required. You take advantage of autoboxing in map.put(k-v,true) ... The value k-v is autoboxed as an Integer and true is autoboxed as Boolean.TRUE.
Yet, when you retrieve the value from map, you explicitly do the autoboxing yourself: map.get(Integer.valueOf(x)). You could simply write map.get(x).
Map<K,V> -vs- Set
When you have a Map<K,V>, it is expected that different values will be stored in the map (under one or more keys).
In this case, you are only ever storing Boolean.TRUE (autoboxed from true). Your map.get() either returns Boolean.TRUE, or it returns null if no value was stored under that key. You explicitly test if it is equal to the former value, but you could have tested the value was not null instead. Or more directly, you could test whether a value was stored under that key, and replace the complicated statement with simply: | {
"domain": "codereview.stackexchange",
"id": 33379,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, k-sum",
"url": null
} |
quantum-mechanics, perturbation-theory
When we have a degeneracy in the Hamiltonian, a problem is that there is no 'true' preferred basis to work with. Any rotation within a degenerate sub-space is allowed without changing the fact that the Hamiltonian is still diagonal.
Let's consider, for example, the angular-momentum Hamiltonian $\mathcal{H} = \frac{\omega}{\hbar}{\bf L}^2$, and consider a system with total angular momentum of $l=1$. We approach the problem and decide to diagonalize it in the usual basis of $|l=1, l_z = -1\rangle$, $|l=1, l_z = 0\rangle$ and $|l=1, l_z = +1\rangle$. However all this states have identical energy of $E = 2\hbar\omega$. Therefore, the basis
$$|l=1, l_z = -1\rangle, \frac{1}{\sqrt{2}}(|l=1, l_z = +1\rangle \pm |l=1, l_z = 0\rangle)$$
is also legitimate and diagonalize the Hamiltonian. | {
"domain": "physics.stackexchange",
"id": 62066,
"lm_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, perturbation-theory",
"url": null
} |
microcontroller, gazebo, ros-melodic
Originally posted by Josh Whitley with karma: 1766 on 2020-07-18
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 35282,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "microcontroller, gazebo, ros-melodic",
"url": null
} |
performance, memory-management, vb.net
End Select
I don't like this
Dim vals As Array = validationsArray(i).ToString.ToUpper.Split("|")
valName = vals(0).trim
valDataType = vals(1).trim
valLength = vals(2).trim | {
"domain": "codereview.stackexchange",
"id": 15707,
"lm_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, memory-management, vb.net",
"url": null
} |
homework-and-exercises, mathematical-physics, hamiltonian-formalism
\end{equation}
and integrate,
\begin{equation}
H=x^{k}\epsilon_{ik}J^{i}_{\ j}x^{j}=-x^{i}\epsilon_{ik}J^{k}_{\ j}x^{j}
\end{equation}
so that, symmetrizing,
\begin{equation}
A_{ij}=-\frac{1}{2}(\epsilon_{ik}J^{k}_{\ j}+J^{i}_{\ k}\epsilon_{kj})
\end{equation}
so, using the parameters of the A matrix in the question, $\alpha=\delta=J^{1}_{\ 2}$, $\beta=-(J^{1}_{\ 1}+J^{2}_{\ 2})/2$. | {
"domain": "physics.stackexchange",
"id": 18506,
"lm_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, mathematical-physics, hamiltonian-formalism",
"url": null
} |
deep-learning, keras, autoencoder, mse
Title: Why autoencoders use binary_crossentropy loss and not mean squared error? Keras autoencoders examples:
(https://blog.keras.io/building-autoencoders-in-keras.html) use binary_crossentropy (BCE) as loss function.
Why they use binary_crossentropy (BCE) and not mse ?
According to keras example, the input to the autoencoders is a normalized image (each pixel has values in range [0..1])
The output of the autoencoders is the same. (predicted normalize image)
I read some articles which shows that BCE use to evaluate the loss when the target is fixed value (0 or 1) and not range of values [0..1]. | {
"domain": "datascience.stackexchange",
"id": 9760,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, keras, autoencoder, mse",
"url": null
} |
regular-languages
Seems very hard to me. I suppose 1-3 are similar (but I may be wrong), but I don't know how to approach. General idea is usually to modify finite state machine for $L$ to accept other language. But those constructions are often very sophisticated and I still can't come up with it alone. Here is a proof that the language $L_0 = \{ w : \exists_u |u|=|w| \land uw \in L \}$ is regular. It can be modified to show that the first three on your list are regular. (Note that I changed $wu$ to $uw$.) Given a DFA for $L$, we build an NFA for $L_0$. The first thing that the NFA does is guess (take an $\epsilon$ move) a state $q$, whose intended semantics is the state that the DFA for $L$ ends up after reading $u$. It then simultaneously runs two copies of the DFA for $L$, one starting at the start state and the other starting at $q$. On reading a symbol $a$, it moves according to an arbitrary symbol on the first, and moves according to $a$ on the second. A state is accepting if the first copy is at | {
"domain": "cs.stackexchange",
"id": 1366,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages",
"url": null
} |
• @RoryDaulton: The OP specifically says, "We pick one [to] be stationary, and we call it $B$." This constitutes specifying a frame of reference, surely? – TonyK Nov 22 '15 at 23:03
• @RoryDaulton: We are not talking about suns and moons here, we are talking about coins on a tabletop. The situation is clear, in my opinion. You seem to be making difficulties just for the sake of it! – TonyK Nov 23 '15 at 0:39 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850857421198,
"lm_q1q2_score": 0.8105162193428554,
"lm_q2_score": 0.8244619220634457,
"openwebmath_perplexity": 292.8656352600706,
"openwebmath_score": 0.7139571905136108,
"tags": null,
"url": "https://math.stackexchange.com/questions/1541474/quarter-rolled-around-a-quarter"
} |
noise, gaussian
Title: Brownian noise is integration of gaussian or uniform white noise? On this wikipedia page it is written that
Brown noise can be produced by integrating white noise
What kind of white noise is meant? The Gaussian or uniform white noise? White noise is noise that has equal (uniform) amplitude across all frequencies. When we say "white" we're talking about the power spectral density (PSD) of the noise.
Saying something like "Gaussian noise" means the statistical properties of any one sample of the noise is distributed Gaussian. You can actually have Cauchy, Poisson, Gaussian etc. distributions that define any one sample of the noise. For any distribution, however, if the power spectral density of the noise is uniform, that noise is white.
So in the integral defining the Weiner process:
$$W(t) = \int_0^t\frac{dW(\tau)}{d\tau}{d\tau}$$
$W(t)$ has samples with Cauchy, Poisson, Gaussian, etc. distributions as long as the power spectral density is uniform, making it white noise. | {
"domain": "dsp.stackexchange",
"id": 5160,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "noise, gaussian",
"url": null
} |
javascript, performance, jquery, ajax, pagination
});
$('#search').keyup(function(){
if($(this).val() == ''){
create_tbody(false, false, true);
}
});
}); | {
"domain": "codereview.stackexchange",
"id": 707,
"lm_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, ajax, pagination",
"url": null
} |
c, strings
sstrfunc sstrinputpass(sstring show){
//dont store anything make null return value
sstrfunc _null;
//is global max char limit corrupted??
//returning null means error was caught!
if(isGMCLCorrupt()){
_null._err = GMCL_CORRUPT;
return _null;
}
char _tmp[GLOBAL_MAX_CHAR_LIMIT];
//nullify string [if i dont use this WiErD things happen]
nullify(_tmp,GLOBAL_MAX_CHAR_LIMIT+1);
char tmpchar;
int done=0;
//until a certain char has not been pressed
while(1>0){
//take chars only upto global max char limit
if(done>=GLOBAL_MAX_CHAR_LIMIT-1){
break;
}
tmpchar = getch();
if(tmpchar=='\r'){
break;
}else if(tmpchar=='\b'){
if(strlen(_tmp)>0){
_tmp[strlen(_tmp)-1] = '\0';
for(int i=0;i<sstrlen(show);i++){
printf("\b");
}
for(int i=0;i<sstrlen(show);i++){ | {
"domain": "codereview.stackexchange",
"id": 42338,
"lm_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",
"url": null
} |
frequency-spectrum, smoothing, linear-phase
But what about smoothing the phase? If one simply smoothes the phase factor (which has unit modulus) in the same way, the result usually will not have unit modulus anymore. Moreover, phases that change rapidly but linearly will cause vast cancellation. But fast phases in a transfer function correspond to big translations/lags of wave groups, which I want to be represented faithfully in the transfer function. If I just cut them off (which is what happens if I filter the phase factor), bigger translations/lags will just disappear.
For example take
$$f(\omega)=e^{i\omega t_0}$$
as a pure phase function, then averaging this over a frequency interval from $\omega=\omega_0-\pi/t_0\dots \omega_0+\pi/t_0$, the result will be zero (in complex) independent of $\omega_0$ because it always integrates over a whole unit circle:
$$\bar{f}(\omega_0)=\frac{1}{2\pi/t_0}\int_{\omega_0-\pi/t_0}^{\omega_0+\pi/t_0} e^{i\omega t_0}d\omega = 0$$ | {
"domain": "dsp.stackexchange",
"id": 8755,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-spectrum, smoothing, linear-phase",
"url": null
} |
electromagnetism, black-holes, conservation-laws, charge, reissner-nordstrom-metric
** I'm sorry for adding so many extra questions, I just didn't want to mass-post a bunch of highly related queries. Hope that's ok!**
Two likely charged Black Holes will always attract each other. | {
"domain": "physics.stackexchange",
"id": 42862,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, black-holes, conservation-laws, charge, reissner-nordstrom-metric",
"url": null
} |
ros2, ros-melodic, docker
--env ADE_IMAGE_AUTOWAREAUTO_COMMIT_SHA=c9745bf2663ecca9d73c20e29d8c4624b58948f5 --env ADE_IMAGE_AUTOWAREAUTO_COMMIT_TAG= --label 'ade_images=[{"fqn": "registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master", "commit_sha": "18425565a9fdfd2b5e9a8fd837f18f8bbd99d961", "commit_tag": ""}, {"fqn": "registry.gitlab.com/apexai/ade-atom:latest", "commit_sha": "41a804c93041bf2ef4fe118676a4b6a84bdeff91", "commit_tag": "v1.39.1"}, {"fqn": "registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto:master", "commit_sha": "c9745bf2663ecca9d73c20e29d8c4624b58948f5", "commit_tag": ""}]' registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master | {
"domain": "robotics.stackexchange",
"id": 34958,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-melodic, docker",
"url": null
} |
c#, javascript, asp.net, design-patterns
notice the script is registered from
session!! Well it happens some times
that the Gridview records are changed
by postback. But since session has
already the key in it, the
rowdatabound event script fails to get
registered with new script. So what do
i do in this situation. Can i get some
other way to persist the script and
make it run whenever gridview binds
again | {
"domain": "codereview.stackexchange",
"id": 399,
"lm_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#, javascript, asp.net, design-patterns",
"url": null
} |
python, recursion
def dsum(*args, s=0):
"""
Executes a recursive sum() on all passed arguments and their contents.
If s is a string, _djoin(args, s) is returned.
Parameters:
*args (tuple): An unrolled tuple of arguments.
s: An initial value to which all other values will be added.
"""
if type(s) == str:
return _djoin(*args, s=s)
if len(args) == 1:
try:
iter(args[0])
if type(args[0]) == str:
raise TypeError
return sum((dsum(arg, s=s) if arg else s for arg in args[0]), s)
except TypeError:
if type(s) == list:
return [args[0]]
return (args[0])
return sum((dsum(arg, s=s) for arg in args), s) | {
"domain": "codereview.stackexchange",
"id": 13044,
"lm_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, recursion",
"url": null
} |
quantum-mechanics, photons, quantum-spin, atomic-physics
Title: Selection rule $\Delta S=0$: Why does a photon not interact with an electrons spin? When talking about selection rules in atomic physics, many books state that the photon interacts with the electrons angular momentum such that that $\Delta l=\pm 1$. Absorbed/emitted photons exchange angular momentum with the electrons of the atom. For example: When an incoming circular polarised photon with spin $1\hbar$ is absorbed by the atom, an electron has to change its angular momentum $\vec{l}$ by $1\hbar$.
But why is there no such interaction between the electrons spin $\vec{s}$ and photons? What is the origin of the selection rule $\Delta S=0$? | {
"domain": "physics.stackexchange",
"id": 42038,
"lm_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, photons, quantum-spin, atomic-physics",
"url": null
} |
memory-management
Title: Calculate how much segements the system can handle I am a bit lost calculating how much segments will the system handle in a memory segmented system (without virtual memory). The problem says that the system has a word length of 32 bits and the address are 6 hexadecimal numbers, 3 of them are the segment identifier. We have a segment size of 4KiB
I tought this:
If the address are of 24 bits wide, we could address $2^{24}$ bytes of data and our segment size is $2^{12}$ bytes. So divide them and we have the maximum number of segments our system can handle.
But I was told this isn't the way to solve this problem. Here is the way it's supposedly correct:
We have $2^{24}$ address in our system, with a length of 32 bits so we have $2 ^ {29}$ bits of addressable memory, $2 ^{16}$ KiB of addressable memory. So dividing between our segment size we have $2^{14}$ segments. | {
"domain": "cs.stackexchange",
"id": 8147,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "memory-management",
"url": null
} |
# Binomial theorem
In this lesson, we will look at how to use the binomial theorem to expand binomial expressions binomials are expressions that contain two terms such as (x + y) and (2 – x). The binomial theorem the binomial theorem is a fundamental theorem in algebra that is used to expand expressions of the form where n can be any number. Then we will see how the binomial theorem generates pascal’s triangle pascal’s triangle is an array of numbers, that helps us to quickly find the binomial coefficients that are generated through the process of combinations. Seen and heard what made you want to look up binomial theoremplease tell us where you read or heard it (including the quote, if possible). | {
"domain": "firdaus.info",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9938070105758346,
"lm_q1q2_score": 0.872042586201258,
"lm_q2_score": 0.8774767906859264,
"openwebmath_perplexity": 269.4138523246094,
"openwebmath_score": 0.7568379044532776,
"tags": null,
"url": "http://oftermpaperyxzr.firdaus.info/binomial-theorem.html"
} |
spectroscopy
In short do not look at just at a single number from the NIST table, look at the conditions in which that NIST data was acquired and also see how good quality XPS data is summarized. They write all the details. Ask your XPS data provider to show all the conditions too (peak position correction, baseline correction method etc).
Your 74.76 eV can only be assigned to a certain oxidation or compound if and only if your AND their experimental conditions match closely. Otherwise, everything will be handwaving. A lot of XPS data in analytical literature is based on handwaving because XPS peak assignment is not a trivial task. This is from the NIST website. Note they do not mention uncertainity, which is also important.
XPS for Pt
. | {
"domain": "chemistry.stackexchange",
"id": 16466,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spectroscopy",
"url": null
} |
complexity-theory, data-structures
$
\begin{equation}
f(n,2) = \Theta(n \log n) \\
f(n,3) = \Theta(n \log \log n) \\
f(n,4) = \Theta(n \log^\ast n)
\end{equation}
$
The upper bound is proven by a simple recursive algorithm.
For non-constant $k$, it is proven that $f(n,O(\alpha(n))) = \Theta(n)$ where $\alpha(n)$ is the inverse Ackermann function. This is best possible for the linear number of subsets. | {
"domain": "cs.stackexchange",
"id": 20554,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, data-structures",
"url": null
} |
python, beginner, python-3.x, game, turtle-graphics
Block_pos = [(-350,250), (-250,250), (-150,250), (-50,250), (50,250), (150,250), (250,250), (350,250),
(-350,210), (-250,210), (-150,210), (-50,210), (50,210), (150,210), (250,210), (350,210),
(-350,170), (-250,170), (-150,170), (-50,170), (50,170), (150,170), (250,170), (350,170),
(-350,130), (-250,130), (-150,130), (-50,130), (50,130), (150,130), (250,130), (350,130),
(-350,90), (-250,90), (-150,90), (-50,90), (50,90), (150,90), (250,90), (350,90)]
Block_default = [True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True]
Block_y = [250, 250, 250, 250, 250, 250, 250, 250,
210, 210, 210, 210, 210, 210, 210, 210,
170, 170, 170, 170, 170, 170, 170, 170, | {
"domain": "codereview.stackexchange",
"id": 39128,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, game, turtle-graphics",
"url": null
} |
with two extra example videos at the end. Sign up, Existing user? Conjunction (AND), disjunction (OR), negation (NOT), implication (IF...THEN), and biconditionals (IF AND ONLY IF), are all different types of connectives. Weâll use p and q as our sample propositions. \hspace{1cm} The negation of a disjunction pâ¨qp \vee qpâ¨q is the conjunction of the negation of ppp and the negation of q:q:q: ¬(pâ¨q)=¬pâ§Â¬q.\neg (p \vee q) ={\neg p} \wedge {\neg q}.¬(pâ¨q)=¬pâ§Â¬q. Using truth tables you can figure out how the truth values of more complex statements, such as. \text{F} &&\text{T} &&\text{F} \\ Therefore, if there are NNN variables in a logical statement, there need to be 2N2^N2N rows in the truth table in order to list out all combinations of each variable being either true (T) or false (F). The symbol and truth table of an AND gate with two inputs is shown below. Truth Tables of Five Common Logical Connectives or Operators In this lesson, we are going to construct the five | {
"domain": "thebearing.net",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429129677614,
"lm_q1q2_score": 0.8799480981223229,
"lm_q2_score": 0.8933094046341532,
"openwebmath_perplexity": 1157.4913499542563,
"openwebmath_score": 0.8060331344604492,
"tags": null,
"url": "https://thebearing.net/dybqf/archive.php?a86677=truth-tables-explained"
} |
completing the square Solving equations with the quadratic formula The discriminant. In cases where you will need help on practice as well as a line, Algebra-equation. Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Quadratic formula. Profit = R(x) - C(x) set profit = 0. compressed by 0. The discriminate of any equation in any degree plays an important role in determining the roots of that equation. A quadratic equation can be solved by using the quadratic formula. 0 ft, thereby decreasing the volume of the cube by 37 ft3(feet-cubed) What was the volume of the original container? (recall: volume of cube with a side length x=x3) Define the variable, write a quadratic equation and solve by factoring. As we get to higher powers [x^3, x^4] it becomes really hard to compute by hand, and we usually rely on computer systems to factor the equations. Reasoning The equation 3x2 + bx + 3 = 0 has one real solution. | {
"domain": "chiesaevangelicapresbiteriana.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787879966233,
"lm_q1q2_score": 0.8047802163424543,
"lm_q2_score": 0.8152324848629214,
"openwebmath_perplexity": 551.1855345766834,
"openwebmath_score": 0.6575508117675781,
"tags": null,
"url": "http://vewb.chiesaevangelicapresbiteriana.it/break-even-quadratic-equation.html"
} |
java, algorithm
Vertex+edge vs. your model. Typically with models like this there are a few foundational perspectives that make sense. You could, for example, use polar coordinates instead of x/y because polar-coordinates are more easy to do spacial geometry with. Unfortunately they involve more complicated algorithms getting data in to and out of the model. If your work is primarily 'inside the model' rather than 'outside the model', then using polar space may make sense because the bulk of the work will be faster.
The same is true for things like Edges vs. Vertices. They each have advantages in different conditions. Depending on your conditions, the one model may make sense over the other.
What you have presented here is not nearly enough to make that decision.... but, for what it's worth, what you are doing is also not really pushing the performance limits enough on your systems to make the differences noticeable. | {
"domain": "codereview.stackexchange",
"id": 6341,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm",
"url": null
} |
ros, moveit, rviz-plugins
So it's unable to open or even find the config file. Can someone explain me why this error occurs and how I can solve it?
I am running ROS hydro in ubuntu 12.04
Originally posted by Yannik_K on ROS Answers with karma: 30 on 2014-04-30
Post score: 0
When nodes are launched through roslaunch, their current working directory is set to ROS_HOME ( usually ~/.ros ).
This means that any file names you provide should use the full path to the file instead of a relative path. I would retry your launch with the full path to your config file.
Originally posted by ahendrix with karma: 47576 on 2014-05-06
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 17816,
"lm_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, moveit, rviz-plugins",
"url": null
} |
c#, exception
On a style note, I would argue against using Hungarian Notation. It's not really commonly used in .net and basically every style guide written in this century argues against it.
I'd also recommend making the bool variable positive (i.e. success instead of notSuccess). This way people don't have to perform double negation in their head when reading things like notSuccess = false (which would be changed to success = true).
With these suggestions the code could look like this:
private void TryUntilSuccess(Action action)
{
bool success = false;
while (!success)
{
try
{
action();
success = true;
} | {
"domain": "codereview.stackexchange",
"id": 48,
"lm_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",
"url": null
} |
organic-chemistry, acid-base, amines
Title: Which base is stronger methylamine or propylamine? Which base is stronger methylamine or propylamine? I know that it depends on the strength of inductive effect of alkyl group. Am I right?
But how can I determine the difference between methyl and propyl substituent? Different sources quote different values.
Wikipedia: Methylamine $\mathrm{pK_a~= 10.64}$ and Propylamine $\mathrm{pK_a~= 10.71}$
Pubchem: Methylamine $\mathrm{pK_a~= 10.6}$ and Propylamine $\mathrm{pK_a~= 10.71}$
$\mathrm{pK_a}$ is also temperature dependent and this effect may be larger than the difference in the inductive effect between the two amines in question.
http://www.zirchrom.com/organic.htm: Methylamine $\mathrm{pK_a~= 10.63~, 25^\circ C}$ and Propylamine $\mathrm{pK_a~= 10.60~, 20^\circ C}$ | {
"domain": "chemistry.stackexchange",
"id": 2701,
"lm_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, acid-base, amines",
"url": null
} |
opencv
Title: Error while linking OpenCV
Hello everyone, I am using ROS Fuerte and in the project that I use OpenCV with ROS I can compile perfectly. The problem is, if I try to compile a project normal project that uses OpenCV (out of ROS), I get errors while linking:
$ make
g++ -Wall -DASSERT -O3 -g pkg-config opencv --cflags -o main.o -c main.cpp
main.cpp: In function ‘int main(int, char**)’:
main.cpp:44:5: warning: ‘key’ may be used uninitialized in this function [-Wuninitialized]
g++ pkg-config opencv --libs -o main main.o
main.o: In function main': /home/roleiland/Desktop/video_test/main.cpp:29: undefined reference to cvCreateFileCapture'
/home/roleiland/Desktop/video_test/main.cpp:39: undefined reference to cvGetCaptureProperty' /home/roleiland/Desktop/video_test/main.cpp:42: undefined reference to cvNamedWindow'
/home/roleiland/Desktop/video_test/main.cpp:52: undefined reference to cvShowImage' /home/roleiland/Desktop/video_test/main.cpp:55: undefined reference to cvWaitKey' | {
"domain": "robotics.stackexchange",
"id": 14069,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "opencv",
"url": null
} |
javascript, jquery, canvas
selItemsDimArray[i]['diff'] = diff;
//Handle negative diffs (e.g letter has negative spacing from previous)
if (diff < 0) {
selItemsDimArray[i]['calcDistance'] = (trackingAmount + (-diff)) + selItemsDimArray[i - 1].calcDistance
} else {
selItemsDimArray[i]['calcDistance'] = (trackingAmount - diff) + selItemsDimArray[i - 1].calcDistance
};
}; | {
"domain": "codereview.stackexchange",
"id": 9565,
"lm_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, canvas",
"url": null
} |
homework-and-exercises, electrostatics, electric-fields
One extra question for some fun: If you put some charge in the point where there is no field, will it remain there?
Now the problem is that:
$$\vec E = \vec E^{(1)} + \vec E^{(2)} = \frac{Q_1}{|\vec r - \vec r_1|^3}\cdot (\vec r - \vec r_1) + \frac{Q_2}{|\vec r - \vec r_2|^3}\cdot (\vec r - \vec r_2)= \vec 0$$
This we can split into components $x$ & $y$.
Component $y$.-
$$ \frac{Q_1}{(x^2+y^2)^{3/2}}y = -\frac{Q_2}{((x-a)^2+y^2)^{3/2}}y$$
This can be fulfilled easily if $y = 0$ or $y \neq 0$ and
$$ \frac{Q_1}{(x^2+y^2)^{3/2}} = -\frac{Q_2}{((x-a)^2+y^2)^{3/2}} $$
Component $x$.-
$$ \frac{Q_1}{(x^2+y^2)^{3/2}}x= -\frac{Q_2}{((x-a)^2+y^2)^{3/2}}(x-a)$$
Using the result obtained for the component $y$ if $y \neq 0$ one gets:
$$x = x-a$$
which is impossible. Then we have proven $y = 0$. Hence:
$$ \frac{Q_1}{(x)^{2}}= sign(a-x)\frac{Q_2}{(x-a)^{2}} $$ | {
"domain": "physics.stackexchange",
"id": 61480,
"lm_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, electrostatics, electric-fields",
"url": null
} |
coefficients are is to say that they count certain ways of grouping items. You can ignore it. We’ll also learn how to interpret the fitted model’s regression coefficients, a necessary skill to learn, which in case of the Titanic data set produces astonishing results. The Binomial Coefficients. Binomial Theorem – Explanation & Examples A polynomial is an algebraic expression made up of two or more terms which are subtracted, added or multiplied. Binomial coefficients are used in the study of binomial distributions and multicomponent redundant systems. 2 Chapter 4 Binomial Coef Þcients 4.1 BINOMIAL COEFF IDENTITIES T a b le 4.1.1. The OLSResults object contains the t-score of the regression coefficient α. Let’s print it out: aux_olsr_results.tvalues. The total number of combinations would be equal to the binomial coefficient. For K-12 kids, teachers and parents. This e-survey is dynamic' so that it can be edited as soon as new developments occur: if you know of something that you believe | {
"domain": "hlccc.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611631680358,
"lm_q1q2_score": 0.8104440785106697,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 710.6547183819509,
"openwebmath_score": 0.781328558921814,
"tags": null,
"url": "https://journey.hlccc.org/book-in-iffhkb/archive.php?page=binomial-coefficient-explained-84acc7"
} |
What happens to the values of $f(x)$ as $x$ approaches zero? Extend your graph of $f$ to reflect your answer.
As $x$ approaches zero from the left (through negative values), the function values decrease toward $-\infty\text{.}$ As $x$ approaches zero from the right (through positive values), the function values increase toward $\infty\text{.}$ The graph approaches but never touches the vertical line $x = 0$ (the $y$-axis.)We say that the graph of $f$ has a vertical asymptote at $x = 0\text{.}$ | {
"domain": "yoshiwarabooks.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9934102285320158,
"lm_q1q2_score": 0.8463386221005705,
"lm_q2_score": 0.8519527963298946,
"openwebmath_perplexity": 420.7700164678617,
"openwebmath_score": 0.7928138375282288,
"tags": null,
"url": "https://yoshiwarabooks.org/mfg/basic-functions.html"
} |
cc.complexity-theory, np-hardness, lo.logic, sat
In the above reduction, each $k$-CNF $F_i$ has at most $c(k,\varepsilon)n$ many clauses, hence is sparse in the above sense. According to this talk, the Exponential Time Hypothesis (ETH) says:
$3$-SAT instances (with $n$ variables and $m$ clauses) cannot be solved in time $O(poly(n) 2^{o(n)})$.
(the $O^{\ast}$-star notation just suppresses polynomials). And it says that the Sparsification Lemma is equivalent to:
If ETH holds, then $3$-SAT instances cannot be solved in time $O(poly(n) 2^{o(n+m)})$.
I do not understand the second claim, so I am asking if anyone could please explain why this is a statement of the Sparsification Lemma, what has it to do with the Lemma as stated before? I think your confusion might come from misquoting the statement of ETH.
$3$-SAT instances (with $n$ variables and $m$ clauses) cannot be solved in time $poly(n)\cdot 2^{o(n)}$.
This statement is not ETH, but rather its weak (but often very useful) corollary. The ETH claims the following: | {
"domain": "cstheory.stackexchange",
"id": 4375,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, np-hardness, lo.logic, sat",
"url": null
} |
classical-mechanics, thermodynamics, lagrangian-formalism, hamiltonian-formalism
$^1$ These are also functions of $q$, but that's not important. They could be functions of any number of distinct variables, though their list of variables will obviously be the same except for $v$ and $p$. Indeed, the Legendre transform doesn't change any of the other dependencies. If this is not clear now, it should become so throughout the rest of this explanation.
$^2$ Note that this is where the single-valuedness of the relation between $v$ and $p$ is required. If $v(p)$ was a parabola for example, then there would be ambiguity about which $p$ corresponds to the $v$ we used. | {
"domain": "physics.stackexchange",
"id": 60423,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, thermodynamics, lagrangian-formalism, hamiltonian-formalism",
"url": null
} |
java, multithreading, socket, server, client
Your magic number 5000 is a bad idea. Better would be to store the games one to a line, and read the file line-by-line. Just check if the line starts with the key. If it does, then worry about splitting.
The return at the end of the method does nothing.
The application flow is a bit wonky here. If you resume a game, you play the entire game from within the context of the resume method. Might it make more sense to return the game, and then play it from the run method?
validate
Predicate methods such as validate typically begin with is or has. isValidTarget might be a better name. digs is a terrible abbreviation for digits. And using a Set would be easier to read than your div/mod math.
In help, you don't need the extra println.
BcGame
Java method names should use camelCase. Java class names should start with a capital letter.
There's no reason to append r at the end of some of your variable names in the constructor. | {
"domain": "codereview.stackexchange",
"id": 35574,
"lm_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, multithreading, socket, server, client",
"url": null
} |
python, parsing, xml
Title: Parsing specifically nested XML Tags I've written a function that works however I'm sure there is a better way. I need to parse specific tags from an xml document (Microsoft Word docx document.xml).
Here is the general structure of the xml in question.
//A ton of crap
...
<w:tbl>
<w:tr>
<w:tc>
<w:p>
<w:r>
<w:t>Data_I_want</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr>
<w:tc>
<w:p>
<w:r>
<w:t>Data_I_want</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
...
// A ton more crap
//Same structure repeats and I need to grab that n number of times where n is unknown.
// Also the order of the data must be preserved within each parent tbl tag. | {
"domain": "codereview.stackexchange",
"id": 12456,
"lm_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, parsing, xml",
"url": null
} |
human-biology, human-anatomy
Title: Difference between the spinal cord and vertebrae column What is the difference between the spinal cord and the vertebrae column, they both run through from the head to the abdomen. Does any one have any idea. The vertebral column is a bony, segmented structure that supports the torso/head and thorax. The spinal cord is a bundle of nerves that runs inside the structure of the vertebral column. So - they run together, but are completely separate. | {
"domain": "biology.stackexchange",
"id": 5103,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, human-anatomy",
"url": null
} |
rna-seq, sam, samtools
Haven't seen a bam file like this before. Any idea what are these and how I can get read counts? Your data is not aligned to hg19, but to a bunch of RNA ref sequences. If you would align to hg19 you'll get each chromosome instead of the NR_* or NM_* accession codes with your samtools view -H code. With samtools idxstats file.bam you'll get the reads per chromosome (or per nucleotide sequence in your case).
For use in featureCounts my advice is to get the fastq files, and align it yourself to hg19 (or hg38 to be more up to date).
If your data is properly aligned to hg19 your output should be something like this:
samtools view -H aligned2hg19.bam | {
"domain": "bioinformatics.stackexchange",
"id": 336,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rna-seq, sam, samtools",
"url": null
} |
java, coordinate-system
static Set<Reflexion> all(){
return all(new Reflexion());
}
static Set<Reflexion> all(Reflexion r){
Set<Reflexion> out = new LinkedHashSet<Reflexion>();
//Loop over all values for each axis.
boolean[] tf = {true, false};
for(boolean x : tf){
for(boolean y : tf){
for(boolean z : tf){
out.add(new Reflexion(r, x, y, z));
}
}
}
return out;
}
} From what I understand, you want to make sure that new objects are not created when they are identical to what has been created before.
This is relatively easy, and would include either having a static map or a map inside another object, such as a ReflectionFactory. I'd personally go with ReflectionFactory as I don't like static things when you can avoid them.
Here's an example factory:
public class ReflexionFactory {
private final Map<Integer, Reflexion> map = new HashMap<>(); | {
"domain": "codereview.stackexchange",
"id": 11220,
"lm_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, coordinate-system",
"url": null
} |
javascript, tic-tac-toe
TicTacToe.prototype._resolveGame = function resolveGame() {
const winner = this._checkForWin();
if (winner) {
if ( typeof this._winHandler === 'function' ) {
this._winHandler(winner);
}
this._gameResolved = true;
} else if ( this._checkForDraw() ) {
if ( typeof this._drawHandler === 'function') {
this._drawHandler();
}
this._gameResolved = true;
}
};
TicTacToe.prototype._handlePlayerTurns = function _handlePlayerTurns() {
this.players.push( this.players.shift() );
if ( typeof this._turnHandler === 'function'
&& !this._gameResolved === true ) {
this._turnHandler( this.players[0] );
}
return this.players[0];
}; | {
"domain": "codereview.stackexchange",
"id": 29564,
"lm_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, tic-tac-toe",
"url": null
} |
java, console, calculator, finance
String incomeString = scanner.nextLine();
// Remove commas
incomeString = incomeString.replace( ",", "" );
BigDecimal income;
try {
income = new BigDecimal( incomeString );
} catch ( NumberFormatException e ) {
System.out.println( "ERROR: You must enter a valid number" );
return getTaxableIncome();
}
if ( income.compareTo( new BigDecimal( "0" ) ) < 0 ) {
System.out.println( "ERROR: You must enter 0 or a positive number" );
return getTaxableIncome();
}
return income;
}
private BigDecimal calculateTax( FilingStatus status, BigDecimal taxableIncome ) {
if ( taxableIncome.compareTo( BigDecimal.ZERO ) == 0 ) return BigDecimal.ZERO;
TaxBracket[] taxTable = TAX_TABLES.get( status ); | {
"domain": "codereview.stackexchange",
"id": 24081,
"lm_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, console, calculator, finance",
"url": null
} |
Additionally, compute an eigenvector for each eigenvalue so you can answer the question at the end of Example TGE.
###### T10.
Suppose $A$ is a square matrix. Prove that the column space of $A\text{,}$ $\csp{A}$ is an invariant subspace of $A\text{.}$
Solution
For any vector $\vect{x}\text{,}$ the matrix-vector product $A\vect{x}$ is a linear combination of the columns of $A\text{,}$ and hence an element of the column space. So if $\vect{x}\in\csp{A}\text{,}$ then $A\vect{x}\in\csp{A}\text{,}$ making $\csp{A}$ an invariant subspace of $A\text{.}$
###### T11.
Suppose $A$ is a square matrix. Prove that the null space of $A\text{,}$ $\nsp{A}$ is an invariant subspace of $A\text{.}$
Solution
For any vector $\vect{x}\in\nsp{A}\text{,}$ the matrix-vector product $A\vect{x}$ is the zero vector, which is an element of any subspace. So if $\vect{x}\in\nsp{A}\text{,}$ then $A\vect{x}=\zerovector\in\nsp{A}\text{,}$ making $\nsp{A}$ an invariant subspace of $A\text{.}$
###### T20. | {
"domain": "ups.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754470129648,
"lm_q1q2_score": 0.8183230419948914,
"lm_q2_score": 0.8311430520409023,
"openwebmath_perplexity": 240.5435147900544,
"openwebmath_score": 0.9983063340187073,
"tags": null,
"url": "http://linear.ups.edu/390/section-IS.html"
} |
electromagnetism, general-relativity, differential-geometry, potential, kaluza-klein
$$=\Gamma^\lambda_{\mu \nu }+\frac{k}{2} g^{\lambda \sigma}(A_\mu F_{\nu \sigma }+A_\nu F_{\mu \sigma}+A_\sigma (\partial_\mu A_\nu +\partial_\nu A_\mu ))$$
According to the paper the $A_\sigma$ term shouldn't be there, but I can't figure out how to make it go away. Anybody have any ideas? You missed a term in expanding the upper-indexed metric. The full version is below:
\begin{align}
\tilde{\Gamma}^\lambda_{\mu\nu} & = \frac{1}{2} \tilde{g}^{\lambda X} \left(\partial_\mu \tilde{g}_{\nu X} + \partial_\nu \tilde{g}_{\mu X} - \partial_X \tilde{g}_{\mu\nu}\right) \\
& =\frac{1}{2} \tilde{g}^{\lambda\sigma} \left(\partial_\mu \tilde{g}_{\nu\sigma} + \partial_\nu \tilde{g}_{\mu\sigma} - \partial_\sigma \tilde{g}_{\mu\nu}\right) + \frac{1}{2} \tilde{g}^{\lambda5} \left(\partial_\mu \tilde{g}_{\nu5} + \partial_\nu \tilde{g}_{\nu5} - \partial_5 \tilde{g}_{\mu\nu}\right) \\ | {
"domain": "physics.stackexchange",
"id": 34988,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, general-relativity, differential-geometry, potential, kaluza-klein",
"url": null
} |
meteorology, tropical-cyclone, atmospheric-circulation, troposphere
Internal waves are responsible for large transfers of energy across vast distances. Therefore, they play important roles in a wide array of atmospherical (and oceanic) processes, such as tropical cyclogenesis (TC). These waves are capable of depositing energy that was created far away in an already active region. This energy may manifest itself in the form of an easterly shear. Depending on the type of wave, there is evidence that some waves play an important role in triggering cyclogenesis. | {
"domain": "earthscience.stackexchange",
"id": 349,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, tropical-cyclone, atmospheric-circulation, troposphere",
"url": null
} |
equation for revenue to get the maximum revenue: $R(75)=75 (1500-750)=75\times 750=\5,671,800$ RonL 3. Hello, archistrategos214! 2) A rectangular field is fenced along a river bank, which is not. The material for the fence costs$12 per foot for the side parallel to the river, | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754474655618,
"lm_q1q2_score": 0.8183230444300996,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 1029.9667022245553,
"openwebmath_score": 0.454154372215271,
"tags": null,
"url": "http://mathhelpforum.com/pre-calculus/10388-function-word-problems.html"
} |
formal-languages, context-free, formal-grammars, pushdown-automata
Title: PDA with multiple element access - $i$ - access PDA We define an $i$ - access PDA as a PDA that can manipulate the top $i$ characters in the stack, where $i>0$.
Given a transition function of the form $\delta(p,x,c,d) \to (q,c')$, where $d \le i, d > 0$, we read it as "When in state $p$, upon reading an input $x$, the stack has depth at least $d$, with $c$ at the $d$th position from the top. Transition to $q$, pop $c$, and add $c'$ at the same index as $c$.
In essence, a $1$ - access PDA is essentially a normal PDA.
How do I show that for any language accepted by an $i$ - access PDA, $\exists$ a normal PDA which accepts it as well?
I know that I have to show that in the end, any $i$ - access PDAs can be reduced down to a $1$ - access PDA. | {
"domain": "cs.stackexchange",
"id": 19132,
"lm_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, context-free, formal-grammars, pushdown-automata",
"url": null
} |
quantum-field-theory, terminology, definition, feynman-diagrams
Title: What is a "Born diagram"? In the introduction of this article, the following statement is made regarding the partonic picture for hadronic scattering amplitudes:
To leading order in $\alpha_S (Q^2)$, the "hard-scattering amplitude"
$T_H$ is the sum of all Born diagrams for $\gamma^*+3q\rightarrow 3q$
in perturbative QCD. | {
"domain": "physics.stackexchange",
"id": 82402,
"lm_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, terminology, definition, feynman-diagrams",
"url": null
} |
image-processing, compression, image-compression, jpeg
The JPEG Algorithm doesn't let you set the size of the output file only the Quality measure. Namely to ensure the size of the output is close to the limit (Namely highest quality) requires trial and error (Though using the Quality you can get a measure of the bits per color).
The JPEG 2000 on the other hand allows you to cut the data at the exact number of bytes required hence makes the task much simpler (You can practically set a threshold on the output size).
The image quality of JPEG at compression ratio of ~100 is really bad (See Wikipedia article on JPEG). While JPEG 2000 can get better results.
To understand the Quality in JPEG, have a look at How JPG Works by Colt McAnlis:
Pay attention to the line:
Probably most important, is that the quality parameter varies depending on the image. Since each image is unique, and presents different types of visual artifacts, the Q value will be unique as well.
This is what JPEG 2000 makes easier. | {
"domain": "dsp.stackexchange",
"id": 6448,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, compression, image-compression, jpeg",
"url": null
} |
thermodynamics, solid-state-physics, kinetic-theory
The partition function is given by:
$$ Z = \sum_{n=0}^\infty e^{-\beta \epsilon_n} = e^{-\frac 1 2 \beta \hbar \omega} \frac{e^{-\beta \hbar \omega}}{1 - e^{-\beta\hbar\omega}} = e^{-\frac 1 2 \beta \hbar \omega} \frac{1}{e^{\beta \hbar \omega} - 1}. $$
The energy in the system is then given by:
$$E = \frac 1 Z \sum_n \epsilon_n e^{\beta \epsilon_n} = -\partial_\beta \ln(Z) = \frac 1 2 \hbar \omega + \frac{\hbar \omega e^{\beta\hbar\omega}}{e^{\beta\hbar\omega}-1} = \frac 1 2 \hbar \omega + \frac{\hbar\omega}{1 - e^{-\beta\hbar\omega}}.$$
The heat capacity will be given by $C = \frac{dE}{dT}$:
$$C = \partial_T E = (\partial_T \beta) \partial_\beta E = \frac 1 {T^2} \frac{\hbar^2\omega^2e^{-\beta\hbar\omega}}{(1 - e^{-\beta\hbar\omega})^2}.$$
While this term looks weird, so you could (a) plot it or (b) consider limit cases (and argue with continuity and monotonicity in between). But one can easily see that this term is continuous (so there no discrete jump in the heat capacity). | {
"domain": "physics.stackexchange",
"id": 25684,
"lm_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, solid-state-physics, kinetic-theory",
"url": null
} |
newtonian-mechanics, inertia
1: "...tip over much more slowly": the time constant of the motion goes as $\sqrt{\frac{2\ell}{3g}}$ as I derived in this answer about balancing a pencil on its tip. So when you are 3x taller, the time it takes to tip over will be about 1.7x slower. | {
"domain": "physics.stackexchange",
"id": 42029,
"lm_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, inertia",
"url": null
} |
fluid-dynamics, viscosity
This process is enhanced on the macro-scale when the flow is turbulent. Now you have large-scale eddies moving molecules from the faster to slower streams and vice-versa. This is why a turbulent boundary layer is thinner -- there is more momentum transfer resulting in a more rapid (in space) mixing of momenta.
Now, the only point that you are confused about is the collisions. If there were no collisions, there would be no viscosity. As a slower molecule moves into the faster stream, it is "ignored" in a collisionless system. So it neither speeds up nor slows down. And in this system, you will end up with total mixing eventually of all different velocity levels and you'll get flow that has a single, uniform velocity with non-equilibrium velocity distributions because there is no way to reach equilibrium. This would also be a frozen flow because it cannot leave this state. | {
"domain": "physics.stackexchange",
"id": 17203,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, viscosity",
"url": null
} |
redox, ions, atoms
I know that when you take away electrons from copper, it does it in a special way. I'm 15 years old and not english so I'm really not an expert or anything, I'm just wondering why $\ce{Cu^{2+}}$ would want to become $\ce{Cu}$ when it meets iron ($\ce{Fe}$). This is a good question, but you may have gotten off on the wrong track by thinking about the electronic shell structure (although what you have written seems correct, if a bit old-fashioned). The relevant phenomenon here is the relative abilities of the metal ions to oxidize (or remove electrons from) each other. For your specific example, the copper ion is a better oxidizing agent than the iron atom. Therefore it is able to take two electrons away from the iron atom, oxidizing it and leaving the iron 2+ ion behind. | {
"domain": "chemistry.stackexchange",
"id": 2548,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "redox, ions, atoms",
"url": null
} |
java
Person.java
package victor;
public abstract class Person {
public final String name;
public final int id;
public Person(String name, int id) {
this.name = name;
this.id = id;
}
} | {
"domain": "codereview.stackexchange",
"id": 43110,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
natural-language-processing
This dialog is a series of signals relying heavily on understandings that are not in the language. There is no formal grammar that could faithfully guide parsing by words. The signals after all seven levels of processing still fall far short of complete descriptions of the scenarios or the ideas of the individuals involved. Yet a series of themes and triggers to existing information shared in common between those at the table communicate volumes of information.
Level six from the layers listed above is important here because people are talking and possibly loudly at other tables. Level seven of the listening is entirely different at this girl's night out and may not share any significant functionality with the listening process when Jenna, Chelsea, Catherine, and Julia are in class taking notes. | {
"domain": "ai.stackexchange",
"id": 853,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "natural-language-processing",
"url": null
} |
Models Quiz Quiz, 10 questions Question 1 1 point 1. Data Booster 5. My question is as follows: I am working on an exercise stated as follows: Let$\\mathcal{E}$be the set of for all real numbers x for which the series converges. . x 1 x x 3 = x 1 1 x x 3 = x n, m 0 ( n + m n) x n ( x 3) m = n, m 0 ( n + m n) x n + 3 m + 1. 427K followers. Note: As we did in the section on sequences, we can think of the an a n as being a function a(n) a ( n) defined on the non-negative integers. Thus, the function f(x) above is a power series centered at 1, while the function g(x) above is a power series centered at 5. But what's exciting about what we're about to do in this video is we're going to use infinite series to define a function. Write the first four nonzero terms and the general term. 1 + x + x 2 + x 3 + when | x | < 1 . This power Find the sum of the series for f. That is easy enough to fix up as follows, 10. In this interval you can derive this series term by term, obtaining a convergent | {
"domain": "winningmahjong.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9546474181553805,
"lm_q1q2_score": 0.8075767673924487,
"lm_q2_score": 0.8459424411924673,
"openwebmath_perplexity": 526.8473182613332,
"openwebmath_score": 0.8019212484359741,
"tags": null,
"url": "https://winningmahjong.com/funeral/gordon/747681471fa3026e81cc4c4966866c97be8-the-function-f-is-defined-by-the-power-series"
} |
quantum-mechanics, quantum-information, double-slit-experiment, measurement-problem, quantum-eraser
2. Erasing the which-way information
Let us now instead measure $c$ in the $\vert+\rangle$, $\vert-\rangle$ basis. If we obtain outcome $\vert+\rangle$, we have effectively erased the which-way information. This can be understood by moving the measurement all the way to the CNOT, and noting that a CNOT in this setup, followed by a projection onto the $\vert+\rangle$ state on the target qubit, corresponds to the identity on the control qubit.
If we obtain $\vert+\rangle$, the (conditional!) probability distribution on $q$ will be thus $\mathrm{prob}(0)=\cos(\phi)^2$.
What happens if we obtain $\vert-\rangle$? In this case, one can easily check that the CNOT + projection yields a Pauli $Z$, i.e., there is an additional phase shift of $\pi$ introduced between the two paths of the interferometer. This is, in this case, we will still have interference, but the interference pattern will be shifted by half a spacing, i.e., $\mathrm{prob}(0)=\sin(\phi)^2=1-\cos(\phi)^2$. | {
"domain": "physics.stackexchange",
"id": 27718,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information, double-slit-experiment, measurement-problem, quantum-eraser",
"url": null
} |
experimental-physics, electrons, magnetic-moment, experimental-technique
Title: How is the electron $g$-factor determined? I found a description of the experiments at CERN where a Penning trap is used to to determine the g-factor but I could not find the value of the radius of the circle of precession, nor could I (surely my bad!) find a clue in the wikipedia article, they say:
The orbital motion of ions in the radial plane is composed of two
modes at frequencies which are called the magnetron and the modified cyclotron frequencies. These motions are similar to the
deferent and epicycle, respectively, of the Ptolemaic model of the
solar system.The sum of these two frequencies is the cyclotron
frequency, which depends only on the ratio of electric charge to mass
and on the strength of the magnetic field. This frequency can be
measured very accurately and can be used to measure the masses of
charged particles. | {
"domain": "physics.stackexchange",
"id": 60571,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "experimental-physics, electrons, magnetic-moment, experimental-technique",
"url": null
} |
ros, installation, ubuntu, ros-electric, ubuntu-lucid
Depends: ros-electric-documentation (= 1.4.2-s1314918935~lucid) but it is not going to be installed
Depends: ros-electric-visualization (= 1.6.4-s1316797656~lucid) but it is not going to be installed
Depends: ros-electric-vision-opencv (= 1.6.1-s1313700748~lucid) but it is not going to be installed
Depends: ros-electric-perception-pcl (= 1.0.1-s1315517480~lucid) but it is not going to be installed
Depends: ros-electric-geometry-experimental (= 0.2.2-s1313712024~lucid) but it is not going to be installed
Depends: ros-electric-robot-model-visualization (= 0.1.2-s1313720142~lucid) but it is not going to be installed
Depends: ros-electric-rx (= 1.6.1-s1314995568~lucid) but it is not going to be installed | {
"domain": "robotics.stackexchange",
"id": 6905,
"lm_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, installation, ubuntu, ros-electric, ubuntu-lucid",
"url": null
} |
ros-melodic
Comment by Dragonslayer on 2020-05-25:
Your welcome. Dwa_local_planner is "the new" trajectory planner so to speak. Instead of taking "long" trajectories to score, dwa (dynamic window approach) only takes them as long as relevant for the controller step, thus reducing computing resources needed. But there is a parameter simulation_time that lets you take longer trajectories into account. This might come in handy as you will read in the guide. Yes with parameters from the web you can get lucky or end in a nightmare. But as your robot seems turtlebot like you seem to be setup to get good results quickly as its kind of a reference for many standard packages.
Comment by Davide on 2020-05-25:
Ok, thanks fro your suggestions, bye | {
"domain": "robotics.stackexchange",
"id": 35010,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-melodic",
"url": null
} |
python, performance, number-guessing-game
For output, Holroy’s suggestion of using capital letters for the trees is a good idea: this makes it straightforward to check that the region constraints are being met.
The constructor takes arguments numr and numc but if the input were formatted as described above, then it would be possible to compute these values from the input, saving the caller having to specify them.
The arguments cpr, cpc, cpf are obscurely named. Does ‘cpr’ mean ‘choices per row’ or ‘choices per region’? What does ‘cpf’ mean? Names of arguments are parts of a class’s public interface, so they need to be clear.
It would make sense for cpr, cpc, and cpf to have default values.
There’s no check on the values in the input. For the problem to be solvable, it needs to be the case that numr*cpr, numc*cpc, and the number of regions times cpf, are all equal.
2. Representing as an exact cover instance
You wrote: | {
"domain": "codereview.stackexchange",
"id": 16411,
"lm_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, number-guessing-game",
"url": null
} |
haskell, quiz
askQuestion :: (Int, Operator, Int, StdGen) -> IO Bool
askQuestion (i1, o, i2, gen) = do
putStrLn $ unwords ["Enter the answer to", show i1, show o, show i2] ++ ": "
userAnswer <- getLine
let trueAnswer = case o of
Add -> i1 + i2
Subtract -> i1 - i2
Multiply -> i1 * i2
if (show trueAnswer) == userAnswer then do
putStrLn "Well done!"
return True
else do
putStrLn $ "Wrong - the answer was " ++ show trueAnswer
return False
main = do
gens <- mapM (const newStdGen) [1..10]
let questions = map genQuestion gens
answers <- mapM askQuestion questions
putStrLn $ "Your score was " ++ show (sum $ map fromEnum answers) | {
"domain": "codereview.stackexchange",
"id": 21554,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell, quiz",
"url": null
} |
c#, sql-server
public bool isValid(string url)
{
HttpWebRequest urlReq;
HttpWebResponse urlRes;
try
{
urlReq = (HttpWebRequest)WebRequest.Create(url);
urlReq.Method = "HEAD";
urlReq.Timeout = 100000;
urlRes = (HttpWebResponse)urlReq.GetResponse();
urlRes.Close();
return true;
}
catch (Exception ex)
{
//Url not valid
strErrorMSG = "Exception From isValid Method. Exception to follow: " + ex.ToString();
return false;
}
}
}
}
Here is the Entire code for this class. | {
"domain": "codereview.stackexchange",
"id": 6419,
"lm_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#, sql-server",
"url": null
} |
performance, matlab
eff_prices = zeros(n_min,ndays);
mid_quotes = zeros(n_min,ndays);
for t=2:n_min
eff_prices(t,:) = eff_prices(t-1,:)+sigma_eff*shocksWe(t,:)+beta*dfactor(t,:);
mid_quotes(t,:) = mid_quotes(t-1,:)+ delta*(eff_prices(t,:)-mid_quotes(t-1,:)) + (1-delta)*sigma_m*shocksWm(t,:);
end
end
after generating the log price in my script we can see that there are flat area . This happens because there are price repetitions, there is the arrival of an informed trader trader_type = double(shocks.U<par.PAIT) who decide to do not trade because abs(eff_prices-mid_quotes)<=c)
What I want to do is to consider only the trading times with the relative prices ( like a real dataset) , roughly speaking I want to delete the flatness due to price repetitions
nrep = 10;
n_obs_per_day = 6*60*60*100; %1/10 di sec
N_asset = 1; | {
"domain": "codereview.stackexchange",
"id": 45071,
"lm_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, matlab",
"url": null
} |
classification, tensorflow, keras, objective-functions, regression
Multiple combinations of loss functions and optimisers can make the single-neuron output layer work, with different configs for them. Note that learning rates of different optimisers are different, some take 1e-1, some need 1e-3 for good training.
For example, this combination should work:
loss_fn = tf.losses.LogCosh();
optimizer = tf.optimizers.RMSprop(1e-3); | {
"domain": "ai.stackexchange",
"id": 1414,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, tensorflow, keras, objective-functions, regression",
"url": null
} |
\begin{aligned} f(x) - f(x^*) \geq \tfrac{\alpha}{2} \|x-x^*\|^2, \end{aligned}\tag{3}\label{3}
for all $x\in\mathcal{B}_\nu^f$ for some $\nu>0$. Functions which satisfy this property are not necessarily strongly convex. As a counterexample we have $f = (\max\{|x|-1,0\})^2$. Of course if $f$ is strongly convex the above holds and if $f$ is given in the form $f(x) = h(Ax)$ where $h$ is a strongly convex function and $A$ is any matrix.
Then, condition \eqref{3} is shown to be equivalent to
\begin{aligned} \|x-x^*\| \leq \frac{2}{\alpha} \|\nabla f(x) \|, \end{aligned}\tag{4}\label{4}
for all $x\in\mathcal{B}_{\nu}^f$ and with $\alpha < 1/L$.
Clearly in this case we may use the termination condition $\| \nabla f(x) \| < \epsilon\alpha/2$ which will imply that $\|x-x^*\| < \epsilon$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226260757066,
"lm_q1q2_score": 0.8505932228740445,
"lm_q2_score": 0.8705972616934406,
"openwebmath_perplexity": 172.65927548897878,
"openwebmath_score": 0.9520741701126099,
"tags": null,
"url": "https://math.stackexchange.com/questions/1618330/stopping-criteria-for-gradient-method/1618347"
} |
called the height. State a conjecture about the pair of angles at each vertex. From the figure below, it is clear that if we divide the parallelogram into two triangles, and , and are their altitudes because they are perpendicular to . \\ And you see the diagonals intersect at a 90-degree angle. 6. The diagonals bisect the vertex angles of a rhombus. If the diagonals of a quadrilateral both bisect each other and they are perpendicular, then the quadrilateral is a rhombus. Download books and chapters from book store. I hope you're following along.... Now that you know this, … At this point the lengths are perfectly split in half resulting in the short diagonal becoming only 5cm and the 24 to become 12cm. We need to find the side of the rhombus using the Pythagorean Theorem. The diagonals of the rhombus bisect each other at 90 degrees. Find the size of the angle x. Therefore, the diagonals are of length 15.5 in. In any rhombus,the diagonals (lines linking opposite corners) bisecteach | {
"domain": "elagroupgc.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475746920262,
"lm_q1q2_score": 0.8398568914233026,
"lm_q2_score": 0.8902942181173146,
"openwebmath_perplexity": 736.1986357623626,
"openwebmath_score": 0.6433411240577698,
"tags": null,
"url": "https://elagroupgc.com/vidhan-sabha-ljvxhkq/diagonals-uk-and-hs-of-a-rhombus-00d2ea"
} |
java, object-oriented, console, role-playing-game
The game output will be printed to the console. So there also should be a class that handles some recurring output tasks.
Display.java
public class Display {
public static void health(Character character) {
System.out.println("health points: " + character.getHealthPoints() + " / " + character.getHealthPointsMax());
}
public static void energy(Character character) {
System.out.println("energy points: " + character.getEnergyPoints() + " / " + character.getEnergyPointsMax());
}
public static void healthAndEnergy(Character character) {
health(character);
energy(character);
}
public static void basicDetails(Item item) {
System.out.println("name: " + item.getName());
System.out.println("category: " + item.getCategory());
System.out.println("price: " + item.getPrice());
}
public static void details(HealthItem item) {
basicDetails(item); | {
"domain": "codereview.stackexchange",
"id": 39862,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, console, role-playing-game",
"url": null
} |
quantum-mechanics, quantum-information, bells-inequality
Title: What is the $S$ operator in the CHSH inequality $-2\leq S\leq 2$? What exactly does $S$ represent in the CHSH inequality
$$-2~~\leq ~S~\leq ~2?$$
Sorry I've been reading for a couple days and I can't figure out what exactly $S$ is and the math is a bit over my head.
Any help is much appreciated. The $S$ in this inequality is defined as
$$ S = E(a b) − E(a b') + E(a' b) + E(a' b') $$
where $E(M)$ is the "expectation value of $M$" which means the average value calculated from many repetitions of the same experiment (empirically) or from the probability distributions (theoretically). | {
"domain": "physics.stackexchange",
"id": 86659,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information, bells-inequality",
"url": null
} |
$$\bar{v}=\frac{v_0+v_0+a\Delta t}{2}=v_0+\frac12a\Delta t$$
So that in the case of constant acceleration we obtain the same result. Note that this is the only case where both give the same result.
• Can't we use the first when an object is undergoing projectile motion – danny Aug 14 '16 at 14:14
• Can't we use it when velocity is constant – danny Aug 14 '16 at 14:15
• Hi Danny. If velocity is constant then what's the point in taking an average? $(v_1+v_1)/2=v_1$! ;-) – Gert Aug 14 '16 at 14:17
• Sorry i meant to say if acceleration is constant – danny Aug 14 '16 at 14:20
• I'll answer that in a edit to the post. – Gert Aug 14 '16 at 14:21
Taking the average of the initial velocity and final velocity is not necessarily, you are assuming a linear change in the velocity which is not the general situation. So only the second formule specifies the average velocity. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018390836985,
"lm_q1q2_score": 0.8126596738652279,
"lm_q2_score": 0.8333245911726381,
"openwebmath_perplexity": 356.64607959652176,
"openwebmath_score": 0.8814342617988586,
"tags": null,
"url": "https://physics.stackexchange.com/questions/274300/what-is-the-difference-between-these-two-ways-to-calculate-average-velocity/274311"
} |
electromagnetism, special-relativity, terminology
Maybe that's not terribly useful because it's more or less a game with index manipulation. But Elie Cartan showed that $d$ makes sense in any spacetime, even the curved ones of general relativity. If we think about Maxwell's equations in terms of the 1-form $A_\mu$ (or the 2-form $F_{\mu\nu}$) and the operator $d$, we automatically get a theory of electromagnetism that works even in curved spacetime.
There is a very high-level way of thinking about $F_{\mu\nu}$ where you think about it as a curvature in a specific sense. Now, the curvature in general terms is something that measures the failure of derivatives to commute. So you put in two vectors $x^\mu$ and $y^\mu$, and the curvature should tell you how much taking derivatives along $y^\mu$ first and then along $x^\mu$ differs from doing it in the other order. The curvature should take two vectors and switching their order should change the sign of what comes out. But this is the definition of a 2-form. | {
"domain": "physics.stackexchange",
"id": 12899,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, special-relativity, terminology",
"url": null
} |
fft, ifft
if(_data !=nullptr|| real.empty() != true || imag.empty() != true){
for (int i = 0; i < real.size(); i++)
{
real[i] = 0.0; imag[i] = 0.0;
}
int le, ip, m, i, nm1, j, t, le1, inv = 0;
double ur, ui, tr, ti, tmpr, tmpi, nv2, k;
if (_hin) inv = 1;
else inv = -1;
for (int i = 0; i <= Nmax - 2; i++)
{
real[i] = _data->at(i+1);
}
m = round((log(Nmax) / log(2)));
nv2 = Nmax / 2;
nm1 = Nmax - 1;
j = 1;
//Vertauschung der Eingangsfolge
for (i = 1; i <= nm1; i++)
{
if (i < j) {
tmpr = real[j - 1];
tmpi = imag[j - 1];
real[j - 1] = real[i - 1];
imag[j - 1] = imag[i - 1];
real[i - 1] = tmpr;
imag[i - 1] = tmpi;
}
k = nv2;
while (k < j)
{
j = round(j - k); | {
"domain": "dsp.stackexchange",
"id": 11504,
"lm_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, ifft",
"url": null
} |
graphs, optimization, weighted-graphs, connected-components, max-cut
(Motivation: I was wondering how many unhappy counties can secede from a U.S. state without breaking the state into disconnected components, and got this graph problem that I can't figure out.) The problem is equivalent to the node-weighted version of the Steiner tree problem.
Happy nodes correspond to terminals, and non-removed unhappy nodes correspond to Steiner vertices.
This problem is NP-hard even for planar graphs. The NP-hardness can be proven by reducing the edge-weighted Steiner tree problem: insert one vertex in the middle of each edge.
The Dreyfus-Wagner algorithm can be used for the node-weighted version as well, and runs in $O(3^k \mathrm{poly}(n))$ time where $k$ is the number of terminal nodes. If $n - k$ is small compared to $k$, bruteforcing Steiner vertices gives $O(2^{n-k} \mathrm{poly}(n))$ time bound. | {
"domain": "cs.stackexchange",
"id": 20204,
"lm_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, optimization, weighted-graphs, connected-components, max-cut",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.