text stringlengths 1 1.11k | source dict |
|---|---|
operating-systems, virtual-memory
Title: finding maximum virtual and physical memory If the following is given:
CPU uses a four-level hierarchical page table, each level can contain 512 entries
the page size is 4KB.
virtual address is 48 bits
How do i get the size of the virtual memory (in terms of pages or bytes). Do i just use the number of page table entries 29*4+12 ?
And can i get the size of the physical memory given this information ? No, you can't get size of physical memory with the provided information.
Explanation: | {
"domain": "cs.stackexchange",
"id": 6542,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "operating-systems, virtual-memory",
"url": null
} |
genetics, genomes, complexity
Largest genome: Paris japonica, a rare plant. Its genome is 149,000,000,000 base pairs large. Approximately 50 times larger than the human genome, by base pair count.
Higher number of genes in an organism: Daphnia pulex, a very common species of water flea. 31,000 protein-coding genes.
As already pointed out, the most genetically complex organism is an unclear question. Complexity can be interpreted in different ways, and I don't think we could agree on a satisfying measure (or definition, for that matter) of genetic complexity. | {
"domain": "biology.stackexchange",
"id": 9428,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "genetics, genomes, complexity",
"url": null
} |
• Why is it called a "phase"?
• Why do we care about phases of complex numbers?
• Can a complex number have different phases and still be considered the same complex number?
• What are examples of applications of this property of a complex number?
• Let me compose a hypothetical example in the next comment. The main issue (as I see it) is that currently the post looks exactly the same as a "gimme teh codez" question by someone who puts no effort in their homework or no effort in even reading their textbook. Mar 9, 2019 at 16:09 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992932829917,
"lm_q1q2_score": 0.8302331355821599,
"lm_q2_score": 0.8577680977182186,
"openwebmath_perplexity": 224.46562648558702,
"openwebmath_score": 0.8827878832817078,
"tags": null,
"url": "https://math.stackexchange.com/questions/3141048/what-exactly-is-the-phase-of-a-complex-number"
} |
stft
Title: Is "Windowed Fourier Transform" a synonym for "STFT"? Sometimes I find the notation WFT (Windowed Fourier Transform) while other times I see STFT (Short Time Fourier Transform).
Are they the same? In Chapter 2.4 Previous Work of The Short Time Fourier Transform and Local Signals, S. Okamura, 2011, one reads:
The STFT is also known under many names such as the windowed Fourier
Transform, the Gabor transform, and the local Fourier transform.
Later, one discovers that the definition may slightly vary with different authors, but, at first glance, they are the same. Be careful though. For some persons, a "Windowed Fourier Transform" is a mere Fourier transform of a windowed signal. Because there is no sliding nor shift involved. For some, "short" implies "finite support".
Leaving theses versions aside, my personal interpretation and use is that a “Windowed Fourier Transform” is a special case of a slightly more generic “STFT” acceptation, for two (mild) reasons: | {
"domain": "dsp.stackexchange",
"id": 5820,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stft",
"url": null
} |
electromagnetism, waves, computational-physics
Title: Computing the analytic solution to the non-homogeneous 3D wave equation I'm working on solving the non-homogeneous equation numerically.
$$ \frac{\partial ^2 w}{\partial t^2} = a^2 \nabla^2w + \Phi(x, y, z, t)$$
with initial conditions
$$ w= f(x, y, z) \space \text{at} \space t=0 $$
$$ \partial_t w= g(x, y, z) \space \text{at} \space t=0 $$
In order to check if the algorithm is implemented succesfully, I need an analytical solution to the problem. The book I am consulting has the analytic solution (to a Cauchy problem) to the equation written as follows:
$$w(x, y,z,t)= \iint\limits_{r=at} \frac{f(ξ, η, ζ)}{r}dS + \frac{1}{4 \pi a} \iint\limits_{r=at}\frac{g(ξ, η, ζ)}{r}dS +\\ \frac{1}{4 \pi a^2} \iiint\limits_{r \leq at}\frac{1}{r} \Phi\left(ξ, η, ζ, \tau - \frac{r}{a}\right)~ dξ dηdζ, $$ | {
"domain": "physics.stackexchange",
"id": 80731,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, waves, computational-physics",
"url": null
} |
spacetime, speed-of-light, space-expansion, faster-than-light
Simply send the spaceship away from Earth at, say, 96% the speed of light. Now transform into "synchronous" coordinates, similar to what we use to describe the universe. The idea is that we want clocks on the Earth and the spaceship to advance at the same rate. To do this, we boost into an intermediate reference frame, in which the Earth and the spaceship are receding in opposite directions at the same speed. Due to relativistic velocity addition, this mutual speed turns out to be 75% the speed of light, since $2\times 0.75/(1+0.75^2)=0.96$. But now the trick is that we measure time with respect to the synchronized clocks on the Earth and spaceship, which are slowed by a factor of about $(1-0.75^2)^{1/2}\simeq 0.66$ due to time dilation. By comparing distance traveled to the time elapsed on these clocks, we would conclude that the Earth and the spaceship are traveling in opposite directions each at $0.75/0.66 = 1.13$ times the speed of light. | {
"domain": "physics.stackexchange",
"id": 99890,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spacetime, speed-of-light, space-expansion, faster-than-light",
"url": null
} |
in vectors and the cos the... This is the product of two vectors is defined for vectors, and if only. Products of the ways in which two vectors [ 6, 2 ] be a geometric relationship between dot. As above for the pairs of vectors can be combined is known as Kahan. ’ ) and hence another name dot product and its properties + b_2 \hat i. Are widely used in mathematics, physics, and leads to the dot ( )... Of this with itself is: there are two ternary operations involving dot product vectors. Product 8 www.mathcentre.ac.uk 1 c mathcentre 2009 though, is the square of the vector ’ s magnitude above... Performing a specific operation on the different vector components these two definitions relies on having a Cartesian system... Loading properties of dot product resources on our website spaces, matrices and matrix calculus, inner product case all. ⋅ a real number, and if and only if by |b| cos θ is its length and. If θ \ \theta θ is 9 0 ∘ 90^ { \circ } 9 0 ∘, then dot. Between the dot product | {
"domain": "lockxx.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9441768557238083,
"lm_q1q2_score": 0.804394116012974,
"lm_q2_score": 0.8519528000888387,
"openwebmath_perplexity": 568.259313630565,
"openwebmath_score": 0.8666537404060364,
"tags": null,
"url": "https://lockxx.com/xom8445/45af58-properties-of-dot-product"
} |
string-theory, standard-model
for iii--- you must remember that I am talking about the worst-case scenario. We have a lot of clues in the standard model, like the small electron mass, and the SUSY (or lack thereof) that we will (or will not) find at LHC. These clues are qualitative things that cut down the number of possibilities drastically. It is very unlikely to me that we will have to do a computer-aided search through $10^{40}$ vacua, but if push comes to shove, we should be able to do that too.
Historical note about Ptolmey, Aristarchus, Archimedes and Apollonius | {
"domain": "physics.stackexchange",
"id": 2649,
"lm_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, standard-model",
"url": null
} |
optics, vision, biology
Title: What are the main causes for eyeball becoming too long or short in myopia and hyperopia? myopia and hypeopia occur due to change in eye ball size or lack in cilliary muscle ability to accomodate. \n\n
But why in lasik laser operation , the one's cornea shape is changed rather than acting on cilliary muscles or somehow fixing the size of eyeball?\n\n
And why does the eyeball become larger or smaller? Does it happen due to external injury or some internal mechanism? What makes the eyeball change it size? Strictly speaking, you are describing axial myopia, indeed caused by a change in the eyeball shape. In some cases, the cornea itself maybe the problem. But your question is still valid for axial myopia and I will try to answer. | {
"domain": "physics.stackexchange",
"id": 53279,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, vision, biology",
"url": null
} |
performance, database, authentication, kotlin, firebase
}else {
response.error = errorMessage
}
return response
} | {
"domain": "codereview.stackexchange",
"id": 23465,
"lm_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, database, authentication, kotlin, firebase",
"url": null
} |
is often used in integrated circuits where wires only run parallel to the X or Y axis. It has complexity of O(n log n log k). I can divide this by n to get a changeIdx from 0-max distance. The reason for this is quite simple to explain. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. The result may be wrong in any directions. Do rockets leave launch pad at full thrust? Noun . Thus, the heuristic never overestimates and is admissible. Let’s say point $P_1$ is $(x_1, y_1)$ and point $P_2$ is $(x_2, y_2)$. The use of Manhattan distance depends a lot on the kind of co-ordinate system that your dataset is using. I'm not sure if my solution is optimal, but it's better than yours. Sort by u-value, loop through points and find the largest difference between pains of points. 1 answer. The following paths all have the same taxicab distance: The rest of the states for a pair of blocks is sub-optimal, meaning it will take more moves than the M.D. your coworkers to find | {
"domain": "eandltoledolandscaping.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995723244552,
"lm_q1q2_score": 0.8357195813963271,
"lm_q2_score": 0.8652240930029117,
"openwebmath_perplexity": 1112.1657793499576,
"openwebmath_score": 0.47308290004730225,
"tags": null,
"url": "http://www.eandltoledolandscaping.com/pri2s/fe22b6-maximum-manhattan-distance"
} |
quantum-field-theory, particle-physics, quantum-electrodynamics, feynman-diagrams, spinors
EDIT: Well, I am not 100% sure of the explanation I will provide, but I think it can justify what I understand to be your concern. You can define two vacuum states: one will be with respect to the electrons/positrons and the other will be with respect to the muon/anti-muon. The product of those vacuum states will comprise the vacuum we already know and cherish! Namely, $|0\rangle=|0\rangle_e|0\rangle_{\mu}$. Electron creation/annihilation operators (obtained from expanding $ψ(x)$) act on the former vacuum state, whereas muon creation/annihilation operators (obtained from expanding $ψ′(x)$) act on the latter. | {
"domain": "physics.stackexchange",
"id": 93409,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, quantum-electrodynamics, feynman-diagrams, spinors",
"url": null
} |
physical-chemistry, water
Title: Why does increase in pressure favor formation of water in water-ice equilibrium (at 273K)? The question:
Ice and water are placed in a closed container at a pressure of 1 atm and a temperature of 273 K. If the pressure of the system is increased to 2 atm while keeping temperature constant, why does the system's volume decrease? To answer this question, it is best to look at a phase diagram of $\ce{H2O}$.
Note the axes are kilopascal and celsius, but we know that $0^{\circ}\text{C}=273\text{K}$ and $101\text{kPa}=1\text{atm}$. We can see that if the pressure goes up at a constant temperature, the system will move from the phase boundary into the liquid phase.
The generally cited reason for why this occurs is that hydrogen bond network of ice makes it less dense than liquid water, and since higher pressure will favor the more dense state, the ice will melt to become liquid. This leads to a lower overall system volume. | {
"domain": "chemistry.stackexchange",
"id": 8089,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, water",
"url": null
} |
ios, email, swift
return retSession
} I don't know anything about mailcore2, nor have you provided any Time Profiler information to help narrow down what takes so long to complete the action (is it just a slow network, or is it something in your code? Anyone's guess), so I can't really address the slowness issue. I also don't have a clue which methods are yours versus what you simply get from mailcore2, but with that said...
NSLog() statements should almost always be wrapped in #if DEBUG and #endif statements.
Moreover, regardless of whether or not the deletion is successfully, we need to let the user know one way or the other, and NSLog() isn't going to cut it.
I'm not sure how the second code snippet ties to the first, but all of our methods could use better names.
deleteOnServer(indexSet:) - delete what? on which server? What does index set represent? | {
"domain": "codereview.stackexchange",
"id": 12698,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ios, email, swift",
"url": null
} |
physical-chemistry, thermodynamics, enthalpy
is conducted under very non-ideal conditions with respect to the behavior of gases and/or including liquid mixtures with a very large Enthalpy of Mixing, then you have to expect big differences between the (tabulated) standard values and the measured values. | {
"domain": "chemistry.stackexchange",
"id": 615,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, thermodynamics, enthalpy",
"url": null
} |
c++, programming-challenge
// Otherwise expand the boundary until both
// points are in the zone or we can't expand anymore.
while(!cZ.empty())
{
Point next = cZ.top();
if (next == dst) {
// next location is the destination we have
// confirmed we can get from source to dest.
return cZ.getType();
}
// Only remove next if we are going to expand.
cZ.pop();
tryAdding(cZ, next, -1, 0);
tryAdding(cZ, next, +1, 0);
tryAdding(cZ, next, 0, -1);
tryAdding(cZ, next, 0, +1);
// This extra check is needed because
// zones may have been combined. Thus it checks
// to see if the two points are now in the same zone
// after combining zones.
if (zone(dst) == cZ.getId()) {
return cZ.getType();
}
}
return 'F';
} | {
"domain": "codereview.stackexchange",
"id": 39424,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, programming-challenge",
"url": null
} |
python, beginner, python-3.x, game, rock-paper-scissors
print(f"USER - {user} \nCOMPUTER - {computer}")
for k, v in var.items():
if k == user:
one = int(v.index(1))
if k == computer:
two = int(v.index(1))
if one < two:
print(f"USER with {user} - WIN!")
my_win += 1
elif one == two:
print("==TIE==")
my_tie += 1
else:
print(f"COMPUTER with {computer} - WIN!")
my_loss += 1
def results():
print ("You win %d times!" % my_win)
print ("You lose %d times!" % my_loss)
print ("You tie %d times!" % my_tie) | {
"domain": "codereview.stackexchange",
"id": 38714,
"lm_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, rock-paper-scissors",
"url": null
} |
quantum-gate, universal-gates
Title: Is the gate-based model of QC universal? I have heard this is the case but can not find a source even discussing this.
Can any problem that can be solved by a Quantum Computer, also be solved by the quantum circuit model?
I realise that even if this is true, it won't always be the best option, I mean theoretically.
And I have heard that CNOT gate combined with arbitrary rotations allow to implement any gate. But nothing that makes it clear that the circuit can do anything. The quantum circuit model is one of the possible models for quantum computation. It is the most studied, because it is quite practical.
Back to the origins, you can look at papers by David Deutsch, like:
Quantum computational networks
Proc. R. Soc. Lond. A 425, 73-90 (1989)
For a slow start, I suggest to read Nielsen and Chuang's book and maybe Scott Aaronson's lecture notes (Section 16.2.2). | {
"domain": "quantumcomputing.stackexchange",
"id": 1772,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, universal-gates",
"url": null
} |
quantum-field-theory, special-relativity, tensor-calculus, notation, spinors
Scharf seemingly does not explicitly specify $\varepsilon_{\alpha\beta}$. I'm aware some authors use $\varepsilon_{\alpha\beta} = -\varepsilon^{\alpha\beta}$ while others prefer $\varepsilon_{\alpha\beta} = \varepsilon^{\alpha\beta}$ (c.f. Moniz, 2010, pages 216–217).
Thus, please be clear on which convention you are using if it makes any difference for the answer.
An additional reason for assuming that $\varepsilon^T$ are given the indices $(\varepsilon^T)^{\alpha\beta}$ comes on page 27 of Scharf's text, where he writes the derivation
$$
\partial^{\alpha \dot{\beta}} = \varepsilon^{\alpha\gamma} \varepsilon^{\dot{\beta}\dot{\delta}} \partial_{\gamma \dot{\delta}} = (\varepsilon \partial \varepsilon^T)^{\alpha \dot{\beta}},
\tag{9}
\label{9}
$$
an equation which to my eye doesn't makes much sense unless $\varepsilon^T = (\varepsilon^T)^{\alpha\beta}$. Here is my own attempt at an answer:
All the derivations are correct.
To see this, let
$$
A^{-1}\equiv
\begin{pmatrix}
a & b \\ | {
"domain": "physics.stackexchange",
"id": 60780,
"lm_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, special-relativity, tensor-calculus, notation, spinors",
"url": null
} |
non-locality, contextuality, peres-mermin-square
$$p(a\vert M_j,P_i) = \sum_{\lambda \in \Lambda}p(\lambda \vert P_i)p(a\vert M_j,\lambda)$$ | {
"domain": "quantumcomputing.stackexchange",
"id": 3686,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "non-locality, contextuality, peres-mermin-square",
"url": null
} |
Thus,
$$3^n + 2(3^{n-1}) + ... +2^{n-1}(3) + 2^n = \sum_{k=0}^n 3^n \cdot \left( \frac{2}{3} \right)^k = 3^{n+1} - 2^{n+1}$$
• It looks like your sum has an extra $(2/3)^k$ in it. – Michael Burr Dec 13 '18 at 3:32
• Where, exactly? – Eevee Trainer Dec 13 '18 at 3:36
• Oh, I see. I'll try to figure out how to resolve it. – Eevee Trainer Dec 13 '18 at 3:37
• Okay, I believe I fixed it. It didn't really affect my approach, just more how it was being written in the summation. I suck at writing summations when they're a bit awkward like the one givenn. – Eevee Trainer Dec 13 '18 at 3:42
Sum of first n terms of a geometric series is given by:
$$S_n = \frac{a(r^n-1)}{r-1}.$$
Here $$a$$ is the first term of the series and $$r$$ is the common ratio.
In your question, $$r = \frac{2}{3}$$, $$a=3^n$$ and the number of terms is $$n+1$$ (you probably messed up in this part). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540674530016,
"lm_q1q2_score": 0.8324227206541862,
"lm_q2_score": 0.84997116805678,
"openwebmath_perplexity": 396.7571985094301,
"openwebmath_score": 0.7695213556289673,
"tags": null,
"url": "https://math.stackexchange.com/questions/3037519/what-geomatric-series-formula-is-used"
} |
agree to our Cookie Policy. Such relations are common; therefore, differential equations play a prominent role in many disciplines including engineering, physics, economics, and biology. On the last page is a summary listing the main ideas and giving the familiar 18.03 analog. Skip to main content. The theory of differential and difference equations forms two extreme representations of real world problems. Search. Level up on all the skills in this unit and collect up to 1100 Mastery points! Differential equations: exponential model word problems Get 3 of 4 questions to level up! Abstract | Full Text | References | PDF (1678 KB) | Permissions 38 Views; 0 CrossRef citations; Altmetric; Article. Differential Equations | Citations: 1,949 | Differential Equations a translation of Differentsial'nye Uravneniya is devoted exclusively to differential equations and the associated integral equations. We just found a particular solution for this differential equation. Download and Read online | {
"domain": "santafestereo.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813463747182,
"lm_q1q2_score": 0.8144509830798989,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 846.8603279618608,
"openwebmath_score": 0.5220600366592407,
"tags": null,
"url": "http://www.santafestereo.com/x6g7ee8/f759bb-difference-equations-and-differential-equations"
} |
c++, file, console, windows, quiz
if (!is_number){ //search by name
delete_row = file_voc.find(input); // ??? delete row == 0
if (delete_row == 0) { //No match
std::wcout << "\n No match found in file\n";
utility::keep_window_open(L"q");
step = Menu_show_choice::start; // break and set global menu
return;
}
}
else { // search by row number
if (delete_row < 0 || delete_row > file_voc.size()-1) {
std::wcout << "\n Error: No match. Invalid row number enterd\n";
utility::keep_window_open(L"q");
step = Menu_show_choice::start; // break and set global menu
return;
}
}
step = Menu_show_choice::erase; // go to next step erase
} | {
"domain": "codereview.stackexchange",
"id": 31017,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, file, console, windows, quiz",
"url": null
} |
ros, custom-message, build, catkin
add_message_files(
FILES
CustomMessage.msg
)
generate_messages(
DEPENDENCIES
geometry_msgs
)
catkin_package(
CATKIN_DEPENDS roscpp_serialization message_runtime
)
include_directories(
${catkin_INCLUDE_DIRS}
)
add_executable(my_package src/MyProgramm.cpp)
target_link_libraries(my_package
${catkin_LIBRARIES}
) | {
"domain": "robotics.stackexchange",
"id": 23504,
"lm_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, custom-message, build, catkin",
"url": null
} |
all ; 02Rd; see e , [23,68]), and some different models have been introduced and discussed, numerical simulations have been provided and a comparison with the behavior of other special materials has been in order; for all that we just refer to, e TechnoMASTER Big omega (): (g(n)) = ff(n)jthere exist positive constants cand n 0 0 such that 0 cg(n) f(n) for all n n 0g { (g(n)) is set of functions whose growth g(n) { g(n) represents a lower bound on f(n)’s growth {best(g(n)) represents a lower limit for all inputs to f(n) 4 To continue getting our minds around asymptotic analysis, here are a few examples The advantages and dangers of ignoring constants were discussed near the beginning of this section For exam-ple: “This is an order n 2 algorithm” really means that the function describing the behavior of the algorithm is in Θ n 2 Arrange the following functions in ascending order according totheir asymptotic growth with respect to the o-notation and proveyour results with the help of the | {
"domain": "tavocrealestate.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754452025767,
"lm_q1q2_score": 0.8388118148409776,
"lm_q2_score": 0.8519528076067262,
"openwebmath_perplexity": 713.1614358094596,
"openwebmath_score": 0.5939570665359497,
"tags": null,
"url": "http://tavocrealestate.com/jfqbpg/asymptotic-order-of-growth.html"
} |
Thread: Real Zeros of a Function
1. Real Zeros of a Function
Well, I have searched all over the internet for a simple explanation for how to
"find all real zeros of the function: f(x) = 2x^3 + 4x^2 - 2x - 4"
but to no avail. I knew how to do this at some point, and I don't remember it being that hard, but I think my mind erased it. Help please?
2. $\begin{array}{rcl}
2x^3 + 4x^2 - 2x - 4 & = & 0 \\
2x^2 \left( {x + 2} \right) - 2\left( {x + 2} \right) & = & 0 \\
2\left( {x + 2} \right)\left( {x^2 - 1} \right) & = & 0 \\
\end{array}$
.
3. Hello, iGuess!
Find all real zeros of the function: . $f(x) \:= \:2x^3 + 4x^2 - 2x - 4$
The procedure is simple: .Solve $f(x) = 0$
The algebra may take some work . . .
We have: . $2x^3 + 4x^2 - 2x - 4 \:=\:0$
Divide by 2: . $x^3 + 2x^2 - x - 2\:=\:0$
Factor by "grouping": . $x^2(x + 2) - (x + 2) \:=\:0$
. . and we have: . $(x +2)(x^2 - 1)\:=\:0\quad\Rightarrow\quad (x + 2)(x - 1)(x + 1)\:=\:0$
Therefore: . $x \:=\:-2,\:1,\:-1$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211546419276,
"lm_q1q2_score": 0.8361704909770774,
"lm_q2_score": 0.8577681013541611,
"openwebmath_perplexity": 515.637245430757,
"openwebmath_score": 0.8454873561859131,
"tags": null,
"url": "http://mathhelpforum.com/algebra/15777-real-zeros-function.html"
} |
java, android
@Test(expected=IllegalArgumentException.class)
public void testIllegalSize() {
new Size(1, -2);
}
}
Matrix.java
public class Matrix<T> {
public interface OnEachHandler<T> {
void handle(Matrix<T> matrix, Position pos);
}
public static class Position {
public final int row;
public final int column;
public Position(int row, int column) {
if (row < 0 || column < 0) {
throw new IllegalArgumentException();
}
this.row = row;
this.column = column;
}
@Override
public boolean equals(Object obj) {
if ((obj == null) || !(obj instanceof Matrix.Position)) {
return false;
}
Matrix.Position other = (Matrix.Position) obj;
return (this.row == other.row) && (this.column == other.column);
}
}
public final int rows;
public final int columns;
private T[] values; | {
"domain": "codereview.stackexchange",
"id": 3940,
"lm_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, android",
"url": null
} |
algorithms, efficiency, knapsack-problems
1) How do you check a solution candidate in O(1) time? 2) Even the most naive algorithm may find a witness early and abort. 3) How do you make the jump from some abstract, unspecified combinatoric measure to runtime (in seconds)?
ad 1: O(1) time candidate check in the pseudo code example takes place in line 9:
if n = 0 and currentWeight >= maxWeight and currentValue > bestValue:
bestValue := currentValue
ad 2: It indeed may
... if you are lucky or at least not very unlucky. Nevertheless there is no guarantee.
ad 3: The "jump" to computation time in seconds takes into account the trustworthyness of the information that
the brute force method can solve the problem with 20 items in 1 second
... (on a specific machine) given in the exercise, reading "the problem" as a synonym for the 0-1 knapsack problem, which, at least as I read it, should include all problem instances, even the ones taking worst-case time. | {
"domain": "cs.stackexchange",
"id": 17787,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, efficiency, knapsack-problems",
"url": null
} |
algorithm, strings, graph, swift, trie
} else {
let newNode = Node(first, final: false)
newNode.children[rest[0]] = insert(rest, parent: newNode)
return newNode
}
}
}
mutating func insert(_ word: String) {
let new_subtree = insert(Array(word), parent: root)
root.children[new_subtree.char!] = new_subtree
}
}
class Node {
var char: Character?
var children: [Character:Node]
var contained: Bool
init() {
char = nil
children = [:]
contained = false
}
init(_ c: Character, final: Bool) {
children = [:]
contained = final
char = c
}
init(_ c: Character, final: Bool, kids: [Character:Node]) {
children = kids
contained = final
char = c
}
} | {
"domain": "codereview.stackexchange",
"id": 38559,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, strings, graph, swift, trie",
"url": null
} |
homework-and-exercises, lagrangian-formalism, differential-geometry, symmetry, effective-field-theory
Title: Shift Symmetry for Scalar Dirac-Born-Infeld (DBI) According to this paper:
Claudia de Rham and Andrew J. Tolley, "DBI and the Galileon reunited", JCAP 1005 (2010) 015, arXiv:1003.5917. | {
"domain": "physics.stackexchange",
"id": 70074,
"lm_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, lagrangian-formalism, differential-geometry, symmetry, effective-field-theory",
"url": null
} |
python, neural-network, deep-learning, keras, lstm
for i,j in request_list:
idx = clock.index(i)
request_full[idx] = j
import numpy as np
import pandas as pd
df = pd.DataFrame({'clock': clock, 'requests': request_full})
df.to_csv('test1.csv', sep = ',')
clock = df['clock'].values
clock = np.reshape(clock, (len(clock), 1))
requests = df['requests'].values
requests = np.reshape(requests, (len(requests), 1))
## Feature Scaling
from sklearn.preprocessing import MinMaxScaler
sc = MinMaxScaler(feature_range = (0, 1))
training_set_scaled = sc.fit_transform(clock)
X_train = []
y_train = []
for i in range(60, len(clock)):
X_train.append(training_set_scaled[i-60:i, 0])
y_train.append(requests[i, 0])
X_train, y_train = np.array(X_train), np.array(y_train)
X_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout
from keras import optimizers
import tensorflow as tf | {
"domain": "datascience.stackexchange",
"id": 4218,
"lm_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, deep-learning, keras, lstm",
"url": null
} |
astronomy
This answer puts forward a variable star, but clearly excludes supernovae as that would have resulted in much larger distances (more about that later). Rob questions the apparent five-digit accuracy in this answer. A bit of research reveals that the distance figure is derived from the central value in the measured parallax of 0.22 +/- 0.59 mas (milli-arcseconds). This means that we have no more than a 50% confidence that the distance is indeed 16 kly (kilo lightyear) or more.
We should not blindly accept a 50% confidence level. Rather, we should agree on a confidence level that is deemed sufficiently strict for the intended purpose of selecting the most distant star. Yet another ambiguity to resolve! | {
"domain": "physics.stackexchange",
"id": 24918,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy",
"url": null
} |
statistical-mechanics, partition-function
Title: Partition function is simply temperature if possible sub system energy is continuous? Partition function is $$Z=\sum_j\exp\left(-\frac{\epsilon_j}{kT}\right)$$ a sum over all possible energy levels $\epsilon_1,\epsilon_2, ..., \epsilon_M$. There must be a finite number of choices otherwise $Z$ does not converge.
If each individual subsystem can have a range of energy level, naturally I can rewrite this to integrals: $$Z=\int_0^\infty\exp\left(-\frac\epsilon{kT}\right)\mathrm d \epsilon = kT.$$ I can get this generalization from variation of entropy (as the normalization constant) as well. Does this mean that if the subsystem can have continuous range of non-negative energy, the partition function is simply that? Or am I missing something?
If each individual subsystem can have a range of energy level | {
"domain": "physics.stackexchange",
"id": 22941,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, partition-function",
"url": null
} |
Shell2[a_, b_, Color_, innerQ_, outerQ_] :=
{
EdgeForm[], FaceForm[Darker@Color], Specularity[White, 30],
If[innerQ,
GraphicsComplex[a pts, Polygon[polygons], Sequence @@ gc[[3 ;;]]],
Nothing
],
If[outerQ,
GraphicsComplex[b pts, Polygon[polygons], Sequence @@ gc[[3 ;;]]],
Nothing
]
}
Now let's actually create the geometries...
MyColors = <|
"Brown" -> RGBColor[0.76, 0.41, 0],
"Yellow" -> RGBColor[0.93, 1, 0.22],
"Orange" -> RGBColor[1, 0.75, 0],
"Green" -> RGBColor[0.4, 0.86, 0],
"Red" -> RGBColor[1, 0.45, 0.39],
"Blue" -> RGBColor[0.1, 0.78, 1]
|>;
Radius = {0.2, 0.35, 0.6, 0.85, 0.95, 1.05, 1.1};
S = ParallelTable[
i == 6],
{i, 1, 6}
]; // AbsoluteTiming // First
0.227411
... and plot them.
Graphics3D[S, Lighting -> "Neutral", Boxed -> False,
SphericalRegion -> True, ViewPoint -> {1, 1, 1}]
We can see that we cheat the beholder by plotting all but the last "shells":
Graphics3D[S[[1 ;; -2]], Lighting -> "Neutral", Boxed -> False,
SphericalRegion -> True] | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.950410972802222,
"lm_q1q2_score": 0.8059178603190166,
"lm_q2_score": 0.8479677564567912,
"openwebmath_perplexity": 5190.283634303612,
"openwebmath_score": 0.2002587914466858,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/175165/plotting-the-layers-of-earth?noredirect=1"
} |
c, reinventing-the-wheel
strcat(ptr_buf, data->fmt.flag.uppercase ? "INF" : "inf");
return e_print_str(data, buffer);
}
static int e_print_double(struct e_print_data *data, double value)
{
int chrs_printed = 0, tmp;
double fp_frac, fp_int;
assert(data != NULL);
fp_frac = modf(fabs(value), &fp_int);
/*
* Print integer part. I need to handle separately the case when integer
* is zero because "e_print_double_int" doesn't print a single zero.
*/
if (fp_int == 0) {
if ((tmp = e_emit_char(data, '0')) == E_PRINT_ERROR)
return E_PRINT_ERROR;
else
chrs_printed += tmp;
} else {
if ((tmp = e_print_double_int(data, fp_int)) == E_PRINT_ERROR)
return E_PRINT_ERROR;
else
chrs_printed += tmp;
} | {
"domain": "codereview.stackexchange",
"id": 37971,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, reinventing-the-wheel",
"url": null
} |
galaxy
For example, which Galaxy? - they vary quite a bit, and from what angle? 10,000 light years from the side or from the "top" for lack of a better word, above the brighter galactic core or 10,000 light years from the tip of a spiral arm?
Andromeda is 10 times brighter than the Milky way, and galaxies get a good deal larger than Andromeda and a good deal smaller than the Milky way.
But, the short answer to your question is, from 10,000 light years, a galaxy wouldn't appear that bright . . . er, mostly but it would appear quite large.
We can see the Milky way as kind of a white smudge across the southern hemisphere, but much of that bright smudge that we see is stars that are closer than 10,000 light years, so that's not really apples to apples, as much of that smudge is alot closer to us than your example. | {
"domain": "astronomy.stackexchange",
"id": 974,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "galaxy",
"url": null
} |
comparison, optimization, simulated-annealing, deterministic-annealing
Any clarification appreciated. After diving deeper into the material I am able to answer my own question:
Simulated Annealing tries to optimize a energy (cost) function by stochastically searching for minima at different temparatures via a Markov Chain Monte Carlo method. The stochasticity comes from the fact that we always accept a new state $c'$ with lower energy ($\Delta E < 0$), but a new state with higher energy ($\Delta E > 0$) only with a certain probability
$$p(c \to c') = \text{min}\{1, \exp(-\frac{\Delta E}{T}) \},$$
$$\Delta E = E(c') - E(c).$$ | {
"domain": "ai.stackexchange",
"id": 2176,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "comparison, optimization, simulated-annealing, deterministic-annealing",
"url": null
} |
$$\overrightarrow {-a}$$ , then $$\overrightarrow {a}$$ + ( $$\overrightarrow {-a}$$ ) = 0. and hopefully some intuition, on multiplying a scalar times a vector. As shown below, vector $$\vec{u}$$ is projected onto vector $$\vec{v}$$ by dropping a perpendicular from the terminal point of $$\vec{u}$$ to the line through $$\vec{v}$$. There are two common ways of multiplying vectors: the dot product and the cross product. A single number can represent each of these quantities, with appropriate units, which are called scalar quantities.There are, however, other physical quantities that have both magnitude and direction. Now suppose the value of k = $$\frac {1}{|a|}$$ given that the value of $$\overrightarrow {a} \ne 0$$ then by the property of scalar multiple of vectors we have $$\overrightarrow {ka}$$ = |k|$$\overrightarrow {a}$$ = $$\frac {1}{|a|}$$× |$$\overrightarrow {-a}$$| . So, for example, we could think about, what is three times w going to be? This can be expressed in the form: | {
"domain": "lockxx.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97997655637136,
"lm_q1q2_score": 0.8229195979769892,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 404.45264643885446,
"openwebmath_score": 0.8674150109291077,
"tags": null,
"url": "https://lockxx.com/vanilla-orchid-xbsvhg/ba4612-scalar-multiplication-of-vectors"
} |
condensed-matter, superfluidity
I will try to address the different parts of the question one-by-one. However, excellent references are available on the subject. I can recommend Basic superfluids by T. Guenault as a simple intro to superfluidity in general, while a more difficult read An introduction to the theory of superfluidity by I. M. Khalatnikov goes into the details of the two-fluid model and is a classic. | {
"domain": "physics.stackexchange",
"id": 21246,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, superfluidity",
"url": null
} |
classical-mechanics, lagrangian-formalism, hamiltonian-formalism
$$
H = E = -\frac{\partial S_{cl}}{\partial t_2}=\frac{\partial S_{cl}}{\partial t_1}\;,
$$
For example, in our simple free partial example
$$
\frac{\partial }{\partial t_1}\left(\frac{m}{2}\frac{(x_2 - x_1)^2}{t_2 - t_1}\right) = \frac{m}{2}\frac{(x_2 - x_1)^2}{(t_2 - t_1)^2} = \frac{1}{2}m\dot x_{cl}^2 = E_{free}
$$ | {
"domain": "physics.stackexchange",
"id": 96157,
"lm_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, lagrangian-formalism, hamiltonian-formalism",
"url": null
} |
You divide this number line into four regions: to the left of –2, from –2 to 0, from 0 to 2, and to the right of 2. linalg (or scipy. I read that it can be done by convolution of the image with a mask like: fx = conv2(im1, 0. With simple modules we can easily compute compute derivatives of single input functions, and partial derivatives / complete gradients of multi-input functions written in Python. py Download Jupyter notebook: lorenz_attractor. Ex: Find the Partial Derivative of a Function of Three Variables (Square Root) Ex: Estimate the Value of a Partial Derivative Using a Contour Map Ex: Application of First Order Partial Derivative (Change in Production) Second Order Partial Derivatives Ex: Find First and Second Order Partial Derivatives Ex: Determine Second Order Partial Derivatives. The partial derivative with respect to x is just the usual scalar derivative, simply treating any other variable in the equation as a constant. Islam‡, Roger B. Free: Licensed under BSD, SymPy is | {
"domain": "gipad.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964198826467,
"lm_q1q2_score": 0.823366040741739,
"lm_q2_score": 0.8354835432479661,
"openwebmath_perplexity": 675.6615702212589,
"openwebmath_score": 0.7235504984855652,
"tags": null,
"url": "http://gipad.it/lmgd/partial-derivative-python.html"
} |
dynamic-programming, tiling
(illustration copied from Codingame problem section).
I have come up with the following DP relation:
dp[i] = (dp[i-1] + (i >= 3 ? dp[i-3] : 0) + (i >= 6 ? dp[i-6] * 2 : 0))
dp[i-1] means at each state, you can add a 1x3 (illustration below) to previous state to get to the current state.
┌─┐
│ │
│ │
└─┘
dp[i-3] means if your width is at least 3, you can stack up three 3x1 vertically to 3 states ago (width - 3) to get to current state.
┌─────┐
├─────┤
├─────┤
└─────┘
dp[i-6] means when my width is greater than or equal to 6, I can add three 2x2 squares horizontally next to each other, then put two 3x1 rectangles on top of them to 6 states ago(width - 6), in two ways, to get to current state).
┌───┬───┬───┐ ┌─────┬─────┐
│ │ │ │ ├───┬─┴─┬───┤
├───┴─┬─┴───┤ │ │ │ │
└─────┴─────┘ └───┴───┴───┘ | {
"domain": "cs.stackexchange",
"id": 15822,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dynamic-programming, tiling",
"url": null
} |
navigation, rviz, ros-kinetic, gmapping, marker
You may assume that the position given by find_object is the center of an object so the cell would always have the value -1. You need to check all the neighbor cells of the cell you get from the object pose having the value -1 until you find a neighbor with the value 100. Once you get the list of all the cells at the object pose you can change their value to 50 :
0 0 0 0 0 0
0 0 50 50 0 0
0 50 50 50 50 0
0 50 50 50 50 0
0 0 50 50 0 0
0 0 0 0 0 0 | {
"domain": "robotics.stackexchange",
"id": 32537,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, rviz, ros-kinetic, gmapping, marker",
"url": null
} |
statistical-mechanics
Now, you could if you wanted describe your macrostate with more numbers. You could divide your box into regions and have a density of particles in each region and an average energy per particle in that region. And then you could ask which macrostates of that are equilibrium ones. And for that, it would not be equilibrium to have totally different densities and average energies in different parts of a box. And you could achieve that from a rare transition. But that is a different question (though it might address what you want to know). | {
"domain": "physics.stackexchange",
"id": 28247,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics",
"url": null
} |
experimental-physics, specific-reference, laser
If on the other hand, the cavity length (or laser frequency) fluctuates in the other direction, TEM00 will acquire a negative phase which means that constructive interference with TEM10 now happens on the right half of the detector and destructive interference on the left half. In this case the split photo diode will produce a negative output voltage. | {
"domain": "physics.stackexchange",
"id": 2625,
"lm_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, specific-reference, laser",
"url": null
} |
javascript, html, ecmascript-6, event-handling, d3.js
I was also told about the risk of using so many equal headers, as I use the <script src="https://d3js.org/d3.v4.js"></script> four times but how I need it for the 4 scripts, I don't know how I could place it only once unless I merge the 4 scripts into one.
<script src="https://d3js.org/d3.v4.js"></script>
This does not need to appear more than once, since the browser will only load it once. Just have it once and the browser will load it. It could be moved to the <head> tag instead of the <body>.
And all of the contents of the <script> tags - e.g. with id values auto-update-images, auto-update-csv, script-da-caixa-de-selecao-suspensa-1, etc. can be combined into a single element or moved to an external javascript file.
Abstracting common functionality
Loops can really help with repeated code - for example - these repeated lines in refresh_images: | {
"domain": "codereview.stackexchange",
"id": 41823,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, html, ecmascript-6, event-handling, d3.js",
"url": null
} |
ros
<build_depend>laser_geometry</build_depend>
<build_depend>map_server</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>pcl</build_depend>
<build_depend>pcl_ros</build_depend>
<build_depend>rosbag</build_depend>
<build_depend>rosconsole</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>visualization_msgs</build_depend>
<build_depend>voxel_grid</build_depend>
<build_depend>map_msgs</build_depend>
<build_depend>pcl</build_depend>
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>eigen</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>laser_geometry</run_depend>
<run_depend>map_server</run_depend>
<run_depend>nav_msgs</run_depend>
<run_depend>pcl</run_depend>
<run_depend>pcl_ros</run_depend>
<run_depend>rosbag</run_depend>
<run_depend>rosconsole</run_depend> | {
"domain": "robotics.stackexchange",
"id": 18691,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
c#, object-oriented, classes
if (Questions.Count > QuizLength)
{
Console.WriteLine("You have too many questions, please change your QuestionLength.");
}
QuizLength seems to be used for two things:
"Preventing" the addition of more questions
What is the purpose of QuizLength, if not to enforce the maximum amount of questions that you can add?
Yet you put no restriction on the actual questions that get added. You just print a message to the console but then add the question anyway. That's a lot of bark with no bite.
If you wish to cap the question limit, then don't add excess questions to the list:
if (Questions.Count < QuizLength)
{
Questions.Add(q);
}
else
{
Console.WriteLine("Question limit reached!");
}
Knowing how many questions to cycle over | {
"domain": "codereview.stackexchange",
"id": 39410,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, object-oriented, classes",
"url": null
} |
python, python-3.x, parsing, meta-programming
you can run it using: python kilogrammar.py some_input_grammar.txt -compile > output_parser.py
To test your new parser just python output_parser.py some_input.txt -color it should print a syntax tree.
or to watch the syntax tree being constructed: python output_parser.py some_input.txt -interactive -color
it also works for the parser generator itsel: python kilogrammar.py some_input_grammar.txt -interactive -color
Even thought it's a toy project and I had no idea of what I was making I would like to know your thoughts about the usability and quality of it, specially about the meta-grammar(?) used by it. Singletons
Color has been written as a singleton. That's fine I guess, but it doesn't need the class machinery. All you're effectively doing is making an inner scope. (You're also missing defaults.) You could get away with a submodule called color whose __init__.py consists of
RED: str = ''
YELLOW: str = ''
PINK: str = ''
CYAN: str = ''
GREEN: str = ''
RESET: str = '' | {
"domain": "codereview.stackexchange",
"id": 37840,
"lm_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, parsing, meta-programming",
"url": null
} |
php, drupal
} catch (\Exception $ex) {
\Drupal::logger('SearchesSaved Class')->error('dbIsHashUsed() Exception: ' . $ex->getMessage());
}
}
//there are a few like this one
private function dbGetSearchUserByEmail(string $email_address): ?array
{
try {
$query = $this->db->query("SELECT * FROM `lrg_savedSearchUsers` WHERE `email_address` = :email", [':email' => $email_address]); //consstancy
return $query->fetchAssoc();
} catch (\Exception $ex) {
\Drupal::logger('SearchesSaved Class')->error('dbGetSearchUserByEmail() Exception: ' . $ex->getMessage());
}
} | {
"domain": "codereview.stackexchange",
"id": 33849,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, drupal",
"url": null
} |
java, matrix
for (int i = 0; i < m1.length; i++) {
for (int j = 0; j < m1[0].length; j++) {
System.out.print(m1[i][j] + " ");
}
System.out.println();
}
System.out.println("-----------------------------------");
}
} In your top=level method mirrorPatch you have:
// for each row.
for (int i = 0; i < m.length; i++) {
// for each column
flipRow(m[i]);
}
This is unnecessarily verbose, using the iterable nature of arrays you could simply:
for (int[] row : m) {
flipRow(row);
} | {
"domain": "codereview.stackexchange",
"id": 5661,
"lm_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, matrix",
"url": null
} |
python, object-oriented, python-2.x, sudoku, tkinter
# Current row
if any(value == cell.value for cell in self.grid[row]):
return False
# Current column
if any(value == row[column].value for row in self.grid):
return False
# Current square
for row in self.grid[square_row:square_row+3]:
for cell in row[square_col:square_col+3]:
if value == cell.value:
return False
return True
class Cell(object):
"""81 cells in a 9x9 sudoku grid."""
def __init__(self, value, row, col):
self.row = row
self.col = col
self.value = value
self.solvable = value is None
if value is None:
self._possibilities = iter(range(1, 10))
else:
self._possibilities = iter([])
@property
def empty(self):
return self.value is None
@property
def text(self):
return ' ' if self.value is None else str(self.value) | {
"domain": "codereview.stackexchange",
"id": 24126,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented, python-2.x, sudoku, tkinter",
"url": null
} |
Check GMAT Club Decision Tracker for the Latest School Decision Releases https://gmatclub.com/AppTrack
It is currently 27 May 2017, 13:09
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# Math: Standard Deviation
Author Message
TAGS:
### Hide Tags
CEO
Joined: 17 Nov 2007
Posts: 3586
Concentration: Entrepreneurship, Other
Schools: Chicago (Booth) - Class of 2011
GMAT 1: 750 Q50 V40
Followers: 575
Kudos [?]: 3982 [37] , given: 360
### Show Tags | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815513471368,
"lm_q1q2_score": 0.8017107932690393,
"lm_q2_score": 0.8104789178257654,
"openwebmath_perplexity": 3099.969506845783,
"openwebmath_score": 0.6381580829620361,
"tags": null,
"url": "https://gmatclub.com/forum/math-standard-deviation-87905.html"
} |
cosmology, spacetime, universe
Title: Is my intuitive understanding of physical infinity correct? Quite possibly I got the section wrong again but the question is about cosmology. When they talk about an infinite Universe, they do not mean that in such a Universe there are two objects, the distance between which is ∞ parsec? This means that although any distance between any two objects is finite, there is always a finite distance between the other two objects, which is greater. That is, all distances are always finite, but the greatest distance does not exist. Is this intuitive understanding correct?
... all distances are always finite, but the greatest distance does not exist. Is this intuitive understanding correct? | {
"domain": "physics.stackexchange",
"id": 79165,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, spacetime, universe",
"url": null
} |
kinematics, relativity, acceleration
Here's a highly hypothetical example:
Say we either can project a gravity well in front of our vehicle, and/or project a gravity hill behind. In empty space, the effects of the gravity will be near-negligible by the time they reach any other object, however close to the vehicle they will be more significant. The end result would be the vehicle would move in the given direction, and nothing else around would really move at all.
An even cruder example would be to shine a bright torch out the back of your vehicle. Even though the photons have no mass, wouldn't the vehicle move forward? It appears to me the issue is understanding momentum conservation. | {
"domain": "physics.stackexchange",
"id": 7695,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, relativity, acceleration",
"url": null
} |
filters, sampling, dft, infinite-impulse-response, z-transform
where I've used the fact that the sum over $m$ is the convolution of $h[n]$ with $\delta[n-lN]$, and consequently equals $h[n-lN]$.
Eq. $(5)$ establishes the result that the IDFT of an equidistantly sampled discrete-time Fourier transform (DTFT) equals an aliased version of the sequence corresponding to the given DTFT. | {
"domain": "dsp.stackexchange",
"id": 3534,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, sampling, dft, infinite-impulse-response, z-transform",
"url": null
} |
newtonian-mechanics, everyday-life, rotational-dynamics, conservation-laws, gyroscopes
Also, as other answers have mentioned, if the car can interact with the air in any meaningful fashion - either by its air intake and exhaust, or by using its bulge as a sail, or by propping up an actual sail - then it will indeed be susceptible to external forces and it will be able to change its direction of motion. Similarly, the car would be able to steer if it could chuck rocks, bump off of other cars, or use rocket thrusters. I don't think this directly answers the core of the question, though. | {
"domain": "physics.stackexchange",
"id": 17870,
"lm_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, everyday-life, rotational-dynamics, conservation-laws, gyroscopes",
"url": null
} |
newtonian-mechanics, terminology
Title: What are the properties of an 'ideal' pendulum? This question mentions a phrase ideal pendulum.
What are the properties of an ideal pendulum(if there is any such term)?
Internet search tells me that there are two types of pendulum:Simple and compound. An ideal pendulum, as in the question you refer to, is one without friction, air resistance, a point-mass bob - i.e. the bob is not a real massive object but just a point, etc. It's defined that way to make the maths simpler. Real, actual pendulums only behave in approximately the same way.
The ideal pendulum can, however, have any length or bob-weight, so it does not have any special proportions. | {
"domain": "physics.stackexchange",
"id": 34430,
"lm_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, terminology",
"url": null
} |
For one, this does not account for the possible variations of order.
Here's a short way to compute this: Let $\Omega$ denote the set of all passwords, $U$ denote the set of passwords that include no uppercase letter, and $N$ the set of passwords that include no digit. Then, the set of passwords that include an uppercase letter and a number is $$\Omega - (N \cup C),$$ so the number of passwords satisfying the criteria is $$|\Omega - (N \cup C)| = |\Omega| - |N \cup C| .$$ Now, use the Inclusion-Exclusion principle to evaluate $|N \cup C|$.
You have worked out the number of passwords that have, say, the first characters an uppercase letter and the second character a number. This does not allow for cases where, say, our first two spaces are lowercase characters and/or special characters and our uppercase letter and number fill the last two spaces of the password. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978712643239288,
"lm_q1q2_score": 0.8757417525282729,
"lm_q2_score": 0.894789454880027,
"openwebmath_perplexity": 365.107649185972,
"openwebmath_score": 0.710651695728302,
"tags": null,
"url": "https://math.stackexchange.com/questions/2209916/how-many-possible-passwords-of-a-four-digit-length-contain-at-least-one-uppercas"
} |
javascript, ecmascript-6, vue.js
Questions: | {
"domain": "codereview.stackexchange",
"id": 42647,
"lm_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, ecmascript-6, vue.js",
"url": null
} |
The argument of the integral is perfectly well-behaved at $t=0$, so $$\begin{eqnarray*} S(x) &=& \lim_{\e\to 0} \int_\e^x dt\, \frac{e^t-1}{t} \\ &=& \lim_{\e\to 0} \left( \int_\e^x dt\, \frac{e^t}{t} - \int_\e^x dt\,\frac{1}{t} \right) \\ &=& \lim_{\e\to 0} \left( \pv \int_{-\infty}^x dt\,\frac{e^t}{t} - \pv \int_{-\infty}^\e dt\,\frac{e^t}{t} -\log x + \log \e \right) \\ &=& \lim_{\e\to 0} \left( \mathrm{Ei}(x) - \mathrm{Ei}(\e) - \log x + \log \e \right) \\ &=& \lim_{\e\to 0} \left( \mathrm{Ei}(x) - (\g + \log \e) - \log x + \log \e \right) \\ &=& \mathrm{Ei}(x) - \g - \log x. \end{eqnarray*}$$ (See below for a derivation of $\mathrm{Ei}(\e) = \g + \log \e + O(\e)$.) Therefore, $$\sum_{k=1}^\infty \frac{x^k}{k k!} = \mathrm{Ei}(x) - \g - \log x$$ and so $$\sum_{k=1}^\infty \frac{1}{k k!} = \mathrm{Ei}(1) - \g.$$
Some details | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9930961617244483,
"lm_q1q2_score": 0.8072554088336871,
"lm_q2_score": 0.8128673133042217,
"openwebmath_perplexity": 189.16572187622577,
"openwebmath_score": 0.9808720946311951,
"tags": null,
"url": "http://math.stackexchange.com/questions/152626/an-interesting-sum-to-infinity"
} |
the present form fits the type system better, since each bound is of the same type as a. g <- c(3, 1, TRUE, 2+3i) s <- c(4,1,FALSE, 2+3i) print (g & s). The transpose of a matrix is a new matrix that is obtained by exchanging the rows and columns. Multiply this matrix by the 3x3 matrix with the supplied elements expanded to a 4x4 matrix with all other matrix elements set to identity. This makes it much easier to compute the desired derivatives. Three-Dimensional Rotation Matrices 1. If V is a vector space and W is a subset of V that is a vector space, then W is a subspace of V. The constructor takes three arguments - the number of rows, the number of columns and an initial type value to populate the matrix with. vectors are just the elements of F. Note that in this example elements of Rn are thought of as the column vectors ( n×1 matrices). This video demystifies the different ways R performs vector arithmetic (e. A Vector in R is an ordered collection of elements. Return TRUE or | {
"domain": "salernoeventicultura.it",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9425067211996142,
"lm_q1q2_score": 0.8171870214192981,
"lm_q2_score": 0.8670357494949105,
"openwebmath_perplexity": 606.5306261851379,
"openwebmath_score": 0.6701095700263977,
"tags": null,
"url": "http://salernoeventicultura.it/cysr/multiply-each-element-of-vector-in-r.html"
} |
python
some_string = "b"
switch(some_string,
b="print('It is b!')",
a="print('It is a!')")
some_string = "c"
switch(some_string,
b="print('It is b!')",
a="print('It is a!')")
Can this be optimized/made more pythonic? While it works for small strings in CPython, "foobar" is "foobar" is not guaranteed to be true. "foobar" == "foobar", however is. This is due to the fact that is compares memory addresses, while == compares content.
Also, for iterating simultaneously over the keys and values of a dictionary dict.items() (dict.iteritems() in Python 2.x) is recommended.
With these two changes your code would become:
def switch(variable, **cases):
for case, val in cases.items():
if variable == case:
exec(val) | {
"domain": "codereview.stackexchange",
"id": 23391,
"lm_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",
"url": null
} |
programming-languages, type-theory, types-and-programming-languages, polymorphisms
Q2
What is the purpose of erasing a type application to a term-application by adding dummyv?
The erasure introduces a term-abstraction into a type-abstraction:
eraseᵥ(λX. t₂) = λ_. eraseᵥ(t₂)
So the erasure needs a term-application instead of a type-application. An argument of the term-application can be any untyped value because it will be discarded, so for example unit.
Q3
What is the evaluation rule for an application when the argument is unit? (I can't find it in the section for type Unit.)
The unit value unit is a value. Therefore we can use (E-APPABS) for an application.
(λx:T₁₁. t₁₂) v₂ ⟶ [x ↦ v₂] t₁₂ (E-APPABS) | {
"domain": "cs.stackexchange",
"id": 14565,
"lm_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, type-theory, types-and-programming-languages, polymorphisms",
"url": null
} |
quantum-field-theory, spin-statistics
We're getting $\xi_{\alpha_{1}...,\alpha_{j},\dot{\beta}_1...\dot{\beta}_k} \longrightarrow \sum\limits_{(\rho)(\dot{\sigma})}-1_1\times...-1_j \xi_{\rho_{1}...,\rho_{j},\dot{\sigma}_1...\dot{\sigma}_k}$ or
$$\xi_{\alpha_{1}...,\alpha_{j},\dot{\beta}_1...\dot{\beta}_k} \longrightarrow \sum\limits_{(\rho)(\dot{\sigma})}(-1)^j \xi_{\rho_{1}...,\rho_{j},\dot{\sigma}_1...\dot{\sigma}_k}
$$
At this point there is a difference in notation, with Streater and Wightman using $\frac{j_{integer}}{2}$ to label their representations, and Weinberg and Novozhilov using $j$ either whole or half integer. Since these are functionally equivalent, then $\mathfrak{D}^{(\frac{j}{2},0)}(-1)_{Streater}\equiv D^{j}(-1)_{Weinberg}\equiv (-1)^{2j}$.
And finally, this leads us to the result:
$$
\begin{align*} | {
"domain": "physics.stackexchange",
"id": 67549,
"lm_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, spin-statistics",
"url": null
} |
• Note that $\frac{2n}{2^{n}} = \frac{d}{dt} t^n |_{t=1/2}$ so you might be able to use power series since we have $\frac{2n-1}{2^n}=\frac{2n}{2^{n}} -\frac{1}{2^n}$. – Surb Apr 11 '18 at 11:36
• @Surb I need to calculate it without derivatives – amplifier Apr 11 '18 at 11:40
• Then you should clearly state it in your post. – Surb Apr 11 '18 at 11:41
• @Surb changed the post – amplifier Apr 11 '18 at 11:43
• – lab bhattacharjee Apr 11 '18 at 11:46
Let's assume that the limit exists. If we call the limit $s$ then
$s = \sum_1^{\infty}\frac{2n-1}{2^n}$
$\Rightarrow 2s = 1 + \sum_1^{\infty}\frac{2n+1}{2^n} = 1 + \sum_1^{\infty}\frac{2n-1}{2^n} + \sum_1^{\infty}\frac{2}{2^n}$
$\Rightarrow 2s = 1 + s + \sum_0^{\infty}\frac{1}{2^n}$
$\Rightarrow 2s = 1 + s + 2$
$\Rightarrow s=3$
So if the limit exists then it must be 3.
Now you just have to prove that the limit exists i.e. the series converges. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668662546613,
"lm_q1q2_score": 0.8133272949507764,
"lm_q2_score": 0.8289388104343892,
"openwebmath_perplexity": 251.00296641903745,
"openwebmath_score": 0.9874009490013123,
"tags": null,
"url": "https://math.stackexchange.com/questions/2732288/find-the-limit-of-sequence-frac12-frac322-frac523-cdots/2732317"
} |
software-recommendation, format-conversion, gff3, gtf
The gff3 file was created as output of GMAP, and contains the transcripts as found by alignment to the reference (specifying option -f gff3_match_cdna).
[Edit: what I found out a poteriori, is that this format is not a standard gff3, thus the conversion is not trivial...]
Here is the beginning of the gff3 file I tried to convert:
$ head r9_gmap_match-cdna.gff
##gff-version 3
# Generated by GMAP version 2017-04-24 using call: /home/aechchik/software/gmap-2017-04-24/bin/gmap.sse42 -d gmapidx -D /scratch/beegfs/monthly/aechchik/isoforms/ref/chromosomes/ -f gff3_match_cdna -n 0 -t 20 r9_2d.fasta
2L gmapidx cDNA_match 18442664 18443024 79 - . ID=ae6a7818-85b5-4739-8031-e58f4462ad41_Basecall_2D_2d.path1;Name=ae6a7818-85b5-4739-8031-e58f4462ad41_Basecall_2D_2d;Target=ae6a7818-85b5-4739-8031-e58f4462ad41_Basecall_2D_2d 141 489;Gap=M13 I10 M8 D3 M8 D3 M32 D1 M4 D2 M5 D3 M34 I3 M6 D1 M7 D1 M5 D1 M30 D2 M16 I1 M8 D3 M10 D1 M5 D1 M6 I1 M8 I1 M8 D1 M33 D3 M33 I1 M28 D3 M25 | {
"domain": "bioinformatics.stackexchange",
"id": 1892,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "software-recommendation, format-conversion, gff3, gtf",
"url": null
} |
entanglement, quantum-operation, clifford-group, stim, randomised-benchmarking
def with_canonical_global_phase(u: np.ndarray) -> np.ndarray:
f = u.flat
best_index = 0
best_val = abs(f[0])
for i in range(1, len(f)):
v = abs(f[i])
if v > best_val * 2:
best_index = i
best_val = v
v = f[best_index]
assert v != 0
v /= abs(v)
return u * (np.conj(v) / abs(v))
Testing that it works:
sqrt_y = tableau_to_unitary(stim.Tableau.from_conjugated_generators(
xs=[
stim.PauliString("-Z"),
],
zs=[
stim.PauliString("X"),
],
), canonical_global_phase=True, endian='big')
np.testing.assert_allclose(
sqrt_y,
np.array([
[1, -1],
[1, 1],
]) / np.sqrt(2),
atol=1e-6,
) | {
"domain": "quantumcomputing.stackexchange",
"id": 3931,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "entanglement, quantum-operation, clifford-group, stim, randomised-benchmarking",
"url": null
} |
cnn, loss-function, image-segmentation, semantic-segmentation
Epoch 33/50
698/698 [==============================] - 113s 161ms/step - loss: 0.0033 - accuracy: 0.9986 - val_loss: 0.0037 - val_accuracy: 0.9985
Epoch 34/50
698/698 [==============================] - 113s 161ms/step - loss: 0.0032 - accuracy: 0.9987 - val_loss: 0.0038 - val_accuracy: 0.9985
Epoch 35/50
698/698 [==============================] - 112s 161ms/step - loss: 0.0030 - accuracy: 0.9987 - val_loss: 0.0039 - val_accuracy: 0.9985
Epoch 36/50
698/698 [==============================] - 112s 161ms/step - loss: 0.0074 - accuracy: 0.9971 - val_loss: 0.0046 - val_accuracy: 0.9982
Epoch 37/50
698/698 [==============================] - 113s 162ms/step - loss: 0.0031 - accuracy: 0.9987 - val_loss: 0.0033 - val_accuracy: 0.9987
Epoch 38/50
698/698 [==============================] - 113s 162ms/step - loss: 0.0027 - accuracy: 0.9989 - val_loss: 0.0032 - val_accuracy: 0.9987
Epoch 39/50 | {
"domain": "datascience.stackexchange",
"id": 8095,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cnn, loss-function, image-segmentation, semantic-segmentation",
"url": null
} |
c++, c++11, pointers, smart-pointers
int main()
{
Foo *foo = new Foo;
ObserverPtr<Foo> ptrToFoo(*foo);
std::cout << (ptrToFoo.expired() ? "expired!" : ptrToFoo->hello()) << "\n";
delete foo;
std::cout << (ptrToFoo.expired() ? "expired!" : ptrToFoo->hello()) << "\n";
return 0;
}
//output:
//hello world
//expired!
The ObserverPtr implementation should work for all classes derived from ObserverPtr</*derived class name*/>::Observable, independently of allocation type (stack, heap, gobal) or any type qualifiers (const, volatile). Multithreading support is not required at this stage. | {
"domain": "codereview.stackexchange",
"id": 6700,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, pointers, smart-pointers",
"url": null
} |
neural-network, deep-learning, reinforcement-learning, dqn
It is also possible that using a more direct representation would help, depending on the true nature of the value function. In which case you could use it, provided you model the neural network for $\hat{q}(s,a,\theta)$ with action vector concatenated to state vector in the input, and a single output of the estimated action value for that specific combination. To assess which action to take, you would create a minibatch of 16 inputs, all of which have the same state component, and cover the 16 possible input variations. Then you would pick the combination with the highest estimate and look at the action part of the input vector to discover which action was estimated to be best.
If you are not sure which approach would suit the problem best, you could try both. | {
"domain": "datascience.stackexchange",
"id": 7547,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-network, deep-learning, reinforcement-learning, dqn",
"url": null
} |
javascript, xml
break
}else{
reserve.expectend--
}
}else if(tree[reserve.i].type==="End"){
reserve.expectend++
}
}
reserve.expectend=null;
if(reserve.textf===reserve.parentitem.name){
tree.push({
type:"End"
});
reserve.path++;
expect.tag=false
}
reserve.parentitem=null
}
}else{
/*
** ATTRIBUTE DETECTED **
** NAME FORWARD **
*/
reserve.length=reserve.textf.length; | {
"domain": "codereview.stackexchange",
"id": 19040,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, xml",
"url": null
} |
quantum-mechanics, angular-momentum, hydrogen, spherical-harmonics
Title: State with non-zero angular momentum - cannot be described by spherical harmonic? For a state with non-zero angular momentum, why is it that it cannot be described by the spherically symmetric spherical harmonic? This is because each spherically invariant state $\psi$ must have zero angular momentum.
Indeed, by hypotheses, the state $\psi$ verifies
$$\psi(R_{\vec n}(\theta)\vec{x} ) = (e^{i \theta \vec{n}\cdot \vec{\hat{J}}} \psi)(\vec{x}) = \psi(\vec{x})\tag{1}$$
where $\vec{n}\cdot \vec{\hat{J}}$ is the self-adjoint generator of rotations $R_{\vec n}(\theta)$ around $\vec{n}$, i.e. it is the angular momentum along $\vec{n}$.
Taking the $\theta$ derivative of (1) for $\theta=0$ we have
$$\vec{n}\cdot \vec{\hat{J}} \psi =0$$
in particular, for $k=x,y,z$,
$$\hat{J}_k \psi=0\:,$$
so that $$\hat{J}^2 \psi = \hat{J}^2_x\psi + \hat{J}^2\psi + \hat{J}_z^2=0\:.$$ | {
"domain": "physics.stackexchange",
"id": 14013,
"lm_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, angular-momentum, hydrogen, spherical-harmonics",
"url": null
} |
{10}^3\right)\left(\frac{1482+4.95}{1482+0}\right)=22073.4\,{\rm Hz} = 22.073\,{\rm kHz}$ In second case, the reflected frequency from whale (in first case) is source and the sonar is receiver (object). Thus the frequency that the sonar received is $f_s=f_w\frac{v+u_s}{v+u_w}=22.073\ \left(\frac{1482}{1482-4.95}\right)=22.17\times {10}^3\ {\rm Hz}$ $\Delta f=22.17-22.073=0.097{\rm kHz}$ In a large tank, two tiny underwater speakers of radius r=1.1\times {10}^{-3}\,{\rm m} are placed next to each other. The speakers vibrate at 1.2\, {\rm kHz} with the same amplitude (they are like vibrating beats). A microphone at the bottom of the tank records the superposition of sound from the two speakers. The mass of the each speakers is 0.015\,{\rm g} . the adiabatic bulk modulus of water is B=2.2\times {10}^9\, {\rm N/m^2} a) What is the velocity of sound in the water? b) What is the wavelength of the sound in the water? c) One of the speakers is dropped and glides towards the bottom of the tank | {
"domain": "physexams.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985718063977109,
"lm_q1q2_score": 0.823551218716196,
"lm_q2_score": 0.8354835411997897,
"openwebmath_perplexity": 713.3236706657972,
"openwebmath_score": 0.9460955262184143,
"tags": null,
"url": "https://physexams.com/exam/Waves_4"
} |
-
WOW! That was not as difficult as I thought, but still cool. Thanks! So how do we proceed to prove the first statement (which intuitively seems obvious)? – Bernard Sep 12 '12 at 2:59
The other direction is called (mini)-Sard's Theorem. Page 205 in Appendix 1 of Guilleman and Pollack, Differential Topology. The mini version is just this: Let $U$ be an open set of $\mathbb R^n,$ and let $f:U \rightarrow \mathbb R^m$ be a smooth map. Then, if $m > n,$ we can conclude that $f(U)$ has measure zero in $\mathbb R^m.$
The full Sard's Theorem is about critical points, while we make no demands about the relative dimensions. Let $f:X \rightarrow Y$ be a smooth map of manifolds, and let $C$ be the set of critical points of $f$ in $X.$ Then $f(C)$ has measure zero in $Y.$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9883127426927789,
"lm_q1q2_score": 0.8319870201872553,
"lm_q2_score": 0.8418256532040708,
"openwebmath_perplexity": 223.0858951161423,
"openwebmath_score": 0.9661476612091064,
"tags": null,
"url": "http://math.stackexchange.com/questions/194472/a-curve-whose-image-has-positive-measure"
} |
javascript
}
document.documentElement.style.setProperty("--rowNum", size);
document.documentElement.style.setProperty("--colNum", size);
}
function pencilGrid(size){
let totalSquares = size * size;
for (let i = 0; i < totalSquares; i++){
const newSquare = document.createElement('div');
newSquare.classList.add('newSquare');
gridContainer.appendChild(newSquare);
newSquare.addEventListener('mouseover', function(e){
newSquare.style.backgroundColor = 'black';
newSquare.style.opacity -= '-0.1';
});
}
document.documentElement.style.setProperty("--rowNum", size);
document.documentElement.style.setProperty("--colNum", size);
} | {
"domain": "codereview.stackexchange",
"id": 33236,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript",
"url": null
} |
beginner, game, tic-tac-toe, rust
fn display_help(&self) {
print!(
"\
Supported commands: \n\
\n\
- exit: quit the session \n\
\n\
- help: display help screen \n\
\n\
- quit: quit the session \n\
\n\
- reset: reset scores \n\
\n\
- scoreboard: display scores \n\ | {
"domain": "codereview.stackexchange",
"id": 38185,
"lm_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, game, tic-tac-toe, rust",
"url": null
} |
python, strings, parsing
So is it the better code?
It depends on your viewpoint. If performance is of concern, you should go for greybeard's answer as it is around 30% faster than your original code.
If readability is of concern, I would take the regex version any day of the week. While many may consider regexes black magic, it is widely applicable to many problems in most if not all popular languages. Most crucially perhaps, the regex solution doesn't require a complex algorithm, which means it's easier to develop and less error-prone.
Again, in terms of readability, it's about the familiarity of the programmer. If you are unfamiliar with regexes, list comprehensions and/or list slicing, your original version is the option to go for.
In the end, there is no one implementation that wins across all categories. You should familiarize yourself with the different ways to approach the problem and then tackle it in a way you deem the best solution. | {
"domain": "codereview.stackexchange",
"id": 40787,
"lm_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, strings, parsing",
"url": null
} |
r, software-development
Title: Software Testing for Data Science in R I often use Nose, Tox or Unittest when testing my python code, specially when it has to be integrated with other modules or other pieces of code. However, now that I've found myself using R more than python for ML modelling and development. I realized that I don't really test my R code (And more importantly I really don't know how to do it well). So my question is, what are good packages that allow you to test R code in a similar manner as Nose, Tox or Unittest do in Python. Additional references such as tutorials will be greatly appreciated as well.
Bonus points for packages in R similar to
Hypothesis
or
Feature Forge
Related Talk:
Trey Causey: Testing for Data Scientists Packages for unit testing and assertive testing that are actively maintained:
Packages for unit testing
testthat: more information on how to use you can find here or on github
Runit: Cran page
Packages for assertions: | {
"domain": "datascience.stackexchange",
"id": 606,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "r, software-development",
"url": null
} |
# Health Risk Probability
Question: An actuary is studying the prevalence of three health risk factors, denoted by A, B, and C, within a population of women. For each of the three factors, the probability is 0.1 that a woman in the population only has this risk factor (and no others). For any two of three factors, the probability is 0.12 that she has exactly two of these risk factors (but not the other). The probability that a woman has all three risk factors given that she has A and B, is (1/3). What is the probability that a woman has none of the three risk factors, given that she does not have risk factor A? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.966914020657881,
"lm_q1q2_score": 0.8400807832574381,
"lm_q2_score": 0.8688267677469952,
"openwebmath_perplexity": 166.2449376641693,
"openwebmath_score": 0.9964821338653564,
"tags": null,
"url": "https://math.stackexchange.com/questions/1075215/health-risk-probability"
} |
quantum-state, textbook-and-exercises
Title: Describe |00> and |10> in terms of |0> and |1> I came across following lines:
$|00\rangle$ : both quibts are in state of $|0\rangle$
since $|00\rangle = [1 0 0 0]$ in column vector and $|0\rangle = [1 0]$ in column vector, so if each single qubit is $[1 0]$ then how multi-qubit state $|00\rangle = [1 0 0 0]$ ?
Is it like each single qubit have 100% probability of being in first state basis so in multi-qubit system they have 100% probability of being in first state basis? | {
"domain": "quantumcomputing.stackexchange",
"id": 3786,
"lm_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-state, textbook-and-exercises",
"url": null
} |
A slightly 'expanded-upon' version of user67418's answer:
The circle here represents the parametric curve $(x=\cos\theta, y=\sin\theta)$, and the line is the line $x+y=1$, so their points of intersection are the points where $\cos\theta+\sin\theta=1$; at least for me, this is the clearest way of seeing that there are only the two solutions already mentioned.
-
Wonderful method. – Thomas Mar 30 '13 at 1:43
I'd write $\sin \theta + \cos \theta = \sqrt{2} \sin \left(\theta + \dfrac{\pi}{4}\right)$ and go from there.
A similar tactic works for all equations of the form $a \sin \theta + b \cos \theta = c$ for constant $a,b,c$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426450627306,
"lm_q1q2_score": 0.8008472775573429,
"lm_q2_score": 0.8221891327004132,
"openwebmath_perplexity": 315.08913720025066,
"openwebmath_score": 0.9973889589309692,
"tags": null,
"url": "http://math.stackexchange.com/questions/346081/solving-sin-theta-cos-theta-1-in-the-interval-0-circ-leq-theta-leq-36"
} |
php, object-oriented, authentication
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
If you want to make login:
E-mail: warlock@mail.com
Pass: Rptw36VWBU%7DF
composer.json
{
"autoload":
{
"psr-4":
{
"Login\\" : "src/"
}
}
}
Questions
Is my code clean?
Am I following the sole responsibility principle that a class should only do one thing?
Regarding naming, do you think I'm naming things correctly?
What do you suggest for me to become a better developer? | {
"domain": "codereview.stackexchange",
"id": 42379,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented, authentication",
"url": null
} |
3. I'm not sure. I found this thread from back in the day which is a similar question...
http://www.mathhelpforum.com/math-he...mutations.html
4. Hello, mathceleb!
We have a group of 150 people, broken into groups of 3, and only 3 are blue.
What is the probability that all 3 blue people are put in the same group?
The 150 people are divided into 50 groups of 3 people each.
There are: . $\dfrac{150!}{(3!)^{50}}$ possible groupings.
To have the 3 blue people in one group, there is: . ${3\choose3} = 1$ way.
The other 147 people are divided into 49 groups of 3: . $\dfrac{147!}{(3!)^{49}}$ ways.
. . Hence, there are: . $\dfrac{147!}{(3!)^{49}}$ ways to have the 3 blue people in one group.
The probability that all 3 blue people are in one group is:
. . $\dfrac{\dfrac{147!}{(3!)^{49}}} {\dfrac{150!}{(3!)^{50}}} \;=\;\dfrac{147!}{(3!)^{49}}\cdot\dfrac{(3!)^{50}} {150!} \;=\;\dfrac{6}{150\cdot149\cdot148} \;=\;\dfrac{1}{551,\!300}$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877002595527,
"lm_q1q2_score": 0.8774868323280683,
"lm_q2_score": 0.8933093961129794,
"openwebmath_perplexity": 678.5368138734311,
"openwebmath_score": 0.8849186897277832,
"tags": null,
"url": "http://mathhelpforum.com/discrete-math/150015-group-combinations-problem.html"
} |
# Red, blue and yellow points
In the plane, there are $r+b+y=15$ points, of which $r\ge2$ points are colored red, $b\ge2$ points are colored blue, and $y\ge2$ points are colored yellow.
• If we consider all pairs of red and blue points and add up their distances then the sum is $51$.
• If we consider all pairs of red and yellow points and add up their distances then the sum is $39$.
• If we consider all pairs of yellow and blue points and add up their distances then the sum is $1$.
Determine all possible values for $r$ and $b$ and $y$.
• "all pairs of red and blue points" - does this include red-red, blue-blue and red-blue, or only red-blue? Apr 9 '16 at 16:48
• @astralfenix: "all pairs of red and blue points" only includes red-blue (but not red-red and blue-blue). Apr 9 '16 at 17:00
• Are the points allowed to coincide? Apr 9 '16 at 17:07
$r = 8$
$b = 4$
$y = 3$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575116884778,
"lm_q1q2_score": 0.8010128083906934,
"lm_q2_score": 0.8152324915965392,
"openwebmath_perplexity": 455.0723516940438,
"openwebmath_score": 0.7615922689437866,
"tags": null,
"url": "https://puzzling.stackexchange.com/questions/30717/red-blue-and-yellow-points/30730"
} |
and compressions—to the parent function … Parent Functions And Transformations Parent Functions: When you hear the term parent function, you may be inclined to think of… Random Posts 4 Ways to Help a College Student Prepare for the First Semester It’s also true that f(1) = g(4). Each point on the parent function gets moved to the right by three units; hence, three is the horizontal shift for g(x). The parent functions are a base of functions you should be able to recognize the graph of given the function and the other way around. Linear Parent Function Characteristics In algebra, a linear equation is one that contains two variables and can be plotted on a graph as a straight line. These can be achieved by first starting with the parent absolute value function, then shifting the graph according to function transformations, flip graph if necessary and even may have to compress or decompress the graph. What is a Parent Function? Graphs help us understand different aspects of the function, | {
"domain": "kailashpinjani.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513885634199,
"lm_q1q2_score": 0.8152629815593823,
"lm_q2_score": 0.826711791935942,
"openwebmath_perplexity": 754.9330834409224,
"openwebmath_score": 0.5024415254592896,
"tags": null,
"url": "https://kailashpinjani.com/x6ccyd/4501e3-how-to-graph-parent-functions"
} |
ros, ros-kinetic, tutorials, rosmsg
Title: CMake Error in rosmsg tutorial
I am in the tutorial at CreateMsgAndSrv and got stuck at chapter 3.
Running the command
$ rosmsg show beginner_tutorials/Num
got me the following
Unable to load msg [beginner_tutorials/Num]: Cannot locate message [unint8] in package [beginner_tutorials] with paths [['/home/aha/catkin_ws/src/beginner_tutorials/msg', '/home/aha/catkin_ws/devel/share/beginner_tutorials/msg']]
and searching the web for a solution I stumbled upon a thread where someone had somewhat the same problem and said that he made a
catkin_make install | {
"domain": "robotics.stackexchange",
"id": 30189,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic, tutorials, rosmsg",
"url": null
} |
and the series converges absolutely and thus converges.
• Oh sure, the absolute value is what's been missing. – Shemafied Nov 25 '14 at 14:10
• And if $n = 3,$ or and multiple of $3$, we have $\cos 2\pi = 1$. I think you want to bound the numerator to get your result. The $n$th root will still evaluate to $1$, but as written, the first equality is incorrect. – Namaste Nov 25 '14 at 14:11
• @amWhy I guess that's what the absolute value brackets are for :) – Shemafied Nov 25 '14 at 14:14
• @amWhy is right, and if I were applying the original test, I should be taking the lim sup of that...and the outcome is the same, of course. Thanks. – Timbuc Nov 25 '14 at 14:16
• Absolute value signs here were assumed to make the \cos always evaluate to positive $1/2$, which is incorrect. Of course, the absolute value sign restricts $1/2 \leq |\cos(2n\pi/3)|\leq 1$. You're welcome Timbuc! – Namaste Nov 25 '14 at 14:17
Hint
Use the comparison with geometric series | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.959762057376384,
"lm_q1q2_score": 0.8176719794162182,
"lm_q2_score": 0.8519528076067262,
"openwebmath_perplexity": 411.68409114103974,
"openwebmath_score": 0.8938830494880676,
"tags": null,
"url": "https://math.stackexchange.com/questions/1038197/show-that-the-series-sum-frac-sin-left-frac-left-3-4n-right-pi-6-ri"
} |
homework-and-exercises, electrostatics, charge, equilibrium
Charges q each are on the vertices, and Q is at the point O originally. As long as it stays at this point, the net force on it is zero, since forces due to the four vertices cancel out. We have to see what happens if it gets displaced along one of the sides, say towards A. Say, it got displaced infinitesimally, by a small amount $\delta r$ towards A. This $\delta r$ subtends an angle $\theta$ at the vertices B and D, such that
$$\tan \theta = \frac{\delta r}{(l/\sqrt{2})} = \frac{\sqrt{2}\delta r}{l}$$
For convenience, let us adopt "natural units" here, so that Q = q = 1, and $\frac{1}{4 \pi \epsilon_0} = 1$. (This is just for convenience, if you don't like this system of units, simply multiply each of the following terms by the factor $\frac{Qq}{4 \pi \epsilon_0}$. Since this part is common for all all four, it doesn't matter - you can even multiply the final answer by this factor directly.)
Electrostatic force is $\propto \frac{1}{r^2}$ is all we need for this. | {
"domain": "physics.stackexchange",
"id": 21015,
"lm_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, charge, equilibrium",
"url": null
} |
#### Python Code
# Selection Sort def SelectionSort(A): for i in range(len(A)): minIndex = i for j in range(i + 1, len(A)): if A[j] < A[minIndex] and j != minIndex: minIndex = j A[i], A[minIndex] = A[minIndex], A[i] # Test import random num_failed = 0 total_tests = 100 for i in range(total_tests): length = random.randint(2, 50) lst = [random.randint(0, 100) for _ in range(length)] SelectionSort(lst) # Check if list has been sorted for i in range(len(lst) - 1): if lst[i] > lst[i + 1]: num_failed += 1 print(f"Test #{i:<2}: List is not sorted") break if num_failed > 0: break if num_failed > 0: print(f"\nFailed") else: print(f"Passed {total_tests}/{total_tests} tests") | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.987568346219724,
"lm_q1q2_score": 0.8615026410302643,
"lm_q2_score": 0.8723473614033683,
"openwebmath_perplexity": 699.9159241570951,
"openwebmath_score": 0.9634503722190857,
"tags": null,
"url": "https://atekihcan.github.io/CLRS/02/E02.02-02/"
} |
python, pymongo
Any other suggestions are of course welcome! PERMISSIONS_MAP should probably be a map of enums to enum sets, not strings to string lists. Stringly-typed data are not a good idea.
Add PEP484 type hints to your function signatures.
permissions being a property is fine. You're concerned about recalculation, but
once this code is refactored and the list comprehension goes away, the amount of "recalculation" will be trivial, and
whereas you could add an lru_cache, that is not called-for here.
Do not use mutable structures like dictionaries for argument defaults. Usual workaround is to default to None and then fill in with a dictionary in function body.
Do not call a method list since that's a built-in.
Your list comprehension should go away. You can just delete the entire RolePermissions class, and in User,
@property
def permissions(self) -> set[Permission]:
return PERMISSIONS_MAP[self.role] | {
"domain": "codereview.stackexchange",
"id": 44211,
"lm_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, pymongo",
"url": null
} |
3 customer reviews a.jh b.JK SOLUTION a.jh FG... Missing length when given area of the parallelogram need to define the height of the parallelogram is the interior angles! Concepts in an accessible way, corner angles, diagonals, height, base and height: = a are! 22, 2018 | Updated: Jul 30, 2018 | Updated: 30... Lesson, young students learn how to find the height of a parallelogram with 12! Is 50, corner angles, diagonals, height, base and a height length right over here as base... Algebra Solver... type anything in there first need to define the height of a parallelogram a classic activity have. Commons Attribution-NonCommercial-NoDerivatives 4.0 Internationell-licens a triangle a 501 ( c ) ( 3 ) nonprofit organization that. Are identical in a parallelogram formed by 2 two-dimensional vectors the Properties of parallelograms 331 Properties... Took this chunk of area that was over there, and i moved it the! Quadrilateral and its midpoints, then create an inscribed quadrilateral 2 | {
"domain": "mouans-immobilier.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9518632316144274,
"lm_q1q2_score": 0.8071493271372351,
"lm_q2_score": 0.8479677545357569,
"openwebmath_perplexity": 778.5552834208993,
"openwebmath_score": 0.6112489104270935,
"tags": null,
"url": "http://blog.mouans-immobilier.com/hmx4d0/b32214-how-to-solve-parallelogram"
} |
Assume $h$ is not constant. Suppose $dh$ does not vanish at $x\in \mathbb{R}^2$. Try to use the implicit function theorem.
• $h(x_1,x_2)=y$ with implicit function theorem we find $h(x_1,g(x_1))=y$. – user151873 May 19 '14 at 15:33
• More generaly, a submersion defines a differential variety. – user151873 May 19 '14 at 15:34
This is not a full answer but it may provide some visual intuition for the problem.
If you visualize the graph of $h: \mathbb{R}^2 \rightarrow \mathbb{R}$ as a surface in the usual way, and imagine a plane of the form $z=c$ intersecting that surface, then what you want to do is choose a path $g:(0,1) \rightarrow \mathbb{R}^2$ that traces along part of the level curves where the plane cuts the surface.
• This does not even begin the answer the question, as it is a priori possible that all level curves of $h$ are fractals, and contain no smooth arcs. – Moishe Kohan May 21 '14 at 16:59 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9895109093587028,
"lm_q1q2_score": 0.8112933960422475,
"lm_q2_score": 0.8198933315126791,
"openwebmath_perplexity": 84.24019310018096,
"openwebmath_score": 0.9631057381629944,
"tags": null,
"url": "https://math.stackexchange.com/questions/801644/show-there-exists-g0-1-to-mathbbr2-such-that-h-circ-g-constant-g-co"
} |
case of ∑tj, tj belongs to [-1, 1] and is uniformly distributed. Intuitively, my mind thinks that this sum should be zero because the tjs are uniformly distributed in -ve and +ve domains. But I think mathematically, even this sum is also irwin-hall distributed?! – Rag Tej May 2 at 9:57 • The variance of the sum increases with$n$, so there is no convergence to zero. However, if you use the sample mean$S/n$instead of the sum$S\$ then the variance decreases to zero, so you have convergence to the mean of zero. – Ben May 2 at 10:00 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9912886173437991,
"lm_q1q2_score": 0.8344921838754386,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 435.4407753183653,
"openwebmath_score": 0.9975186586380005,
"tags": null,
"url": "https://stats.stackexchange.com/questions/406191/summation-of-cosine-of-uniform-random-variable"
} |
quantum-field-theory, path-integral, correlation-functions, partition-function, topological-field-theory
I don't understand how to do this. My main concern is that the path integral
$$Z = \int \mathscr{D}\phi \mathscr{D}a\,
\mathrm{e}^{-S}\tag{3}$$
doesn't look Gaussian to me. To me, the Gaussian integral is
$$ \int\mathrm{d}^n\Phi\, \mathrm{e}^{-\frac{1}{2} \Phi^T M \Phi} = \frac{1}{\sqrt{\det(M/2\pi)}} \tag{4}$$
where $M$ is symmetric and positive definite,
but if I try to define (in 1+1 dimensions for concreteness) $\Phi = (\phi, a_0, a_1)$, I get
$$ \begin{align} S &= \frac{n}{2\pi} \int \mathrm{d}^2 x\, \mathrm{d}^2 y\, \frac{1}{2} \phi(\partial_0 a_1 - \partial_1 a_0) \\
&= \int \mathrm{d}^2 x\, \mathrm{d}^2 y\, \frac{1}{2} \Phi^T \underbrace{\frac{n}{4\pi} \delta^{(2)}(x - y)
\begin{pmatrix} 0 & -\partial_1 & \partial_0 \\
\partial_1 & 0 & 0 \\
-\partial_0 & 0 & 0\end{pmatrix}}_{M(x,y)} \Phi
\end{align}\tag{5} $$ | {
"domain": "physics.stackexchange",
"id": 78459,
"lm_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, path-integral, correlation-functions, partition-function, topological-field-theory",
"url": null
} |
cell-biology, terminology
primordial utricle shares in the division, in the propagation of cells by division. Therefore when daughter-cells are said to be formed in the mother-cells, or to slip out from the mother-cells, or mother-cells are said to be dissolved and absorbed, these phrases must be admitted only as conveniently abbreviated expressions, "mother-cell" being here used instead of maternal cell-membrane. | {
"domain": "biology.stackexchange",
"id": 5874,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cell-biology, terminology",
"url": null
} |
arduino, quadcopter
Title: Quad Copter flight module can replace with smart phone? I want to replace the flight module with smart phone because it has all sensors that are required, like gyroscope, magnetometer, etc. Is that possible?
I am using an Google Nexus 4 Android (OS model 5.1). I will control using another mobile, I am able write an app, with an Arduino acting as a bridge between smartphone and copter. I am using flight controller OpenPilot CC3D CopterControl. You need to be a lot more specific in your question so you can get a meaningful answer:
What smart phone are you connecting? Make, model, OS
What flight module are you replacing?
How will you be controlling the smart phone?
Are you able to write an app for the smart phone?
What will happen when the smart phone looses its signal?
How will you connect the phone to the copter?
Why have you tagged this with Arduino?
If you can provide more info then I can provide a more specific answer than: Maybe. | {
"domain": "robotics.stackexchange",
"id": 847,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "arduino, quadcopter",
"url": null
} |
quantum-information, mathematical-physics, quantum-entanglement, bells-inequality, non-locality
Every Bell polytope has a certain amount of trivial symmetries, like permutation of parties or relabelling of inputs or outputs. Is it possible to give an explicit Bell polytope with nontrivial symmetries? (e.g. transformations of the polytope into itself that takes faces to faces and is not trivial in the above sense) In other words, I'm interested whether a specific Bell scenario can possess any "hidden" symmetries | {
"domain": "physics.stackexchange",
"id": 3270,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-information, mathematical-physics, quantum-entanglement, bells-inequality, non-locality",
"url": null
} |
beginner, file-system, unicode, raku
It is best illustrated by the following diagram:
$ tree
.
├── copy
│ ├── folder 1
$ tree │ │ ├── cr.txt
. │ │ └── es.txt
└── project │ └── folder 2
├── folder%201 │ ├── ai.txt
│ ├── čř.txt │ └── zy.txt
│ └── ěš.txt ~*> └── project
└── folder%202 ├── folder%201
├── áí.txt │ ├── čř.txt
└── žý.txt │ └── ěš.txt
└── folder%202
├── áí.txt
└── žý.txt | {
"domain": "codereview.stackexchange",
"id": 11599,
"lm_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, file-system, unicode, raku",
"url": null
} |
thermodynamics, pressure, fluid-statics
Usually, in introductory classes on thermodynamics, you learn the $-p\cdot\mathrm dV$ term in the thermodynamic identity $\mathrm dU=-p\cdot\mathrm dV+T\cdot\mathrm dS$ (for a number $N=\mathrm{cst}$ of particles) through the following proof: you write out the first principle for a infinitesimally small transformation ($\mathrm dU=\delta W+\delta Q$, where $\delta W$ is the work and $\delta Q$ the heat) and you state that $\delta W$ is the work of pressure forces. Thoses forces act on each surface element $\mathrm d\mathbf\Sigma$ of the system on a length $\mathrm d\mathbf l\left(\mathrm d\mathbf\Sigma\right)=\mathbf r_{\mathrm d\mathbf\Sigma}\left(t+\mathrm dt\right)-\mathbf r_{\mathrm d\mathbf\Sigma}\left(t\right)$, where $\mathbf r_{\mathrm d\mathbf\Sigma}\left(t\right)$ is the position of the surface element $\mathrm d\mathbf\Sigma$ a time $t$ relative to an arbitrary origin. Integrating, you get: $\delta W=\iint_\mathbf\Sigma-p\mathrm d\mathbf l\cdot\mathrm | {
"domain": "physics.stackexchange",
"id": 67239,
"lm_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, fluid-statics",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.