text stringlengths 1 1.11k | source dict |
|---|---|
ds.algorithms, reference-request, fl.formal-languages, automata-theory, optimization
[2] What are the conditions for a NFA for its equivalent DFA to be maximal in size? This is really a stubborn -- and well-studied -- problem. Regarding positive results, an exact algorithm by Kameda and Weiner, a heuristic approach by Polák, and a recent approach using SAT solvers by Geldenhuys et al. come to mind. But there seem to be far more negative results ruling out other possible approaches (e.g. approximation algorithms, special cases, less powerful models of NFAs, ...) See below for some references.
T. Kameda and P. Weiner. On the state minimization of nondeterministic finite automata. IEEE Transactions on Computers, C-19(7):617–627, 1970.
A. Malcher. Minimizing finite automata is computationally hard. Theoretical Computer Science 327:375-390, 2004.
L. Polák. Minimalizations of NFA using the universal automaton. International Journal of Foundations of Computer Science, 16(5):999–1010, 2005. | {
"domain": "cstheory.stackexchange",
"id": 5026,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ds.algorithms, reference-request, fl.formal-languages, automata-theory, optimization",
"url": null
} |
c++, object-oriented, rational-numbers
fraction operator / (fraction a, fraction b)
{
fraction result(a);
return (result /= b);
}
bool fraction::operator == (fraction const &b) const
{
double c = (double(this->numerator) / double(this->denominator));
double d = (double(b.numerator) / double(b.denominator));
if (this->is_neg)
{
c *= -1;
}
if (b.is_neg)
{
d *= -1;
}
return (c == d);
}
bool fraction::operator != (fraction const &b) const
{
return ((*this == b) ? false : true);
}
bool fraction::operator < (fraction const &b) const
{
double i = (double(this->numerator) / double(this->denominator));
double j = (double(b.numerator) / double(b.denominator));
if (this->is_neg)
{
i *= -1;
}
if (b.is_neg)
{
j *= -1;
}
return (i < j);
} | {
"domain": "codereview.stackexchange",
"id": 26679,
"lm_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, rational-numbers",
"url": null
} |
quantum-mechanics, electromagnetism, magnetic-monopoles
It's clear, of course, that if $\vec{B} = \nabla \times \vec{A}$, then $\nabla \cdot \vec{B} = 0$. I don't understand, however, what quantum mechanics has to do with any of this.
Under classical electrodynamics, the magnetic vector potential is defined to be that whose curl gives the magnetic field. Together with electric potential $\phi$, we may specify the electric field.
It is stated earlier in the article that magnetic monopoles are compatible with classical electrodynamics. It goes on to suggest that they are (seemingly) incompatible with quantum mechanics, but then argues this using what seems to be classical electrodynamics.
How is this related to QM? The argument here is supposed to go something like this: | {
"domain": "physics.stackexchange",
"id": 87496,
"lm_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, electromagnetism, magnetic-monopoles",
"url": null
} |
signal-analysis, fourier-transform
Also, the software can perform Inverse Fourier transformation just for complex transformed data to obtain displacement in the time domain. how to calculate displacement?
I attached transformed data as Excel sheet.Excel sheet
I can perform integration on the time-domain data by dividing the transformed acceleration data by the scale factor (-2πf) where f is the frequency in Hz. | {
"domain": "dsp.stackexchange",
"id": 9263,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, fourier-transform",
"url": null
} |
c++, template, coordinate-system
this_t operator+(const this_t &r) const {
std::array<T, num_components> new_components;
for (int i = 0; i < num_components; i++) {
new_components[i] = this->Get(i) + r.Get(i);
}
return this_t(std::move(new_components));
}
this_t operator-(const this_t &r) const {
std::array<T, num_components> new_components;
for (int i = 0; i < num_components; i++) {
new_components[i] = this->Get(i) - r.Get(i);
}
return this_t(std::move(new_components));
}
this_t operator*(const this_t &r) const {
std::array<T, num_components> new_components;
for (int i = 0; i < num_components; i++) {
new_components[i] = this->Get(i) * r.Get(i);
}
return this_t(std::move(new_components));
}
this_t operator*(T s) const {
std::array<T, num_components> new_components;
for (int i = 0; i < num_components; i++) { | {
"domain": "codereview.stackexchange",
"id": 32151,
"lm_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++, template, coordinate-system",
"url": null
} |
kinematics, momentum, potential-energy
Title: Is it possible to avoid a dangerous collision with the ground after free fall by converting the potential energy into rotational kinetic energy? Is a human body able to survive if someone sabotages your parachute and you're in a free fall towards earth suddenly realizing that you have one out of two options left- either die or stand on the ground and directly converting all the potential energy into kinetic energy in form of a front roll? Would that be possible? Maybe we need to consider the type of ground too (muddy, soft ground, rocky ground,...). You could hit something like a very large skateboard ramp, nearly vertical at first, then gradually getting less steep. With the right shape, there'd be a constant force on you giving you horizontal motion. The ramp could be friction-less, thus not necessarily making you rotate.
If you do not want to introduce a net horizontal motion, you could twist the ramp into a helix, giving the falling person a spiral motion. | {
"domain": "physics.stackexchange",
"id": 50813,
"lm_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, momentum, potential-energy",
"url": null
} |
c#, beginner, homework, search
}
}
private static void searchbyprice()
{
Console.WriteLine("Please, give me the maximum book price");
string input = Console.ReadLine();
int maxprice = Convert.ToInt32(input);
foreach (Book result in myList.Where(x => x.price <= maxprice).ToList())
{
Console.WriteLine(result);
}
}
private static void searchbyauthor()
{
Console.WriteLine("Please, write author's name!");
string input = Console.ReadLine();
foreach (Book result in myList.Where(x => x.Author == input).ToList())
{
Console.WriteLine(result);
}
}
} Always nice to see a student eager to learn.
Class Book
Your should try to always use an access modifier, so this should be
public class Book
Other issues: | {
"domain": "codereview.stackexchange",
"id": 27851,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, homework, search",
"url": null
} |
c++, beginner, combinatorics
Since you are learning, I see no reason not to get into C++11 right away.
4: Tutorials and the like often use mySomething as identifiers. my is a bad identifier prefix. Instead, write what role it has or what it represents. outputFile is much better than myFile.
5: Initialize variables right away. The std::ofstream constructor takes a filename, so there is no need to first initialize and then call open().
6: Instantiate variables as late as possible. In your rotateRt() (which should be called rotateRight(), by the way), you don't have to create your strings unless the last else triggers. Change it to this:
else {
string a = input.substr(0, len - 2);
string b = input.substr(len - 1) + " ";
return b + a;
} | {
"domain": "codereview.stackexchange",
"id": 4043,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, beginner, combinatorics",
"url": null
} |
Linear Equation Word Problem; Geometry Lesson 1: Angle Basics. As a ratio, it will be a to b, or a:b. Given a fixed cost, variable cost, and revenue function or value, this calculates the break-even point Features: Calculator | Practice Problem Generator Examples (2): C(x) = 125x + 1500 and R(x) = 1500x - 1000, canoes has a fixed cost of $20,000. December 5, 2018 by Leave a Comment. For the second problem, you don't even need to use a formula—just basic math and some common sense. In addition, this problem. Ratio Word Problems. For example, if I were to make macaroni and cheese for a group of 6 people and I knew that a ½ cup. Ratios are usually written in the form a:b and can be used on maps to show the scale in relation to real life. In a bag full of small balls, 1/4 of these balls are green, 1/8 are blue, 1/12 are yellow and the remaining 26 white. Ratio-Based Age Problems. Welcome to the Ratios and Unit Rates tutorial at Tutorialspoint. 5 inches, what is the actual length of the | {
"domain": "lotoblu.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631671237733,
"lm_q1q2_score": 0.8109770726076169,
"lm_q2_score": 0.8221891283434876,
"openwebmath_perplexity": 1571.7178582619654,
"openwebmath_score": 0.35488325357437134,
"tags": null,
"url": "http://lotoblu.it/eign/ratio-word-problems.html"
} |
One way of drawing ellipses is via a mechanism called Trammel of Archimedes. As described in wiki: It consists of two shuttles which are confined ("trammelled") to perpendicular channels or rails, and a rod which is attached to the shuttles by pivots at fixed positions along the rod. As the shuttles move back and forth, each along its channel, the end of the rod moves in an elliptical path. This principle is illustrated in the figure below.
Now let us geometrically analyze one instance of this trammel when the vertical shuttle is at $A$ and the horizontal shuttle is at $B$ forming an angle of $\theta$. Due to construction, $\left|BX\right| = x_2$ and $\left| AB \right| = x_1-x_2$, $\forall \theta$ (here $x_1\geq x_2$ is assumed wlog). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211641513499,
"lm_q1q2_score": 0.8285698983590242,
"lm_q2_score": 0.8499711832583695,
"openwebmath_perplexity": 338.28284259050065,
"openwebmath_score": 0.9555947184562683,
"tags": null,
"url": "https://stats.stackexchange.com/questions/254357/intuition-geometric-or-other-of-varx-ex2-ex2?noredirect=1"
} |
# How do I find the minimum/maximum stable value of scalar gain for a closed loop transfer function?
I have the following transfer function:
$$G(s) = \frac{s + 8}{s^2 − 2s − 3}$$
This function is placed in series with a static gain $$k$$ and unity feedback. In this case I'm looking for the minimum value of $$k$$ in which the system is stable, but is there a general algebraic method to find the value of $$k$$ when the poles cross the imaginary axis on a root locus plot? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018398044144,
"lm_q1q2_score": 0.824964613656618,
"lm_q2_score": 0.8459424295406088,
"openwebmath_perplexity": 318.3903987631406,
"openwebmath_score": 0.9852312207221985,
"tags": null,
"url": "https://engineering.stackexchange.com/questions/49103/how-do-i-find-the-minimum-maximum-stable-value-of-scalar-gain-for-a-closed-loop"
} |
Here is the smallest counterexample on which the greedy algorithm might fail, which has 3 processes and 4 resources. Process $$P$$ requests resources $$a$$ and $$b$$. Process $$Q$$ request $$a$$ and $$c$$. Process $$R$$ request $$b$$ and $$d$$. When the greedy algorithm select $$P$$ first, it cannot select any more process.
Exercise. Find a counterexample on which the greedy algorithm will always fail. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9416541626630935,
"lm_q1q2_score": 0.802244897056508,
"lm_q2_score": 0.8519527963298946,
"openwebmath_perplexity": 588.9101758106211,
"openwebmath_score": 0.3279935121536255,
"tags": null,
"url": "https://cs.stackexchange.com/questions/101703/resource-reservation-no-greedy-approach"
} |
dimensional-analysis
$$y_{sol}=\frac{(KA^{\alpha})^{\frac{1}{1 - \alpha}}}{x_{salt}} \tag{2}$$
I know that $y_{sol}$ is measured in units of $\frac{\text{L}}{\sec \text{cm} ^2}$, so I blithely assume that the RHS of this equation $(2)$ is automatically expressed in units of $\frac{\text{L}}{\sec \text{cm} ^2}$ too.
But as I begin to play around with this expression $(2)$ experimentally it dawns on me that something weird is going on. I go back to the drawing board, again plugging in $Ay_{sol}x_{salt}$ for $w$ and solving equation $(1)$ for $y_{sol}$, but this time keeping units explicit:
$$f_{salt} = K\left(w\frac{\text{mg}}{\sec \text{cm} ^2}\right)^{\alpha}$$
$$y_{sol}x_{salt} = K\left(Ay_{sol}x_{salt}\frac{\text{mg}}{\sec \text{cm} ^2}\right)^{\alpha}$$
$$y_{sol}x_{salt} = K\left(Ay_{sol}\frac{\text{L}}{\sec \text{cm} ^2}x_{salt}\frac{\text{mg}}{\text{L}}
\right)^{\alpha}$$ | {
"domain": "physics.stackexchange",
"id": 51560,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dimensional-analysis",
"url": null
} |
star, stellar-evolution, stellar-astrophysics
& = & \gamma \frac{P}{\rho}.
\end{array}
$$
so Eq. 4 can be written
$$
\left.\frac{dT}{dr}\right|_\mathrm{ad} = \frac{\gamma-1}{\gamma} \frac{T}{P}\frac{dP}{dr} \tag{5}
$$.
This is one version of the adiabatic temperature gradient, but we can also express it in terms of pressure: Since we're physicists — not mathematicians — we have no problems treating $dr$ as a finite variable, so eliminating that from Eq. 5 gives you
$$
\frac{\gamma-1}{\gamma} = \frac{P}{T}\frac{dT}{dP},
$$
or, using @uhoh's fact that $dx/x=\ln x$,
$$
\boxed{
\frac{\gamma-1}{\gamma} = \left.\frac{d\ln T}{d\ln P}\right|_\mathrm{ad}.
}
$$ | {
"domain": "astronomy.stackexchange",
"id": 6380,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "star, stellar-evolution, stellar-astrophysics",
"url": null
} |
quantum-mechanics, berry-pancharatnam-phase, two-level-system
Let's put that result to the test. Consider a trajectory along the vertical great circle in the $xz$-plane. This circle subtends a solid angle of $4\pi/2 = 2\pi$ and so the Berry's phase should be proportional to $2\pi/2 = \pi$. One way we can compute the Berry's phase is by parameterizing $\theta(t) = 2\pi t/T$ and $\phi(t)=0$ and take $t=0$ to $t=T$. Then, we have the second statement:
$$ \gamma_\uparrow = i\int_0^T \langle\uparrow_{\hat{\mathbf{n}}}(s)|\frac{d}{ds}|\uparrow_{\hat{\mathbf{n}}}(s)\rangle\,ds = i\int_0^T 0\,ds = 0$$ | {
"domain": "physics.stackexchange",
"id": 88262,
"lm_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, berry-pancharatnam-phase, two-level-system",
"url": null
} |
optics, cosmology, black-holes
(Question of an amateur) I'm afraid the behaviour of light near an event horizon is altogether more complicated than you suggest. You work out the path a light follows by calculating the null geodesic, which is not that hard as problems in GR go but it's still formidable for non-nerds.
To give some idea of the complexity, the answer you get depends on who you ask. If you sit outside the event horizon watching the light fall in then you'll never see the light cross the horizon. That's because from your perspective the light slows as it approaches the even horizon and actually comes to a halt at the horizon itself. You would have to wait an infinite time for the light to even reach the horizon let along cross it. However if you're falling into the black hole then after you've crossed the horizon you can see light cross the horiozn after you and catch you up. | {
"domain": "physics.stackexchange",
"id": 13745,
"lm_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, cosmology, black-holes",
"url": null
} |
1 2 x − 5 y + 7 = 0 which contains the point (− 1, 4) is View Answer VIEW MORE (b) Find the bisector of that angle between the planes 3x – 6y + 2z + 5 = 0 , 4x − 12y + 3z − 3 = 0 which contains the origin. Bisector Planes of Angle between two Planes : | {
"domain": "calatoriiclandestini.ro",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407160384083,
"lm_q1q2_score": 0.8001879381081793,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 1117.5011641630144,
"openwebmath_score": 0.30480191111564636,
"tags": null,
"url": "https://calatoriiclandestini.ro/site/8aef1b-equation-of-angle-bisector-of-two-lines-in-3d"
} |
python, python-3.x, parsing, regex, reinventing-the-wheel
def empty(self):
return self.value == ''
def add_child(self, other):
self.children.add(other)
def find_parent_of_terminal(self, terminal):
"""
We assume that there shall only be one node leading to the terminal
and that there is only one terminal
"""
visited = set()
to_explore = {self}
while to_explore:
current = to_explore.pop()
visited.add(current)
if terminal in current.children:
# If this fails, then there is a bug in union, concat, or kleene
assert len(current.children) == 1
return current
to_explore.update({node for node in current.children
if node not in visited})
return None
def leads_to(self, value):
"""
Return True iff argument can be reached by traversing empty nodes
"""
return bool(self._get_node_if_reachable(value)) | {
"domain": "codereview.stackexchange",
"id": 34023,
"lm_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, regex, reinventing-the-wheel",
"url": null
} |
python, beginner, python-3.x, tkinter, gui
# Tells the program to return to the create sticky function on click
myCreateButton = Button(
frame,
text='Create',
command=lambda: create_sticky(self),
font = small_font,
)
myCreateButton.pack(padx=5, pady=5)
settingsbutton = Button(
frame,
text= 'Settings',
font = small_font,
command= lambda: openSettings(self),
)
settingsbutton.pack(padx=5, pady=10, side=BOTTOM)
help(MyApp)
if __name__ == '__main__':
w = MyApp()
w.mainloop() Overall this is a great start, basically functional, and looks cool.
Your doing this:
import tkinter as tk
is a good idea - so you should then avoid the next line:
from tkinter import *
as it pollutes your namespace. Using tk.LabelFrame etc. uniformly will help.
tk.Tk.__init__(self, *args, **kwargs) | {
"domain": "codereview.stackexchange",
"id": 41832,
"lm_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, tkinter, gui",
"url": null
} |
python, python-3.x, rest, https, nuget
# --- --- ---
@log_elapsed
def main():
config = load_config()
search_url = get_search_url()
my_packages = find_my_packages(search_url)
obsolete_packages = get_obsolete_packages(my_packages)
unlist_packages(obsolete_packages, config["apiKey"], list_only=True)
if __name__ == '__main__':
main()
For completenes, this is the other module that I load here to measure the time:
import time
def log_elapsed(func):
def measure(*args, **kw):
start = time.perf_counter()
func(*args, **kw)
end = time.perf_counter()
elapsed = round(end - start, 2)
print(f"'{func.__name__}' elapsed: {elapsed} sec")
return measure | {
"domain": "codereview.stackexchange",
"id": 32460,
"lm_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, rest, https, nuget",
"url": null
} |
climate, models, wind, climate-models
[where R is the ideal gas constant of the gas under consideration and T is temperature in Kelvin]
This would allow you replace the unknown density, and you'd then end up with:
w = −ωRT/pg
Which you could then either further approximate R to be that for dry air = Rd = 287 J/Kkg, or even work up the adjustment your moisture content variable causes (though don't think doing so would offer much useful improvement as you've already got greater errors due to the failings of the hydrostatic approximation).
Since you don't have temperature, it seems your only remaining option would be to plug in the density approximation for the level of interest from the approximated "Standard Atmosphere" here (use the table where ρ is in units of kg/m^3). | {
"domain": "earthscience.stackexchange",
"id": 983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "climate, models, wind, climate-models",
"url": null
} |
Control
Treatment 1 at intensity levels $$1, 2, 3, 4, 5,\dots$$
Treatment 2 at intensity levels $$1, 2, 3, 4, 5,\dots$$
Treatment 3 at intensity levels $$1, 2, 3, 4, 5,\dots$$
$$\vdots$$
Then the "covariate" for the ANCOVA model would be the intensity, and you would multiply the covariate by each treatment indicator variable (the interactions that indicate differing slopes). Since there is no intensity for the control group, I would omit the covariate on its own. For the groups above:
$$Y_i = \beta_0 + \beta_1X_{treatment1} + \beta_2X_{treatment2} + \beta_3X_{treatment3} + \beta_4 X_{treatment1}X_{intensity}+ \beta_5 X_{treatment2}X_{intensity}+ \beta_6 X_{treatment3}X_{intensity} +\epsilon_i$$
A regular ANCOVA would have an $$X_{intensity}$$ on its own, but you correctly identify that not to be meaningful, so omit it, fit your regression model, and interpret the coefficients. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475746920261,
"lm_q1q2_score": 0.8324361832853153,
"lm_q2_score": 0.8824278618165526,
"openwebmath_perplexity": 6908.528824306564,
"openwebmath_score": 0.46185579895973206,
"tags": null,
"url": "https://stats.stackexchange.com/questions/566246/ancova-with-common-zero-level"
} |
boiling-point, equipment
Usually lab glass breaks because of thermal shock - either hot glass with cold water or cold glass with hot water. However, if you heated the beaker steadily for 40 minutes, it definitely wasn't shocked into breaking. An exception might be if the hotplate is malfunctioning and get extremely hot extremely quickly, but that doesn't seem likely. It is definitely possible that there was already a small crack in the beaker and that heating caused it to open further.
A contaminant is very unlikely to have been the source of the problem. You should be able to boil dirty beakers all day long without them popping on you.
Unfortunately it's pretty much impossible to tell what happened for sure unless it winds up being reproducible. | {
"domain": "chemistry.stackexchange",
"id": 5152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "boiling-point, equipment",
"url": null
} |
python, python-3.x
def main():
menu={'Bread':{"Wheat":2.2,"White":1.2,"Sourdough":4.6},
'Protein':{"Chicken":3.3,"Turkey":5.9,"Ham":4.9,"Tofu":1.2},
'Cheese':{"Cheddar":2.2,"Swiss":1.2,"Mozzarella":4.6,"No cheese":0.0},
'Add_ons':{"Mayo":1.0,"Mustard":0.8,"Lettuce":1.4,"Tomato":1.6,"No add-ons":0.0}}
prompts=['What bread do you want?\n',
'What protein do you want?\n',
['Do you want cheese in your sandwich?(y/n)\n',
'What type of cheese do you want?\n'],
['Do you want some add ons to your sandwich?(y/n)\n',
'What add-ons do you want?\n'],
'How many of this sandwich do you want?\n']
menu_type_list=list(menu.keys())
orders=[]
for i in range(len(menu_type_list)):
if i <= 1:
orders.append(pyip.inputMenu(list(menu[menu_type_list[i]]),
prompts[i],
numbered='True'))
elif i <= 3: | {
"domain": "codereview.stackexchange",
"id": 44255,
"lm_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",
"url": null
} |
javascript, node.js, asynchronous, ecmascript-6, promise
Example Usage:
const keepass = require('./keepass/keepass.js');
keepass.itl('www.example.com')
.then(result => console.log('Success', result))
.catch(result => console.log('Error', result)) Since no one else has commented on your use of promises I will do so.
Just mainly looking at your promise code I see one repeating pattern that could be Improved. Your use of new Promise() in your code is often not needed in the ways you are using it. Generally creating a new promise is only needed when working with asynchronous code that is not already using promises.
Let's look at one example of how your usage of new Promise is verbose, unnecessary, and a little redundant.
function logins(url) {
return new Promise((resolve, reject) => {
let request = {
RequestType: 'get-logins',
TriggerUnlock: 'false',
SortSelection: 'false',
};
request = verify(request);
const iv = request['Nonce'];
request['Url'] = encrypt(url, iv); | {
"domain": "codereview.stackexchange",
"id": 24647,
"lm_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, node.js, asynchronous, ecmascript-6, promise",
"url": null
} |
experimental-chemistry, combustion, chemistry-in-fiction
Title: How could I produce/rig this flame-colour lottery? Not sure if this is the wrong SE for this, happy to move it if not...
In the Netflix TV series Sabrina, there is a scene where people take part in an appropriately-gothic-and-ominous lottery, which proceeds as follows:
Fourteen participants draw, one at a time, pieces of paper from a box. The papers are all blank and have no differences visible to the human eye in the (rather moody) lighting.
The participants burn their paper in the flame of a candle which is in front of them. There is a separate candle for each participant, but they all appear to burn with the same yellow flame.
Twelve of the papers burn up quickly, like flash paper. The other papers burn more slowly, and release red (for the 'runner up') or white (for the 'winner') smoke, respectively.
The runner up waits on the winner hand and foot for three days, and then the winner is killed and eaten cannibalistically, with a strong religious 'ascension' dogma. | {
"domain": "chemistry.stackexchange",
"id": 10870,
"lm_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-chemistry, combustion, chemistry-in-fiction",
"url": null
} |
c#, object-oriented, parsing, rss
static Story[] Parse(string content)
{
var items = new List<string>();
int start = 0;
while (true)
{
var nextItemStart = content.IndexOf("<item>", start);
var nextItemEnd = content.IndexOf("</item>", nextItemStart);
if (nextItemStart < 0 || nextItemEnd < 0) break;
String nextItem = content.Substring(nextItemStart, nextItemEnd + 7 - nextItemStart);
items.Add(nextItem);
start = nextItemEnd;
}
var stories = new List<Story>();
for (byte i = 0; i < items.Count; i++)
{
stories.Add(new Story() {
title = Regex.Match(items[i], "(?<=<title>).*(?=</title>)").Value,
link = Regex.Match(items[i], "(?<=<link>).*(?=</link>)").Value,
date = Regex.Match(items[i], "(?<=<pubDate>).*(?=</pubdate>)").Value
});
}
return stories.ToArray();
} | {
"domain": "codereview.stackexchange",
"id": 4938,
"lm_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, parsing, rss",
"url": null
} |
Just a remark which develops Pierre's and Soarer's answers toward abstract algebra.
Proposition. Let $A \subseteq B$ an extension of domains. Suppose that $A$ is a PID and $B$ is a Dedekind domain. Let $K$ be the field of quotients of $A$ and suppose that $B \cap K = A$. If $M$ and $N$ are finite $A$-modules such that $M \otimes_A B$ and $N \otimes_A B$ are isomorphic as $B$-modules, then $M$ and $N$ are isomorphic as $A$-modules.
The proposition implies the thesis on similar matrices if we consider the extension $F[t] \subseteq K[t]$. The proposition can be applied to every finite extension $A \subseteq B$, where $A$ is a PID and $B$ is a Dedekind domain. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808678600415,
"lm_q1q2_score": 0.8014526170633238,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 94.96422527268751,
"openwebmath_score": 0.9650614261627197,
"tags": null,
"url": "http://math.stackexchange.com/questions/57242/similar-matrices-and-field-extensions/57257"
} |
c#, asp.net, video, reference
Once more: getHasTrial() shouldn't have to be casted.
lposition is not a good name. I assume it means lastPosition but that should be written out entirely and follow naming conventions.
You can shorten this:
List<Instructor> surveyLinks = new List<Instructor>();
foreach (Instructor i in VideoProduct.Instructors)
{
surveyLinks.Add(i);
}
to this:
List<Instructor> surveyLinks = new List<Instructor>();
surveyLinks.AddRange(VideoProduct.Instructors);
or even
List<Instructor> surveyLinks = new List<Instructor>(VideoProduct.Instructors);
uclicensesinuse and all other variables in this neighbourhood should be using lowerCamelCase styling.
Here too: I prefer string.Empty over String.Empty. Takes away some of the black color in your IDE and it feels slimmer. All the cool kids use it. | {
"domain": "codereview.stackexchange",
"id": 11030,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, asp.net, video, reference",
"url": null
} |
ros, ros-melodic, roscore
0.0.0.0 is almost certainly not a valid value for ROS_IP. ROS_IP is used by ROS nodes to tell others at which IP:PORT combo they can be reached. For host0, 0.0.0.0 is a local address. For host1, 0.0.0.0 is also a local address. It should be clear why that will not work.
Set ROS_IP to the IP which is accessible to all other (remote) ROS nodes. For a simple LAN setup, that would be the IP of the NIC connected to the LAN on which the other ROS hosts are present.
Set ROS_MASTER_URI to the IP:PORT combo at which the master is reachable.
Note: if remote means "reachable over the (public) internet", and you have a typical consumer grade internet connection with something like a NAT box between you and the "remote", things will become more difficult, as you now have to deal with NAT as well. | {
"domain": "robotics.stackexchange",
"id": 35199,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, roscore",
"url": null
} |
electricity
Over the course of years of use, the red hot wire reacts with the oxygen in the air, forming an oxide layer. [Probably the electrically insulating powder helps keep air away from the surface of the wire, but it won't do so completely.] As the oxide layer gets thicker, the metal of the wire gets thinner. Inevitably it will not get thinner uniformly, and spots of particular thinness will develop. These will get hotter than the rest of the wire, and this will accelerate the local rate of oxidisation, so the thin spot 'quickly' gets even thinner, and hotter – until it melts, so the wire is interrupted and no current can flow through it. Your element is 'burnt out'. But you won't see this, because the protective metal tube will probably be unaffected. | {
"domain": "physics.stackexchange",
"id": 54462,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electricity",
"url": null
} |
thermodynamics, energy, particle-physics, statistical-mechanics, entropy
$$S = k_BN \cdot \ln(Z(\beta)) - k_B\beta\cdot U(\beta) + k_B \cdot \sum^n_{j=1}\bigg[\ln(g_j)\cdot \frac{N}{Z(\beta)} \cdot e^{\beta E_j}\bigg]$$
Since $\ln(g_j) = \ln\big(\frac{N}{Z(\beta)}e^{\beta E_j}\big)- \beta E_j - \frac{N}{Z(\beta)}$, this would eventually give me:
$$\frac{dS}{d\beta} = k_B\cdot\left( - \beta\cdot\frac{dU}{d\beta} + \frac{U(\beta)\cdot N}{Z(\beta)} - U(\beta) \right)$$
Derivation. But using again $dS = \frac{dU}{T}$, this relationship does not give $\beta = -\frac{1}{k_BT}$.
Is it permitted for $\beta$ to have a different value than $-\frac{1}{k_BT}$ when quantum states is taken into account or am I misunderstanding something here? I have figured it out.
The way I included degeneracy was correct but I made some subtle mistakes during substitution of some parameters.
The formula for $\ln(\Omega)$ when degeneracy $g_j$ is taken into account is:
$$\ln(\Omega)= N \cdot \ln(N) - N - \sum^n_{j=1}[n_j \cdot \ln(n_j) - n_j] + \sum^n_{j=1} [\ln(g_j) \cdot n_j]$$ | {
"domain": "physics.stackexchange",
"id": 58764,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, energy, particle-physics, statistical-mechanics, entropy",
"url": null
} |
newtonian-mechanics
So Newton's second law says a force or impulse will change the momentum regardless of where this force/impulse is applied.
$$ \begin{aligned}
p & = m \,v_{\rm COM} & & & \text{(momentum) }p \\
J & = \Delta p = m \, \Delta v_{\rm COM} & & & \text{(impulse) }J\\
F & = \frac{\rm d}{{\rm d}t} p = m \frac{\rm d}{{\rm d}t} v_{\rm COM} & & & \text{(force) }F
\end{aligned} $$
That is all you need to know to describe the motion of the center of mass.
Now for the motion about the center of mass, you need to consider the torque applied about the center of mass. Here is the concept of angular momentum and mass moment of inertia is introduced.
$$ \begin{aligned}
L_{\rm COM} & = I_{\rm COM} \,\omega & & & \text{(angular momentum) }L \\
r \times J & = \Delta L_{\rm COM} = I_{\rm COM} \, \Delta \omega & & & \text{(impulse position) }r\\
\tau_{\rm COM} & = \frac{\rm d}{{\rm d}t} L_{\rm COM} & & & \text{(torque) }\tau
\end{aligned} $$ | {
"domain": "physics.stackexchange",
"id": 66937,
"lm_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",
"url": null
} |
python, algorithm, python-2.x, graph
This says that "A follows B" implies "A → B" which implies that there is an edge from A to B. I stated this explicitly in §1 above, where I wrote:
(an arrow from A to B means that A follows B)
Of course you are free to represent the graph the other way round, so that if A follows B then B → A. If you do this then this doesn't affect the strongly connected component part of the algorithm (since a component remains strongly connected if you reverse all the edges), but you will need to swap "out-neighbour" and "in-neighbour" in the remainder of the algorithm. | {
"domain": "codereview.stackexchange",
"id": 22241,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, python-2.x, graph",
"url": null
} |
vapor-pressure
Title: Is the vapor pressure of a liquid dependent on the pressure of the atmosphere in which it is measured? The figure below shows how vapor pressure of a liquid is measured. Initially the flask is at atmospheric pressure. Then the liquid is dropped in the flask. Once equilibrium is reached, the pressure from the vapor created is recorded. My question is - if the flask were initially at a different pressure - let's say 5 atm - would the vapor pressure of the liquid be different? My thinking is that the additional pressure in the flask would keep more of the liquid molecules in liquid form. Yes, in principle it could be different, but the effect would be very small unless the increase in pressure were very large. To put it in simplified terms: The increase in ambient pressure compresses the liquid, bringing it to a higher-energy state, causing a higher proportion of the liquid molecules to want to escape from the liquid, and into the gas state, thus causing the vapor pressure to | {
"domain": "chemistry.stackexchange",
"id": 12682,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vapor-pressure",
"url": null
} |
Choose "Evaluate the Integral" from the topic selector and click to. This time, we start pushing the spring at 0. Prepare your students for success with meticulously researched ELA, math, and science practice for grades 5-8. The Add 1 or 10 exercise appears under the Early math Math Mission. Aprenda Matemática, Artes, Programação de Computadores, Economia, Física, Química, Biologia, Medicina, Finanças, História e muito mais, gratuitamente. Note: use your eyes and common sense when using this! Some curves don't work well, for example tan(x), 1/x near 0, and functions with sharp changes give bad results. The rule of thumb is to try to use U-Substitution, but if that fails, try Integration by Parts. For each of the following problems: (a) Explain why the integrals are improper. Suleiman has 4 jobs listed on their profile. During her short tenure, she completely revamped the Curriculum Management System (in-house ASP and Oracle based application) with proper integration with Banner Student | {
"domain": "quellidellalambra.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211612253741,
"lm_q1q2_score": 0.8102158269803681,
"lm_q2_score": 0.8311430436757312,
"openwebmath_perplexity": 1585.5757865630837,
"openwebmath_score": 0.5003786683082581,
"tags": null,
"url": "http://vcfk.quellidellalambra.it/antiderivative-practice-khan.html"
} |
ros, ros2, transforms, eigen, tf2
lookupTransform:
cam -> tag:
0.993005 0.115175 -0.0259908 0.480949
0.115586 -0.903337 0.413064 -0.542837
0.0240963 -0.413179 -0.910331 0.743633
0 0 0 1
cam -> tag:
0.961699 0.198847 -0.188665 0.511308
0.256293 -0.896393 0.361654 -0.422628
-0.097204 -0.396155 -0.913024 0.743996
6.91763e-310 7.29112e-304 0 1
cam -> tag:
0.961699 0.198847 -0.188665 0.511308
0.256293 -0.896393 0.361654 -0.422628
-0.097204 -0.396155 -0.913024 0.743996
6.91763e-310 7.29112e-304 0 1
cam -> tag:
0.956792 0.27811 -0.0848747 0.498498
0.28892 -0.876387 0.38532 -0.405495
0.0327782 -0.393193 -0.918872 0.856553
6.91763e-310 7.29112e-304 0 1
cam -> tag:
0.939404 0.342707 -0.00846977 0.407591
0.326405 -0.886622 0.327659 -0.352925 | {
"domain": "robotics.stackexchange",
"id": 38115,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros2, transforms, eigen, tf2",
"url": null
} |
asteroids, star-systems, nomenclature
Now the Black Widow pulsar is located at 19hr 57 minutes of right ascension and +20 degrees of declination (in the B1950 coordinates). So its designation is PSR B1957+20. | {
"domain": "astronomy.stackexchange",
"id": 5482,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asteroids, star-systems, nomenclature",
"url": null
} |
c, algorithm, parsing, lookup, c99
if (curr_glyph == ',') {
if (prev_was_comma) return -2;
if (!number_len_ok(literals, curr_num_len)) return -1; | {
"domain": "codereview.stackexchange",
"id": 4161,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, algorithm, parsing, lookup, c99",
"url": null
} |
c#
are rounded to the nearest cent.
Write a program that calculates the total charge to a customer for a
job
Samples:
Job 1: extra-margin envelopes 520.00 letterhead 1983.37 exempt
should output: envelopes: $556.40 letterhead: $1983.37 total: $2940.30
Job 2: t-shirts 294.04
output: t-shirts: $314.62 total: $346.96
Job 3: extra-margin frisbees 19385.38 exempt yo-yos 1829 exempt
output: frisbees: $19385.38 yo-yos: $1829.00 total: $24608.68 | {
"domain": "codereview.stackexchange",
"id": 17126,
"lm_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#",
"url": null
} |
reinforcement-learning, game-ai, rewards, reward-design, connect-four
Title: How should I define the reward function in the case of Connect Four? I'm using RL to train a Network on the game Connect4. It learns quickly that 4 connected pieces is good. It gets a reward of 1 for this. A zero is rewarded for all other moves.
It takes quite a time until the AI tries to stop the opponent from winning.
Is there a way this could be further reinforced?
I thought about giving a negative reward for the move played before the winning move. Thinking about this, I came to the conclusion that this is a bad idea. There'll be always a looser (except for ties), therefore there always be a last move from the losing player. This one hasn't to be a bad one. Mistakes could have been made much earlier.
Is there a way to improve this awareness of opponents? Or does it just have to train more? | {
"domain": "ai.stackexchange",
"id": 865,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, game-ai, rewards, reward-design, connect-four",
"url": null
} |
ros, turtlebot, ros-electric, rosserial-python, startup
</launch>
**Things that I've tried / checked so far**
I have added /home/doug/ros_workspace to ROS_PACKAGE_PATH in /etc/ros/setup.bash. This solved a problem that I had getting the turtlebot_lipo_diag.py node to start, so I know it is finding that. The rosserial_python stack does not live there anyway.
If I do "ls -l /dev/ttyACM0" it shows that it is owned by group "dialout". I have already added users turtlebot and root to the dialout group (through "usermod -a -g dialout user).
I tried the other Arduino permissions tips also at this link.
Still thinking that permissions may have been an issue, I tried editing the startup script in /usr/sbin/turtlebot-start, and made a copy of lipo.launch in /etc/ros/electric/ where the turtlebot.launch is executed from. I had changed the lines to start lipo.launch INSTEAD of turtlebot.launch, using MY user id where all the code seemed to work. | {
"domain": "robotics.stackexchange",
"id": 10191,
"lm_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, turtlebot, ros-electric, rosserial-python, startup",
"url": null
} |
• Start with $\lfloor y+n \rfloor = \lfloor y\rfloor +n$. – lhf Sep 25 '14 at 1:53
• @lhf Is there a proof for that? – 1110101001 Sep 25 '14 at 1:56
• By definition, $\lfloor y \rfloor \le y < \lfloor y \rfloor +1$ and so $\lfloor y \rfloor + n \le y + n < \lfloor y \rfloor +n+1$, which says that $\lfloor y+n \rfloor = \lfloor y\rfloor +n$. – lhf Sep 25 '14 at 1:58
If $x$ is even, then $x=2k$ where $k \in \mathbb{Z}$.
We then have: $$x-\left\lfloor \frac{x}{2} \right\rfloor=2k-\lfloor k \rfloor=k=\left\lfloor k+\frac{1}{2} \right\rfloor=\left\lfloor \frac{2k+1}{2} \right\rfloor=\left\lfloor \frac{x+1}{2} \right\rfloor$$
If $x$ is odd, then $x=2k+1$ where $k \in \mathbb{Z}$.
We then have $$x-\left\lfloor \frac{x}{2} \right\rfloor=2k+1-\left\lfloor k+{1\over 2} \right\rfloor=k+1=\left\lfloor k+1 \right\rfloor=\left\lfloor \frac{2k+2}{2} \right\rfloor=\left\lfloor \frac{x+1}{2} \right\rfloor$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464499040094,
"lm_q1q2_score": 0.8580001636052454,
"lm_q2_score": 0.8791467643431002,
"openwebmath_perplexity": 206.49783456375567,
"openwebmath_score": 0.9267817139625549,
"tags": null,
"url": "https://math.stackexchange.com/questions/945138/proving-that-x-left-lfloor-fracx2-right-rfloor-left-lfloor-frac"
} |
A. The Questions and Answers of The kinetic energy 'K' of a particle moving in a straight line depends up on the distance 's' as K=as square, force acting on the particle is ??? While kinetic energy is not an invariant in classical mechanics, the gain or loss in kinetic energy due to internal forces within a system is an invariant. The Planck constant transforms energy to a number that miraculously is the frequency of the light that will be built up by zillion such photons. This is because the temperature of a substance depends on the kinetic energy of the particles. Examples of Kinetic Energy: 1. Active 4 years, 10 months ago. Potential energy, stored energy that depends upon the relative position of various parts of a system. 2 $\begingroup$ Closed. D. Mass and velocity. It is the energy stored in a moving body. The unit for energy is joules. Definition of potential energy, gravitational potential energy, elastic potential energy and other forms of potential energy. The force acting | {
"domain": "ekodev3.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9304582516374121,
"lm_q1q2_score": 0.8546075189048913,
"lm_q2_score": 0.9184802406781396,
"openwebmath_perplexity": 508.16888157696775,
"openwebmath_score": 0.43632879853248596,
"tags": null,
"url": "http://ekodev3.com/d2bial/0736a6-kinetic-energy-depends-on"
} |
jquery, html, css
})
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr id="trRow">
<td>Closed:</td>
<td><select name="closed" id="closedRow">
<option value="0">Show All</option>
<option value="1">Hide Closed</option>
</select></td>
</tr>
<tr id="trRow2">
<td>Service:</td>
<td><select name="service" id="serviceRow">
<option value="0">Show All</option>
<option value="1">Hide Service</option>
<option value="2">Another Service</option>
</select></td>
</tr>
<table> Maybe use a generic function to set the css on change if you don't have anything other than colors. It also helps with dry.
function evt_highlightRow() {
row = $(this).parent().parent()
if ($(this).val() != 0)
row.css('background-color', 'yellow');
else
row.css('background-color', 'white');
} | {
"domain": "codereview.stackexchange",
"id": 25488,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "jquery, html, css",
"url": null
} |
python, python-3.x, pygame, pong
def render(self, screen):
pygame.draw.circle(screen, self.color, self.rect.center, self.radius, 0)
pygame.draw.circle(screen, (0,0,0), self.rect.center, self.radius, 1)
#creates the AI paddle
class AIPaddle(object):
def __init__(self, screensize):
self.screensize = screensize
self.centerx = 5
self.centery = int(screensize[1]*0.5)
#ai paddle dimensions
self.height = 100
self.width = 10
self.rect = pygame.Rect(0, self.centery-int(self.height*0.5), self.width, self.height)
self.color = (255,255,255)
#ai paddle speed
self.speed = 6
def update(self, pong):
if pong.rect.top < self.rect.top:
self.centery -= self.speed
elif pong.rect.bottom > self.rect.bottom:
self.centery += self.speed
self.rect.center = (self.centerx, self.centery) | {
"domain": "codereview.stackexchange",
"id": 22530,
"lm_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, pygame, pong",
"url": null
} |
Question: Total=?
Applying first formula as we have intersections of two groups and not the number of only (exactly) 2 group members.
Total=M+S+V-(MnS+SnV+SnV)+MnSnV+Neither=20+30+40-(5+6+9)+4+0=74.
Example #2:
Each of the 59 members in a high school class is required to sign up for a minimum of one and a maximum of three academic clubs. The three clubs to choose from are the poetry club, the history club, and the writing club. A total of 22 students sign up for the poetry club, 27 students for the history club, and 28 students for the writing club. If 6 students sign up for exactly two clubs, how many students sign up for all three clubs? | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812345563904,
"lm_q1q2_score": 0.8191947799238877,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 1791.4215152338725,
"openwebmath_score": 0.360896497964859,
"tags": null,
"url": "http://gmatclub.com/forum/equations-for-3-overlapping-sets-154705.html?sort_by_oldest=true"
} |
java, object-oriented, interview-questions, rags-to-riches
String input = scanner.next();
System.out.println();
if (IS_DIGIT_PATTERN.matcher(input).matches()) {
int selectedDrink = Integer.parseInt(input);
if (selectedDrink < 1 || selectedDrink > indexedDrinks.size()) {
System.out.println("Invalid drink number");
System.out.println();
return true;
}
Drink drink = indexedDrinks.get(selectedDrink - 1);
if (coffeeMachine.isOutOfStock(drink)) {
System.out.println("Drink " + drink + " is not in stock");
System.out.println();
return true;
}
coffeeMachine.makeDrink(drink);
return true;
}
if (IS_R_PATTERN.matcher(input).matches()) {
Map<Ingredient, Integer> newStock = coffeeMachine.getIngredients().stream()
.collect(Collectors.toMap(ingredient -> ingredient, ingredient -> 10)); | {
"domain": "codereview.stackexchange",
"id": 12451,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, interview-questions, rags-to-riches",
"url": null
} |
machine-learning, deep-learning, computer-vision, convolutional-neural-network, convolution
Title: What is the difference between Dilated Convolution and Deconvolution? These two convolution operations are very common in deep learning right now.
I read about dilated convolutional layer in this paper : WAVENET: A GENERATIVE MODEL FOR RAW AUDIO
and De-convolution is in this paper : Fully Convolutional Networks for Semantic Segmentation
Both seem to up-sample the image but what is the difference? In sort of mechanistic/pictorial/image-based terms:
Dilation: ### SEE COMMENTS, WORKING ON CORRECTING THIS SECTION
Dilation is largely the same as run-of-the-mill convolution (frankly so is deconvolution), except that it introduces gaps into it's kernels, i.e. whereas a standard kernel would typically slide over contiguous sections of the input, it's dilated counterpart may, for instance, "encircle" a larger section of the image --while still only have as many weights/inputs as the standard form. | {
"domain": "datascience.stackexchange",
"id": 7620,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, computer-vision, convolutional-neural-network, convolution",
"url": null
} |
### Show Tags
21 Oct 2017, 22:19
1
KUDOS
RMD007 wrote:
mahu101 wrote:
JeffTargetTestPrep addressed this in his response above -
(Note: By the way the problem is worded, “when m is raised to the third power, it becomes the square of another integer,” 1 should not be counted as one of the 9 different values m could be, unlike all the other 8 values. For example, take the number 4: 4^3 = 64 = 8^2, which is the square of another integer, 8. However, 1^3 = 1 = 1^2, which is the square of the same integer. The correct way to word the problem is “when m is raised to the third power, it becomes the square of an integer.”)
Thanks, my point is, with the given question stem 8 should be the answer!
Yes, you are right.
Re: M is a positive integer less than 100. When m is raised to the third [#permalink] 21 Oct 2017, 22:19
Display posts from previous: Sort by | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.9005297787765764,
"lm_q2_score": 0.9005297787765764,
"openwebmath_perplexity": 1336.469105695326,
"openwebmath_score": 0.7223361730575562,
"tags": null,
"url": "https://gmatclub.com/forum/m-is-a-positive-integer-less-than-100-when-m-is-raised-to-the-third-226775.html"
} |
functional-programming, event-handling, react.js, typescript
interface ShowHintProps {
// hints (from dictionary)
hint: TagCount,
// the current value of the tag in the editor
inputValue: string,
// callback of tag selected from list of hints if user clicks on it
result: (outputTag: string) => void
}
const ShowHint: React.FunctionComponent<ShowHintProps> = (props) => {
const { hint, inputValue, result } = props; | {
"domain": "codereview.stackexchange",
"id": 35303,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "functional-programming, event-handling, react.js, typescript",
"url": null
} |
rviz, osx
Ogre::Vector3::getRotationTo(Ogre::Vector3 const&, Ogre::Vector3 const&) const in arrow_marker.cpp.o
Ogre::Quaternion::Quaternion(Ogre::Radian const&, Ogre::Vector3 const&) in shape_marker.cpp.o
Ogre::Quaternion::Quaternion(Ogre::Radian const&, Ogre::Vector3 const&) in odometry_display.cpp.o
Ogre::Quaternion::Quaternion(Ogre::Radian const&, Ogre::Vector3 const&) in pose_display.cpp.o
... | {
"domain": "robotics.stackexchange",
"id": 14428,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rviz, osx",
"url": null
} |
solid-state-physics, dispersion
Title: Phase velocity of optical branch of lattice vibration at zone center In a 1-D diatomic lattice, the dispersion relation for lattice vibration is given by:
$\omega =\surd( \beta (1/M + 1/m)+\beta(\surd(1/M + 1/m)^2 -4sin^2ka/Mm))$
$v = \omega/k$
gives the phase velocity.
At $ka = 0$(zone center), the phase velocity comes out to be infinity.
is this correct?
the group velocity is zero as there is a local maxima in the zone center. It is a standing wave ($v_{\rm group}=0$) of infinite wavelength with a finite frequency. So yes, the phase velocity is also infinite. | {
"domain": "physics.stackexchange",
"id": 53566,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solid-state-physics, dispersion",
"url": null
} |
molecular-biology, proteins, translation, ribosome
https://books.google.co.uk/books?id=6sEq1xLu_hcC&pg=PA130&lpg=PA130&dq=polysome+translation+initiation&source=bl&ots=Un6JjImBJX&sig=ln9mn0KoJDJaVOGK8LbrEmMz9XE&hl=cs&sa=X&ei=x2JiVci8N4jX7Ab02YLgBQ&ved=0CGQQ6AEwCw#v=onepage&q=polysome%20translation%20initiation&f=false
http://jcs.biologists.org/content/115/11/2443/F4.large.jpg It will depend on the drug you are using. There is a pathway that forms the translational initiation complex that starts with binding the mRNA's cap, the small subunit scans to find the AUG, then the large subunit binds, and so on. The 80 S peaks on the density gradients are not vacant, they are poised on mRNAs waiting to initiate (if you removed the inhibitor). | {
"domain": "biology.stackexchange",
"id": 3977,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "molecular-biology, proteins, translation, ribosome",
"url": null
} |
homework-and-exercises, newtonian-mechanics, reference-frames, momentum
Title: Why wouldn’t the COM change position due to internal forces acting on objects inside a trolley?
7.3 A child sits stationary at one end of a long trolley moving uniformly with a speed $V$ on a smooth horizontal floor. If the child gets up a runs about on the trolley in any manner, what is the speed of the CM of the (trolley + child) system? | {
"domain": "physics.stackexchange",
"id": 93230,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, reference-frames, momentum",
"url": null
} |
electrostatics, electric-fields, gauss-law, conductors
Title: Gauss law - charge inside a conductor If there is a point charge inside a shell conductor for example, making a Gaussian surface around the point charge will tell me there is a non-zero flux, meaning non-zero electric field inside, but how is that possible if electric field inside any conductor is zero because charges on the inner surface redistribute to cancel the electric field? Metals have access to a sea of free electrons. Under equilibrium condition the net movement of the electrons inside the metal is zero. And this is reflected in the fact that metals have no field inside them.
To answer your comment:
Why doesn't the point charge in the cavity induce a charge distribution on the inner surface of the conductor that will cancel the field inside?
Simply because the charge distribution at the inner surface is such that the field in the metal is zero. This need not balance the field in the cavity. | {
"domain": "physics.stackexchange",
"id": 67256,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, electric-fields, gauss-law, conductors",
"url": null
} |
special-relativity, cosmology, astronomy, astrophysics, space-travel
If yes:
It is possible that we may fail to detect matter when we look to the outer space and think that nothing is there? Relating the fact that no radiation detectable from that point and that the relativistic mass is especially high, could it, or why cannot, this be related to dark matter?
Note: I am NOT referring to change of energy caused by red-shift, I am referring to change of the number of photons per unit time! Short answer:
Yes, the rate at which we would receive photons from the emitter would slow down, and the photons be redshifted. No, this could not account for Dark Matter in the Universe.
Rate of photons
If you think about relativistic Doppler shift of photons as a slowing down of frequency due to relativistic time dilation, rather than a change in wavelength, it is quite easy to see that the redshift of the photons and the slower rate at which they will be received by the observer is the exact same effect.
Remember that
$$
\Delta t = \gamma \Delta \tau, \\ | {
"domain": "physics.stackexchange",
"id": 11482,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, cosmology, astronomy, astrophysics, space-travel",
"url": null
} |
newtonian-mechanics, rotational-dynamics, friction
Non-ideal/more realistic model - rolling friction comes into the picture
These pictures are from this link that gives a very good graphic view on this. Going away from an ideal model introduces rolling friction since the wheel touches more than just one point, and not all points press back directly through the center - forces from such points cause counteracting torques, which is perceived as the rolling friction. | {
"domain": "physics.stackexchange",
"id": 22830,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, rotational-dynamics, friction",
"url": null
} |
c, linked-list
struct accList //a linked-list consisting of accListNodes
{
struct accListNode *head;
struct accListNode *tail;
int size;
};
void accList_allocate(struct accList *theList); //allocate the accList and set to NULL
void appendToEnd(void *data, struct accList *theList); //append data to the end of the accList
void removeData(void *data, struct accList *theList); //removes data from accList
#endif
accList.c:
#include "accList.h"
#include "cmpsc311.h"
void accList_allocate(struct accList *theList) //allocate and initialize to NULL values
{
theList = Malloc(sizeof(struct accList));
theList->head = NULL;
theList->tail = NULL;
theList->size = 0;
} | {
"domain": "codereview.stackexchange",
"id": 1964,
"lm_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, linked-list",
"url": null
} |
k4n3v8ay042qnl4, w4c3ezd4p85cb2z, yknlrjoenhykah, 4qwq8va3ia, g66f9vxewvt9c8z, dnx3rkqp43, 211v68d5kg4sp6g, gp9lz7tx7ds7bs, qnpczf1z8pmxz3c, 8p46rjps21iku9, xunv152iaef, xbre1hu0azhq, cj7v8jwdwo9eb, 38uog99picvq, gzz8uioi28nlpc, z55lf90zw98b09j, j7mluogrdc7p, 0enol2ge0yf, bmmabi7hi0o5s, esz17pre8u6uf, goyqom7dhlq, zjnwx4dnni1s, zk4ijdfl8c7, 6carkkq2uf38x0, lr67r6s3yvo, desj977l8t18nf | {
"domain": "fnaarccuneo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631635159684,
"lm_q1q2_score": 0.8282826528650059,
"lm_q2_score": 0.8397339676722393,
"openwebmath_perplexity": 778.9735825241737,
"openwebmath_score": 0.654097318649292,
"tags": null,
"url": "http://fnaarccuneo.it/ybbj/modulus-in-maths.html"
} |
ros, rviz, ros-melodic, qt5, rqt
## Statemachine Control:
qt5_wrap_cpp(MOCS_SRCS_CONTROLS ${HDRS_CONTROLS})
qt5_wrap_ui(UI_HEADER_CONTROLS ${UIS_CONTROLS})
##########################################################################################
include_directories(${INC_DIR} ${catkin_INCLUDE_DIRS})
## Statemachine Control:
add_library(rsm_rqt_plugins ${SRCS_CONTROLS} ${MOCS_SRCS_CONTROLS} ${UI_HEADER_CONTROLS})
target_link_libraries(rsm_rqt_plugins ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
add_dependencies(rsm_rqt_plugins ${catkin_EXPORTED_TARGETS})
install(TARGETS rsm_rqt_plugins
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
install(FILES
rsm_rqt_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | {
"domain": "robotics.stackexchange",
"id": 35778,
"lm_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, rviz, ros-melodic, qt5, rqt",
"url": null
} |
neural-network, pytorch
Title: How does the forward method get called in this pyTorch conv net? In this example network from pyTorch tutorial
import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
# 1 input image channel, 6 output channels, 3x3 square convolution
# kernel
self.conv1 = nn.Conv2d(1, 6, 3)
self.conv2 = nn.Conv2d(6, 16, 3)
# an affine operation: y = Wx + b
self.fc1 = nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension
self.fc2 = nn.Linear(120, 84)
self.fc3 = nn.Linear(84, 10) | {
"domain": "datascience.stackexchange",
"id": 5933,
"lm_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, pytorch",
"url": null
} |
evolution, mammals, sexuality
Bonobos, which have a matriarchal society, unusual among apes, are a fully bisexual species—both males and females engage in heterosexual and homosexual behavior, being noted for female–female homosexuality in particular. Roughly 60% of all bonobo sexual activity occurs between two or more females. While the homosexual bonding system in bonobos represents the highest frequency of homosexuality known in any species, homosexuality has been reported for all great apes (a group which includes humans), as well as a number of other primate species.
Although the complexity of sexuality likely points to the existence of multiple genes playing a role in sexual behavior and preference, at least one study$^1$ points to a single gene playing an important role in the sexual behavior, of female mice: | {
"domain": "biology.stackexchange",
"id": 7005,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolution, mammals, sexuality",
"url": null
} |
dimensional-analysis, si-units
Title: What it the physical meaning of kg$^{m}\cdot$m$^{n}\cdot$s$^{l}$ for $m,n,l\in \mathcal{N}$ I have some questions regarding the physical meaning of the units.
The unit of Planck's constant $h$ is J$\cdot$s= kg$\cdot$m$^2\cdot$s$^{-1}$ in the SI system. My question is: When multiplying by m$^2$ what is the meaning of kg$\cdot$m$^2$? As $\frac{kg}{m^2}$ is kilogram per square meter. So, can we write J$\cdot$s= kg$\cdot$m$^2\cdot$s$^{-1}$ = kg$\cdot$m$^4\cdot$s$^{-1}\cdot$m$^{-2}$? The same question for m$^4$ or m$^3$.
Joule is a unit of energy, J= kg$\cdot$m$^2\cdot$s$^{-2}$. What does per s$^2$ mean? Per s and per s ... per two s? But s$^2 \neq 2$s. | {
"domain": "physics.stackexchange",
"id": 69054,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dimensional-analysis, si-units",
"url": null
} |
signal-analysis, continuous-signals
But how does it even make sense to write a negative value for time,
Think of $t=0$ as "now", $t < 0$ as "before now", and $t > 0$ as "later". Does that make sense?
By extension, $t = 0$ is just any arbitrary moment in time; if you don't like it, shift everything over.
shouldn't any "real world" signal start at some instant
Aside from the big bang, no, why should there be some instant where a signal "starts"?
Note that the concept of signals that exist for all time comes from Fourier analysis. If you have some reason to start considering signals at an instant, there is Laplace analysis, where time pretty much starts at $t = 0$.
does negative time do anything other than make us refrain from writing too many piece-wise defined functions? | {
"domain": "dsp.stackexchange",
"id": 10148,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, continuous-signals",
"url": null
} |
keras, convolutional-neural-network, theano
Title: shape of theano tensor variable out of keras Conv2D Being new to theano, pls bear with me. I thought the shape of the tensor variable is already well defined out of the Conv2D layer since the input is specified, as follow,
from keras.layers import Input, Convolution2D
import theano
input_img = Input(shape=(1, 28, 28))
x = Convolution2D(16, 3, 3, activation='relu', border_mode='same') (input_img)
print type(x)
print theano.tensor.shape(x)
But the output is,
<class 'theano.tensor.var.TensorVariable'>
Shape.0 | {
"domain": "datascience.stackexchange",
"id": 1337,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "keras, convolutional-neural-network, theano",
"url": null
} |
ros, gazebo, urdf, model
</inertial>
</link>
<joint name="lwj" type="continuous">
<parent link="base"/>
<child link="left_wheel"/>
<origin xyz="0 0 0" />
<axis xyz="0 1 0"/>
</joint> | {
"domain": "robotics.stackexchange",
"id": 36718,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, gazebo, urdf, model",
"url": null
} |
quantum-entanglement, superconductivity
Here's the rough idea: let $|0\rangle$ denote the ground state and let $c^\dagger(k,s)$ denote the operator that promotes a single electron with spin $s=\pm 1/2$ (up or down) to an excited state with momentum $k$. Then an operator of the form
$$
A \equiv \sum_{k,s} A(k,s)c^\dagger(k,s),
$$
with complex coefficients $A(k,s)$ creates a single electron with some generic wavefunction. Electrons are fermions, which means that the operators $c^\dagger(k,s)$ all anticommute with each other.
(In particular, any such operator multiplied by itself gives zero — this is the Pauli exclusion principle.) So we can't promote two electrons into the same "state" (again in the sense of "orbital"), because
\begin{align*}
A^2|0\rangle
&=
\left(\sum_{k,s} A(k,s)c^\dagger(k,s)\right)
\left(\sum_{k',s'} A(k',s')c^\dagger(k',s')\right)|0\rangle \\
&=
\sum_{k,s}\sum_{k',s'}
A(k,s)
A(k',s')c^\dagger(k,s)c^\dagger(k',s')|0\rangle \\
&=
\sum_{k,s}\sum_{k',s'}
A(k,s) | {
"domain": "physics.stackexchange",
"id": 54290,
"lm_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-entanglement, superconductivity",
"url": null
} |
control-engineering, control-theory, optimal-control
So, this is practical limitation of how the software works, not a theoretical limitation of the MPC method. | {
"domain": "engineering.stackexchange",
"id": 2170,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "control-engineering, control-theory, optimal-control",
"url": null
} |
Last edited: Jan 16, 2008
7. Jan 16, 2008
### Gib Z
The super and subscripts didn't come up properly from when you copied that text to this post. Perhaps you could just link us to the original file? It can be quite hard to read without superscripts when talking about exponents! lol
8. Jan 16, 2008
### mathwonk
exp and log functions 2. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877038891777,
"lm_q1q2_score": 0.8164215919756966,
"lm_q2_score": 0.8311430436757312,
"openwebmath_perplexity": 626.8308290929708,
"openwebmath_score": 0.8821554183959961,
"tags": null,
"url": "https://www.physicsforums.com/threads/logarithm-question.209250/"
} |
model container for a steady-state or transient thermal model. The important determinants of diffusion time (t) are the distance of diffusion (x) and the diffusion coefficient (D). 44 Beginning with a differential control volume in the form of a cylindrical shell, derive the. Since log10 0. Read "On the blow-up of finite difference solutions to the heat-diffusion equation with semilinear dynamical boundary conditions, Applied Mathematics and Computation" on DeepDyve, the largest online rental service for scholarly research with thousands of academic publications available at your fingertips. •…isthetransport of mass in gases, liquids and solids under the influence of a concentration gradient • …proceeds spontaneously due to microscopic movement of mass •…isan irreversible process which leads to an increase in entropy and is only reversible by supply of work. I’ve also looked into pdepe but as far as I understood this is not applicable as I have dC1/dx in the equation for dC1/dt. Heat | {
"domain": "open-cube.fr",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795091201804,
"lm_q1q2_score": 0.8246051252638175,
"lm_q2_score": 0.8354835309589074,
"openwebmath_perplexity": 604.947876856448,
"openwebmath_score": 0.7840031385421753,
"tags": null,
"url": "http://erpe.open-cube.fr/heat-diffusion-equation.html"
} |
complex fourier series of square wave. I'm trying to plot the fourier series following fourier series; f(t)=$$\sum_{k=0}^k \frac{(1)(\sin(2k+1)pi*t)}{2k+1}$$ equation. 2 Fourier Series Learning outcomes In this section we will learn how Fourier series (real and complex) can be used to represent functions and sum series. Now, we will write a Matlab code. A Fourier series (which rely on complex Fourier coefficients defined by integrals) uses the complex exponential e inx. The functions sin(nx) and cos(nx) form a sort of periodic table: they are the atoms that all other waves are built out of. When an and bn are given by ( 2 ), the trigonometric series ( 1 ) is called the Fourier series …. Fourier Series of waveforms. 16 Example: Find the complete Fourier series of the square wave function sqr(x). Example # 01: Calculate fourier series of the function given below: $$f\left( x \right) = L – x on – L \le x \le L$$ Solution: As,. s (1) and (2), is a special case of a more gen-eral concept: | {
"domain": "xenchic.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308768564867,
"lm_q1q2_score": 0.8670619074356445,
"lm_q2_score": 0.8774767874818409,
"openwebmath_perplexity": 578.2945620419474,
"openwebmath_score": 0.8959225416183472,
"tags": null,
"url": "https://xenchic.de/complex-fourier-series-of-square-wave.html"
} |
If there were two continuous functions $f(x)$ and $g(x)$ that were equal at all rationals, then (because the rationals are dense) we can show that $\lim_{x \to a} f(x) - g(x) = 0$ for all values of $a$ using a delta-epsilon proof.
Since the difference of two continuous functions is continuous, we know $\lim_{x \to a} f(x) - g(x) = f(a) - g(a)$ for all $a$, and therefore $f(a) - g(a) = 0$ and $f(x) = g(x)$, proving that $f$ and $g$ must be identical.
-
Indeed I did. Thanks for catching that! – Ben Alpert Jul 22 '10 at 17:04
Sketch of an alternative proof.
First, recall (or see for the first time) the following fact:
Given a continuous function $h: \mathbb{R} \rightarrow \mathbb{R}$, the set $K_h := \{x \in \mathbb{R}: h(x) = 0\}$ is closed.
"Recalling" this fact might seem just like sweeping details under the rug; indeed, it is Exercise $4.3.7$ in Stephen Abbott's introductory textbook Understanding Analysis.
Nevertheless, one can then proceed as follows: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290913825541,
"lm_q1q2_score": 0.8071471847519127,
"lm_q2_score": 0.8311430394931456,
"openwebmath_perplexity": 261.9742762576107,
"openwebmath_score": 0.957425594329834,
"tags": null,
"url": "http://math.stackexchange.com/questions/505/can-there-be-two-distinct-continuous-functions-that-are-equal-at-all-rationals"
} |
signal-analysis, frequency-spectrum, python, spectrogram, stft
Your data should be scaled with dBFS reference (see the "reference" box in cool edit pro).
Cool Edit Pro probably computes the average power spectrum:
Modify
stft_matrix[:, i] = np.abs(np.fft.rfft(windowed_segment)) * (2.0 / window.sum())
to
stft_matrix[:, i] = 2.0 * ( np.abs(np.fft.rfft(windowed_segment)) / window.sum() ) ** 2
Take the mean and 10*np.log10():
power_spectrum = 10 * np.log10(stft_matrix.mean(axis=0) + 1e-60) | {
"domain": "dsp.stackexchange",
"id": 12211,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, frequency-spectrum, python, spectrogram, stft",
"url": null
} |
pharmacology
Can steroid treatment lead to drug dependency, and if yes, how? All classes of drugs react differently in the body. Some bind to receptors, some clean receptors, some drugs cause re-uptake inhibition in the brain, and others destroy viral and bacterial infections. Classifying drugs and how the human body would develop a tolerance to them in a post on this website would take pages upon pages to answer. When you say steroids, i'm assuming you are talking about anabolic steroids. That is the male sex hormone testosterone and its multitudes of derivatives. (DHT and non-DHT). Your body does not in fact develop a "dependance" on the drugs, rather it is a checks and balances system that your endocrine system establishes. Lets say you take a dosage of Testosterone Cypionate at 200mg a week for a 20 week interval from your G.P (common treatment for andropause). In laymans terms, your body senses the increase of testosterone and tells your Leydig Cells in the testes to stop signaling LH | {
"domain": "biology.stackexchange",
"id": 10983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pharmacology",
"url": null
} |
search-algorithms, big-data, search
Estimation via random sampling. An even better approach is to avoid computing the entire intersection, but just estimate its size through random sampling. You repeatedly do the following: randomly choose a document that contains computer, and check whether it also contains science. Each trial (randomly picking a document that contains computer) can be done in one operation, by picking a random offset into the sorted list for computer, and then it's easy to check whether that document also contains the word science (say, by binary search into the sorted list for science). Repeat this 1000 times, and you can get a good estimate of the fraction of documents containing computer that also contain science -- this uses the same principles as political polling, where we survey a random sample of people and then extrapolate to draw inferences about the entire population. Multiply that fraction by the total number of documents containing computer, and you've got an estimate of the size of the | {
"domain": "cs.stackexchange",
"id": 6782,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "search-algorithms, big-data, search",
"url": null
} |
thermodynamics, ideal-gas
Title: Deriving combined gas law from Boyle's and Charles' laws I know that the combined gas law, $$\frac{PV}{T}=k$$ should be derivable from Boyle's Law and Charles' Law. Since these are very basic equations, I presumed that it would be a simple matter, so I tried it myself.
Charles' Law is $$\frac{V}{T}=k_1$$ and Boyle's Law is $$PV=k_2$$The subscripts are arbitrary. In the derivation on Wikipedia, they jump from this to $$PV=k_2T$$
I'm sure I'm just overlooking something silly, but I see no way of combining Charles' and Boyle's to achieve an equation in which we don't cancel at least one of $P$, $V$, or $T$.
What am I missing? Thanks. You have to realize first that Charles' law is the change in volume with respect to temperature for constant pressure while Boyle's law is the change in volume with respect to pressure for constant temperature. So when you combine them, you need to account for these | {
"domain": "physics.stackexchange",
"id": 95806,
"lm_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, ideal-gas",
"url": null
} |
vba, excel
We want to remove any awareness of the CFrameSorter class from the View..and, unltimately, any awareness of the View, from the CFrameSorter. "FrameSorter.Initialise Me" has to go. We want to do this for a few reasons, but the primary reason is that in the final system, the CFrameSorter will not be taking frame positioning commands from the UI. It will be issued commands from one or more application objects. The simplest way to set this up here is to create a StandardModule (FrameSorterTester). It's job is to simulate the Application. It will create a CFrameSorter instance as well as the View instance. Add an entry point to initiate the testing.
Sub TestCFrameSorter()
Dim frameSorter As CFrameSorter
Set frameSorter = New CFrameSorter | {
"domain": "codereview.stackexchange",
"id": 37513,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
aerodynamics
Title: Why does reentry from space tend to result in such great heat? Let's pretend for a moment that the atmosphere had sea-level density, pressure, and temperature all the way up to, say 500km high, and then would abruptly end in a complete vaccum. In such a situation you could have a glider orbiting at 501km high which could do a very graceful, low temperature reentry by simply slowing down the angular velocity and then using aerodynamic lift at, say, a 1:30 gliding ratio to drastically reduce the rate in which potential energy gets released. Or even have a completely vertical entry using a simple parachute.. | {
"domain": "physics.stackexchange",
"id": 3788,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "aerodynamics",
"url": null
} |
You have written down two quantities: The first quantity 0.078... looks like the correct answer, which symbolically is $P(A \cap B)$. The second quantity $P(A \, | \, B)$ is the conditional probability where you have ignored (divided by) the initial probability $P(B)$ of not getting heads the first and second time. So that is a different quantity and not the answer to your question.
• Why is the answer $P(A \cap B)$ and not $P(A|B)$? Apr 20, 2015 at 16:10 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713863665182,
"lm_q1q2_score": 0.8145354796761436,
"lm_q2_score": 0.8267117983401363,
"openwebmath_perplexity": 239.494914127721,
"openwebmath_score": 0.8584323525428772,
"tags": null,
"url": "https://math.stackexchange.com/questions/1243551/conditional-probability-coin-toss-getting-2-tails-then-head-in-a-row-with-u"
} |
probability, resonance, nuclear-magnetic-resonance
I would like to ask for a sketch of this connection - nothing too intimidating, but an idea of where these to fields of knowledge (resonance in differential equations) and Cauchy distribution (probability) meet algebraically. For nuclear resonance, the nuclear spin is set up in discretized state by applying an external static magnetic field, $\mathbf{B}$ to separate the spin up and spin down states:
$$
E_\pm = \mp \frac{\mu B}{2}
$$
Then observe how is a microwave radiation with angular frequency $\omega$ is absorbed by the system. The peak of absorption will occur when $\omega$ is near the nature frequency of the system $\omega_o = \mu B / \hbar$, the energy separation of spin states. Practical, we will scan the static magnetic field $\mathbf{B}$ to find the resonance absorption. We can model this absorption by a driven damping oscillation.
$$
\frac{d^2x}{dt^2} + 2 \gamma \frac{dx}{dt} + \omega_o^2 x = A \sin \omega t.
$$ | {
"domain": "physics.stackexchange",
"id": 76799,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "probability, resonance, nuclear-magnetic-resonance",
"url": null
} |
fluid-dynamics, astrophysics
On the other hand, the Lagrangian perturbation $\delta h(\boldsymbol{r})$ can be written as
$$\delta h(\boldsymbol{r})=h(\boldsymbol{r}_0+\boldsymbol{\delta r})-h_0(\boldsymbol{r}_0)=\left[h(\boldsymbol{r}_0)+\boldsymbol{\delta r}\cdot \nabla h_0(\boldsymbol{r}_0)\right]-h_0(\boldsymbol{r})$$
or, by using the relation found for the Eulerian perturbation, eq. $(1)$, evaluated at $\boldsymbol{r}_0$,
$$\delta h(\boldsymbol{r})=h'(\boldsymbol{r}_0)+\boldsymbol{\delta r}\cdot \nabla h_0(\boldsymbol{r}_0).$$
>> The question | {
"domain": "physics.stackexchange",
"id": 5213,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, astrophysics",
"url": null
} |
java
sublist = new ArrayList<String>(arrayList.subList(x, arrayList.size()));
for(String slist : sublist)
{
System.out.println("i:"+slist);
}
}
} It seems like you are mixing up the number of segments and the number of elements per segment. In your example, both are the same, so the result is correct, but in other cases it will not be. For instance, i1 is created as the number of elements per segment, with the number of segments being hard-coded as 5.0. Then, in the loop, you treat i1 as the number of segments, while the number of elements per segment is hard-coded as 5. Mistakes like this will be easier to spot if you use properly named variables, like numSegments or segmentSize instead of i1 or integer constants.
Also: | {
"domain": "codereview.stackexchange",
"id": 28650,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
performance, c, strings, file
Code can only handle files fit-able in memory. Risks allocation failures.
Limitations with file sizes more than SIZE_MAX and LONG_MAX.
Code could read in 1 "word" at a time.
If performance is an issue, then read in perhaps a block of memory at a time.
Expand uses
Consider if argc == 2, then with a stream view of the file as suggested above, stdin could be used as the input. This makes for a useful "pipe-able" tool.
foo | Ayxan_filter "gkmqvwxz"
Certainly a bug on first word
Code's first call to get_next_word_size() is get_next_word_size(1), I'd expect get_next_word_size(0)
Perform a size++ at the end of the loop rather than a + 1 at the beginning.
Wrong type
Precision specifier should be int, else code is UB.
// printf("%.*s\n", msize, mbeg);
printf("%.*s\n", (int) msize, mbeg); | {
"domain": "codereview.stackexchange",
"id": 33192,
"lm_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, c, strings, file",
"url": null
} |
c++, tree, reinventing-the-wheel
I know your current implementation prevents multiple copies of t from being
inserted (though only because I read carefully through the code!), but I think
for that to be a reasonable thing to do, you need to modify the API, which makes
it more complicated.
// Returns a node containing t, or nullptr if this tree does not contain t.
std::shared_ptr<const Node> find(const T& t, Less less, Eq eq) const;
std::shared_ptr<Node> find(const T& t, Less less, Eq eq); | {
"domain": "codereview.stackexchange",
"id": 10127,
"lm_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++, tree, reinventing-the-wheel",
"url": null
} |
ros, universal-robots
To achieve this, I need the universal_robots package installed, which is part of the ROS_industrial stack.
To install ROS_industrial, I am following these installation instructions:
http://wiki.ros.org/Industrial/Install
It states I should be able to install ROS_industrial using the command:
"sudo apt-get install ros-noetic-industrial-core", however this results in the message "E: Unable to locate package ros-noetic-industrial-core".
I'm brand new to ROS, so any help is appreciated!
I am using Ubuntu 20.04 (64 bit) with ROS Noetic.
That package hasn't been released yet for Noetic, so that command cannot be used yet.
I'll update the instructions.
As I wrote above: please find the new, supported and official driver at UniversalRobots/Universal_Robots_ROS_Driver.
Originally posted by gvdhoorn with karma: 86574 on 2020-06-18
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 35151,
"lm_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, universal-robots",
"url": null
} |
• How can elements of an infinite dimensional space (that of functions whose Fourier transforms have supports contained in $[-R,R]$) be "completely determined" by finitely many coefficients ?? – Jean Duchon Jan 14 '16 at 14:31
• Moreover, what does your last paragraph actually mean? It seems unfortunately close to hand-waving – Yemon Choi Jan 14 '16 at 15:23
• If the Fourier transform of f has compact support, then f is not compactly supported (follows from Heisenberg uncertainty principle, or, more nicely from the uncertainty principle by Donoho and Stark). Hence, there are countable many nonzero samples that determine f completely. If bandlimited functions could be compactly supported, signal processing would be considerably much easier. – Dirk Jan 14 '16 at 16:03 | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180652357769,
"lm_q1q2_score": 0.8012579953636415,
"lm_q2_score": 0.8128673133042217,
"openwebmath_perplexity": 193.16929692396081,
"openwebmath_score": 0.9016064405441284,
"tags": null,
"url": "https://mathoverflow.net/questions/228379/interpret-fourier-transform-as-limit-of-fourier-series"
} |
ros, nao-robot, nao
Title: NAO with nao_path_follower?
Hi all,
New to ROS world.
How to launch the package nao_path_follower (nao_path_follower) ?
I've check the package github:
the package github , no launch file and config file.
Do I have to write the my launch file and config file to make this node been shown in the rosnode list?
Thanks!
Originally posted by SHI.ZP on ROS Answers with karma: 30 on 2016-01-25
Post score: 0
It is launched with rosrun nao_path_follower nao_path_follower.
Originally posted by yasagitov with karma: 223 on 2016-02-24
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 23552,
"lm_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, nao-robot, nao",
"url": null
} |
For your second question, note that $p(x^{-1})=x^{-4}+x^{-1}+1$ is something which is zero when you put in $\alpha^{-1}$, so if you multiply it by $x^4$ you get
$$x^4p(x^{-1})=1+x^3+x^4$$
plugging in $\alpha^{-1}$ we get $\alpha^{-4}\cdot p(\alpha) = 0$, so this is the minimal polynomial for $\alpha^{-1}$, since you can get irreducibility from the same things we said for $\alpha$, namely that there are no roots, and it is not equal to $x^4+x^2+1$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347920161259,
"lm_q1q2_score": 0.8448698236650416,
"lm_q2_score": 0.8670357735451834,
"openwebmath_perplexity": 159.7111273415104,
"openwebmath_score": 0.8905219435691833,
"tags": null,
"url": "https://math.stackexchange.com/questions/1718969/k-mathbbf-2-alpha-alpha-root-of-x4x1-in-mathbbf-2x-find-d?noredirect=1"
} |
c#, unit-testing, dependency-injection
else
{
response.ErrorCode = "UserNotFound";
}
response.Acknowledge = AcknowledgeType.Failure;
return response;
}
catch (Exception ex)
{
Log.Error(ex);
response.Acknowledge = AcknowledgeType.Failure;
response.ErrorCode = "Exception";
return response;
}
} | {
"domain": "codereview.stackexchange",
"id": 6903,
"lm_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#, unit-testing, dependency-injection",
"url": null
} |
slam, navigation, eigen
<description brief="SLAM on RGBD Data">
This package can be used to register the point clouds from RGBD sensors such as the kinect or stereo cameras.
The rgbdslam node can be connected easily to an octomap_server node to create a memory-efficient 3D map.
</description>
<author>Felix Endres, Juergen Hess, Nikolas Engelhard</author>
<license>GPL v3</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/rgbdslam</url>
<depend package="tf"/>
<depend package="pcl"/>
<depend package="rospy"/>
<depend package="roscpp"/>
<depend package="rosbag"/>
<depend package="pcl_ros"/>
<!--depend package="opencv2"/-->
<depend package="cv_bridge"/>
<depend package="sensor_msgs"/>
<!--depend package="openni_camera"/-->
<!--depend package="octomap_server"/-->
<!--depend package="octomap"/-->
<depend package="geometry_msgs"/>
<depend package="visualization_msgs"/>
<rosdep name="libqt4-opengl-dev"/> | {
"domain": "robotics.stackexchange",
"id": 11742,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam, navigation, eigen",
"url": null
} |
it is called identity matrix and denoted by I. Basis. All the other entries will still be . A square matrix is said to be scalar matrix if all the main diagonal elements are equal and other elements except main diagonal are zero. Closure under scalar multiplication: is a scalar times a diagonal matrix another diagonal matrix? and Robertson, E.F. (2002) Basic Linear Algebra, 2nd Ed., Springer [2] Strang, G. (2016) Introduction to Linear Algebra, 5th Ed., Wellesley-Cambridge Press It is never a scalar, but could be a vector if it is 0 x 1 or 1 x 0. The same goes for a matrix multiplied by an identity matrix, the result is always the same original non-identity (non-unit) matrix, and thus, as explained before, the identity matrix gets the nickname of "unit matrix". This topic is collectively known as matrix algebra. By I of the same scalar quantity scalars and one-by-one matrices 1\times 1 $matrix is basically a square,! Off-Diagonal elements are zero and all on-diagonal elements are equal | {
"domain": "hcaus.org",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668723123672,
"lm_q1q2_score": 0.8507067646280727,
"lm_q2_score": 0.8670357598021707,
"openwebmath_perplexity": 240.12511795014694,
"openwebmath_score": 0.8604883551597595,
"tags": null,
"url": "https://hcaus.org/feverfew-cancer-hbmvgtz/difference-between-scalar-matrix-and-identity-matrix-14a08f"
} |
java, swing, file-system, formatting, stackexchange
public static List<File> fileList(String pattern) {
List<File> files = new ArrayList<>();
File file = new File(pattern);
if (file.exists()) {
if (file.isDirectory()) {
for (File f : file.listFiles())
if (!f.isDirectory() && isAsciiFile(f))
files.add(f);
}
else files.add(file);
}
else {
// extract path
int lastSeparator = pattern.lastIndexOf('\\');
lastSeparator = Math.max(lastSeparator, pattern.lastIndexOf('/'));
String path = lastSeparator < 0 ? "." : pattern.substring(0, lastSeparator);
file = new File(path); | {
"domain": "codereview.stackexchange",
"id": 6023,
"lm_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, swing, file-system, formatting, stackexchange",
"url": null
} |
Sometimes, convergence may be slow, or not at all.
We can place a weight on it.
With my Casio FX-115MS
1.512 =
ln(3 Ans
= → 1.512045566
= → 1.512075703
= → 1.512095633
r = (95633-75703) / (75703-45566) = 19930 / 30317
Convegence is slow (we wanted small |r|)
Assume same trend continued (constant r), estimated converged to:
1.512045566 + 0.000030317/(1-r) = 1.512134548
Let's check if assumption is good. Continued on ...
w = 1/(1-r) ≈ 3
x = (1-w)*x + w*ln(3*x) = -2 x + 3 ln(3*x)
-2 Ans + 3 ln( 3 Ans
= → 1.512135175
= → 1.512134542
= → 1.512134552, converged
06-10-2022, 07:20 AM
Post: #3
Thomas Klemm Senior Member Posts: 1,768 Joined: Dec 2013
RE: (41C) Method of Successive Substitutions
(10-04-2020 04:21 PM)Eddie W. Shore Wrote: Be aware, some equations cannot be solved in this manner, such as x = π / sin x and x = ln(1 / x^4). | {
"domain": "hpmuseum.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180656553329,
"lm_q1q2_score": 0.8192727091720775,
"lm_q2_score": 0.8311430394931456,
"openwebmath_perplexity": 4562.28990882531,
"openwebmath_score": 0.9988073110580444,
"tags": null,
"url": "https://www.hpmuseum.org/forum/thread-15683-post-161258.html#pid161258"
} |
standard-model, conventions, representation-theory, higgs, electroweak
Response to comment on conventions Recall both the Higgs entry in WP (Peskin & Shroeder conventions), and Srednicki's text are "modern", so the hypercharge is the average charge of the weak isomultiplet. Since, however, P&S put the v.e.v. downstairs in the Higgs doublet, that is the neutral component, so the upper one is charge +1, hence hypercharge 1/2. By contrast, Srednicki puts the v.e.v. upstairs, (87.4), so the lower component has charge -1, hence hypercharge -1/2. The averaging halves the units since one of the two components is neutral! A rule of thumb: to unconfuse yourself on such conventions, always, always , always , write down the Yukawa term that generates a mass for the charged lepton through its v.e.v. and monitor the charges and hypercharges of all fields, so the term conserves charge and hypercharge--as I'm sure you were trained to do in class. | {
"domain": "physics.stackexchange",
"id": 38179,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "standard-model, conventions, representation-theory, higgs, electroweak",
"url": null
} |
ngs, software-recommendation, errors
You have to split the dataset by chromosomes. ShapeIT can just phase one chromosome at a time. If you are working on GWA data, you can proceed as follows:
for chr in $(seq 1 22) ; do plink --file example --chr $chr --recode --out example_chr$chr ; done
You will obtain 44 files; example_chr1.ped, example_chr1.map, ..., example_chr22.ped, example_chr22.map that you can phase separately. | {
"domain": "bioinformatics.stackexchange",
"id": 303,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ngs, software-recommendation, errors",
"url": null
} |
optics, experimental-physics, quantum-optics, diffraction
Title: Diffraction Gratings Is it possible to use the sawtooth shape diffraction grating instead of rectangular grating
if yes then which parameters will affect at the output ? Secondly, what is special in blaze grating comparison with rectangular shaped diffraction grating ? Yes indeed. For gratings, the use of different shapes of the rills (triangular, square-wave and so forth) changes the character of the line splitting achieved by the grating. The grating's output is essentially the Fourier transform of the incoming field that is phase or amplitude modulated by the grating in the sense that if $\psi(x, y)$ is the incoming field (scalar optical theory here - so think of $\psi$ as a transverse electromagnetic field component) and the grating modulates this by a phase or amplitude function:
$g(x,y) = \left(\sum_k \left(\alpha_k \exp(i K_g x) + \alpha_k^* \exp(-i K_g x)\right) \right)e^{i \sum_k \left(\beta_k \exp(i K_g x) + \beta_k^* \exp(-i K_g x)\right)}$ | {
"domain": "physics.stackexchange",
"id": 8897,
"lm_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, experimental-physics, quantum-optics, diffraction",
"url": null
} |
fluid-dynamics, bernoulli-equation
*Note that these equations are themselves a simplified model of the way actual fluids work. In particular, they're only reliable for completely inviscid liquids (i.e. those that flow without any internal resistance). | {
"domain": "physics.stackexchange",
"id": 60753,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, bernoulli-equation",
"url": null
} |
java, tree
Equality of these type of objects should be checked either be on all values or on none.
Node (business object)
Equality of a business object is checked on a global unique id.
This is a real business object. It has the assertion to be immutable in the current version. If the non unique values are different but the id is the same you have a different version of the business object. But it is the same object. A business object is ALWAYS consistent in respect to the information it provides. If it is not this is an error. Business objects enforce business rules and consistency when you try to make a change. They will process validation and structural checks to keep the whole system consistent.
Useful assertions
As you remap the business object to the mapping object in the DAO you can be sure that the communication object is consistent as the business object was consistent.
As you remap an unmodified mapping object from the database to a business object you can assume consistency.
Your code | {
"domain": "codereview.stackexchange",
"id": 24326,
"lm_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, tree",
"url": null
} |
javascript, performance, beginner, php, html
};
var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>";
return $html;
}
/**
*
* @return a large HTML string of past 20 sessions equilibrium estimations with 7 volatilities
*/
public static function getMobileEquilibrium($arr)
{
$html = ''; // child html
$eq_htmls = ''; // parent html
if (is_array(array_column($arr, "m")[0])) {
$ps = array_column($arr, "m")[0];
} else {
$ps = array();
}
foreach ($ps as $k => $p) {
for ($i = (sizeof($p) / 4) - 1; $i >= 0; $i--) {
$r = rand(0, 9);
if ($i === (sizeof($p) / 4) - 1) {
$html .= '<div class="ro di-2 a120 a220 a320 a420 a520 a620 a720 sq-1 br-5 mv-5 b11' . $r . ' r100 sq-1">'; | {
"domain": "codereview.stackexchange",
"id": 34180,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, beginner, php, html",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.