text stringlengths 1 1.11k | source dict |
|---|---|
Now observe from the basic identity
$\displaystyle \frac{a_1}{q_1} - \frac{a_2}{q_2} = \frac{a_1 q_2 - a_2 q_1}{q_1 q_2}$
that the Farey sequence ${\{ \frac{a}{q}: q \leq Q; a \in ({\bf Z}/q{\bf Z})^\times\}}$ is ${\frac{1}{Q^2}}$-separated in ${{\bf R}/{\bf Z}}$. We may thus invoke the analytic large sieve inequality (see Proposition 6 of Notes 3) to conclude that
$\displaystyle \sum_{q \leq Q} \sum_{a \in ({\bf Z}/q{\bf Z})^\times} |\hat f(\frac{a}{q})|^2 \ll (N + Q^2) \sum_n |f(n)|^2.$
But from construction of ${n}$, the left-hand side of (52) is equal to both ${\sum_n |f(n)|^2}$ and ${\hat f(0)}$, and the claim follows. $\Box$
Note that if one uses the sharp form of the large sieve inequality (Remark 7 from Notes 3) then one can sharpen (52) to
$\displaystyle |\{ n \in {\bf Z}: M < n \leq M+N\} \backslash \bigcup_{p \leq Q} E_p| \leq \frac{N+Q^2}{J}.$ | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682444653242,
"lm_q1q2_score": 0.8012947666000314,
"lm_q2_score": 0.8104789155369048,
"openwebmath_perplexity": 248.19796379327,
"openwebmath_score": 0.9931489825248718,
"tags": null,
"url": "https://terrytao.wordpress.com/2015/01/21/254a-notes-4-some-sieve-theory/"
} |
electromagnetism, electric-fields, inductance
Title: Why electrons accelarate in a solenoid? The induced voltage in a solenoid equals to the applied voltage $U = L\frac{di}{dt}$.
From that I conclude that the electric field generated by the voltage supply and the induced electric field cancel out at each moment. So why do the electrons accelarate when there is a voltage across a solonoid? When you connect a solenoid to a battery, the net emf in the circuit will be
$$\mathscr E_{net}=\mathscr E_{batt}-L\frac{dI}{dt}.$$We know that $\mathscr E_{net}=IR$ when there is resistance $R$ in the circuit. When the resistance is negligible it is, I agree, usual to assume that $\mathscr E_{net}$ is zero. I think this is almost, but not exactly, true. Some work is needed to accelerate the electrons.
Naïvely treating the free electrons as if they were in vacuo, we'd have $$e\frac {\mathscr E_{net}}{l}=m_e \frac{dv}{dt}$$ | {
"domain": "physics.stackexchange",
"id": 83818,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, electric-fields, inductance",
"url": null
} |
# Does $\sum\frac1{n^2}x^n$ represent a continuous functions on $[-1,1]$?
Does $\sum\frac1{n^2}x^n$ represent a continuous functions on $[-1,1]$?
Here is what I thought:
Let $g_n(x)=\frac1{n^2}x^n$. Since each function $g_n$ is continuous on $[-1,1]$, the infinite series $\sum g_n$ represents a continuous function if on $[-1,1]$ if this series converges uniformly on $[-1,1]$.
So I need to prove that this series converges uniformly on $[-1,1]$. I was thinking that I can show this by the following reasoning:
Let $M_n=\frac1{n^2}$. Then $\sum M_k<\infty$.
Let $x\in [-1,1] \implies |x|<1 \implies |x|^n<1\implies |x^n|<1 \implies |\frac{x^n}{n^2}|<\frac1{n^2}$.
Therefore $|g_n(x)|\leq M_k$ for all $x\in [-1,1]$. And so the series converges uniformly by the Weierstrass M-test.
This is how I would prove this myself, but my solution manual introduces a fixed number $a$, and I don't know why they do this, and if this is necessary for the proof: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9884918499186286,
"lm_q1q2_score": 0.8401895741682749,
"lm_q2_score": 0.8499711699569786,
"openwebmath_perplexity": 32.080498306369684,
"openwebmath_score": 0.9936822652816772,
"tags": null,
"url": "http://math.stackexchange.com/questions/315839/does-sum-frac1n2xn-represent-a-continuous-functions-on-1-1"
} |
vba, excel, hash-map
Day
Location
Hour
Timeframe
bread
barley
bagels
beef
chicken
4/1/2021
A
0
night
51
91
12
26
176
4/1/2021
A
1
night
51
24
4
43
17
4/1/2021
A
8
day
25
84
5
72
125
4/1/2021
A
14
day
32
10
7
7
166
4/2/2021
A
0
night
31
29
11
49
5
4/2/2021
A
1
night
25
25
3
40
175
4/2/2021
A
8
day
70
81
6
69
89
4/2/2021
A
14
day
83
45
2
9
141
4/1/2021
B
0
night
55
37
8
59
164
4/1/2021
B
1
night
53
88
12
50
74
4/1/2021
B
8
day
20
73
1
33
200
4/1/2021
B
14
day
6
33
7
2
191
4/2/2021
B
0
night
39
52
4
22
99
4/2/2021
B
1
night
19
80
6
55
0
4/2/2021
B
8
day
44
49
10
42
8
4/2/2021
B
14
day
72
11
3
54
44 | {
"domain": "codereview.stackexchange",
"id": 40990,
"lm_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, hash-map",
"url": null
} |
python, parsing, xml
To:
return geopy.distance.vincenty(self.pos, other.pos).m
By providing:
@property
def pos(self):
return self.lat, self.lng
Since lat, lng as a pair is a position, making that relationship explicit by using a property, better documents the relationship.
Python features
Using python libraries
By storing the timestamp in the class as a datetime value, I was able to convert:
@staticmethod
def timecalc(x1, x2):
a, b = x1.time, x2.time
t1 = dt.datetime(a[0], a[1], a[2], a[3], a[4], int(a[5]))
t2 = dt.datetime(b[0], b[1], b[2], b[3], b[4], int(b[5]))
t1_decimal = float(a[5]-int(a[5]))
t2_decimal = float(b[5]-int(b[5]))
return (t2 - t1).total_seconds() + (t2_decimal - t1_decimal)
To:
def time_since(self, other):
return (self.time - other.time).total_seconds() | {
"domain": "codereview.stackexchange",
"id": 25335,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, parsing, xml",
"url": null
} |
black-hole, supermassive-black-hole
http://www.calctool.org/CALC/phys/astronomy/escape_velocity
The velocity of the jet is apparently many times 191.009 kilometers per second, so the matter in the jet will never slow down, stop, and then begin to fall into the black hole.
The Black Hole at the center of Hercules A is believed to have a mass of about 4 billion solar masses. Since the jets extend over 1 million light years from the black hole, the escape velocity from the Black hole at that distance should be about 10.5953 kiometers per second, less than the escape velocity of the Earth. The galaxy Hercules A is in has about 1,000,000,000,000,000 times the mass of the Sun. At a distance of 1,000,000 light years, it should have an escape veloctiy of about 5,257.65 kilometers per second.
http://www.calctool.org/CALC/phys/astronomy/escape_velocity | {
"domain": "astronomy.stackexchange",
"id": 6118,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-hole, supermassive-black-hole",
"url": null
} |
general-relativity, cosmology, space-expansion, cosmological-constant
It may also have nothing at all to do with fields and their energy-momentum tensors, and simply be a true constant in a term on the “geometry” side of Einstein’s equations. This would not be surprising, because such a cosmological constant would just be the leading (i.e., zeroth-order) term in the gravitational action when expanded in powers of the curvature. The puzzle is why this constant seems to have an unnaturally small but nonzero value. | {
"domain": "physics.stackexchange",
"id": 64647,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, cosmology, space-expansion, cosmological-constant",
"url": null
} |
php
Title: Image upload script more cleaner and secure using php 7 oop style. I want to utilize namespaces and make the code on this file uploading script more secure, and cleaner looking, here is what i have so far
it uploads an image and inserts it into a database.
I want to be able to use namespaces within view files, without it looking messy.
i know i can use laravel blade etc, but for the sake of sharpening my php skills, i want to be able to do this from scratch.
Image.php
<?php
require 'Db.php';
class Image{
private $dbh;
private $connect;
public $directory;
public $uploadfile;
public function __construct()
{
$this->dbh = new Db();
$this->connect = $this->dbh->connect();
$this->directory = "uploads/";
}
public function upload_image($filename, $image_name)
{
$this->uploadfile = $this->directory . basename($filename); | {
"domain": "codereview.stackexchange",
"id": 30934,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php",
"url": null
} |
(first non-homework related question :p)
• Excellent first non-homework related question! – Nameless Dec 23 '12 at 15:11
• I just want to stress that it is important that $|x-a|$ is strictly greater than 0. – Yury Dec 23 '12 at 17:06
• Yeah about that part I know, every book and class did even explain it (rather then just giving it as is) – Nescio Dec 23 '12 at 17:50
Excellent question. In fact, it turns out that the definition with $\leq$ is equivalent.
Suppose that $f$ approaches the limit $l$ near $a$ using the standard definition (the one with $<$), so that for every $\epsilon >0$ there is some $\delta > 0$ such that, for all $x$, if $0<|x-a|<\delta$, then $|f(x)-l|<\epsilon$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811591688145,
"lm_q1q2_score": 0.8205461606508058,
"lm_q2_score": 0.8499711775577736,
"openwebmath_perplexity": 140.94833750617306,
"openwebmath_score": 0.9796487092971802,
"tags": null,
"url": "https://math.stackexchange.com/questions/264148/why-does-the-definition-of-limits-of-a-function-have-strict-inequality"
} |
physical-chemistry, thermodynamics, equilibrium, kinetics
When you do the full integration, but not for a temperature $T_2$ but arbitrary temperature $T$, then you can go back to Eq. (1). Once you integrate it again, you have the "exact" value of $K(T_2)$, in the sense that you get a more exact value the better your data is.
The worst assumption is $\Delta_\mathrm{r} H^\circ = \text{constant}$. If you feel strong, you perform the full integration. An intermediate level is to consider the functionality of temperature, but to assume that the heat capacities of $A$, $B$, $C$, and $D$ are constant in $T \in [T_1,T_2$]. Eq. (3) becomes
$$ \Delta_\mathrm{r} H^\circ(T_2) = \Delta_\mathrm{r} H^\circ(T_1) +
\Delta_\mathrm{r} C_\mathrm{p}^\circ (T_2 - T_1) \tag{5} $$ | {
"domain": "chemistry.stackexchange",
"id": 17448,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, thermodynamics, equilibrium, kinetics",
"url": null
} |
python, ros2
Title: how to install a python file with ament_cmake
I have an ament_cmake package that is mostly c++ but it also contains a python script in the "package_dir/script" folder (following the ROS1 directory convention). My expectation is that the script could be invoked using "ros2 run" and also could be referenced from launch files as an executable node.
Would it be possible to install this python file as an executable script from this ament_cmake package?
If that is possible, what would be the cmake "install" function I should use for the python file or the scripts directory?
Should I instead create another separated ament_python package for that single script?
Originally posted by Pablo Iñigo Blasco on ROS Answers with karma: 2982 on 2020-10-17
Post score: 1
This is the solution I found for that issue:
install(PROGRAMS
scripts/myscript.py
DESTINATION lib/${PROJECT_NAME}) | {
"domain": "robotics.stackexchange",
"id": 35646,
"lm_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, ros2",
"url": null
} |
Often, during a conversation or an email, or at a forum, I would like to type some math, but I don't need full equation support. Search results for MATH font, free downloads of MATH fonts at Fonts101. In certain cases it may be desirable to include "normal text" within an equation. Some Tips and Tricks for Using LaTeX in Math Theses by Rob Benedetto How to Use the les samplethesis. Let be an integer variable which tends to infinity and let be a continuous variable tending to some limit. A Mathematical symbols \alpha \beta \gamma \delta \epsilon \varepsilon \zeta \eta AMS miscellaneous symbols. Here is a definition of the grammar used to parse AsciiMath expressions. From our Help Center article, How do you use LaTeX mathematical notation for formulae on Quora?: > You can write LaTeX and have it styled correctly by using the Math formatting option in the Quora editor (see screenshot) or by using the keyboard s. 5 Table of symbols and notation It is sometimes useful to give the reader a | {
"domain": "site-photographer.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9372107949104865,
"lm_q1q2_score": 0.8372192158871655,
"lm_q2_score": 0.8933094032139576,
"openwebmath_perplexity": 2403.9701909023875,
"openwebmath_score": 0.911067545413971,
"tags": null,
"url": "http://ddhk.site-photographer.it/latex-math-letters.html"
} |
charge, potential-energy, tensor-calculus, voltage, capacitance
Title: Why was $U=\frac{1}{2}QV$ not listed in my book as the potential energy of a capacitor? $$U=\frac{Q^2}{2C}\tag{1}$$
$$U=\frac{1}{2}CV^2\tag{2}$$
$$U=\frac{1}{2}QV\tag{3}$$
$(1)$ and $(2)$ were listed in my book. However, I think $(3)$ is also a valid formula. Is there any particular reason why (3) was left out? It's in your book somewhere for sure. Just maybe not in the section about capacitors because it's much more general than that.
In Griffith's "Introduction to Electrodynamics" it's equation 2.42 and 2.43 in the section "The Energy of a Point Charge Distribution"
$$
W=\frac{1}{2}\sum_i q_iV(r_i)
$$
$$
W=\frac{1}{2}\int\rho(\mathbf{x})V(\mathbf{x})d^3\mathbf{x}
$$ | {
"domain": "physics.stackexchange",
"id": 94983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "charge, potential-energy, tensor-calculus, voltage, capacitance",
"url": null
} |
cosmology, universe, space-expansion, dark-matter
Title: Fall of the number density $n$ with the scale factor $a(t)$ for a relativistic particle species in equilibrium? Consider the thermal dark matter (DM) scenario. Before the dark matter got frozen out, it was both in chemical and thermal equilibrium with the other particles in the early universe. At this point of time, when the dark matter was in equilibrium, the number densities of both the DM and the relativistic particles with which it were equilibrium depleted with the fall of temperature as $$n\propto T^3\tag{1}$$ where $T$ is the temperature of the universe.
Intuitively, the depletion in the number density with the expansion of the Universe should be like $$n\propto a^{-3}(t)\tag{2}$$ where $a(t)$ is the scale factor. | {
"domain": "physics.stackexchange",
"id": 41466,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, universe, space-expansion, dark-matter",
"url": null
} |
ros, ar-track-alvar
Originally posted by Stefan Kohlbrecher with karma: 24361 on 2013-02-14
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by Mivia on 2013-02-14:
Thank you for your clarification of the issue.
I think I will look into the source and try to find the snippets of code causing the problem for this particular package.
Comment by 130s on 2015-01-23:
Relatively recently, patches (this, this etc) were made, but they aren't released yet. I opened a release request. | {
"domain": "robotics.stackexchange",
"id": 12785,
"lm_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, ar-track-alvar",
"url": null
} |
quantum-mechanics, hilbert-space, operators, momentum, boundary-conditions
Every time one is manipulating expressions containing unbounded operators, it is important to identify the underlying domain, if a precise mathematical meaning has to be given to the expressiones.
Coming to your expression, the starting point (expectation value of $\hat x$) requires that the wavefunction $\Psi(x,t)$ would be in $D_{\hat x}$. In order to exploit the fact that $\Psi(x,t)$ is solution of the time dependent Schrödinger equation, $\Psi(x,t)$ has also be in the domain $D_{\hat p^2}$, which is the subset of twice differentiable elements of $L^2(\mathbb R)$). Therefore, the whole formal manipulation implicitly assumes $\Psi(x,t) \in D_{\hat p^2} \cap D_{\hat x}$.
Vanishing of your expression is ensured in such a domain by Schwarz's inequality. Indeed,
$$
\left| \int_{-\infty}^{+\infty} x\Psi^* \frac{d \Psi}{dx} dx \right| \le
\sqrt{\int_{-\infty}^{+\infty} x^2\left|\Psi\right|^2 dx}
\sqrt{\int_{-\infty}^{+\infty} \left|\frac{d \Psi}{dx} \right|^2 dx}.
$$ | {
"domain": "physics.stackexchange",
"id": 63221,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space, operators, momentum, boundary-conditions",
"url": null
} |
python, python-3.x, mathematics
What is the smallest positive integer n that can be written as a sum of three positive cubes in at least 12 ways?
Can this be coded better way such that it is easy to compute the smallest positive integer that is sum of m nth powers? I'm not a professional programmer, so I managed only to write one solution that works.
l = list()
for i in range(1,500):
for j in range(i,500):
for k in range(j,500):
l.append(i**3+j**3+k**3)
l.sort()
for i in range(0,len(l)-12):
if l[i] == l[i+12]:
number = l[i]
for i in range(1,500):
for j in range(i,500):
for k in range(j,500):
if i**3+j**3+k**3 == number:
print(str(number)+"="+str(i)+"^3+"+str(j)+"^3+"+str(k)+"^3") Instead of three nested for loops, you can use itertools to enumerate combinations. Also, I would personally prefer to keep a count in a dictionary, as opposed to storing the same numbers over and over.
import itertools
cube_counts = {} | {
"domain": "codereview.stackexchange",
"id": 10550,
"lm_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, mathematics",
"url": null
} |
Yes, technically, cardinals are particular ordinals; but my impression is that one uses $\omega$ when one wants to emphasize/keep in mind the ordinal structure, and uses $|\omega|$ and $\aleph_0$ when one wants to ignore the ordinal structure. Clearly, my impression was mistaken, I'll have to try to track down where I got it from. – Arturo Magidin Aug 4 '11 at 16:14
@Arturo: Yes, in essence you are correct. However since one uses $\aleph$ notation a lot less than people would expect (as most of the time we use $\kappa,\lambda$ and such to denote cardinals) it is customary to just let them assume their "ordinal role" when needed, and to say an ordinal is of smaller cardinality than some initial ordinal is the same as saying it has a smaller order type. So it works out just fine. – Asaf Karagila Aug 4 '11 at 16:46
The second notation is rather confusing to me. If I saw it in a paper I would not be able to guess what it meant. – Qiaochu Yuan Aug 4 '11 at 16:52 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995733060718,
"lm_q1q2_score": 0.8491674906693192,
"lm_q2_score": 0.8791467706759584,
"openwebmath_perplexity": 484.4202491961179,
"openwebmath_score": 0.9860823154449463,
"tags": null,
"url": "http://math.stackexchange.com/questions/55591/notation-for-the-set-of-all-finite-subsets-of-mathbbn"
} |
pcl
Then give it a catkin_make clean and then again catkin_make an let me know.
Of course I am assuming that you have pcl 1.7 installed correctly
Comment by dinesh on 2016-06-03:
pcl 1.7 is installed, but still getting problems.
Comment by dinesh on 2016-06-03:
hurray it is finally working. i dont know exactly what was the problem, but after reinstalling the package and rewriting the codes, it is now not showing any error. thanks for your feedback sir, by the way.
Comment by marcozorzi on 2016-06-05:
Glad I could help! | {
"domain": "robotics.stackexchange",
"id": 24789,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl",
"url": null
} |
java, spring, e-commerce, spring-mvc
double total = 0, cash = 0, credit = 0, debit = 0;
int quantity;
List<ShoppingCart> results;
if (reportDto.getBeginDate() == null || reportDto.getEndDate() == null) {
results = shoppingCartService.findAll();
} else {
results = shoppingCartService.findByDateTimeBetween(reportDto.getBeginDate(), reportDto.getEndDate());
}
total = results.stream()
.mapToDouble(shoppingCart -> shoppingCart.getCartItems().stream()
.mapToDouble(cartItem -> cartItem.getProduct().getPrice() * cartItem.getQuantity()).sum())
.sum();
quantity = results.stream().mapToInt(
shoppingCart -> shoppingCart.getCartItems().stream().mapToInt(cartItem -> cartItem.getQuantity()).sum())
.sum(); | {
"domain": "codereview.stackexchange",
"id": 32946,
"lm_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, spring, e-commerce, spring-mvc",
"url": null
} |
python, bed, pyranges
h1 = PyRanges(pd.read_csv("dataset1.tsv.gz", sep="\t", names=colnames, header=0, usecols=usecols))
h2 = PyRanges(pd.read_csv("dataset2.tsv.gz", sep="\t", names=colnames, header=0, usecols=usecols))
regions = pr.read_bed("chr21.bed.gz")
regions = regions[~regions.Chromosome.str.contains("_")].merge()
regions.ID = list(range(len(regions))) | {
"domain": "bioinformatics.stackexchange",
"id": 1153,
"lm_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, bed, pyranges",
"url": null
} |
electromagnetism, potential
How can be the average potential due to an external (out of the sphere) charge $q$ be equal to the average potential due to a charge $q$ located at the center?
I agree that the potential does not have a physical meaning as such, but my intuition tells me that the difference between position a (say its value at the center of the sphere) and b (say its value at the position out of the sphere) should matter. Besides, the potential falls off like $1/r$. Thus I do not see how is it possible (physically speaking) that:
$$V_{ext}(R)= V_{ext}(0)$$ 1) I think you mean that "the average potential due to exterior charges is the same as the potential at the center". We're not talking about a different charge configuration, we're talking about some aspect about the potential. | {
"domain": "physics.stackexchange",
"id": 55892,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, potential",
"url": null
} |
visible-light, waves, biophysics, vision
Title: What, if anything, makes primary colours distinct? I've recently become interested in the primary colours; red, green and blue.
In my capacity as a computer programmer I'm well aware of how these colours are used practically, and of how varying combinations of the three can produce any colour visible to the human eye.
However, it occurs to me that these are essentially three evenly spaced frequencies on the visible spectrum. I don't know of any scientific reason why these colours are used to combine light, or if they are distinct in any way. | {
"domain": "physics.stackexchange",
"id": 22516,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, waves, biophysics, vision",
"url": null
} |
planet, solar-system, time
Venus could be a little trickier, depending on your application.
I'm not aware of any timekeeping system for any other planets. There hasn't been a need for one yet. So, again depending on your application, you could come up with various different possible schemes. | {
"domain": "astronomy.stackexchange",
"id": 4712,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planet, solar-system, time",
"url": null
} |
food-chemistry, fats
I am struggling with this explaination and I doubt it's going to be any easier for the kids.
The breakfast cereals reference.
If cis is what's naturally found, by default it's unsaturated fat isn't it? | {
"domain": "chemistry.stackexchange",
"id": 3124,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "food-chemistry, fats",
"url": null
} |
c++, io, integer
// Binds to value returned function call (r-value really)
std::cout<<asInt(oneplusone())<<std::endl;
// Binds to literal
std::cout<<asInt(31)<<std::endl;
return 0;
}
In addition to being shorter and easier to comprehend, it also prohibits: std::cin<<asInt(3); from happening. | {
"domain": "codereview.stackexchange",
"id": 22873,
"lm_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++, io, integer",
"url": null
} |
javascript, game, chat, websocket
const msg = "Client error: You must select a mod to play with the opponent.";
addChatMessage({
chatId: 1,
message: msg,
from: "NOTIFICATION",
command: "chat"
});
logDebugMessage(msg);
}
else {
let selectedUsedId = null;
for (let i = 0; i < onlineUsers.length; i++) {
if (onlineUsers[i].name === selectedUser) {
selectedUsedId = onlineUsers[i].id;
}
}
const inviteMsg = new CardshifterServerAPI.messageTypes.StartGameRequest(selectedUsedId, selectedMod);
CardshifterServerAPI.sendMessage(inviteMsg);
}
}; | {
"domain": "codereview.stackexchange",
"id": 30016,
"lm_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, game, chat, websocket",
"url": null
} |
turing-machines, computation-models, simulation
I'm trying to answer it formally in terms of the 7-tuple and show that the TM and multijump TM are equivelant, but I'm having trouble getting started on that.
Any and all tips are appreciated, thanks The basic idea is to simulate every LL and RR move using an extra state. Whenever the machine wants to move twice to the right, instead make it move once to the right, and transition to a new state, at which the machine always moves to the right and then transitions to the original target of the RR transition. Implementing this idea using the 7-tuple representation is a routine but tedious exercise. | {
"domain": "cs.stackexchange",
"id": 3550,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines, computation-models, simulation",
"url": null
} |
python, python-3.x, object-oriented, complexity
self.cleanTempStorageDir(subtitleFileNames)
if __name__ == '__main__':
subtitleOp = Subtitles(
'/Users/st/Downloads',
'/Volumes/Untitled/Game of Thrones/Season 2',
'/tmp')
subtitleOp.mapSubtitlesToFiles() snake_case
The PEP8 standard is for these:
getTargetFileNames
currentWorkingDir
to be
get_target_filenames
current_working_dir
and so on for your other functions and variable names.
Fail-safe directory reversion
os.chdir(currentWorkingDir) | {
"domain": "codereview.stackexchange",
"id": 38627,
"lm_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, object-oriented, complexity",
"url": null
} |
orbit, planet, tidal-forces
Title: Does tidal heating imply orbit degradation? What compensate the energy loss in tidal heating? Is it orbital decay? There is a wonderful post at Physics Stackexchange:
Gravitational coupling between the Moon and the tidal bulge nearest the Moon acts as a torque on the Earth's rotation, draining angular momentum and rotational kinetic energy from the Earth's spin. In turn, angular momentum is added to the Moon's orbit, accelerating it, which lifts the Moon into a higher orbit with a longer period. As a result, the distance between the Earth and Moon is increasing, and the Earth's spin slowing down.
You can find more reading material and information in the original thread. | {
"domain": "astronomy.stackexchange",
"id": 1060,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit, planet, tidal-forces",
"url": null
} |
python, python-3.x, tic-tac-toe, bitwise, bitset
def remove(self, move=None):
move = move if move else self.last_move
state = self.remove_X(move)
return self.remove_O(move, state)
The only calls to remove_O and remove_X are in remove.
You're already passing move, so the turnery is a waste of both human (reading) and computer (executing) time.
Additionally passing self.state to remove_X would allow you to cut out 4 of the 9 lines of code.
Then we can see remove_X and remove_O are really just calls to bit_clear.
Do the same to remove's move and we've just cut out so much of your code.
def remove(self, move):
state = bit_clear(self.state, move + X_O_BITLEN)
return bit_clear(state, move)
As such lets apply 4 rules to your code:
Remove all 'helper' turneries.
Inline any function only used once.
Inline all global bit_* functions.
Remove any unused functions.
import termcolor # Used for colored output
def states_are_equal(state_a, state_b):
return state_a & state_b == state_b | {
"domain": "codereview.stackexchange",
"id": 41518,
"lm_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, tic-tac-toe, bitwise, bitset",
"url": null
} |
homework-and-exercises, electric-current, electrical-resistance, voltage, power
Title: Finding out how long a light bulb will light A cylindrical wire used to form a light bulb filament has radius 3.7 micrometers and length 1.7 cm. The resistivity of the wire is 5.25 * 10^-5 ohm meters. The light bulb is connected to a 12V battery.
With the given information; resistance equals 20.75 ohm meters. Current will be 0.58 amps and power will be 6.94 W.
The question I do not understand the meaning of is, if the battery has a total stored charge of 0.5 A hr, and produces a constant potential difference until discharged, how long will the light bulb light?
Can anyone explain to me what the question means? You've done all the hard work and now there's one little part left. | {
"domain": "physics.stackexchange",
"id": 33140,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, electric-current, electrical-resistance, voltage, power",
"url": null
} |
vba, excel, pdf
is not. What happens if the name of your sheet changes? Or your data table moves because someone inserted/deleted a column/row? You'll have to go and re-code every single value.
Naming
Variable names should be Concise, Descriptive and, above all, Unambiguous.
FolderPath
is a good name because it's clear exactly what the variable contains/represents.
lr
is not. If I encounter that line halfway through your code, I'm going to go all the way back through to remind myself what it's meant to be representing. Just call it lastRow and you avoid all that trouble.
VBA Naming Conventions:
Typical VBA Naming conventions go as follows:
camelCase for local variables.
PascalCase for Module/Global Variables.
SHOUTY_SNAKE_CASE for constants.
Get in the habit of following them. | {
"domain": "codereview.stackexchange",
"id": 17922,
"lm_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, pdf",
"url": null
} |
ros
Title: gazebo_ros_block_laser FOV limitation of -90 to +90 degrees?
Hi guys,
I'm trying to use the gazebo_ros_block_laser to provide point cloud data of a -180 to 180 degree (360 degree) field of view. However visualizing using RVIZ , only -90 degree to +90 degree looks very good. Everything else behind the lidar system looks incorrect. Is this a known design limitation of gazebo_ros_block_laser or am I using this incorrectly?
Thanks guys,
WW | {
"domain": "robotics.stackexchange",
"id": 7796,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
# Efficient method for computing the properties of a block anti-diagonal matrix
EDIT: the title and content of this question were reformulated for the sake of clarity and to avoid diverting attention from the main issue. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.973240714486111,
"lm_q1q2_score": 0.8523515527561906,
"lm_q2_score": 0.8757869867849166,
"openwebmath_perplexity": 120.69533107824483,
"openwebmath_score": 0.8627724647521973,
"tags": null,
"url": "https://math.stackexchange.com/questions/2640694/efficient-method-for-computing-the-properties-of-a-block-anti-diagonal-matrix"
} |
rviz, ros-melodic
Title: RViz does not show robot appearance (RViz tutorials: building from scratch)
I follow examples from URDF Tutorial
/opt/ros/melodic/share/urdf_tutorial$ roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf
... logging to /home/loic/.ros/log/e042da92-b408-11e8-943d-0800271f9a30/roslaunch-duneton-1649.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
xacro.py is deprecated; please use xacro instead
started roslaunch server http://duneton:36715/
SUMMARY
========
PARAMETERS
* /robot_description: <?xml version="1....
* /rosdistro: melodic
* /rosversion: 1.14.3
* /use_gui: True
NODES
/
joint_state_publisher (joint_state_publisher/joint_state_publisher)
robot_state_publisher (robot_state_publisher/state_publisher)
rviz (rviz/rviz)
ROS_MASTER_URI=http://localhost:11311 | {
"domain": "robotics.stackexchange",
"id": 31745,
"lm_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, ros-melodic",
"url": null
} |
pressure, material-science, continuum-mechanics, surface-tension, liquid-state
Title: Confusion in Derivation of Excess Pressure in a Cylindrical Drop I have recently learnt about surface tension and have developed a list of key points to solve problems:-
Surface tension acts on the surface where a surface is defined as the interface(flat or curved) between a liquid and another substance which could be a solid, a different liquid or gas.
It acts tangential(or along) the surface.
It is defined as force per unit length and for any given line/curve lying on the surface, surface tension acts in both directions normal (and in same plane to surface)to the line/curve. However, because the line/curve may be surrounded by different substances on both sides,so the net resultant force normal to the line may or may not be zero. For example, in:- | {
"domain": "physics.stackexchange",
"id": 87701,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pressure, material-science, continuum-mechanics, surface-tension, liquid-state",
"url": null
} |
To illustrate, let’s sample an index from the distribution [0.4, 0.2, 0.2, 0.2] that was mentioned above in the context of a die roll.
1. First, we construct the cumulative distribution: [0.4, 0.4 + 0.2, 0.4 + 0.2 + 0.2, 0.4 + 0.2 + 0.2 + 0.2], or more simply, [0.4, 0.6, 0.8, 1.0].
2. Then, we sample a random number $r$ between $0$ and $1.$ Suppose we get $r = 0.93.$
3. Finally, we find the index of the last value in the cumulative distribution that is less than $r = 0.93.$ In our case, this is the value $0.8$ at index $2,$ because the next value ($1.0$ at index $3$) is greater than $r = 0.93.$
So, we have sampled the index $2.$
## Exercise
Write a function random_draw(distribution) that samples a random number from the given distribution, an array where distribution[i] represents the probability of sampling index i. | {
"domain": "justinmath.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9914225133191064,
"lm_q1q2_score": 0.8522900014867285,
"lm_q2_score": 0.8596637559030338,
"openwebmath_perplexity": 291.4495911781642,
"openwebmath_score": 0.8775347471237183,
"tags": null,
"url": "https://www.justinmath.com/roulette-wheel-selection/"
} |
javascript, jquery, functional-programming, observer-pattern, frp
// **********************************
// *** start: Sources constructor ***
// **********************************
function Sources() {
this.sources = {};
}
Sources.prototype.subscribe = function(subscriptionID, subscriberID) {
if(!this.sources[subscriptionID]) {
this.sources[subscriptionID] = (new Subscription()).updateSubTime(5000);
}
this.sources[subscriptionID].subscribe(subscriberID, function(data) {
self.postMessage({cmd: subscriberID, msg: data});
});
return this; //for method chaining
};
Sources.prototype.unsubscribe = function(subscriptionID, subscriberID) {
this.sources[subscriptionID].unsubscribe(subscriberID);
return this; //for method chaining
}
Sources.prototype.updateSubTime = function(subscriptionID, time) {
this.sources[subscriptionID].updateSubTime(time);
return this; //for method chaining
}
// ********************************
// *** fin: Sources constructor ***
// ******************************** | {
"domain": "codereview.stackexchange",
"id": 17255,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, functional-programming, observer-pattern, frp",
"url": null
} |
c++, template-meta-programming, markov-chain
"take", "all", "this", "trouble", "about", "them", "i", "have", "shown", "what", "a", "bother", "it", "is", "to", "decline", "a", "good", "male", "friend", "well", "this", "is", "only", "a", "third", "of", "the", "work", "for", "there", "is", "a", "variety", "of", "new", "distortions", "of", "the", "adjective", "to", "be", "learned", "when", "the", "object", "is", "feminine", "and", "still", "another", "when", "the", "object", "is", "neuter", "now", "there", "are", "more", "adjectives", "in", "this", "language", "than", "there", "are", "black", "cats", "in", "switzerland", "and", "they", "must", "all", "be", "as", "elaborately", "declined", "as", "the", "examples", "above", "suggested", "difficult—troublesome—these", "words", "cannot", "describe", "it", "i", "heard", "a", "californian", "student", "in", "heidelberg", "say", "in", "one", "of", "his", "calmest", "moods", "that", "he", "would", "rather", "decline", "two", "drinks", "than", "one", "german", "adjective", "the", "inventor", | {
"domain": "codereview.stackexchange",
"id": 23353,
"lm_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-meta-programming, markov-chain",
"url": null
} |
ros, ros2, python3, colcon
Title: colcon build fails when adding pkg in setup.py
Greetings: I am new to ROS2 and paid for a tutorial that has 10 sections. I understand everything so far. The course has covered building packages, nodes, topics, and servers. It shows me how to do this in python and C++.
I use Ubuntu 20 and Visual code. The instructor provided source code for all the examples. I'm using Foxy.
QUESTION: Where might I look to resolve colcon build failure when I add the last item in this entry list?
i.e. "add_two_ints_client = my_py_pkg.add_two_ints_client:main
entry_points={
'console_scripts':[
"py_node = my_py_pkg.my_first_node:main",
"robot_news_station = my_py_pkg.robot_news_station:main",
"smartphone = my_py_pkg.smartphone:main",
"number_publisher = my_py_pkg.number_publisher:main",
"number_counter = my_py_pkg.number_counter:main",
"add_two_ints_server = my_py_pkg.add_two_ints_server:main", | {
"domain": "robotics.stackexchange",
"id": 36647,
"lm_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, python3, colcon",
"url": null
} |
c++, c++11, thread-safety, collections, lock-free
}
});
}
for (int i = 0; i < threadCount; i++) {
threads.emplace_back([&, i]() {
for (int j = 0; j < perThreadElementCount; j++) {
int x;
a.pop_front(x, std::memory_order_relaxed, std::memory_order_relaxed);
{
std::unique_lock<std::mutex> lock(mutex);
assert(remainingNumbers.erase(x));
}
std::cout << x << " ";
}
});
}
for (auto &thread : threads) {
thread.join();
}
assert(a.empty());
assert(remainingNumbers.empty());
}
DUMP;
} | {
"domain": "codereview.stackexchange",
"id": 12394,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, thread-safety, collections, lock-free",
"url": null
} |
electric-circuits, electrons, electric-current, electrical-resistance, light-emitting-diodes
Kirchhoff's circuit laws are fundamental to (lumped element) circuit theory.
In the case of Kirchhoff's current law (KCL), which is essentially that the sum of currents entering a node (junction of two or more circuit elements) equals the sum of currents leaving the node, we learn that series connected circuit elements have identical current through.
That is, according to KCL, all of the current out of the LED is in to the resistor. If you were to swap their order, then all of the current out of the resistor is in to the LED. In either case, both the LED and resistor have identical current through.
What then does the resistor do? Since the voltage across the (forward biased) LED is essentially constant over a wide range of current through, the voltage across the resistor is essentially fixed. Thus, by Ohm's law, the series current is determined by the value of the resistance.
From a comment:
how do the electrons know that there is resitance ahead 'go slow'? | {
"domain": "physics.stackexchange",
"id": 32895,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, electrons, electric-current, electrical-resistance, light-emitting-diodes",
"url": null
} |
• @kres901567708 I think it’s unclear but as I’ve thought more about it, with these splines (ie not smoothing or interpolating) it probably is pretty much always the case that the specified knots are interior and wouldn’t be boundary knots. Like when the $\xi$ are thought of as tuning parameters, which I think is the case with a standard regression spline, they’re often put at quantiles of the data which would make them interior – jld Oct 30 '19 at 2:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446452420054,
"lm_q1q2_score": 0.8638219997289245,
"lm_q2_score": 0.8872045914803097,
"openwebmath_perplexity": 304.51867510471266,
"openwebmath_score": 0.6516091227531433,
"tags": null,
"url": "https://stats.stackexchange.com/questions/433478/dof-of-natural-cubic-spline"
} |
c++, algorithm, game-of-life, sdl
You don't need to set them to NULL, they'll get deleted anyways. Same for isRunning.
Use nullptr instead of NULL.
As of right now, you're calling the free functions for gameWindow, gameRenderer and gameWindowSurface in the destructor. This is ok, but what if I try to copy the class? Then, the destructor of both classes will try to destroy the same object (because the pointers point to the same object). There is something called the Rule of 5 (before it was three, but now, it's five) to "protect" against this.
You can always do that, but a better solution would be to use std::unique_ptr, which is a smart pointer. Granted, you would still be unable to copy GameOfLife, but you'll be able to move it.
For that, gameWindow would be defined as:
std::unique_ptr<SDL_Window, void(*)(SDL_Window*)> gameWindow; | {
"domain": "codereview.stackexchange",
"id": 27802,
"lm_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, game-of-life, sdl",
"url": null
} |
rosdep
Title: multiple ros release support in rosdep.yaml
The modular_cloud_matcher package requires yaml-cpp, which is installed in the ros-wide rosdep.yaml in electric but not in diamondback. For the latter, I had put an entry in our rosdep.yaml:
yaml-cpp:
ubuntu: yaml-cpp0.2.6-dev
This entry solves the problem for diamondback, but creates a conflict in electric:
[ rosmake ] rosdep install failed: QUITTING: due to conflicting rosdep definitions, please resolve this conflict.
Rules for yaml-cpp do not match:
{'apt': {'packages': ['yaml-cpp0.2.6-dev']}} [/opt/ros/electric/stacks/common_rosdeps/rosdep.yaml]
yaml-cpp0.2.6-dev [/opt/ros_addons/electric/stacks/ethzasl_mapping/rosdep.yaml]
Is there a way to specify rules specific to different ros releases in rosdep.yaml? | {
"domain": "robotics.stackexchange",
"id": 7133,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosdep",
"url": null
} |
script file, see convertMuPADNotebook. The two vectors must be the same size. There’s a High and low frequency version of all. ©2016 Keegan Mehall and Kevin MehallKevin Mehall. Gradient vector field Definition: A vector field F is called a conservative vector field if it is the gradient field of some scalar function, that is F= ∇f. On the same plot include the approximation value of the. Find the best digital activities for your math class — or build your own. VECTOR_FIELD : Places colored, oriented vectors of specified length at each vertex in an input vertex array. @Raju07 - "Vector_B" has a magnitude and phase (real/imag) components. quiver(X, Y, U, V, **kw) with. plot ( pf ) mtexColorbar MTEX tries to guess the right size of the circle in order to produce a pleasing result. but I need to draw a vector field in 2 dimension and 3 dimension. Consider the vector field F = ( y+2*z, x-z, 2*x-y ). New in Wolfram Mathematica 7: Vector & Field Visualization Plot Field Vectors in 3D. To find the | {
"domain": "chiryo.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.974434783107032,
"lm_q1q2_score": 0.8203041939269606,
"lm_q2_score": 0.8418256492357358,
"openwebmath_perplexity": 877.9790993869453,
"openwebmath_score": 0.6458716988563538,
"tags": null,
"url": "http://oycg.chiryo.it/plot-3d-vector-field.html"
} |
ros, roscore, tutorials
And after the stacktrace:
socket.error: [Errno 98] Address already in use
ERROR: could not contact master [http://pfc-VirtualBox:11311/]
[master] killing on exit
So, my question is: Is this a kind of "bug" in the tutorial or may I worry about that error being threw instead of the suggested output @ tutorial?
Thanks in advance for your answer!
Originally posted by 1morelearner on ROS Answers with karma: 57 on 2012-07-13
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 10188,
"lm_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, roscore, tutorials",
"url": null
} |
diagonals of a parallelogram and adjancent angles from side lengths and angle. Calculations include side lengths, corner angles, diagonals, height, perimeter and area of a rhombus. Here is a simple Area of a Rhombus Calculator which helps to calculate the rhombus area using its diagonals. Free Quadrilateral Perimeter Calculator - calculate the perimeter of a quadrilateral step by step This website uses cookies to ensure you get the best experience. share | follow | answered Oct 15 '09 at 19:09. Side of polygon given area. Using height, angles at the base and sides 4. Inscribing A Circle Within A Kite All kites are tangential quadrilaterals, meaning that they are 4 sided figures into which a circle (called an incircle) can be inscribed such that each of the four sides will touch the circle at only one point. It turns out that there is a relationship between the sides of the quadrilateral and its diagonals. Geometric Kite Calculator, Geometry Kite Calculator, quadrilateral. Establish two | {
"domain": "blaumut.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471628097781,
"lm_q1q2_score": 0.8155490884734139,
"lm_q2_score": 0.8289388019824947,
"openwebmath_perplexity": 535.1336367052928,
"openwebmath_score": 0.6780699491500854,
"tags": null,
"url": "https://www.blaumut.com/benzoin-to-yfmgt/c7c06f-diagonal-of-quadrilateral-calculator"
} |
javascript, design-patterns, angular.js
Am I implementing some ugly/confuse code to deal with this? I'm only doing this on applications, the base modules services and methods are encapsulated, they always receive the Id in methods parameters. But on apps, each service would had to receive the Id on each parameter in order to be reused across several controllers (they could be loaded in the same session consuming the same service).
I've tried to avoid this extra service and calling the UserResource on controller but I always end up with controller handling business operations. "A service per controller" sounds like a bad architecture. A good service should 'know' nothing about controllers and presentation details. Controllers should be thin, and any repeating code there should be abstracted into general purpose services not specific to controllers. | {
"domain": "codereview.stackexchange",
"id": 12897,
"lm_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, design-patterns, angular.js",
"url": null
} |
cryptography, go
In your decryptString method, it's declared to return an error, but you never actually return one.... you just panic. Your encryptString does, in fact, occasionally return an error.
I looked in to the documentation for AES in go, and I see you copied most of it from the examples in there - code in the go documentation is not necessarily good code!
Crypto Key
You select to convert the key to a 32-byte hash. This is a good thing, but what you are missing is that you can use the sha-256 algorithm so much better.... in fact, it's a fantastically convenient hash, but you are doing it wrong... here's your function: | {
"domain": "codereview.stackexchange",
"id": 19624,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cryptography, go",
"url": null
} |
postscript
args-begin { dup length dict begin { exch def } forall }
args-and-types { /was_x false def [ exch { each-specifier } fortokens fix-last ] dup args exch types }
each-specifier { dup xcheck /is_x exch def is_x was_x and { null exch } if /was_x is_x def }
fix-last { counttomark 2 mod 1 eq { null } if }
check-stack { {pop} 4 index cvlit { cvx /stackunderflow signalerror } curry compose
/if cvx 2 array astore cvx {check-count} exch compose curry
3 index cvlit { cvx /typecheck signalerror } curry
/if cvx 2 array astore cvx {check-types} exch compose compose }
check-count { dup length count 2 sub gt }
check-types { dup length 1 add copy true exch { check-type and } forall exch pop not }
check-type { dup null eq { 3 -1 roll pop pop true }{ 3 -1 roll type eq } ifelse }
make-type-name { dup type /nametype eq { dup length 4 add string dup dup 4 2 roll cvs | {
"domain": "codereview.stackexchange",
"id": 42640,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "postscript",
"url": null
} |
control, kinematics, inverse-kinematics
Until
$$F(X_n+1) \approx 0 \tag{t}$$
Then:
$$LeftChain = \sqrt{(x-h\cos(\phi_1))^2+(y+y_1^+-h\sin(\phi_1))^2}-r \tan(\gamma)+r\gamma \tag{u}$$
$$RightChain = \sqrt{(D-(x+h\cos(\phi_2)))^2 + (y+y_2^+-h\sin(\phi_2))^2}-r\tan(\lambda)+r\lambda \tag{v}$$
Again, a HUGE thank you to Keith Selbo for this solution. | {
"domain": "robotics.stackexchange",
"id": 2281,
"lm_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, kinematics, inverse-kinematics",
"url": null
} |
python, optimization, beginner
rxx = rxx_func(magn)
end = time.time()
calc_time = end - start
time_string = 'Non-parallel: N = %i T = %f\n'%(length,calc_time)
else:
print 'Parallel calc was started'
ppservers = ()
ncp = 4
job_server = pp.Server(ncp, ppservers=ppservers)
print "Starting pp with", job_server.get_ncpus(), "workers"
arg_n = tuple(magn)
job = job_server.submit(rxx_func, (arg_n,), (), ())
start = time.time()
rxx = job()
job_server.print_stats()
end = time.time()
calc_time = end - start
time_string = 'Parallel with %i CPUs: N = %i T = %f\n'%(ncp,length,calc_time)
print (" \n Task for %i terms takes %f seconds for calc" %(length, calc_time))
print (" Max value of Autocorrelation func achieves %f" %(max(rxx)))
print (" And it'll be normalized to 50 \n")
#normalization to 50
norm_const = 50/max(rxx)
proves = autocorr(magn)
for k in xrange(length):
rxx[k] = rxx[k]*norm_const
proves[k] = proves[k]*norm_const | {
"domain": "codereview.stackexchange",
"id": 5623,
"lm_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, optimization, beginner",
"url": null
} |
thermodynamics, work, entropy
If you assume that heat converts to work then it should follow that the entropy being carried with thermal energy representing "heat" somehow disappears for work has no entropy. Since that is not allowed, Clausius introduced the concept of simultaneous heat compensation, a separate irreversible process to restore that disappearing entropy in the working fluid before rejected at a lower temperature.
What Kittel & Kroemer are quietly saying with "A device that generates work from heat must necessarily strip the entropy from the heat that has been converted to work" is that Clausius is wrong about that "heat compensation", there is no compensation, instead the entropy in the thermal energy is, by some magic, removed from it and it is the same entropy that is to be rejected at the lower temperature. Kittel & Kroemer do not explain that if that is indeed the case then what is being converted in the first place, and how does the converted heat become work. | {
"domain": "physics.stackexchange",
"id": 96016,
"lm_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, work, entropy",
"url": null
} |
c#, converting
}
else if (ThirdCharacterTextBox.Text.Equals("F", StringComparison.InvariantCultureIgnoreCase))
{
ThirdCharacter = F;
}
else if (ThirdCharacterTextBox.Text.Equals("G", StringComparison.InvariantCultureIgnoreCase))
{
ThirdCharacter = G;
}
else if (ThirdCharacterTextBox.Text.Equals("H", StringComparison.InvariantCultureIgnoreCase))
{
ThirdCharacter = H;
}
else if (ThirdCharacterTextBox.Text.Equals("I", StringComparison.InvariantCultureIgnoreCase))
{
ThirdCharacter = I;
}
else if (ThirdCharacterTextBox.Text.Equals("J", StringComparison.InvariantCultureIgnoreCase))
{
ThirdCharacter = J;
}
else if (ThirdCharacterTextBox.Text.Equals("K", StringComparison.InvariantCultureIgnoreCase))
{ | {
"domain": "codereview.stackexchange",
"id": 17962,
"lm_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#, converting",
"url": null
} |
thermodynamics, entropy, thought-experiment, noise
Title: Does this thought experiment violate the second law of thermodynamics? Consider an adiabatic box with an adiabatic board in the middle, which separates the box into two parts. There is a small hole in the board next to a coil, and the hole has a door which opens when the current in the coil reaches a certain value.
Now, if I put some gas in the right half of the box, where each molecule has a magnetic dipole moment, only fast molecules will produce enough current in the coil by induction to open the door.
After some time, the faster molecules will come to the left side and the slower molecules will be left on the right side, so the entropy in this isolated system decreases spontaneously. Does this violate the second law of thermodynamics? What's the problem with this setup? This ratchet-like Maxwell's demon has the same problem as all of the other ones: the door/coil mechanism itself will heat up, and become useless. | {
"domain": "physics.stackexchange",
"id": 29387,
"lm_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, entropy, thought-experiment, noise",
"url": null
} |
java, strings, parsing, json, factory-method
//removes all "{}[] characters
splitedPageContent[i] = pageContent[i].replaceAll("[\\[\\](){}]","").replaceAll("\"","").split(":");
// if statement is fullfiled every nth step where n equals attr value
if (i % attr == (attr-1)) {
int k = 0;
//so basically it is reorganising data
for (int j = attr-1; j >= 0; --j) {
groupedPageContent[savePoint][k] = splitedPageContent[i-j][1];
++k;
}
++savePoint;
}
}
return groupedPageContent;
} | {
"domain": "codereview.stackexchange",
"id": 13705,
"lm_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, strings, parsing, json, factory-method",
"url": null
} |
The FT of a three dimensional real function is not in general real, so there is no way you could express it in real spherical harmonics. I think however that if you only include harmonics with even $l$ the result should be real.
The FT of a spherically symmetric function $g(r)$ is $S(Q) = \int_{0}^{\infty} \frac{r}{Q} \sin(Qr) g(r)\,\mathrm{d}r$ (with some factors of $2\pi$ depending on how you define the FT).
A 3D function decomposed into spherical harmonics is a sum of products $g_{lm}(r) d_{lm}(\theta,\phi)$, so the FT will be a sum of convolutions $S(Q) \otimes \mathrm{FT} \left[ d_{lm}(\theta,\phi) \right]$. I can't think of an easy way to calculate these in general. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717432839349,
"lm_q1q2_score": 0.8345828993456249,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 326.1088456293106,
"openwebmath_score": 0.9665665626525879,
"tags": null,
"url": "https://scicomp.stackexchange.com/questions/11322/fourier-transform-of-function-in-spherical-harmonics"
} |
measurement, bloch-sphere
Title: Significance of angle $\phi$ on bloch sphere So far I learned that a qubit can be written as $| \psi \rangle = \alpha | 0 \rangle + \beta | 1\rangle$ with $|\alpha|^2 + |\beta|^2 = 1$ and reparametrized as $| \psi \rangle = cos( \theta / 2) + e^{i \phi} sin (\theta / 2)$ to visualize it on the bloch sphere: https://en.wikipedia.org/wiki/Bloch_sphere. Moreover, the source I am reading says that the probability to measure $0$ is $|\alpha|^2$ and the probability to measure $1$ is $|\beta|^2$.
Which role does the angle $\phi$ play since changing it does not influence the probabilities $|\alpha|^2$ and $|\beta|^2$ (due to $|e^{i \phi}| = 1$).
While thinking about this question it came to my mind that one could measure the qubit with different basis as well. Is this assumption true? If yes, are there some examples of application? You got it exactly; it matters when measuring in different bases. | {
"domain": "quantumcomputing.stackexchange",
"id": 4417,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "measurement, bloch-sphere",
"url": null
} |
DP[i] = max (DP[i], dp[hsh[i] - 1] + sum(hsh[i], i))
hsh[i] \text{ is the largest j (j < i) such that segment} [j,i] \text{ is the balanced.}
The given recurrence is using the simple fact if expressions E_{1} and E_{2} are balanced, expression E_{1}E_{2} is balanced.
For finding out overall maximum sum sub-array we can iterate over each i and take maximum of DP[i].
### Solutions:
Setter’s solution can be found here.
Tester’s solution can be found here.
5 Likes
can anybody tell why this solution got tle
solution
why largest index j in the hsh[] array?
shouldn’t it be for all j < i such that [j, i] is properly parenthesized?
For each i, there will be only one j such that [j,i] will be balanced. I couldn’t come up with a counter example, so I assume its true.
can anybody tell why this solution got wa link text
I applied the same logic, but got tle. Can anybody suggest what’s wrong in my solution | {
"domain": "codechef.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811611608242,
"lm_q1q2_score": 0.810663348905641,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 2611.3031041066633,
"openwebmath_score": 0.3939034640789032,
"tags": null,
"url": "https://discuss.codechef.com/t/subarray-editorial/9642"
} |
refraction, geometric-optics, variational-principle
From these values, we can calculate the travel times:
$$
t_{\text{refr}} = (d_1 + d_3) / c * n_a + d_2 / c * n_d
$$
$$
t_{\text{dir}} = (d_1' + d_3') / c * n_a + d_2' / c * n_d
$$
with $d_1 = |\overline{AC_1}|$, $d_2 = |\overline{C_1C_2}|$, $d_3 = |\overline{C_2B}|$ and $d_i'$ the same but replacing $C_j$ with $E_j$. $n_a$ also denotes the index of refraction of air. The resulting travel time is then $t_{\text{refr}} = 4.84 \, \text{ns}$ and $t_{\text{dir}} = 4.53 \, \text{ns}$, i.e. the direct ray actually has a shorter travel time because its travel length in the object is far shorter than for the refracted ray. Usually, however, if people talk about Snell's law, it is said that the straight line has a longer travel time (and is therefore not taken) because of its longer way through the object, i.e. refraction causes the travel length through the medium of higher refractive index to shorten, which is the opposite of what is happening here. | {
"domain": "physics.stackexchange",
"id": 86657,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "refraction, geometric-optics, variational-principle",
"url": null
} |
organic-chemistry, thermodynamics, aromatic-compounds, stability, carbocation
Breslow, R.; Groves, J. T. (1970). "Cyclopropenyl Cation. Synthesis and Characterization". J. Am. Chem. Soc. 92 (4): 984–987. doi:10.1021/ja00707a040. | {
"domain": "chemistry.stackexchange",
"id": 17929,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, thermodynamics, aromatic-compounds, stability, carbocation",
"url": null
} |
api, r
Below you can find the main methods, here a link to the repo.
get_travel_time.R
#' Get travel time between two points
#'
#' Computes estimated travel time between two points using public transport.
#' If \code{time} and \code{time_type} are not specified, time of travel will be assumed to be the same time at which the request is made.
#'
#' @param start_coord Geographical coordinates of the start point in WGS84 '<latitude>,<longitude>' format.
#' @param end_coord Geographical coordinates of the arrival point in WGS84 '<latitude>,<longitude>' format.
#' @param time A date & time in ISO-8601 format (e.g \code{2014-11-06T19:00:02-0500}). If omitted travel time will be computed for travel at the time of the request.
#' @param time_type Required if `time` is provided. At the moment the only defined type is `arrival`, it computes the travel time for arriving at `end_coord` at the given time.
#' @inheritParams citymappr_setup
#' @return Estimated travel time in minutes (int).
#'
#' @examples | {
"domain": "codereview.stackexchange",
"id": 36996,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "api, r",
"url": null
} |
automated-theorem-proving
This would be something along the lines of induction, I guess. In that you'd have just as much confidence in the complex prover at the end as the hand checked prover you started with.
If it has been explored (wouldn't be surprised), a pointer towards more resources would be welcome. Not that I know of. A more typical architecture is to decompose the theorem prover into a prover plus a proof checker. Then only the proof checker needs to be validated. If proofs are expressed in a simple enough language, then the proof checker might be extremely simple. All of the smarts can go into the prover (which tries various strategies to try to find a valid proof), but it doesn't need to be validated, since its output will always be checked by the proof checker. | {
"domain": "cs.stackexchange",
"id": 11696,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "automated-theorem-proving",
"url": null
} |
A slightly different proof (which doesn't start with knowledge of the hypotenuse):
we want the side of the square, call it $x$,
the area of the square is $x^2$,
the non-hypotenuse (two shortest) sides of the original, right-angled triangle are $a,b$
the area of the original triangle is, therefore, $\frac{ab}2$
removing the square leaves two smaller right-angled triangles (angles on a line sum to $180^\circ$)
they also have two shortest sides (meeting at the respective right-angle),
one of these sides of each of those triangles is a side of the square with length $x$,
the other of the sides are $a-x$ and $b-x$
the sum of the areas of those two smaller triangles is\begin{align}&\frac{x(a-x)}2+\frac{x(b-x)}2\\=&\frac{x(a+b)}2-x^2\end{align} the two smaller triangles and the square make up the whole of the original triangle so\begin{align}\frac{ab}2&=\frac{x(a+b)}2-x^2+x^2\\ab&=x(a+b)\\x&=\frac{ab}{a+b}\end{align}
Yielding an answer to the specific question posed of | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137916170774,
"lm_q1q2_score": 0.809632988718298,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 628.8458417709084,
"openwebmath_score": 0.8396172523498535,
"tags": null,
"url": "https://puzzling.stackexchange.com/questions/40213/side-length-of-square-inside-a-triangle"
} |
exoplanet, planetary-transits
If the transit is partial then you get a more "U-shaped" and finally a "V-shaped" eclipse because there is a singular minimum point when the maximum area of star is obscured.
In this way you have both the shape and depth of the transit to work with and this can give you both the inclination (or rather the "impact parameter") of the exoplanet orbit and the exoplanet size. | {
"domain": "astronomy.stackexchange",
"id": 5112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "exoplanet, planetary-transits",
"url": null
} |
python, performance, algorithm, breadth-first-search
Naming: the function name repeats is a bit ambiguous, it sounds like how many times n appears in the sequence. A better name could be first_repeating_sequence_of.
Edge case: for bigger n, more digits of pi are required, otherwise no matches are found. Consider passing the max number of digits of pi as an argument so the caller is aware of this limit. | {
"domain": "codereview.stackexchange",
"id": 41345,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, algorithm, breadth-first-search",
"url": null
} |
use Ctrl + Shift + = Aug 26, 2010 8:39 pm comment! We use the \frac command to display them in LaTeXis very similar to the numerator and.. Tutorial on how to typeset integrals, fractions and binomial coefficients are common elements in mathematical expressions: command... Defined by the next expression: \ [ \binom { } { }! Typeset integrals, fractions and binomial coefficients in an expression is straightforward nombreux cas on... Latexis very similar to the numerator and denominator is quite flexible, they can be nested obtain! Or not little ) technical problems start typing LaTeX documents fraction is very easy the braces } will the! And Science related features ( e.g fraction using these different formats with subscript, Enter your equation Alt!, information, etc to solve your little ( or not little ) technical problems and about! Via$ \frac { 1 } { } { } will print the binomial coefficient is defined by next! Pour les opérations arithmétiques, on peut avoir la négation d'un | {
"domain": "hamnvag.no",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9136765328159727,
"lm_q1q2_score": 0.8253187165153385,
"lm_q2_score": 0.9032942041005328,
"openwebmath_perplexity": 3931.995740765869,
"openwebmath_score": 0.9558112621307373,
"tags": null,
"url": "https://hamnvag.no/9xl9pip/8159ac-fraction-in-latex"
} |
python, console
Title: Job queue system I'm doing a side project at work and I consider it as a learning opportunity more than work itself, but it does hold a purpose if I can complete it. Anyway, I'll post the code, what it actually does and hopefully people can critique/improve what I've done.
os.system("bjobs -u all| awk ' NF>1' > file")
lines = open('file', 'r').readlines()
del lines[0]
open('file', 'w').writelines(lines)
source = open("file")
out = open("file1", "w")
for line in source:
out.write(line.split(" ")[0] + "\n")
out.close()
source.close()
This code does 2 parts. Firstly the bjobs -u all| awk ' NF>1' > file will print this to a file (plus however many jobs are running): | {
"domain": "codereview.stackexchange",
"id": 1529,
"lm_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, console",
"url": null
} |
electrostatics, electricity, voltage, dielectric, lightning
Another way to understand the lightning initiation process is very similar to the amplification of the background electric field on the surface of a conductor. We know from electromagnetic theory that the electric field on the conductor may be $\sim 3$ times the background field. One of the ideas for solving the lightning initiation problem considers hydrometeors, i.e., liquid or ice particles in clouds. The idea is that the presence of hydrometeors locally enhances the field near their surfaces, both due to charges residing on them and due to their polarization. The local increase of field then can lead to electrical breakdown (e.g., Jansky and Pasko, 2020).
I hope this provides the answer to your question. Please let me know if anything is unclear or you have other questions. | {
"domain": "physics.stackexchange",
"id": 85565,
"lm_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, electricity, voltage, dielectric, lightning",
"url": null
} |
photons, laser, polarization, quantum-optics
Title: Polarization in Lasers and Liquid Crystal Displays When we talk about Polarization in Lasers we mean placement of the crystal at Brewster angle to block the s-polarization and only the p-polarization will survive. How do we compare the term polarization in Lasers and in liquid crystal displays? So, for example, we know there are polarizers present in the case of LCD. Does that mean we are also using these polarizers to block the back-light s-polarization and want the p-polarization at the output? Polarization has the same meaning in both cases, as a general optical phenomenon, but it is exploited differently in the two situations.
In lasers the Brewster window (or some other polarizing optic) is used to create losses in the feedback path for one of the polarizations. This ensures that only the other polarization can lase and, therefore, that the output of the laser has a well defined polarization. | {
"domain": "physics.stackexchange",
"id": 11249,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photons, laser, polarization, quantum-optics",
"url": null
} |
python, python-3.x, finance, tkinter, sqlite
#creation of labels
self.first_name_label =tk.Label(master, text = 'First name', fg = 'dark green').grid(row = 1 , column = 0 , sticky = 'we')
self.last_name_label =tk.Label(master, text = 'Last name', fg = 'dark green').grid(row = 1 , column = 1 , sticky = 'we')
self.Company_label =tk.Label(master, text = 'Company', fg = 'dark green').grid(row = 3 , column = 0 , sticky = 'we')
self.amount_due_label =tk.Label(master, text = 'amount due', fg = 'dark green').grid(row = 3 , column = 1 , sticky = 'we')
self.account_number_label =tk.Label(master, text = 'account number', fg = 'dark green').grid(row = 7 , column = 0 , sticky = 'we')
self.amount_paid_label =tk.Label(master, text = 'amount paid', fg = 'dark green').grid(row = 9 , column = 0 , sticky = 'we')
self.due_date_label =tk.Label(master, text = 'due date', fg = 'dark green').grid(row = 9 , column = 1 , sticky = 'we') | {
"domain": "codereview.stackexchange",
"id": 29482,
"lm_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, finance, tkinter, sqlite",
"url": null
} |
classical-mechanics, fluid-dynamics
Questions: Is this analysis correct? I'd really like to know the quantitative model for this. Not quite. But before getting into the math, you'd need to fix up the problem a bit: if the string and the ball are both massless, then there will be nothing left to oscillate once the water drains out. It probably makes the most sense to assume that the ball is a uniform spherical shell with a mass $m$. For simplicity, I'll make two more assumptions: | {
"domain": "physics.stackexchange",
"id": 769,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, fluid-dynamics",
"url": null
} |
c#, object-oriented, dependency-injection
public HumanFactory(TransportFactory tFactory)
{
horse = tFactory.ProvideTransport(TransportTypes.Horse);
camel = tFactory.ProvideTransport(TransportTypes.Camel);
ship = tFactory.ProvideTransport(TransportTypes.Ship);
}
public Human ConfigureHuman()
{
if (_availableTransports == null)
{
_availableTransports = new Dictionary<string, ITransport>();
_availableTransports.Add(GroundTypes.Desert.ToString(), camel);
_availableTransports.Add(GroundTypes.Sea.ToString(), ship);
_availableTransports.Add(GroundTypes.Plains.ToString(), horse);
}
transportRequested += new Action<Human, string>(_human_transportRequested);
_human = new Human(transportRequested);
return _human;
} | {
"domain": "codereview.stackexchange",
"id": 4126,
"lm_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, dependency-injection",
"url": null
} |
homework-and-exercises, angular-momentum, rotational-dynamics, conservation-laws
Actually, you will have to exert a force while you pull the string, and since the motion is frictionless, this work has to go somewhere, namely into the kinetic energy of the rotating object. | {
"domain": "physics.stackexchange",
"id": 79881,
"lm_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, angular-momentum, rotational-dynamics, conservation-laws",
"url": null
} |
A few closing thoughts to the reader:
• Can we characterize the values of $n$ above similar to what we did for $g=2$?
• Are any of these sequences on the Online Encyclopedia of Integer Sequences?
• Has a full mathematical analysis been conducted? I’ve seen the XKCD Urinal Protocol Vulnerability, but this assumes the first person sits on the end.
• Stay safe, and continue to practice social distancing everywhere you go!
# Similar to Fermat’s Last Theorem
Let $n$ be a positive integer. Prove that there exist distinct positive integers $x, y, z$ such that $x^{n-1} + y^n = z^{n+1}.$ (Source: 1997 IMO Shortlist N6) | {
"domain": "numbertheoryguy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717448632122,
"lm_q1q2_score": 0.8042853328459857,
"lm_q2_score": 0.8152324826183822,
"openwebmath_perplexity": 196.52895737182104,
"openwebmath_score": 0.6612284183502197,
"tags": null,
"url": "https://numbertheoryguy.com/category/puzzles/"
} |
kinematics, acceleration, vectors, velocity, calculus
However, even after imposing these two restrictions, you are left with the freedom to select any (let's say smooth) function $\tau(t)$ as torsion. If you select the torsion to be zero $\tau(t) = 0$, then you obtain a circle. If you set the torsion to a non-zero constant, you get a helix. But if you choose something much more involved, then... well I think you get my point.
Let me put it this way, under the two constraints of arch-length parametrization and constant curvature, the space of all curves with these two properties is parametrized by the space of, say smooth functions $\tau(t)$ which is an infinite dimensional space. For each choice of torsion function, you get a curve with a unique geometry, up to rotation and translation.
So If things do not work in 3D, then imagine the complexity in higher dimensions. | {
"domain": "physics.stackexchange",
"id": 80737,
"lm_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, acceleration, vectors, velocity, calculus",
"url": null
} |
general-relativity, gravity, mass, mass-energy
Conclusion
Okay, so it sounds a whole lot like the weight of the proton doesn't change, but I said it did at the very top.
The key here is that "weight" applies to a gravitational interaction between two things. Two $7$ TeV protons moving at the same velocity are in a shared reference frame, so their gravitational attraction is identical to two protons at rest. But if one proton is moving relative to the the other, all observers will agree that the total energy of the system is greater than the sum of their masses. The joint gravitational field of both protons will be stronger due to their relative motion. In that sense the moving proton "weighs" more. | {
"domain": "physics.stackexchange",
"id": 89082,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity, mass, mass-energy",
"url": null
} |
system. 3) (A p, A^,, Az) or A a (2. t where v = ds/dt Here v defines the magnitude of the velocity (speed) and (unit vector) u. Keywords: Euler equations, Navier-Stokes equations, Lagrangian description, Eulerian description, Bernoulli's law, rectangular coordinates, cylindrical coordinates, spherical coordinates. Therefore we have velocity and acceleration as: v = ˙rur +rθ˙uθ + ˙zk a = (¨r −rθ˙2)ur +(rθ¨+ 2˙rθ˙)uθ + ¨zk. The Cartesian coordinate system provides a straightforward way to describe the location of points in space. Note: the angle Θ is in degrees. Hello, I tried to use the cylindrical coordinate system to see the axial velocity patterns in my model. This is the most common type of velocity reported. The cylindrical Couette flow of a rarefied gas is investigated, under the diffuse-specular reflection condition of Maxwell’s type on the cylinders, in the case where the inner cylinder is rotating whereas the outer cylinder is at rest. Due to the low thermal conductivity of phase | {
"domain": "daisytale.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815519849906,
"lm_q1q2_score": 0.8177680555031247,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 603.2376859278611,
"openwebmath_score": 0.8972199559211731,
"tags": null,
"url": "http://daisytale.it/qiyn/velocity-in-cylindrical-coordinates.html"
} |
forces, stress-strain
The second figure is incorrect. You are showing the entire load $P(x+L)$ as acting to the left of the cut section but only part of the load acts to the left of the section. The total load to the left of the section is $Px$.
II - (Third figure of second picture) If we calculate the resultant
after separating into sections, the magnitude of stress would be the
vector sum of R1 and P(x). | {
"domain": "physics.stackexchange",
"id": 60684,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, stress-strain",
"url": null
} |
bond
Title: What affects bond angles? I have three factors in mind:
1) vdW repulsions
2) Bond length
3) Electron-electron repulsions.
I know that vdW repulsions between ligand atoms push the atoms apart. And bond length obviously influences bond angle; if the bonds were very long, then the bond angle can shrink without bringing the ligand atoms too close together.
Are there any other factors or are these it? Bond angles mainly depend on the following three factors: | {
"domain": "chemistry.stackexchange",
"id": 1504,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "bond",
"url": null
} |
algorithms, complexity-theory, integers
More generally, this method allows you to find the unique real solution to your system of equations, if any exists.
Note that $m = (b-1)/s = 2(b-1)/(c-1)$. Hence $s,m$ are integers if $s$ is odd and $c-1$ divides $2(b-1)$. If they are integers, the final equation is satisfied if
$$
a = ms + m = b-1 + \frac{2(b-1)}{c-1} = (b-1) \frac{c+1}{c-1}.
$$
Another way to state this condition is
$$
a(c-1) = (b-1)(c+1).
$$ | {
"domain": "cs.stackexchange",
"id": 4931,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, complexity-theory, integers",
"url": null
} |
c++, c++11, socket, server, tcp
return std::shared_ptr<TcpSocket>(new TcpSocket(newSock, info, true, false));
}
void TcpSocket::send(const char *data, unsigned int length, int flags)
{
const char * buff = data;
int status = 0;
int total_sent = 0;
int left_to_send = length;
while(total_sent < length)
{
status = ::send(mSock, buff + total_sent, left_to_send, flags);
if(status == -1)
{
throw SocketSendException(std::string(strerror(errno)));
}
else
{
total_sent += status;
left_to_send -= status;
}
}
}
bool TcpSocket::receive(char* msg, int len, int flags)
{
int status;
if( (status = ::recv(mSock, msg, len, flags)) == -1)
throw SocketReceiveException(std::string(strerror(errno)));
else if(status == 0)
return false;
return true;
} | {
"domain": "codereview.stackexchange",
"id": 15057,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, socket, server, tcp",
"url": null
} |
javascript, algorithm, jquery
/**
* Checks links to see whether they need matching
*
* Loops through all cats, selects the non-matching, for every link decides
* whether it needs matching
*
* cats = (array) an array with all the category-objects in it
* currentQuery = the currently typed-in query
* previousQuery = the query that was previously typed in
*
* returns (array) cats, possibly in a different state
*/
function flagIfMatchingIsNeededForLinks(cats,currentQuery,previousQuery) {
var newQueryIsLonger = isNewQueryLonger(currentQuery, previousQuery);
for (var i = 0; i < cats.length; i++) {
if (!cats[i].matches) { // only necessary when cat does not match
for (var k = 0; k < cats[i].links.length; k++) {
cats[i].links[k].matchingNeeded = isMatchingNeededForLink(
cats[i].links[k].matches
,newQueryIsLonger
,currentQuery.length
,cats[i].links[k].noMatchFoundAtNumChars
); | {
"domain": "codereview.stackexchange",
"id": 1111,
"lm_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, algorithm, jquery",
"url": null
} |
quantum-field-theory, symmetry, symmetry-breaking, wilson-loop
To drive this point home, one can go back to imagining spacetime on a torus, and smoothly deforming $C$ to wrap around one non-trivial cycle of the torus, such that $C$ becomes two separated non-trivial cycles of the torus with opposite direction, which I will call $C_1$ and $C_2$, with a cylinder shaped membrane between them. Note that $W(C) = W(C_1)W(C_2)$, and $W(C_1), W(C_2)$ are charged under the 1-form global symmetry! Next, I imagine separating $C_1$ and $C_2$ from each other by increasing the height of the cylinder connecting them, let's call this height/separation $h$. The vev decays exponentially in $h$ if we are in area law, but remains constant (with a subleasing decay) if we are in perimeter law. For sufficiently large separation $h$, we can use the usual long-range order argument to say $\langle W(C)\rangle = \langle W(C_1)\rangle | {
"domain": "physics.stackexchange",
"id": 92608,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, symmetry, symmetry-breaking, wilson-loop",
"url": null
} |
performance, email, groovy
19990225|96542|00711|0528|1684.45|19990101|19990131|For services rendered|1|F|2.00|-70|630|19990115|L510||A102|22547|Research Attorney's fees, Set off claim|24-6437381|350|Arnsley, Robert|PARTNR|423-987|77654|76-1235|Merten Merger|694.20|22240.25|GBP|Arnsley|Robert|O|||||||||||||||.16|100.80|VAT|100.80|[]
19990225|96542|00711|0528|1684.45|19990101|19990131|For services rendered|2|F|2.00|0|700|19990115|L510||A102|22547|Research attorney's fees, Trial pleading|24-6437381|350|Arnsley, Robert|PARTNR|423-987|77654|76-1235|Merten Merger|694.20|2240.25|GBP|Arnsley|Robert|O|||||||||||||||.16|112.00|VAT|112.00|[]
19990225|96542|00711|0528|1684.45|19990101|19990131|For services rendered|3|F|0.200|0|40|19990116|L510||A107|45875|Telephone conference with John Doe|24-6437381|200|Beaster, John|ASSOC|423-987|77654|76-1235|Merten Merger|694.20|2240.25|GBP|Beaster|John|O|||||||||||||||.16|6.40|VAT|6.40|[]
--a92720f5836d4daaa4251e805cba228b
''' | {
"domain": "codereview.stackexchange",
"id": 25753,
"lm_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, email, groovy",
"url": null
} |
beginner, android
That way the TTS will be ready before the user can click the button and is only initialised once.
You are getting the value of your editText AFTER you startActivityForResult().
This does not seem to be the logical order, although if you remove the code above from your onClick(), that also solves this problem.
You have a magic number 1 in your startActivityForResult() method, better use a final value with a proper name like :
private final int TTS_REQUEST_CODE = 1;
makes this also look way better :
startActivityForResult(checkIntent, TTS_REQUEST_CODE);
if (requestCode == TTS_REQUEST_CODE)
In case the application becomes larger and more complex this will be way more secure and readable since the value is final and cannot be tampered with.
There is no information to the user wether the TextToSpeech is installed and ready or not, I would suggest showing a Toast or a Snackbar to let the user know what is happening, especially in case of
status == TextToSpeech.ERROR | {
"domain": "codereview.stackexchange",
"id": 40102,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, android",
"url": null
} |
Then stuck....
Thanks
2. Jul 29, 2013
### Simon Bridge
I would have read the "digit" part as meaning that the uncertainty given has been rounded to 2 digits.
But $\small (2.64 \pm 0.06)\text{A}$ would be an uncertainty of 2.3%
Similarly, I'd have expected part b to be the mean of the measurements - with the uncertainty on the mean as the error.
I I guess a typo and that 2.04A should be 2.64A, then the mean becomes 2.11A - kinda the same sort of typo perhaps?
So you do need to check how you are expected to interpret that rating.
So I too await what others come up with.
Note: you've asked this question in lots of forums... if another forum beats us to it, please repost here.
Thanks.
3. Jul 29, 2013
### songoku
Hm...yes.
0.06 / 2.64 x 100% ≈ 2.3 % not 1.5%. It is because of that ± 2 digits. If we subtract 0.02 from 0.06 then the uncertainty will be back to 1.5% but the measurement can't be written as 2.64 ± 0.06. This confuses me. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9473810421953309,
"lm_q1q2_score": 0.8071239298688182,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 1062.562749528778,
"openwebmath_score": 0.5086212158203125,
"tags": null,
"url": "https://www.physicsforums.com/threads/reading-with-uncertainty.703479/"
} |
quantum-mechanics, hilbert-space, superposition, two-level-system
Yet I cannot find any mention of such solutions in theory or in nature. Have I made a mistake or are they prevented by some principle?
Edit: Maybe measuring the spin of an electron in a magnetic field along an arbitrary axis is the same as switching to an arbitrary basis? That might look like an unequal energy superposition in the new basis? Certain systems - like electron spin - can be described by a two-state system plus changes of basis. The change of basis corresponds to measurement of spin along a different direction in space and can look like an unbalanced superposition from the point of view of the new basis.
All possible states of a two-state system can be represented as points on the Bloch sphere and opposite points on that sphere always form a basis https://en.wikipedia.org/wiki/Bloch_sphere | {
"domain": "physics.stackexchange",
"id": 76675,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space, superposition, two-level-system",
"url": null
} |
-
Good work on attempting a solution. You can learn a lot from experimenting. With regards to your attempt, when you take x out as a common factor, you have to take x out of all components. So (x-3) = x(1 - 3/x) A good way to test your steps is to expand it out again! – Fuzz Mar 24 '14 at 14:04
@Fuzz Thanks..for encouragment..I quitely do it often..whenever I don't understand..still I solve some way..but not sure..that what I did is in the right way or in the wrong way? – Umair Shah Mar 24 '14 at 14:11
Some easy ideas to attack your problem with integer solutions:
$$(x-3)(x+9)(x+5)(x-7)=385=5\cdot7\cdot11\implies$$
one of the factors in the LHS must be $\;\pm1\;$ , and after a little action we can see this happens for $\;x=2\;$ since the signs fit nicely (two positive, two negative):
$$(2-3)(2+9)(2+5)(2-7)=(-1)\cdot11\cdot7\cdot(-5)=385$$
Try now also $\;x=-4\;$ ... | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799441350253,
"lm_q1q2_score": 0.8031415319161644,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 846.8404456583871,
"openwebmath_score": 0.8998255729675293,
"tags": null,
"url": "http://math.stackexchange.com/questions/724655/solve-the-equation-x-3x9x5x-7-385"
} |
quantum-mechanics, quantum-field-theory, gauge-theory, quantum-electrodynamics, transport-phenomena
E_k^L{\psi_k}_L = \left(-\left(k+\frac12\right)\frac{2\pi}{r} 1+e(A^0-A^1)\right) {\psi_k}_L
\end{cases}
\end{equation}which give us the spectrum:
\begin{equation}
\begin{cases}
E_k^R = eA_0+\frac{2\pi}{r} \left(k+\frac12\right)+eA^1\\
E_k^L = eA_0-\frac{2\pi}{r} \left(k+\frac12\right)-eA^1
\end{cases}
\end{equation}
so we see that the $A_0$ gives energy linearly to both components ($\psi_R$ and $\psi_L$) creating or destroying both equally, which is related to the $j_V$, while the $A_1$ give energy also linearly to one and takes from the other, converting left to right and vice-versa, related with $j_A$. Where we see the relation of the gauge freedom with the anomaly of the vector and axial currents/charges ($Q_V=|\psi_R|^2+|\psi_L|^2$ and $Q_A=|\psi_R|^2-|\psi_L|^2$).
Which at the limit $r \xrightarrow[]{} \infty$, which would means going to the infinite normal Minkowsky 1+1d space-time again, doesn't make much sense to me. | {
"domain": "physics.stackexchange",
"id": 89222,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, gauge-theory, quantum-electrodynamics, transport-phenomena",
"url": null
} |
modulation, oscillator
Since the accumulator output represents phase that is changing with time, and we want to generate a sinusoid output ($sin(\theta)$), then we can simply use a LUT to perform the trigonometric function. (Note: If you have plenty of extra cycles but no memory, other techniques to calculate the sine of an angle can be done, notably the CORDIC algorithm). Beautiful right? So now how do we decide on specifics to design our NCO, and what happens when we lose all the least signficant bits in our phase word? Read on! | {
"domain": "dsp.stackexchange",
"id": 4822,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "modulation, oscillator",
"url": null
} |
quantum-mechanics, linear-algebra
Title: Formalism in Quantum Mechanics How inner product of two vectors (generalizing the dot product in three dimensions)give a complex number Vectors in introductory linear algebra are often assumed to consist of real numbers. However, other varieties of vectors are available !
The elements of the vectors used in the matrix formulation of quantum mechanics are complex numbers. In other words, they form a complex vector space. The inner product of two vectors in a complex vector space can be a complex number.
In a complex vector space the geometric interpretation of the inner product $\vec a.\vec b = |a||b|\cos \theta$ does not really apply. | {
"domain": "physics.stackexchange",
"id": 81333,
"lm_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, linear-algebra",
"url": null
} |
ros2
Any way to avoid this behavior? It is
quite annoying from an
interoperability point of view (Admin
console, but also other non ROS2
DDS-based applications).
We are aware of the mismatch with RTI's Admin Console, but AFAICT there is no workaround. I am not quite sure if I understand your point on non ROS2 DDS-based applications. Our workaround is safe to use between multiple DDS vendors and is wire compatible (we run quite a few cross talking tests on the ROS2 buildfarm, e.g. Connext and FastRTPS).
Does the behavior change when I would
use IDL instead of msg files? I didn't
find a way to get that working
although it should work on Dashing.
No. The message generation step is independent from the way we send it over the wire. | {
"domain": "robotics.stackexchange",
"id": 33739,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
control, ros, moveit
Originally posted by gvdhoorn with karma: 86574 on 2016-02-04
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by ipa-hsd on 2016-08-04:
Isn't removing Moveit from the scenario increase the probability of self-collisions? Maybe this particular case the robot is safe, but I'm talking about other scenarios with similar requirements.
Comment by gvdhoorn on 2016-08-13:
@intelharsh: well, yes. You could -- if timing and performance allows -- use the collision scene maintained by MoveIt to include some form of checking. But OMPL just isn't very well suited for the kinds of planning tasks that @cobhc999 wanted to do. | {
"domain": "robotics.stackexchange",
"id": 23643,
"lm_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, ros, moveit",
"url": null
} |
food, decomposition
Title: Worm compost cannot have cooked food I live in the Netherlands and it is getting fashionable to compost with worms. After investigating a few websites I noticed that most websites suggested that I cannot feed the worms leftovers from citrus fruits. This seems logical. I then started noticing that people advise against feeding the worms cooked food.
I'm no biologist but I cannot imagine a reason why cooked food is bad for the worms. Could anybody explain why this might be in layman’s terms? There are a few reasons for not feeding cooked foods to worms (Eisenia spp.) in a smaller household size worm farm. It's not because the food is cooked but what it often contains. | {
"domain": "biology.stackexchange",
"id": 7334,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "food, decomposition",
"url": null
} |
java, beginner, game, console, hangman
public class Game {
// check if args[2] is an int
public static boolean CheckInt(String input) {
boolean valid = true;
for (int i = 0; i < input.length(); i++) {
String secondarg = input.substring(i, i + 1);
if (secondarg.compareTo("0") < 0 || secondarg.compareTo("9") > 0) {
valid = false;
System.out.println("First argument must be integer");
System.exit(1);
}
}
return valid;
}
public static void main(String[] args) {
BufferedReader reader = null;
if (args.length != 2) {
System.out.println("Please enter two arguments");
System.exit(2);
}
boolean result = CheckInt(args[1]);
// try to open file
try {
reader = new BufferedReader(new FileReader(args[0]));
} catch (FileNotFoundException fnfe) {
System.out.println("Error opening file" + args[0]);
System.exit(3);
}
boolean done = false;
String inputLine = null;
String[] words = null;
int length = 0; | {
"domain": "codereview.stackexchange",
"id": 23198,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, game, console, hangman",
"url": null
} |
navigation, rviz, ros-kinetic, gmapping, marker
Now you have your history_map with an object detected, you just have to copy the occupancy grid and replace the 50 by 0 to get your cleared_map.
Note : I couldn't find ros packages doing that but you can probably identify objects using openCV, that would be more precize and easier than working direclty with the occupancy grid data. Moreover, if my first assumption about the coordinates of the objects being only one pose is wrong and you do have the edges, then the last part is trivial.
Hope it helps.
Originally posted by Delb with karma: 3907 on 2019-02-28
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 32537,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, rviz, ros-kinetic, gmapping, marker",
"url": null
} |
quantum-mechanics, quantum-information, probability, bells-inequality, non-locality
Blockquote
"The central realization of Bell’s theorem is the fact that there are quantum correlations obtained by local measurements ($M_a^x$ and $M_b^y$) on distant parts of a joint entangled state $\varrho$, that according to quantum theory are described as:
$$p_{Q}(a,b,|x,y) = \text{Tr}(\varrho(M_a^x\otimes M_b^y) $$
and cannot be decomposed in the LHV form (i.e. The CH condition for locality)"
So why $p_Q(a,b|x,y)$ is seen as a measure of quantum correlation (that for definition is the mean of the product of the possible output)? It isn't a joint probability distribution (as stating while obtaining the LHV form)?
Is there a link between the classical correlation ($E(\vec{a},\vec{b})$) and the joint probability distribution $p(a,b|x,y,\lambda)$?
NOTE: This question has also been asked on quantumcomputing.SE. Copied from the same answer on quantumcomputing.SE. | {
"domain": "physics.stackexchange",
"id": 55884,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information, probability, bells-inequality, non-locality",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.