text stringlengths 1 1.11k | source dict |
|---|---|
thermodynamics, temperature, dimensional-analysis, si-units, metrology
That, said, of course, if the answer is "because of historical reasons", then we also need to discuss what those historical reasons actually are.
So: up until 2018: because the kelvin was metrologically independent. The framework of statistical mechanics is sufficiently strong that it leaves no room for doubt that, as far as the abstract concepts go, temperature is directly proportional to energy through a fixed, universal constant (the Boltzmann constant), and, as such, it is not really an independent physical dimension. However, the fact that they're equivalent in the theory doesn't mean that this can be reliably implemented in the laboratory to high precision. | {
"domain": "physics.stackexchange",
"id": 75038,
"lm_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, temperature, dimensional-analysis, si-units, metrology",
"url": null
} |
To load a function, the mesh need to be exactly the same as the one used when saving it.
``````auto Vh = Pch<1>( mesh );
auto u = Vh->element("v");
The `path` and `type` parameters need to be the same as the one used to save the function.
##### Extended parallel doftable
In some cases, when we use parallel data, informations from other interfaces of partitions are need. To manage this, we can add ghost degree of freedom on ghost elements at these locations. However, we have to know if data have extended parallel doftable to load and use it.
In order to pass above this restriction, the two function `load` and `save` has been updated to use hdf5 format. With this format, extended parallel doftable or not, the function will work without any issues. More than that, we can load elements with extended parallel doftable and resave it without it, and vice versa. This last feature isn’t available with other formats than hdf5.
### 14.6. Bilinear and Linears Forms | {
"domain": "feelpp.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813538993888,
"lm_q1q2_score": 0.8163246661246598,
"lm_q2_score": 0.8539127492339909,
"openwebmath_perplexity": 13718.21862802429,
"openwebmath_score": 0.26109886169433594,
"tags": null,
"url": "http://book.feelpp.org/user-manual/"
} |
in part 3:. Each group selects 6-8 different regular polygons (two per person). The Corbettmaths Practice Questions on Angles in Polygons. Which has more sides: a hexagon or a pentagon? hexagon 6. Regular polygon. MathScore EduFighter is one of the best math games on the Internet today. The next step is to show your knowledge of Polygon Properties with our interactive matching activity. Abstract white poly background. Irregular polygon. SplashLearn is an award winning math learning program used by more than 30 Million kids for fun math practice. This question cannot be answered because the shape is not a regular polygon. All photos are included but can be easily changed to match your branding’s style and personality. 180° ~ [ Sum of all angles For a hexagon: 720° One interior angle = - 120° 6 Note: The previous information could also be used to find the number of sides for a regular polygon given the measure of one interior angle. Newest Active Followers. Barnes et al. Remember the | {
"domain": "clandiw.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513873424044,
"lm_q1q2_score": 0.8260200949028581,
"lm_q2_score": 0.8376199694135332,
"openwebmath_perplexity": 601.3711387596932,
"openwebmath_score": 0.2936362624168396,
"tags": null,
"url": "http://clandiw.it/xpik/regular-polygon-questions.html"
} |
laser
You will now be able to determine the available fluence at every distance, given the assumption that there are no losses, or you can include a loss parameter, such as a certain proportion per meter due to scattering.
The most powerful lasers today can produce brief pulses, under 100 femtoseconds in duration, with perhaps 10 joules per pulse, and an initial beam diameter of one millimeter. Of course you can invent more powerful lasers for your project, but this gives you a start. This system will also require some fantastic degree of pointing stability, for not only will you have to point at a distant star, but you will also have to point at the actual detector in orbit about that star, and actually hit it.
We can actually detect single photons, but for communications you will need to provide a communications protocol which will permit the detector to know that it has received a signal, as opposed to a random photon. | {
"domain": "physics.stackexchange",
"id": 29437,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "laser",
"url": null
} |
c#, networking, unity3d, tcp, udp
// Send the contents of buffer
client.Send(buffer, buffer.Length, endPoint);
}
catch (SocketException se)
{
PrintError("SocketException sending to " + address + ":" + port + ": " + se.ToString());
}
catch (Exception e)
{
PrintError("Unexpected exception sending to " + address + ":" + port + ": " + e.ToString());
}
}
} | {
"domain": "codereview.stackexchange",
"id": 33287,
"lm_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#, networking, unity3d, tcp, udp",
"url": null
} |
cv-bridge
cannot convert ‘cv_bridge::CvImage’ to
‘const CvArr* {aka const void*}’ for
argument ‘1’ to ‘CvSize
cvGetSize(const CvArr*)’
What am I missing?
Update on error
I'm sorry for so many basic questions, but this C++ is way more complicated then Matlab.
It does compile using the cv_ptr_green->image but the it gives me an error when running it. I reduced the code to try to find out where it was happening and now my code only has:
cv_bridge::CvImagePtr cv_ptr_green;
cv_ptr = cv_bridge::toCvCopy(original_image, enc::BGR8);
cv_ptr_green->image.create(cv_ptr->image.size(), CV_8UC1);
And the error I get when running (compiling is OK):
ardrone_visualservo: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr::operator->() const [with T = cv_bridge::CvImage]: Assertion `px != 0' failed.
Aborted (core dumped) | {
"domain": "robotics.stackexchange",
"id": 10718,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cv-bridge",
"url": null
} |
c#, excel
WorksheetPart worksheetPart1 = workbookPart.AddNewPart<WorksheetPart>();
string currentCurrency = null;
string regionName = null;
Worksheet worksheet1 = new Worksheet();
SheetData sheetData1 = new SheetData();
Row rowInSheet1 = new Row();
Row firstRow = new Row();
Row lastRow = new Row();
rowInSheet1.Append(
excelController.ConstructCell("Region", CellValues.String, 3), excelController.ConstructCell("Merchant - Terminal", CellValues.String, 3),
excelController.ConstructCell("Fee Charged", CellValues.String, 3),
excelController.ConstructCell("Currency", CellValues.String, 3),
excelController.ConstructCell("Processing Date", CellValues.String, 3),
excelController.ConstructCell("Description", CellValues.String, 3)
);
sheetData1.Append(rowInSheet1); | {
"domain": "codereview.stackexchange",
"id": 41086,
"lm_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#, excel",
"url": null
} |
# Math Help - Prove
1. ## Prove
Prove 0.9999999.....=1
2. ## Re: Prove
Originally Posted by franios
Prove 0.9999999.....=1
What have you got so far?
-Dan
3. ## Re: Prove
Let n=.999999.. Then 10n=9.999999...
So 9n= 10n-n= 9.0000000
Therefore 9n=9 & so n=1
But I dont really have a good explanation so I was looking for something more detailed..
4. ## Re: Prove
Originally Posted by franios
Prove 0.9999999.....=1
$X=0.\overline{9}$
$10X=9+.\overline{9}$
What is $X=~?$
5. ## Re: Prove
X=9.999999....??
6. ## Re: Prove
You could also state:
$0.\bar{9}=9\sum_{k=1}^{\infty}\left(\frac{1}{10} \right)^k=\frac{9}{1-\frac{1}{10}}-9=1$
7. ## Re: Prove
first of all, you have to say what you MEAN by:
0.999999.....
(yes, we all know your intention is to say "the 9's go on forever"...but what does THAT mean?)
one way to think of this, is to consider 0.99999..... as a SEQUENCE:
f(n) = 9.
then we have a "new kind of number":
NEW NUMBER = INTEGER + SEQUENCE. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750477464142,
"lm_q1q2_score": 0.8002466466258932,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 1569.1451813659253,
"openwebmath_score": 0.8358426690101624,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/203365-prove.html"
} |
c++, programming-challenge, time-limit-exceeded, circular-list
Then, eventually we return from our recursion. Now we go on to process the rest of the array. There's 2 problems here: 1) At this point, the recursion we're returning from has already processed the rest of the array, and 2) the array is no longer the same size, but we're going to process to the end of the original array anyway!
I haven't worked out a full solution, but hopefully the above is enough to help you see what's wrong with your current solution. | {
"domain": "codereview.stackexchange",
"id": 28249,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, programming-challenge, time-limit-exceeded, circular-list",
"url": null
} |
java, game
System.out.printf("Wrong entry: there are %d matches, "
+ "the last player selected %d, "
+ "which means you can only select one of %s\n",
totalMatches, previous, Arrays.toString(allow));
}
}
Main
Puting this all together, the main method becomes much simpler:
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in) ;) {
int totalMatches = getStartCount(sc);
int matchesPreviousTurn = 0 ;
int round = 0 ;
int player = 0 ;
do {
//previousPlayer = player ;
player = 1 + (round % 2);
round++ ;
int matchesThisTurn = getPlayerPick(sc, totalMatches, player, matchesPreviousTurn);
totalMatches -= matchesThisTurn ;
matchesPreviousTurn = matchesThisTurn ;
} while (totalMatches > 1 || totalMatches == 1 && matchesPreviousTurn != 1); | {
"domain": "codereview.stackexchange",
"id": 12984,
"lm_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, game",
"url": null
} |
homework-and-exercises, electric-circuits, electric-current, electrical-resistance, batteries
Title: The electric current in a circuit comprising a battery, an ideal wire and a few resistors
How will the electric current in this circuit flow? Assuming that the current starts flowing from the positive(+ve) terminal (Conventional current), will it flow entirely through the branch between the 2Ω and the 1Ω resistor offering no resistance {Ideal} or will it flow through both the paths{Through the middle branch and the 1Ω resistor}? and if it flows through both paths, then why is that the case? Current as far as I know, prefers a path which offers the least resistance. In this case, shouldn't it pass entirely through the middle branch with no resistance? It's a multi step process:
Redraw the circuit without the crossing traces.
Add a trace, see which resistances are shorted out, and then redraw without those resistances.
Repeat step 2 for the last trace.
At the end of process, the actual path the electrons take will become clear | {
"domain": "physics.stackexchange",
"id": 88832,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, electric-circuits, electric-current, electrical-resistance, batteries",
"url": null
} |
Thus GCF(60, 1260) = $\displaystyle 2^2 \cdot 3 \cdot 5$ = 60.
-Dan
PS Now that I think of it, there is a formula, but it isn't anything direct:
Given two numbers x and y, we know that GCF(x, y) = (x*y)/LCM(x, y), where LCM(x, y) is the "Least Common Multiple" of x and y. There is no direct formula I know of to find the LCM either.
3. Originally Posted by topsquark
Equation, not that I know of. Process, yes.
Consider the GCF of 60 and 630.
The prime factorization of 60 is $\displaystyle 2^2 \cdot 3 \cdot 5$.
The prime factorization of 630 is $\displaystyle 2 \cdot 3^2 \cdot 5 \cdot 7$.
The GCF (also known as the Greatest Common Divisor, GCD) will be the number that has a prime factorization that contains the same prime factors as the combination of the lists. In other words,
There is a factor of 2 common to each,
there is a factor of 3 common to each,
there is a factor of 5 common to each.
Thus GCF(60, 630) = 2*3*5 = 30. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771782476948,
"lm_q1q2_score": 0.8754732447808191,
"lm_q2_score": 0.8872045929715078,
"openwebmath_perplexity": 593.253405818335,
"openwebmath_score": 0.7328869104385376,
"tags": null,
"url": "http://mathhelpforum.com/algebra/6659-greatest-common-factor.html"
} |
9 Science Chapter 4, NCERT Solutions for Class 9 Science Chapter 5, NCERT Solutions for Class 9 Science Chapter 6, NCERT Solutions for Class 9 Science Chapter 7, NCERT Solutions for Class 9 Science Chapter 8, NCERT Solutions for Class 9 Science Chapter 9, NCERT Solutions for Class 9 Science Chapter 10, NCERT Solutions for Class 9 Science Chapter 12, NCERT Solutions for Class 9 Science Chapter 11, NCERT Solutions for Class 9 Science Chapter 13, NCERT Solutions for Class 9 Science Chapter 14, NCERT Solutions for Class 9 Science Chapter 15, NCERT Solutions for Class 10 Social Science, NCERT Solutions for Class 10 Maths Chapter 1, NCERT Solutions for Class 10 Maths Chapter 2, NCERT Solutions for Class 10 Maths Chapter 3, NCERT Solutions for Class 10 Maths Chapter 4, NCERT Solutions for Class 10 Maths Chapter 5, NCERT Solutions for Class 10 Maths Chapter 6, NCERT Solutions for Class 10 Maths Chapter 7, NCERT Solutions for Class 10 Maths Chapter 8, NCERT Solutions for Class 10 Maths Chapter | {
"domain": "jehobs.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399060540359,
"lm_q1q2_score": 0.8429704015160763,
"lm_q2_score": 0.8688267677469952,
"openwebmath_perplexity": 850.5288189952355,
"openwebmath_score": 0.6436747312545776,
"tags": null,
"url": "http://jehobs.com/3a6k2bow/e95e2b-corollary-of-cyclic-quadrilateral-theorem"
} |
c++, trie
Title: use trie data structure to solve the problem of clustering anagrams
Given an array of words, print all anagrams together. For example, if
the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output
may be “cat tac act dog god”.
The following is my c++ code. I use raw pointer to implement varying number of children
for practice. Actually, I guess maybe it's better to adopt STL containers.
#include <iostream>
#include <cstring>
using namespace std;
struct Index_node_base
{
Index_node_base* next;
Index_node_base():next(NULL){}
};
struct Index_node : public Index_node_base
{
int index;
Index_node(int i):index(i), Index_node_base(){}
};
void insert_index_node(Index_node** head, int i)
{
Index_node* node = new Index_node(i);
node->next = (*head);
*head = node;
}
struct Trie_node_base
{
typedef Trie_node_base* Base_ptr;
Base_ptr* child;
int num_of_child; | {
"domain": "codereview.stackexchange",
"id": 2715,
"lm_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++, trie",
"url": null
} |
quantum-mechanics, special-relativity, quantum-spin
Although I understand that accounting for relativity is needed to FULLY describe the SO coupling, why is it so difficult to find a clear explanation that separates the classical part from the relativistic one.
I have to emphasis that I am chemist, working in the field of quantum chemistry. As such I have, for example, only little knowledge about representation theory. Hence, I am more seeking for an "intuitive" (if that is possible when mixing quantum theory and relativity ...) explanation. However I have some good understanding of quantum mechanics in general and some basic knowledge of (special) relativity. Yes, you can just say an electron has a (quantised) magnetic moment as an observed fact, without involving Dirac or relativity. | {
"domain": "physics.stackexchange",
"id": 96448,
"lm_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, special-relativity, quantum-spin",
"url": null
} |
optics, soft-question, terminology, conventions
It is possible that this usage is inconsistent. I personally don't think anyone gets confused when you call diffractive reflection-like scattering from a small object "reflection", even though it doesn't follow the geometric optics trajectory. | {
"domain": "physics.stackexchange",
"id": 2025,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, soft-question, terminology, conventions",
"url": null
} |
time-complexity, sorting, selection-problem
Title: Finding Median value given a tuple (value, frequency) in O(n) worst case time complexity
An accountant in a big firm would like to find the median of the
salaries of all employees. The data they received is a list of size n
containing the tuples $\left\{s_{i\ },f_{i\ }\right\}_{i=1}^{n}$,
where the number $s_i$ is the salary and the integer $f_i$ is the
number of employees that got salary $s_i$ in the firm.
Suggest an algorithm that gets the list as input and returns the
median salary of the employees at the firm in time O(n) in the worst
case, and justify why this is the running time of your algorithm. For
example for the input (8000, 4),(20000, 1),(10000, 2) the output
should be 8000 since the full, sorted list of salaries is: 8000, 8000,
8000, 8000, 10000, 10000, 20000. Remark: $\sum_{ }^{ }f_{i\ }$ (i.e.
the number of employees) may be way bigger than n so you are not
expected to write the expanded list of salaries. | {
"domain": "cs.stackexchange",
"id": 19948,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "time-complexity, sorting, selection-problem",
"url": null
} |
Because if we consider the sequence without the signs, we add at the previous number the number 2n. Then the sign changes, at the odd positions we have $-$ and at the even places we have $+$, or not?
Last edited:
#### Olinguito
##### Well-known member
$$\begin{array}{c|c|c|c|}n & a_n & a_{n+1}=(-1)^{n+1}\cdot (a_n+2\cdot n) & a_n\ =\ (-1)^{n+1}n(n-1) \\ \hline 1 & 0 & 0 & 0\\ 2 & 2 & (-1)^{1+1}\cdot(0+2\cdot 1) = 2 & (-1)^{2+1}\cdot 2 (2-1)={\color{red}-2}\\ 3 & -6 & (-1)^{1+2}\cdot(2+2\cdot 2) = -6 \\ 4 & 12 & (-1)^{1+3}\cdot(-6+2\cdot 3) = {\color{red}0} \\ 5 & -20 \\ \end{array}$$
Thanks, ILS. When the first term is $0$ it’s easy to slip into thinking it’s $a_0$ rather than $a_1$. In this case the formula should be
$$\boxed{a_n\ =\ (-1)^nn(n-1)}.$$
Ah should it maybe be $$a_{n+1}=(-1)^{n+1}\cdot (|a_n|+2\cdot n)$$ ?
Yes, that should work.
#### mathmari | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147169737826,
"lm_q1q2_score": 0.8482834367456017,
"lm_q2_score": 0.8723473862936942,
"openwebmath_perplexity": 2310.157009889639,
"openwebmath_score": 0.9979795813560486,
"tags": null,
"url": "https://mathhelpboards.com/threads/convert-the-recursive-formula-into-the-explicit-form.24905/"
} |
a stroke 32 and the radicand contains no factor ( other than 1 which! You do n't know how to rationalize the denominator our squares itself, can simplified! A radical can be simplified of “ enclosed ” radicals, search for these hiragana! Is called our squares to Simplifying radical problem, check to see if the indices and are! Every Simplifying radical problem, check to see if the given radical itself, can be defined as symbol. Is 32 and the radicand of the second is 8. to simplify radicals to! The second is 8. also give the properties of radicals and of. In every Simplifying radical Expressions root of a number of the opposite also define simplified form... You are right there is different pinyin for the dictionary radical name and some are the for. Know how to simplify radicals go to Simplifying radical problem, check to see the. Radical are: Step 1 cube root, unlike radicals examples root are all radicals 108 prime. What the stroke is called for Simplifying radicals, in every | {
"domain": "co.cr",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9615338123908151,
"lm_q1q2_score": 0.8094438296936984,
"lm_q2_score": 0.8418256532040708,
"openwebmath_perplexity": 1184.4680893797392,
"openwebmath_score": 0.8446316123008728,
"tags": null,
"url": "http://lacasadelespia.co.cr/4y4n1/viewtopic.php?a4353b=unlike-radicals-examples"
} |
oscillators, coupled-oscillators
Title: What are "correlation time" and "relaxation time" in oscillations? I am reading this paper which is about oscillations. I came across two terms called "Correlation time" and "Relaxation time" in the following passages:
In this Letter, we solve these problems by formulating the
stochastic phase reduction with careful consideration of the
relationship between the correlation time of the noise and relaxation
time of the amplitude of the limit cycle.
Noise in the real world has a small but finite correlation time [17]. When the correlation time is much smaller than characteristic
time scales of the noise-driven system, we can use the white noise
description by taking the limit where the correlation time goes to
zero. | {
"domain": "physics.stackexchange",
"id": 10734,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "oscillators, coupled-oscillators",
"url": null
} |
# A given functional is path independent if k equals to the one of the following:
The functional $$\int_0^1 (y^{\prime 2} + (y + 2y')y'' + kxyy' + y^2) ~dx,$$ $$y(0) = 0, ~y(1) = 1, ~y'(0) = 2, ~y'(1) = 3$$ is path independent if $k$ equals
(A) $1$
(B) $2$
(C) $3$
(D) $4$
I have used Euler's formula for extremizing the given functional and get $k=2$. But I am pretty sure that I have done mistake as I could not get to use the given conditions and also I will be grateful if someone explains what path independent really means and the appropriate formula to be used to tackle the problem. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104924150546,
"lm_q1q2_score": 0.8053336324970686,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 502.59206142079574,
"openwebmath_score": 0.9694810509681702,
"tags": null,
"url": "http://math.stackexchange.com/questions/240799/a-given-functional-is-path-independent-if-k-equals-to-the-one-of-the-following?answertab=votes"
} |
data-analysis, spectroscopy, optics, space-telescope, instruments
3.4 Interfaces Requirements
3.4.1 Launcher Interfaces
3.4.1.1 The XXX flight hardware shall be compatible with the launch environment of SpaceX Dragon and Northrop Grumman Cygnus as defined in SSP 50835 [AD4].
3.4.1.2 The XXX flight hardware shall be launched packed in foam in non-operating, non-powered condition.
3.4.2 Spin Load
The XXX Experiment shall be designed to withstand a roll rate at burnout of 8.0 Hz +/- 1 Hz at burnout of the motor.
Note: The static loads caused by the spin of 8 Hz can be calculated depending on the radius where the components of the experiments units are assembled.
Note: At motor burnout the linear acceleration will be at maximum.
etc etc and down to the individual parts, like cameras and optical setups where the requirements and performance matter: | {
"domain": "astronomy.stackexchange",
"id": 7056,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "data-analysis, spectroscopy, optics, space-telescope, instruments",
"url": null
} |
java, swing, canvas
Title: Display class containing a Canvas in a JFrame I've been using this class for so long, I never thought about how terribly big and how bad it looks. Looking back on it, this class looks so out-of-date, and nothing explains itself; I want to get it looking much better, not with all the extra junk that it doesn't need.
Here's the class:
import java.awt.Canvas;
import java.awt.Dimension;
import javax.swing.JFrame;
public class Display {
private JFrame frame;
private Canvas canvas;
private String title;
private int width, height;
public Display(String title, int width, int height){
this.title = title;
this.width = width;
this.height = height;
createDisplay();
} | {
"domain": "codereview.stackexchange",
"id": 29409,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, swing, canvas",
"url": null
} |
spectroscopy, luminosity, photometry, apparent-magnitude, magnitude
If I do aperture photometry on an I-band image and an i'-band image, will the first one return Vega magnitude of the object and the second return AB magnitude of the object, by default? And if I wanted to do SED fitting, then I need to be consistent such that all of my data points (even from other telescopes) need to be on the same magnitude system (e.g., convert the I-band Vega magnitude into an I-band AB magnitude)? (Or do that conversion first, and only then convert to flux units via $\nu F_{\nu}$ or $\lambda F_{\lambda}$). I'd guess it's largely a matter of historical accident and inertia, mixed with a certain amount of taste. | {
"domain": "astronomy.stackexchange",
"id": 2123,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spectroscopy, luminosity, photometry, apparent-magnitude, magnitude",
"url": null
} |
# Calculus
Hi!
My question is:
Given that f is a function defined by f(x) = (2x - 2) / (x^2 +x - 2)
a) For what values of x is f(x) discontinuous?
b) At each point of discontinuity found in part a, determine whether f(x) has a limit and, if so give the value of the limit.
c) write the equation for each vertical and each horizontal asymptote for f. Justify your answer.
d) A rational function g(x) = (a) / (b + x) is such that g(x)=f(x) whenever f is defined. Find the values of a and b.
Ok so I figured out the answers to a and b. A is "discontinuous at x = -2 and x = 1. and b is "as the limit approches -2, it does not exist and is nonremovable and as the limit approches 1, the limit is 2/3 and is removable". I'm not sure how to do part c and d though. Hopefully someone can help me!!
Thanks!! :)
1. 👍
2. 👎
3. 👁
1. You probably factored the function properly and got
f(x) = (2x - 2) / (x^2 +x - 2)
= 2(x-1)/[(x-1)(x+2)]
= 2/(x+2) , x not equal to 1 | {
"domain": "jiskha.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9546474220263197,
"lm_q1q2_score": 0.8277134594596396,
"lm_q2_score": 0.8670357666736772,
"openwebmath_perplexity": 861.6961100192528,
"openwebmath_score": 0.8677287101745605,
"tags": null,
"url": "https://www.jiskha.com/questions/251874/hi-my-question-is-given-that-f-is-a-function-defined-by-f-x-2x-2-x-2-x-2"
} |
There are a couple of measurements that don't relate to this problem. My guess is that this diagram comes from a book with several questions relating to it.
12. Jan 21, 2010
### vela
Staff Emeritus
Draw a vertical line from the corner to the upper horizontal line. The vertical line, the upper horizontal line, the horizontal edge of the corner, and the measurement arrows form a rectangle. The opposite sides of the rectangle are the same length, so the vertical line is 0.3 m. Similarly, the horizontal distance from where F3 acts to the corner is 0.2 m.
13. Jan 21, 2010
### jegues
Thank you for the clarification, I seem to have forgot that we were only using the similar triangle to solve the angle for F3 in relation to the positive x-axis.
I've solved the problem now! | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241965169939,
"lm_q1q2_score": 0.8219556716482178,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 731.9924530183413,
"openwebmath_score": 0.7257798314094543,
"tags": null,
"url": "https://www.physicsforums.com/threads/magnitudes-resultant-force-missing-angle.371259/"
} |
homework-and-exercises, electromagnetism, magnetic-fields
Title: Field Line Diagram for Small Bar Magnet in a Magnetic Field I understand the resultant magnetic field diagram produced when a current carrying wire is placed in a magnetic field as shown in the diagram below.
However, what would this field diagram look life if, instead of a wire, a small bar magnet were placed in the field, either opposing or in the direction of the field? The geometry of the lines depends on the magnitude of the external field. In fig. shows the case of a relatively weak external field. | {
"domain": "physics.stackexchange",
"id": 56503,
"lm_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, electromagnetism, magnetic-fields",
"url": null
} |
potential-energy, molecules
Going towards $A$ they will gain potential energy by converting kinetic energy into it (in other words, slowing down).
Once at the distance $A$, they will have gained exactly $\epsilon$ potential energy and will have therefore zero kinetic energy.
At this point the cycle will repeat inverted, they will move towards a distance of $C$ because it's lower energy, surpass it and reach $B$ with zero kinetic energy, which will make the cycle repeat from the start. | {
"domain": "physics.stackexchange",
"id": 11367,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "potential-energy, molecules",
"url": null
} |
c++, algorithm, beginner
// This is where the first test string is initialized.
std::string this_message_RAW = "like my status because its awesome.";
// Explode the string into words.
std::vector<std::string> this_message = explode(this_message_RAW, ' ');
// TEST ONE: Detect if the message is shorter or equal to 3 letters.
if (this_message.size() <= 3) {
master_switch = true;
}
// TEST TWO: Keyword matching
for (int i = 0; i < this_message.size(); i++) {
string this_item = this_message[i];
for (int ii = 0; ii < 130; ii++) { // 130 needs to be updated to however many items are in the list.
// Messing around with conditionals goes here.
if (this_item == conditionals[ii]) {
printf("A MATCH WAS FOUND.");
master_switch = true;
}
}
} | {
"domain": "codereview.stackexchange",
"id": 1073,
"lm_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, beginner",
"url": null
} |
tex
}
\end{itemize}
}}
\vspace{-1mm}
{\addtolength{\leftskip}{0mm} \textbf{Ameriprise Financial Services} \emph{Financial Advisor}
\sbullet New York, NY \hfill{} January, 2004 - August, 2005
\vspace{-2mm} {\addtolength{\leftskip}{0mm}
\begin{itemize}\setlength{\itemsep}{0cm}\setlength{\parskip}{0cm} {\addtolength{\leftskip}{-5mm}
\item Gave Seminars, Sold Financial Plans, Met Sales Goals, and Applied Monte Carlo Simulation \& Modern Portfolio Theory
\item Series 7 Securities, Series 66 Investment Advisor, Life Insurance, Health Insurance, and Variable Annuity Licensed
}
\end{itemize}
}}
\vspace{-1mm}
\textsc{Education}
\vspace{.5mm}
\hline
{\addtolength{\leftskip}{0mm}
\textbf{University Of West Florida}, College of Business \sbullet Pensacola, FL \hfill August 2010
\vspace{-2mm} {\addtolength{\leftskip}{0mm}
\emph{Master of Business Administration}
\vspace{-2mm} %{\addtolength{\leftskip}{5mm} | {
"domain": "codereview.stackexchange",
"id": 23597,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "tex",
"url": null
} |
java, object-oriented, unit-testing, interview-questions, math-expression-eval
}
And Unit Tests
package com.luxoft;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class CalculatorTest {
@Test
public void shouldCalculateCorrectWhenAdded() throws Exception {
Calculator calculator = new Calculator();
assertEquals(calculator.calculate("8 7 +"), Integer.valueOf(15) );
}
@Test
public void shouldCalculateCorrectWhenAddedMultipleValues() throws Exception {
Calculator calculator = new Calculator();
assertEquals(calculator.calculate("99 11 + 8 7 + +"), Integer.valueOf(125) );
}
@Test
public void shouldCalculateCorrectWhenMultiplied() throws Exception{
Calculator calculator = new Calculator();
assertEquals(calculator.calculate("4 7 *"), Integer.valueOf(28));
} | {
"domain": "codereview.stackexchange",
"id": 30757,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, unit-testing, interview-questions, math-expression-eval",
"url": null
} |
general-relativity, electromagnetic-radiation, newtonian-gravity, photons, mass-energy
Understandably, if this were a good and valid idea, it would have been used or realized a long time ago. My question is centred around understanding why the rest mass equation must be used; I am not trying to say what has been done is wrong, just trying to understand why it makes sense. For a particle of fixed mass $m$ moving in a fixed gravitational potential $\phi(\vec{r})$ the motion is independent of the mass of the particle. The equations are
$$
\vec{F}=-m\nabla\phi
$$
and
$$
\vec{F} = \frac{d\vec{p}}{dt} = m \frac{d\vec{v}}{dt}
$$
It's clear that the $m$'s cancel when combining these equations. So from this point of view it doesn't matter what (non-zero) mass is taken for the photon in the calculation. It sounds like you've read a derivation of photon deflection which assumes the photon mass is $m=E/c^2$, but this assumption isn't necessary. | {
"domain": "physics.stackexchange",
"id": 12158,
"lm_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, electromagnetic-radiation, newtonian-gravity, photons, mass-energy",
"url": null
} |
java, swing, event-handling, gui
/** Add new random point **/
public void addPoint() {
int randomX = (int)(Math.random() * getWidth());
int randomY = (int)(Math.random() * getHeight());
points.add(new Point(randomX, randomY));
if (points.size() > 1) {
updateClosestPair();
}
} | {
"domain": "codereview.stackexchange",
"id": 21503,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, swing, event-handling, gui",
"url": null
} |
c#, generics
protected override void UpdateSums (float value)
{
Sum += value;
Sum2 += value * value;
}
protected override void UpdateAverage ()
{
Avg = (float) decimal.Divide ((decimal) Sum, Count);
}
}
}
I'm looking for feedbacks and hindsight on the following :
MagicProperty and such are poor names, but I lack a good qualifier
I don't like having to implement ComputeNewAverage, UpdateSum and UpdateSigma twice. The lack of a generic type common to floats and ints prevents me from doing so in the generic class
Any other point that I'd have missed You can add additional constraint to your generic type :
public abstract class MagicProperty<T>
where T : struct, IComparable
It doesn't makes sense to have a public constructor in an abstract class, since abstract classes are instantiated through they're derived types, more appropriate access modifier would be protected. | {
"domain": "codereview.stackexchange",
"id": 23848,
"lm_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#, generics",
"url": null
} |
c#, interview-questions, combinatorics
public List<int[]> GetAllCombinations(int[] array, int k)
{
int len = array.Length;
// basic sanity check
if (len < k)
throw new ArgumentException("Array length can't be less than number of selected elements");
if (k < 1)
throw new ArgumentException("Number of selected elements can't be less than 1");
_array = array;
_k = k;
_results = new List<int[]>();
_element = new int[k];
_pushForward = new int[k]; // they are initialized to Zero already, no need to initialize again
// the first element can move up to this position (in permutations); subsequent elements could move +1
int maxStepsForward = len - _k + 1;
// entrance to recurssion method
GetCombinations(0, maxStepsForward);
return _results;
} | {
"domain": "codereview.stackexchange",
"id": 30716,
"lm_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#, interview-questions, combinatorics",
"url": null
} |
Furthermore, how can I generalize the consecutivity constraint? E.g. instead of just nonconsecutive (spacing of $\ge 2$), what about spacing $\ge M$? So e.g. with $M=3$, if I select the integer $7$, then I cannot choose $[5,6,7,8,9]$.
Reading the generating function left to right:
The $x$ in
$$1+x+x^2+\cdots$$
counts spaces (unchosen numbers) between the smallest chosen number $y_1$ and $0$.
The $x$ in
$$x+x^2+x^3+\cdots$$
counts spaces between $y_2$ and $y_1$. This is why it starts at $x^1$ because we must have at least $1$ space between consecutive chosen numbers according to the condition in the question. We thus have $x+x^2+x^3+\cdots$ for each consecutive pair from $y_2$, $y_3$, $y_4$ and $y_5$ too. Hence the power of $4$.
Finally the $x$ in
$$1+x+x^2+\cdots$$
counts spaces between $n$ and $y_5$.
The coefficient of $x^{n-5}$ is the number of choices with $n-5$ spaces (unchosen numbers) because | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513914124559,
"lm_q1q2_score": 0.8062522050899941,
"lm_q2_score": 0.8175744739711883,
"openwebmath_perplexity": 373.69182192226225,
"openwebmath_score": 0.8682951927185059,
"tags": null,
"url": "https://math.stackexchange.com/questions/2412718/ordinary-generating-function-for-nonconsecutive-integer-selection"
} |
control, design, stepper-motor, motion
Manufacturers use both designs interchangeably, so it's hard to predict which design is better than which.
Any help would be much appreciated!
Please note, this question has been migrated from the Stackexchange Physics (and Electrical) forum by me because the mods thought it would be appropriate here. Performance-wise, first version wins as the motor's own weight is not added to the payload for motion.
Efficiency-wise, it depends on the elasticity and material properties of the drive belt, versus the material of the powered roller surface, gripping force of rollers, and other energy loss factors.
The belt drive will be far more vibration-damped: Note the spring-loaded tensioning pin through which the belt passes in the top photo. This will flex and absorb a lot of the vibration - acting like a low-pass filter for mechanical energy. | {
"domain": "robotics.stackexchange",
"id": 455,
"lm_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, design, stepper-motor, motion",
"url": null
} |
java, algorithm, tree, formatting
return root;
}
private static int getMaximumHeight(TreeNode node) {
if (node == null)
return 0;
int leftHeight = getMaximumHeight(node.left);
int rightHeight = getMaximumHeight(node.right);
return (leftHeight > rightHeight) ? leftHeight + 1 : rightHeight + 1;
}
private static String multiplyString(String string, int times) {
StringBuilder builder = new StringBuilder(string.length() * times);
for (int i = 0; i < times; ++i) {
builder.append(string);
}
return builder.toString();
}
public static String getStartingSpace(int height) {
return multiplyString(" ", ((int) Math.pow(2, height - 1)) / 2);
}
public static String getUnderScores(int height) {
int noOfElementsToLeft = ((int) Math.pow(2, height) - 1) / 2;
int noOfUnderScores = noOfElementsToLeft
- ((int) Math.pow(2, height - 1) / 2); | {
"domain": "codereview.stackexchange",
"id": 11746,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, tree, formatting",
"url": null
} |
newtonian-mechanics, momentum, collision
Title: Newton's law of restitution Newton's law of restitution. Could someone tell me what the easiest form of this law to use is?
I usually try to use e=(v(2)-v(1))/(u(1)-u(2)).
Does the law also work if I don't know the direction of v(1) and v(2)?
So for example, if a particle moving with u(1) hits a steady object and I don't know if the particle's speed vector will change its direction, can I still use the law in the form e=(v(2)-v(1))/(u(1)-u(2)) with u(2)=0 (since the object was steady originally)? The law states this: | {
"domain": "physics.stackexchange",
"id": 22527,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, momentum, collision",
"url": null
} |
30. Hunus
$v_{x}=|M|\cos(150)=|M|(\frac{-\sqrt{3}}{2})=\frac{-|M|\sqrt{3}}{2}$
31. anonymous
what does 150 degrees tellus ?
32. anonymous
are we saying the angle 150 is equal to 30 degrees
33. Hunus
150 degrees tells us what the angle is from the positive x axis. That's what we usually like to use as a reference point when using sines and cosines.
34. Hunus
What we are saying is that we only need the reference angle (how many degrees it is from the closest x axis) if we know if x is positive or negative or y is positive or negative
35. anonymous
so basically we are saying the angle is 150 degrees away from the orgin
36. Hunus
From the positive x axis
37. anonymous
what about the negative x axis
38. Hunus
150 degrees tells us how far we would have to rotate a vector from the positive x axis (0 degrees) to get to where the vector is.
39. anonymous
ohhh i get it
40. Hunus
Good :)
41. anonymous
and to find the negative value what would i have to do
42. Hunus | {
"domain": "openstudy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806549388171,
"lm_q1q2_score": 0.8354084420599676,
"lm_q2_score": 0.8519528076067262,
"openwebmath_perplexity": 713.7253635149038,
"openwebmath_score": 0.7324343323707581,
"tags": null,
"url": "http://openstudy.com/updates/4f417c2ee4b0803c6352f76e"
} |
python, tkinter, youtube
try:
ytlib = {
'format': 'bestaudio/best',
'noplaylist': True,
'outtmpl': '/python_downloads/%(title)s-%(id)s.%(ext)s',
'continue_dl': True,
'postprocessors_args': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'wav',
'preferredquality': 'max'}]
}
except Exception:
print('something went wrong...')
with youtube_dl.YoutubeDL(ytlib) as ydl:
ydl.download([vid])
print("download complete")
bar()
window.mainloop()
def bar():
#progress bar
#couldn't manage to make it show the actual downloading process...
#looks pretty neat so i'm keeping it
progress['value'] = 20
window.update_idletasks()
time.sleep(1)
progress['value'] = 40
window.update_idletasks()
time.sleep(1)
progress['value'] = 50
window.update_idletasks()
time.sleep(1) | {
"domain": "codereview.stackexchange",
"id": 42616,
"lm_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, tkinter, youtube",
"url": null
} |
python, object-oriented
def setup(self):
print('setting up log tables')
type(self).alogs = []
type(self).logs = [None]
sr = 1
for index in range(self.F_LENGTH-1):
type(self).alogs.append(sr)
sr <<= 1
if sr & self.F_LENGTH:
sr ^= self.F_PRIM_POLY
sr &= self.F_MASK
for sr in range(1, self.F_LENGTH):
type(self).logs.append(self.alogs.index(sr))
"""
GF8 = type('GF8', (BaseGF,),
{'F_POWER':8,
'F_LENGTH':256,
'F_MASK':255,
'F_PRIM_POLY':29})
"""
class GF8(BaseGF):
F_POWER = 8
F_LENGTH = 256
F_MASK = 255
F_PRIM_POLY = 29
class GF4(BaseGF):
F_POWER = 4
F_LENGTH = 16
F_MASK = 15
F_PRIM_POLY = 9 | {
"domain": "codereview.stackexchange",
"id": 15687,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, object-oriented",
"url": null
} |
organic-chemistry, carbonyl-compounds
Title: How can this ketone show Cannizzaro reaction? | {
"domain": "chemistry.stackexchange",
"id": 9217,
"lm_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, carbonyl-compounds",
"url": null
} |
All we care about is that $3^y - 1$ is divisible by $7^2 = 49,$ as this contradicts the assumption of $x \geq 1$ in $$6 \left( 3^y -1 \right) = 7 \left( 7^x -1 \right).$$ $$\bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc$$
The other case is $1 + 2 \cdot 7^x = 3^y,$ or $$3^y - 1 = 2 \cdot 7^x.$$ Assume $x \geq 1.$ Then both sides are divisible by $7,$ giving $$3^y \equiv 1 \pmod 7,$$ $$y \equiv 0 \pmod 6.$$ Then $3^y - 1$ is divisible by $$3^6 - 1 = 728 = 8 \cdot 7 \cdot 13.$$ However, then $2 \cdot 7^x$ is divisible by $13,$ which is a contradiction. $$\bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754488233528,
"lm_q1q2_score": 0.8464038212254912,
"lm_q2_score": 0.8596637487122111,
"openwebmath_perplexity": 138.42189810388928,
"openwebmath_score": 0.8869752883911133,
"tags": null,
"url": "https://math.stackexchange.com/questions/2465086/for-what-pair-of-integers-a-b-is-3a-7b-a-perfect-square"
} |
java, algorithm, tree, validation, groovy
instead of
map.each { entry -> println("key: $entry.key, value: $entry.value") }
So I have rewritten your method and in the following I will refer to the rewritten version.
List<String> findInvalidNodes(Map<String, String> edges) {
Set<String> invalidNodes = []
edges.each { String currentNode, _ ->
Set<String> nodes = []
String child = currentNode
String parent = edges[currentNode]
while ( parent && !invalidNodes.contains(child) && !nodes.contains(child) ) {
nodes << child
if (parent == currentNode || nodes.size() > 50) {
invalidNodes.addAll(nodes)
}
child = parent
parent = edges[parent]
}
}
return invalidNodes as List<String>
} | {
"domain": "codereview.stackexchange",
"id": 44565,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, tree, validation, groovy",
"url": null
} |
particle-physics, momentum
Title: Do $x$ and $Q^2$ associate with particular directions in the infinite momentum frame? In deep inelastic scattering, you describe a collision using the variables $Q^2 = -q^2$ (probe virtuality) and $x = Q^2/2p\cdot q$ (Bjorken x, parton momentum fraction). Now, I seem to remember reading somewhere that in the infinite momentum frame, one of these variables primarily depends on momentum in the transverse direction and the other primarily depends on momentum in the longitudinal direction, but I can't remember which, and checking my most likely sources hasn't turned up anything. Is this actually the case, or is my memory playing tricks on me? And if it is true, which is which? | {
"domain": "physics.stackexchange",
"id": 547,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, momentum",
"url": null
} |
programming-languages, software-engineering, object-oriented
Title: Subclass specification From http://web.mit.edu/6.031/www/fa19/classes/12-interfaces-enums/#implementing_generic_interfaces
"That means B is only a subtype of A if B’s specification is at least as strong as A’s specification. When we declare a class that implements an interface, the Java compiler enforces part of this requirement automatically: for example, it ensures that every method in A appears in B, with a compatible type signature. Class B cannot implement interface A without implementing all of the methods declared in A.
But the compiler cannot check that we haven’t weakened the specification in other ways: strengthening the precondition on some inputs to a method, weakening a postcondition, weakening a guarantee that the interface abstract type advertises to clients. If you declare a subtype in Java — implementing an interface is our current focus — then you must ensure that the subtype’s spec is at least as strong as the supertype’s." | {
"domain": "cs.stackexchange",
"id": 17357,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-languages, software-engineering, object-oriented",
"url": null
} |
homework-and-exercises, special-relativity, spacetime, relativity, time-dilation
So to sum up, the shift in time is caused by switching between two inertial frames in relative motion. When you switch between two different time axes(and space axes but this is not our concern here), this result in this shift in time of earth into the future. | {
"domain": "physics.stackexchange",
"id": 24376,
"lm_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, special-relativity, spacetime, relativity, time-dilation",
"url": null
} |
quantum-field-theory, mathematical-physics, resource-recommendations
At the moment I am studying
Piron: Foundations of Quantum Physics,
Jauch: Foundations of Quantum Mechanics, and
Ludwig: Foundations of Quantum Mechanics
All of them discuss nonrelativistic quantum mechanics.
Now my question is, if there are corresponding approaches to quantum field theory (in particular aiming to the standard model of particle physics). | {
"domain": "physics.stackexchange",
"id": 269,
"lm_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, mathematical-physics, resource-recommendations",
"url": null
} |
stability, chaos-theory, complex-systems
In general, Lyapunov exponents are properties of the dynamics, not of a certain point².
Roughly speaking, they are a temporal average of the projection of the Jacobian to a specific direction along the trajectory.
Analogously, chaos is a property of a dynamics or set of trajectories (a chaotic attractor, saddle, transient, or invariant set), not of a fixed point.
If you look at a stable fixed point, a trajectory within its basin of attraction will be very close to the fixed point for this average and thus you obtained the quoted definition¹.
For an unstable fixed point, almost any trajectory will eventually move away from it and its type of dynamics (fixed point, periodic, chaos, …) depends on the structure of the phase-space flow in regions distant from the unstable fixed point.
So, the nature of a fixed point does not tell you anything about a system being chaotic or not.
Your second quote alludes to the following: | {
"domain": "physics.stackexchange",
"id": 48708,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stability, chaos-theory, complex-systems",
"url": null
} |
measurements
Title: What are grads used for on a scientific calculator? Every scientific calculator I've come across has a DRG button that controls whether trigonometric functions use units of degrees, radians or grads yet I've never seen or heard of any system that actually uses grads. When is the grads setting useful? Grads were developed by the French as part of the metric system and have been referred to as the metric degree.
In some countries in Europe surveyors use grads instead of degrees. The other use is by French artillery units who have used grads for decades. | {
"domain": "engineering.stackexchange",
"id": 275,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "measurements",
"url": null
} |
list of size N then the Simple Linear Search will take a total of 2N+1. Since all letters are placed in one bucket, Put and Get operation will no longer have time complexity of O(1) because put and get operation has to scan each letter inside the bucket for matching key. Multiply to get n*log(n). Write a linear-time filter IntegerSort. Another simple yet important function. Binary Search source. Yields of experiment are expected to provide an information related to the complexity of the algorithm in LibSVM and knowing the running-time indicator of training and testing both for C++ and Java. How many elements of the input sequence need to be checked on the average, assuming that the element being searched for is equally likely to be any element in the array? How about in the worst case? What are the average-case and worst-case running times of linear search in $\theta$-notation? Justify your answers. Examples: binary search. All have polynomial time complexity while some allow very long | {
"domain": "marathon42k.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534327754854,
"lm_q1q2_score": 0.8612026083995186,
"lm_q2_score": 0.8774767906859264,
"openwebmath_perplexity": 614.0522630942693,
"openwebmath_score": 0.5858543515205383,
"tags": null,
"url": "http://marathon42k.it/zcy/time-complexity-of-linear-search.html"
} |
general-relativity, time-dilation, gravitational-redshift
I set at C such that someone at C observes the same frequencies from A and B. Then by the above relation:
$$
\begin{cases}
\frac{f_A}{f'_A}=\exp{(-\frac{(\Phi_A-\Phi_C)}{c^2})}\\
\frac{f_B}{f'_B}=\exp{(-\frac{(\Phi_B-\Phi_C)}{c^2})}
\end{cases}
$$
$f'_A=f'_B$ by my setting. So I got a relation between $f_A$ and $f_B$.
$$
\frac{f_A}{f_B}=\exp{(-\frac{(\Phi_A-\Phi_B)}{c^2})}
$$
Because $\Phi_A>\Phi_B$, $f_A<f_B.$ This does not satisfy with the statement of gravitational time dilation on the Wikipedia(https://en.wikipedia.org/wiki/Gravitational_redshift), which is higher oscillation frequency at larger gravitational potential. | {
"domain": "physics.stackexchange",
"id": 87392,
"lm_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, time-dilation, gravitational-redshift",
"url": null
} |
c, datetime, validation
Use const where practical
In your findxy routine, the passed string is never altered, which is just as it should be. You should indicate that fact by declaring it like this:
int findxy(const char *c)
Check for a null pointer
Things do not go well if the routine is passed a NULL pointer. On my machine, I get a segmentation fault and a crash. You can eliminate this hole by adding these lines near the top of the routine:
if (c == NULL) {
return -1;
}
Use better naming
The days array is well named because it's easy to guess from the name what it contains. Likewise i and j are commonly used as index variables as you have done in this code. However, findxy is a rather cryptic name for what this does and c is a poor name for the passed string. I'd recommend something like this instead:
int findWeekdayDate(const char *str) | {
"domain": "codereview.stackexchange",
"id": 23518,
"lm_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, datetime, validation",
"url": null
} |
GMAT Question of the Day - Daily to your Mailbox; hard ones only
It is currently 12 Dec 2018, 04:28
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
## Events & Promotions
###### Events & Promotions in December
PrevNext
SuMoTuWeThFrSa
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Open Detailed Calendar
• ### The winning strategy for 700+ on the GMAT
December 13, 2018
December 13, 2018
08:00 AM PST
09:00 AM PST | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9681411406370837,
"lm_q1q2_score": 0.8170095652647215,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 3153.3203078067236,
"openwebmath_score": 0.6869385242462158,
"tags": null,
"url": "https://gmatclub.com/forum/the-length-of-one-of-the-sides-of-a-triangle-is-13-units-if-the-area-260441.html"
} |
cosmology, cosmological-inflation, cosmic-microwave-background
Note: I don't want to get into the argument "Oh, but to explain the cosmological constant, we need an inflaton field", I think that's not relevant to this question.
Edit: If the answer is "You're wrong, Λ-CDM is always with an inflaton and a constant Λ has been ruled out", that's a perfectly valid answer to me, if you can point at some resources. $n_s$ is a parameter of the standard model of cosmology in the sense that the standard model doesn't predict it. If you want to calculate, for example, matter distribution you start with a spectrum of initial fluctuations and evolve forwards in time. $n_s$ describes the spectrum of those initial fluctuations, so it's an input to the modelling not something that can be predicted.
You ask: | {
"domain": "physics.stackexchange",
"id": 12520,
"lm_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, cosmological-inflation, cosmic-microwave-background",
"url": null
} |
c#, json, community-challenge, pokemon
public string Name { get; set; }
public ICollection<ResourceReference> Abilities { get; set; }
public ICollection<ResourceReference> EggGroups { get; set; }
public ICollection<PokemonEvolution> Evolutions { get; set; }
public ICollection<PokemonMove> Moves { get; set; }
public ICollection<PokemonType> Types { get; set; }
public int Attack { get; set; }
public int CatchRate { get; set; }
public int Defense { get; set; }
public int EggCycles { get; set; }
public string EvolutionYield { get; set; }
public int ExperienceYield { get; set; }
public string GrowthRate { get; set; }
public int Happiness { get; set; }
public string Height { get; set; }
public int HitPoints { get; set; }
public string MaleFemaleRatio { get; set; }
public int SpecialAttack { get; set; }
public int SpecialDefense { get; set; }
public string Species { get; set; }
public int Speed { get; set; }
public int Total { get; set; } | {
"domain": "codereview.stackexchange",
"id": 7214,
"lm_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#, json, community-challenge, pokemon",
"url": null
} |
homework-and-exercises, hamiltonian-formalism, time-evolution, phase-space
Almost every step of your reasoning was incorrect so far. And your conclusion is wrong anyway, so there isn't a correct version of the reasoning. Originally you had a tangent to your curve be orthogonal to your gradient. Then you broke it into two vectors that added up to your tangent and said the inner products of those vectors with your gradient needed to give equal and opposite scalars (and the scalars depend on time since the tangent can depend on time). But each of those inner products involved a sum from $1$ to $n.$ And now in your conclusion you act as if $\dot q_1$ has to be zero if $\partial \mathcal{H} /\partial p_1$ is zero. But your assumptions made no relationship between any of the $2n$ variables $q_1,$ $\dots,$ $q_n,$ $p_1,$ $\dots,$ $p_n.$ So you can have 6 variables and have the height not depend on one of them and call that one $p_1$ and then you can pick one variable that does change in time and call it $q_1.$ Because your assumptions never required that any variable | {
"domain": "physics.stackexchange",
"id": 27889,
"lm_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, hamiltonian-formalism, time-evolution, phase-space",
"url": null
} |
spacetime, momentum, conservation-laws, symmetry, inertial-frames
Title: Is absolute motion inconsistent with homogenous space? I read that homogenous space implies conservation of momentum (according to Noether's theorem) Conservation of momentum is kinda the statement that bodies continue moving with constant velocity unless a force is applied.
Suppose we instead lived in a universe where a bunch of frames could be described as absolutely at rest. Suppose anything moving relative to these frames would inevitably start slowing down relative to these frames, and would eventually also come to rest. I guess this implies that physics experiments would produce such results in constant velocity frames from which you could deduce that you were moving.
Though how does this imply that space is not homogenous in this universe? All the origins of these rest frames have equal preference here After the comment by @ZeroTheHero I realized my answer is wrong. Here is the explanation of what went wrong. I will delete the answer later | {
"domain": "physics.stackexchange",
"id": 69503,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "spacetime, momentum, conservation-laws, symmetry, inertial-frames",
"url": null
} |
Evaluating it is not difficult, but I want to know if you can determine convergence (delimiting the integrand) without evaluating such an improper integral.
• Comparison test is the first thing to pop into my mind. – Vim May 15 '15 at 10:04
• Show that $0\leq \frac{x^{2n-1}}{\left(x^2+1\right)^{n+3}}\leq \frac{1}{x^2+1}$ for $x>0$ and all $n\geq 1$ – Lozenges May 15 '15 at 11:44
• The integrand is asymptotically $x^{2n-1-2(n+3)}=x^{-7}$, so convergence is very fast. – Yves Daoust May 15 '15 at 14:10
• @Lozenges I find your suggestion very useful, but this inequality is difficult to prove. Anyway thanks. – mathsalomon May 15 '15 at 19:39
• quite easy to prove by induction on $n$ that $0\leq x^{2n-1}\leq \left(x^2+1\right)^{n+2}$ – Lozenges May 16 '15 at 8:57
By equivalents: $$\frac{x^{2\;n - 1}}{(x^2 + 1)^{n + 3}}\sim_{\infty}\frac{x^{2\;n - 1}}{x^{2(n + 3)}}=\frac1{x^7}$$ and the latter is convergent since the exponent of $x$ in the denominator is $>1$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9643214480969029,
"lm_q1q2_score": 0.8378282835438394,
"lm_q2_score": 0.8688267643505193,
"openwebmath_perplexity": 314.40359479979827,
"openwebmath_score": 0.9696581959724426,
"tags": null,
"url": "https://math.stackexchange.com/questions/1283195/can-we-determinine-the-convergence-of-int-0-infty-fracx2n-1x2-1"
} |
ros, ros-melodic, ubuntu, visp-auto-tracker, ubuntu-bionic
starting tracker
*********** Parsing XML for Mb Edge Tracker ************
ecm : mask : size : 5
ecm : mask : nb_mask : 180
ecm : range : tracking : 10
ecm : contrast : threshold 5000
ecm : contrast : mu1 0.5
ecm : contrast : mu2 0.5
ecm : sample : sample_step : 10 (default)
[DEPRECATED] sample : sample_step : 4
WARNING : This node (sample) is deprecated.
It should be moved in the ecm node (ecm : sample).
klt : Mask Border : 0
klt : Max Features : 10000
klt : Windows Size : 5
klt : Quality : 0.05
klt : Min Distance : 20
klt : Harris Parameter : 0.01
klt : Block Size : 3
klt : Pyramid Levels : 3
face : Angle Appear : 75
face : Angle Disappear : 75
camera : u0 : 192 (default)
camera : v0 : 144 (default)
camera : px : 600 (default)
camera : py : 600 (default)
lod : use lod : 0 (default)
lod : min line length threshold : 50 (default)
lod : min polygon area threshold : 2500 (default)
terminate called after throwing an instance of 'vpException' | {
"domain": "robotics.stackexchange",
"id": 32484,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, ubuntu, visp-auto-tracker, ubuntu-bionic",
"url": null
} |
# How do I eliminate useless subsets?
BACKGROUND / MOTIVATION:
The other day, I was given a finite covering $\mathcal{B} = \{I_1, \ldots, I_n\}$ of $[0, 1]$ by open intervals, and I wanted to refine it by eliminating useless intervals, that is, those $I_k$ which are contained in the union of the others: $$I_k \subseteq I_1 \cup \dots \cup \widehat{I_k} \cup \dots \cup I_n~~(\text{I_k is ommited.)}$$ Since my covering was finite, it was easy to establish an algorithm for doing this: check if $I_1$ is useless; if it is, remove it from the list and proceed to $I_2$, considering the new list now, and so on.
However, I couldn't help but notice that this process depends on the given order. For example, if $I_1 = [0, 1]$, $I_2 = [0, 3/4)$ and $I_3 = (1/4, 1]$, I would eliminate just $I_1$ and I'd be done. If, on the other hand, $I_3$ and $I_1$ switched places, my algorithm would end up eliminating $I_2$ and $I_3$ instead. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399060540358,
"lm_q1q2_score": 0.8376969979592752,
"lm_q2_score": 0.8633916134888614,
"openwebmath_perplexity": 57.862789006788134,
"openwebmath_score": 0.9559611678123474,
"tags": null,
"url": "http://math.stackexchange.com/questions/110201/how-do-i-eliminate-useless-subsets"
} |
visible-light, photons
Title: What happens to photons over distance? According to this diagram: | {
"domain": "physics.stackexchange",
"id": 42658,
"lm_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, photons",
"url": null
} |
concurrency, go, tcp
Title: golang concurrent tcp server Go and concurrency noob here. I wrote a program to handle a tcp connection to index (and removes) packages. I want it to be able hundreds of connections and messages that might come in at the same time. I am using a hash table to store the data and using channels to provide the worker with the incoming messages.
My understanding is that I will not have to use any locks against the data store as all add/remove will be blocked until the previous connection has finished writing and reading. Just wanted to make sure I understand go channels correctly here and I wrote an efficient solution. In the future in lieu of the hash table does it make sense to use something like Redis? Or even store a list on the file system?
I would like to understand | {
"domain": "codereview.stackexchange",
"id": 28388,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "concurrency, go, tcp",
"url": null
} |
java, game, graphics, libgdx
Title: Isometric City Building Game I have recently been working on my first game with an isometric perspective. For those who don't know, an isometric perspective is a pseudo 3D view created from 2D tiles. I am working off of this tutorial about isometric graphics.
I believe my approach is fairly clean and efficient. I have tried to do things in an object oriented way. For some of the math involved, I am relying on the code found in the tutorial linked above. I will include this code for completeness, but it is not really my code. | {
"domain": "codereview.stackexchange",
"id": 13878,
"lm_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, game, graphics, libgdx",
"url": null
} |
thermodynamics, pressure, temperature, ideal-gas, kinetic-theory
Finally, the overall constant is fixed by inserting this ansatz into the Boltzmann equation. The detailed solution depends on the form of the collision term, although there are popular approximations (the "relaxation time" or BGK form), for which the solution is easily found analytically. The answer is that the ansatz given above, for a suitable $\chi_p$ with vanishing first moment, indeed satisfies the Boltzmann equation, and the collision term just fixes the thermal conductivity. For the BGK form one gets the well known result
$$
\kappa \sim \rho c_P \frac{\tau T}{m}
$$
where $c_P$ is the specific heat, and $\tau$ is the collision time. | {
"domain": "physics.stackexchange",
"id": 81877,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, pressure, temperature, ideal-gas, kinetic-theory",
"url": null
} |
computational-geometry
This gives two points, each of which can be added to a growing list of points. Each point keeps track of what points have been added as neighbor relative to it, and when it has M neighbors, it no longer tries to find any new neighbor. It also does not continue to look for more neighbors if no new neighbors can be found that don't leave the bounds of the polygon.
I am having some mental blocks and if anyone could suggest any leads I would greatly appreciate it. Thank you. Are you looking for something like this?
Another way is to create equilateral triangle tiling like this, plot your polygon and check which points are inside. Of course it is not needed to actually plot it, just store it in memory.
If your resolution is e.g. one pixel big, you can check all possible starting points shifts from the starting point to find better solution.
To find optimal solution also rotation would be needed, or different approach. | {
"domain": "cs.stackexchange",
"id": 6391,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-geometry",
"url": null
} |
javascript, object-oriented, game
while (isSunk == false) {
guess = prompt("Enter a guess between 1 and 6");
if (guess < 0 || guess > 6) {
alert("Enter a valid number between 0 and 6");
}else if(guess > 0 || guess < 6) {
guessCheck= guessarr.indexOf(guess);
if (guessCheck >= 0) {
valid = false;
alert("You've already entered this number. Try again");
} else if (valid = true){
guesses = guesses +1;
if (guess == location1 ||
guess == location2 ||
guess == location3) {
hits = hits + 1;
alert ("You got a hit!");
guessarr.push(guess);
}
else {alert("miss");
}
if (hits == 3) {
isSunk= true;
alert("you won!");
}
}
} | {
"domain": "codereview.stackexchange",
"id": 21552,
"lm_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, object-oriented, game",
"url": null
} |
$$\newcommand\bm\boldsymbol$$
If such $$\bm P'$$ works for all matrices, then for all $$\bm A$$, $$\bm {AP} = \bm {P'A},$$ then specifically it works for the identity matrix $$\bm I$$, i.e. $$\bm {IP} = \bm {P'I},$$ then the only candidate of $$\bm P'$$ is $$\bm P$$ again. But clearly $$\bm {PA} = \bm {AP}$$ only holds for specific matrices $$\bm A$$.
Conclusion: maybe for some $$\bm A$$, there exists $$\bm P'$$ that $$\bm {P'A}$$ swap two columns of $$\bm A$$, but there exists no universal matrices $$\bm P'$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611563610179,
"lm_q1q2_score": 0.8064478842293373,
"lm_q2_score": 0.8397339676722393,
"openwebmath_perplexity": 156.76232067531083,
"openwebmath_score": 0.9526061415672302,
"tags": null,
"url": "https://math.stackexchange.com/questions/3112210/how-to-permute-columns-by-pre-multiplying-and-rows-by-post-multiplying"
} |
Math Warehouse's interactive parallelogram. Parallelogram Properties DRAFT. Let's look at their sides and angles. 60 seconds . Or: Both pairs of opposite sides are congruent. 9th - 10th grade. Is it possible to prove a quadrilateral a parallelogram with two consecutive and two opposite congruent sides? In this lesson we will prove the basic property of a parallelogram that the opposite sides in a parallelogram are equal. You can draw parallelograms. C) The diagonals of the parallelogram bisect the angles. Another property is that each diagonal forms two congruent triangles inside the parallelogram. Prove that opposite sides of a parallelogram are congruent. Tags: Question 19 . If both pairs of opposite sides of a quadrilateral are congruent, then the quadrilateral is_____a parallelogram Always To prove a quadrilateral is a parallelogram, it is ________enough to show that one pair of opposite sides is parallel Let’s play with the simulation given below to better understand a | {
"domain": "co.kr",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964220125033,
"lm_q1q2_score": 0.8453274001757967,
"lm_q2_score": 0.8577681068080749,
"openwebmath_perplexity": 491.7611758590075,
"openwebmath_score": 0.6805704236030579,
"tags": null,
"url": "http://woori2000.dothome.co.kr/rus-approved-xxzg/black-pepper-benefits-for-eyes-2be3ef"
} |
magnetic-fields, magnetostatics
Now that we derived Coulomb's Law from Maxwell's Equations (without using Coulomb's Law to do so!), we could use it to construct electric fields of non-symmetric continuous charge distributions. But there are other symmetric charged objects (infinite cylinder, infinite plane) for which the above technique works directly. | {
"domain": "physics.stackexchange",
"id": 91837,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, magnetostatics",
"url": null
} |
Interesting case! Would definitely be curious to see thoughts on how to handle this kind of situation better. I am not so sure. isn't 9999998 correct matches just as bad as only 2 correct matches in terms of information value? | {
"domain": "mersenneforum.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808707404786,
"lm_q1q2_score": 0.8125928568118921,
"lm_q2_score": 0.8289388083214156,
"openwebmath_perplexity": 627.189817983413,
"openwebmath_score": 0.5778322815895081,
"tags": null,
"url": "https://mersenneforum.org/showthread.php?s=53af9ef5f63fa64f69cea8ca05592283&p=579814"
} |
energy, lagrangian-formalism, variational-principle, action
A short introduction to the Lagrangian formalism
Let's first do a quick review of the Lagrangian formalism for fields. In general, we have a Lagrangian
\begin{equation}
\mathcal{L}(\phi_j, \nabla \phi_j, \partial_t \phi_j) = \int d^3x \, \mathscr{L}(\phi_j, \nabla \phi_j, \partial_t \phi_j)
\end{equation}
where $\mathscr{L}$ is called the Lagrangian density. The Lagrangian density is some function of our fields $\phi_j$ with $j=1,...,N$ (where $N$ is the number of independent fields that we consider), their spatial derivatives, and their time derivatives. We define the action as usual
\begin{equation}
S = \int dt\, \mathcal{L} = \int dt\, \int d^3r \, \mathscr{L}.
\end{equation}
As in the case of Lagrangian mechanics, the principle of least action gives us the Euler-Lagrange-equations. As we are considering fields, these equations give us the EOMs for the fields
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 97582,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, lagrangian-formalism, variational-principle, action",
"url": null
} |
javascript, object-oriented, design-patterns, modules
select.change(function () {
select.blur();
});
$('select option').click(function () {
select.blur();
});
// code for sidebar toggle in jQuery -thomas
$.fn.toggleClick = function () {
var methods = arguments, // Store the passed arguments for future reference
count = methods.length; // Cache the number of methods
// Use return this to maintain jQuery chainability
// For each element you bind to
return this.each(function (i, item) {
// Create a local counter for that element
var index = 0;
// Bind a click handler to that element
$(item).on('click', function () {
// That when called will apply the 'index'th method to that element
// the index % count means that we constrain our iterator between 0
// and (count-1)
return methods[index++ % count].apply(this, arguments);
});
});
}; | {
"domain": "codereview.stackexchange",
"id": 14155,
"lm_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, object-oriented, design-patterns, modules",
"url": null
} |
string-theory, compactification, calabi-yau, algebraic-geometry, cohomology
Can someone explain what I am missing or misunderstood?
I am certain that the book has no typo as the result that is presented has a nice interpretation in the context of mirror symmetry. To be precise, one can check that under the change $h^{1,1} \leftrightarrow h^{2,1}$ the vector and hypermultiplets in the resulting four-dimensional theories get interchanged.
Edit: After the answer by ACuriousMind | {
"domain": "physics.stackexchange",
"id": 66218,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "string-theory, compactification, calabi-yau, algebraic-geometry, cohomology",
"url": null
} |
energy, radiation, big-bang, matter
What is also apparent is the fact that you would need a huge amount of energy to do the opposite. That is, convert energy to mass. This happens in certain particle interactions.
Pair production is a process where energy (in the form of a photon) creates matter in the form of a particle and antiparticle. For example, an electron and a positron or a muon and an antimuon. But in order for such a process to occur, the energy of the incoming photon must be above a certain energy. Specifically, at least the total rest mass energy of the two particles, for example $2m_{e}c^2$, $2m_{\mu} c^2$ etc and only if the interaction is such that the energy-momentum is conserved. | {
"domain": "physics.stackexchange",
"id": 75640,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, radiation, big-bang, matter",
"url": null
} |
classical-mechanics, kinematics, rotational-dynamics, simulations
Is this correct?
This leaves two generalised coordinates, which I have taken to be the angle of rotation of the wheel and the angle between the rod and the y-axis.
After struggling (and failing) with a Newtonian approach I constructed a Lagrangian for the system and applied the Euler-Lagrange equation(s), using the angles as generalised coordinates. After much algebra out popped two second-order non-linear differential equations.
To my surprise, I could eliminate the wheel rotation completely from one equation, leaving it concerning only the rod angle and its derivatives. What, if at all, is the significance of this? | {
"domain": "physics.stackexchange",
"id": 4429,
"lm_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, kinematics, rotational-dynamics, simulations",
"url": null
} |
javascript, url, constants
Title: Function to create URL relative to a configured base URL I have written this function to create a URL:
function createUrl(urlPath) {
const endpoint = url.parse(env.config.get('myEndpoint'));
endpoint.pathname = path.posix.join(endpoint.pathname, urlPath);
return endpoint;
}
const basically creates a mutable object whose properties can still be modified.
Here, I need to declare some Object which will only be modified once. Am I correct in declaring endpoint as const? Yes, it's correct to use const here. That would be considered idiomatic Javascript. If you're using const when you shouldn't, you'll notice as it will produce a TypeError.
People coming from other languages might disagree as they think that const means that the variable is constant/immutable (which is not the case, it's just not re-assignable). But that is really a critique of the naming of the keyword, not your usage of the keyword (which is correct). | {
"domain": "codereview.stackexchange",
"id": 35442,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, url, constants",
"url": null
} |
optics, reflection
They basically look the same, smooth and flat surfaces, almost the same size (one has a label saying 37x134cm), except one having a little thicker
decoration border than the other. The one with thinker edge is the
one giving me fatter and shorter image.
I don't have other things to place them, so I just make both of them
stand on the floor, with a small angle lying against the wall.
Although the two mirrors are placed in the same way, will different
placement of the mirrors change my image?
What kinds of mirrors (size, ...) and how to place them will give me more
realistic image of myself? Image distortions you describe are because of the mirror being slightly bent. With sizes you mention (very elongated) the main reason would be the frame not rigid enough and deformed while being stored or transported. | {
"domain": "physics.stackexchange",
"id": 1387,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, reflection",
"url": null
} |
clustering, gaussian, expectation-maximization, gmm
When and how exactly does the log likelihood function play into this?
The log-likelihood function is used to evaluate the goodness of fit of the GMM to the data. In the M-step of the EM algorithm, the parameters of the GMM are updated to maximize the log-likelihood function. Specifically, the mean, variance, and weight parameters of each component are updated to maximize the expected complete data log-likelihood, which is the sum of the expected log-likelihood of each data point under the current GMM parameters. The EM algorithm iterates between the E-step and the M-step until convergence is reached. | {
"domain": "datascience.stackexchange",
"id": 11660,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "clustering, gaussian, expectation-maximization, gmm",
"url": null
} |
c#, datetime
//if(BL == Bundesland.BadenWürttemberg)
//this.feiertage.Add(new Feiertag(false, osterSonntag.AddDays(-3), "Gründonnerstag"));
//alle Bundesländer
this.feiertage.Add(new Feiertag(false, osterSonntag.AddDays(-2), "Karfreitag"));
if (BL == Bundesland.Brandenburg)
this.feiertage.Add(new Feiertag(false, osterSonntag, "Ostersonntag"));
//alle Bundesländer
this.feiertage.Add(new Feiertag(false, osterSonntag.AddDays(1), "Ostermontag"));
//alle Bundesländer
this.feiertage.Add(new Feiertag(true, new DateTime(year, 5, 1), "Tag der Arbeit"));
//alle Bundesländer
this.feiertage.Add(new Feiertag(false, osterSonntag.AddDays(39), "Christi Himmelfahrt"));
if (BL == Bundesland.Brandenburg)
this.feiertage.Add(new Feiertag(false, osterSonntag.AddDays(49), "Pfingstsonntag")); | {
"domain": "codereview.stackexchange",
"id": 15062,
"lm_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#, datetime",
"url": null
} |
newtonian-gravity, planets, earth, faq
Title: How does gravity work underground? Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not? The other answers provide a first-order approximation, assuming uniform density (though Adam Zalcman's does allude to deviations from linearity). (Summary: All the mass farther away from the center cancels out, and gravity decreases linearly with depth from 1 g at the surface to zero at the center.)
But in fact, the Earth's core is substantially more dense than the outer layers (mantle and crust), and gravity actually increases a bit as you descend, reaching a maximum at the boundary between the outer core and the lower mantle. Within the core, it rapidly drops to zero as you approach the center, where the planet's entire mass is exerting a gravitational pull from all directions. | {
"domain": "physics.stackexchange",
"id": 2072,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-gravity, planets, earth, faq",
"url": null
} |
c++, c++11, tic-tac-toe
Turn turn;
PlayerBitset x;
PlayerBitset o;
};
enum class GridState
: std::uint16_t
{
VictoryX = 0x0,
VictoryO = 0x1,
Draw = 0x2,
Unspecified = 0x3
};
using PlayerBitmask = std::bitset<9u>;
constexpr std::array<PlayerBitmask, 8u> victoryMasks{ 0x007, 0x038, 0x049, 0x054, 0x092, 0x111, 0x124, 0x1c0 };
GridState CheckGrid(const Grid& grid) noexcept
{
if(grid.turn[0u]) {
for(auto& mask : victoryMasks) {
if((mask & grid.x) == mask) {
return GridState::VictoryX;
}
}
}
else {
for(auto& mask : victoryMasks) {
if((mask & grid.o) == mask) {
return GridState::VictoryO;
}
}
}
if(grid.x.count() + grid.o.count() >= 9u) {
return GridState::Draw;
}
else {
return GridState::Unspecified;
}
}
using Move = std::uint16_t;
using MoveSet = std::bitset<9u>; | {
"domain": "codereview.stackexchange",
"id": 25738,
"lm_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, tic-tac-toe",
"url": null
} |
ros, rviz, ros-melodic, rosmake
Title: Build rViz on top of Melodic
I am trying to build rViz on top of melodic; but think I have some of the setup incorrect.
I have cloned rViz to
/home/brent/rosbuild_ws/src/rviz
I then ran
cd /home/brent/rosbuild_ws
rosws init . /opt/ros/melodic
rosdep install rviz
rosmake rviz
I see the below output which is generated in under 1 second; so I don't think anything is actually getting built.
Any tips on what is wrong with my setup would be most appreciated.
This code block was moved to the following github gist:
https://gist.github.com/answers-se-migration-openrobotics/ccdfd95294b794ad6c9bc7aea022d655
Originally posted by bgraysea on ROS Answers with karma: 29 on 2020-08-31
Post score: 0
I then ran
cd /home/brent/rosbuild_ws
rosws init . /opt/ros/melodic
rosdep install rviz
rosmake rviz | {
"domain": "robotics.stackexchange",
"id": 35480,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, rviz, ros-melodic, rosmake",
"url": null
} |
matlab, wavelet, spectrogram
...from the following data: Dropbox Link (FS40.dat)
The time is in milliseconds (frequency is 40000 Hz)
The article state that they used Complex Morlet wavelet to create the spectrogram:
"Power estimates from the averaged LFPs were calculated from
time–frequency spectrograms of the data from 1–88 Hz by convolving the signals with a complex Morlet wavelet of the form
$$
w(t,f_{0})=Ae^{(\frac{-t^2}{2\omega^2})}e^{(2i{\pi}f_{0}t)}
$$
for each frequency of interest $f_{0}$, where $\omega=\frac{m}{2{\pi}f_{0}}$, and $i$ is the imaginary unit. The normalization factor was $A=\frac{1}{\omega(2{\pi})^0.5}$, and the constant $m$ defining the compromise between time and frequency resolution was 7.
I only managed to get some "good" results using spectrogram function in matlab.
But I dont have much idea of how to use the morlet complex wavelet.
I got bad result when trying to use cwt with 'morl' window
Thank You.
P.S.
I'm trying to recreate this article: | {
"domain": "dsp.stackexchange",
"id": 1230,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, wavelet, spectrogram",
"url": null
} |
any rotation you can use the built-in constant Matrix3dIdentity. Rotation around any given axis Rotation from normal vector to normal vector Apparently the 5th function is enough, because for example "Rotation around X axis" can be replace by rotation around (1,0,0), and "Rotation around all axes" is merely the product of 3 matrices. Practice: Rotate 2D shapes in 3D. Euler returns a 3D vector containing the XYZ Euler angles. Rotation in 3D That works in 2D, while in 3D we need to take in to account the third axis. What do the vectors mean in T? T is a 4*4 column-major matrix. 0625 rz = -0. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4. ggb file along with images of a red arrow and ball (that represent the spiral) at different angles. represent data on 3D rotation groups. NEGATIVE_DETERMINANT - this matrix has a negative determinant. As I understand, the rotation matrix around an arbitrary point, can be expressed as moving the | {
"domain": "valledelchieseonline.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777179414275,
"lm_q1q2_score": 0.8537833831960149,
"lm_q2_score": 0.8652240860523328,
"openwebmath_perplexity": 608.277822995443,
"openwebmath_score": 0.5945829749107361,
"tags": null,
"url": "http://rfmb.valledelchieseonline.it/rotation-matrix-3d.html"
} |
c++, c++11, tree
First, use the more modern initializer style for the constructor, and second, use make_unique. A revised form would look like this:
BinarySearchTree(const T& RootValue) :
root{std::make_unique<TreeNode>(RootValue)},
V{1}
{} | {
"domain": "codereview.stackexchange",
"id": 15207,
"lm_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, tree",
"url": null
} |
The second line is the same as the first line, but with $7^{n+1}$ added:
$$\color{maroon}{\frac{7^{n+1}-1}{6}} + 7^{n+1} = \color{darkblue}{\frac{7^{n+2}-1}{6}}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399026119353,
"lm_q1q2_score": 0.828500231673562,
"lm_q2_score": 0.8539127585282744,
"openwebmath_perplexity": 634.7607716882713,
"openwebmath_score": 0.99262535572052,
"tags": null,
"url": "https://math.stackexchange.com/questions/986034/confusing-algebra-rule-why-frac7n1-16-7n1-frac7n2-16"
} |
c++, performance, game
template<ResourceComponent T = Resource>
void Release() {
const ResourceType type = EnumResourceType<T>();
std::erase_if(m_Resources, [this, type](const ResourceContainerPair& pair) {
if (type == ResourceType::None || pair.second->GetType() == type) {
return true;
}
return false;
});
}
void Load(ResourceKey key) {
const auto it = m_Resources.find(key);
if (it != m_Resources.end()) {
const auto& resource = it->second;
if (resource->GetLoaded()) {
// notify rewrite
resource->Unload();
}
if (resource->Load()) {
// notify success
}
else {
// notify failure
}
}
}
template<ResourceComponent T = Resource>
void Load() {
const ResourceType type = EnumResourceType<T>(); | {
"domain": "codereview.stackexchange",
"id": 44151,
"lm_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++, performance, game",
"url": null
} |
quantum-gate, deutsch-jozsa-algorithm
For your first question, the ability to using n qubits to evaluate say $2^n$ functions is parallelism. You see that for a classical computer, there are $2^n$ operations to evaluate while for the quantum computer you only need to perform the operation once (in this case if you applied n Hadamard gate beforehand). As for how the procedure works, I think what you mean is to perform a measurement and that won't work.
For the Deutsch-Jozsa, after you prepared the state $|\psi>$, what you need to do to extract the result is to get the expectation value, $<\phi|\psi>$, while if you perform a direct measurement $<\psi|\psi>$ you can not get the phase factor because there is no phase difference.
For your second question, it is difficult and all the comments I see admit this. What you need is to read some papers to find potential direction toward new algorithms. | {
"domain": "quantumcomputing.stackexchange",
"id": 2118,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, deutsch-jozsa-algorithm",
"url": null
} |
quantum-gate, quantum-algorithms, quantum-circuit, complexity-theory
If we visualize the circuit as being divided into a sequence of discrete time-slices, where the application of a single gate
requires a single time-slice, the depth of a circuit is its total number of time-
slices. Note that this is not necessarily the same as the total number of gates in
the circuit, since gates that act on disjoint bits can often be applied in parallel.
While it is somewhat clear what they mean here it is not the definition. One of my colleagues casually mentioned the "longest path" in the circuit as a measure of depth, though they did not attempt to give a formal definition.
The connectivity in the circuit is even less clear to me, let alone trying to come up with a formal definition of the concept.
Just to summarize. I would like to know if the notion of circuit depth and connectivity were ever formally defined in some literature.
Edit: Niel de Beaudrap gave the definition of the circuit depth | {
"domain": "quantumcomputing.stackexchange",
"id": 3880,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, quantum-algorithms, quantum-circuit, complexity-theory",
"url": null
} |
A rigorous study of infinite sequences of Bernoulli trials requires the introduction of a probability measure in the space of infinite sequences of zeros and ones. This may be done directly or by the method illustrated for the case below. Let be a number, uniformly distributed on the segment , and let
where or 1, be the expansion of into a binary fraction. Then the , are independent and assume the values 0 and 1 with probability each, i.e. the succession of zeros and ones in the expansion of is described by the Bernoulli trial scheme with . However, the measure on can also be specified so as to obtain Bernoulli trials with any desired (if the measure obtained is singular with respect to the Lebesgue measure).
Bernoulli trials are often treated geometrically (cf. Bernoulli random walk). Certain probabilities of a large number of events connected with Bernoulli trials were computed in the initial stage of development of probability theory in the context of the ruin problem. | {
"domain": "encyclopediaofmath.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9919380091867155,
"lm_q1q2_score": 0.8015525808081269,
"lm_q2_score": 0.8080672112416737,
"openwebmath_perplexity": 408.5358173296395,
"openwebmath_score": 0.9159142971038818,
"tags": null,
"url": "http://www.encyclopediaofmath.org/index.php/Bernoulli_trials"
} |
json, web-scraping, xpath, xslt
</html:tr>
<html:tr class="bbGrid-subgrid-row visible_none">
<html:td/>
<html:td colspan="4">
<html:div class="bbGrid-container">
<html:table class="bbGrid-grid table table-bordered table-condensed" width="100%" cellpadding="0" cellspacing="0">
<html:thead class="bbGrid-grid-head">
<html:tr class="bbGrid-grid-head-holder">
<html:th>Disposition, Date</html:th>
<html:th>Disposition by Unfair Acts, Date</html:th> | {
"domain": "codereview.stackexchange",
"id": 42749,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "json, web-scraping, xpath, xslt",
"url": null
} |
quantum-field-theory, symmetry, feynman-diagrams, propagator
If we strip off the 4 $J$-sources at nodes $x_1$, $x_2$, $x_3$, $x_4$ (by 4 differentiations), there are 3 possible diagrams (1 of them is OP's diagram), each with symmetry factor $S=1$.
--
$^1$ We assume the propagator is un-oriented, i.e. without an arrow. | {
"domain": "physics.stackexchange",
"id": 87002,
"lm_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, feynman-diagrams, propagator",
"url": null
} |
circuit-construction, shors-algorithm
Title: Is there a simple, formulaic way to construct a modular exponentiation circuit? I'm a newcomer to quantum computing and circuit construction, and I've been struggling to understand how to make a modular exponentiation circuit. From what I know, there are several papers on the matter (like Pavlidis, van Meter, Markov and Saeedi, etc.) but they are all so complicated and involve a lot of efficiency and optimization scheme that make it impossible for me to understand. When I read it in Nielsen and Chuang, specifically in Box 5.2 the author wrote them without any example, as if it is very easy to make (it probably is, but not for me).
Anyway, I've learned about the algorithm to do modular exponentiation using binary representation (it's simple enough at least this thing), but I don't know how to make a circuit out of it. Here's the picture I believe describing the process: | {
"domain": "quantumcomputing.stackexchange",
"id": 2143,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "circuit-construction, shors-algorithm",
"url": null
} |
Recall the product space of the Michael line and the space of the irrational numbers. Even though the first factor is a normal space (in fact a paracompact space) and the second factor is a metric space, their product space is not normal. This is one of the classic examples demonstrating that normality is not well behaved with respect to product space. This post presents an even more striking result, i.e., for any non-discrete normal space $Y$, there exists another normal space $X$ such that $X \times Y$ is not normal. The example of the non-normal product of the Michael line and the irrationals is not some isolated example. Rather it is part of a wide spread phenomenon. This result guarantees that no matter how nice a space $Y$ is, a counter part $X$ can always be found that the product of the two spaces is not normal. This result is known as Morita’s first conjecture and was proved by Atsuji and Rudin. The solution is based on a generalization of Dowker’s theorem and a construction | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9914225128122336,
"lm_q1q2_score": 0.8082398475701057,
"lm_q2_score": 0.8152324938410784,
"openwebmath_perplexity": 1637.948484019525,
"openwebmath_score": 1.0000100135803223,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/normal-space/"
} |
ruby, linked-list
def get(node)
current_node = self.node
data_match = nil
while !current_node.getPointer.nil? and ! data_match.nil? do
data_match = current_node.getData if node.getData == current_node.getData
current_node = current_node.getPointer
end
return current_node
end | {
"domain": "codereview.stackexchange",
"id": 34019,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, linked-list",
"url": null
} |
special-relativity, particle-physics, time-dilation
The explanation is actually just standard quantum weirdness. If so, can it be recast directly in terms of some other more familiar complementarity phenomenon? The decay rates are different but both observers must agree in the number of decays between two events. Let us say we define two events, the first when the beam leaves from A and the second when the beam reaches B (for the observer that does not move with the beam. For an observer stationary with the beam the rate will be larger than for the observer that sees the beam moving, however the distance between A and B is smaller for the observer moving with the beam. Thus, for the observer at rest with the beam the number of decays will be slower but will occur during a longer distance, for the observer moving with the beam, the decay will be larger, but will occur during a shorter distance. In such a way that both observers see the same number of decays (it cannot be otherwise). | {
"domain": "physics.stackexchange",
"id": 34116,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, particle-physics, time-dilation",
"url": null
} |
waves, acoustics, shock-waves
I'm imagining the first oscillation of a speaker membrane (i.e. a piece of cardboard) in air, but it could be a vocal chord, a guitar string etc. The membrane imparts a certain initial velocity to the particles it hits, but this velocity is quickly absorbed by the surrounding particles of air due to inefficient collisions occurring at angles different to the direction of wave propagation. The nearby particles are pushed very close together, and due to the nature of gases/liquids, spread out, but this causes a gathering of particles somewhere further down the line, and the chain continues until the movement of particles reaches my ear. When the speaker membrane moves backwards, an area of space is freed up for the particles to move into; the particles begin to move in the reverse direction. Since this movement is not at all governed by the initial velocity imparted to the particles, the speed of sound is constant (within a given medium). | {
"domain": "physics.stackexchange",
"id": 75072,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, acoustics, shock-waves",
"url": null
} |
the x value. A natural extension of the 2d polar coordinates are cylindrical coordinates, since they just add a height value out of the xy Conversion from cartesian to spherical coordinates: Cartesian [x, y, z] Spherical [r, θ, φ] Conversion from spherical to cylindrical coordinates: Spherical [r, θ, φ] Cylindrical [ρ, φ', z'] ρ = r sin θ φ' = φ z' = r cos θ Conversion from cylindrical to spherical coordinates: Cylindrical [ρ, φ, z] Spherical [r, θ, φ'] θ = arctan Relationships in Cylindrical Coordinates This section reviews vector calculus identities in cylindrical coordinates. Morrison Continuity Equation, Cartesian coordinates ∂ρ ∂t + vx ∂ρ ∂x +vy ∂ρ ∂y +vz ∂ρ ∂z +ρ ∂vx ∂x + ∂vy ∂y + ∂vz ∂z = 0 Continuity Equation, cylindrical coordinates ∂ρ ∂t + 1 r ∂(ρrvr) ∂r + 1 r ∂(ρvθ) ∂θ + ∂(ρvz) ∂z = 0 This article contains a download link for a script which converts cylindrical or spherical coordinates to xyz coordinates for use in Surfer. Overrides: fromReference in class CoordinateSystem | {
"domain": "sramble-communication.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9914225158534695,
"lm_q1q2_score": 0.8682749313616078,
"lm_q2_score": 0.8757869803008764,
"openwebmath_perplexity": 535.9419383625223,
"openwebmath_score": 0.931949257850647,
"tags": null,
"url": "http://angs-diasporanew.sramble-communication.com/apdsmyht/cartesian-to-cylindrical-coordinates.php"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.