text stringlengths 1 1.11k | source dict |
|---|---|
organic-chemistry, solutions, spectroscopy, carbonyl-compounds, halides
(And yes, this is in stark contrast to geminal couplings in diastereotopic, $\mathrm{sp^3}$ $\ce{CH2}$ groups, which often have large magnitudes!)
So, to observe it in the spectrum, you will need to increase the resolution. The easiest way would be to perform extra zero-filling and see if that helps. The next simplest way is to process the data using a different window function / apodisation function: to increase the resolution, you can use a Gaussian window function, see e.g. | {
"domain": "chemistry.stackexchange",
"id": 16739,
"lm_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, solutions, spectroscopy, carbonyl-compounds, halides",
"url": null
} |
python, performance, python-2.x, csv
def fileblock_write():
if count >= 1:
fileblock.write("BloqLine(%s,%s)\n" % (fo[0],check[7]))
count = 0
def fo1_in_nodo():
for nodo in nodos:
if fo[1] in nodo:
refactor_first()
fileblock_write()
def check2_in_nodo():
for nodo in nodos:
if check[2] in nodo: #ITEMREP
refactor_first()
fileblock_write()
def all_in_nodo():
for nodo in nodos:
refactor_first()
fileblock_write()
Using these non-working functions your massive if block is simplified to this:
#Fam87
if forder.find(check[5]) >= 1 or (forder.find(fam87)) >= 1:
if forder.find(check[6]) >= 1 or (forder.find(est)) >= 1: #Si EstCom coincide con bloqueo actual
if fo[1] in check[2]: #Si ITEMREP coincide bloqueo actual
all_in_nodo():
elif check[2] == '': #Cuando no hay ITEMREP
fo1_in_nodo() | {
"domain": "codereview.stackexchange",
"id": 16949,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-2.x, csv",
"url": null
} |
java, algorithm, object-oriented, queue, deque
}
}
} Pointless try ... catch:
try {
if (item == null) {
throw new IllegalArgumentException("item cannot be null");
}
}
catch (NullPointerException ex) {
throw new IllegalArgumentException("item cannot be null");
} | {
"domain": "codereview.stackexchange",
"id": 31221,
"lm_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, object-oriented, queue, deque",
"url": null
} |
javascript, functional-programming, mapreduce
The X axis is called "Warmth" and the Y axis is called "Dominance".
This function aims to calculate which quadrant you are in given your answers. If you are on a boundary, it returns an array with the quadrants that you span. If there is a 4-way tie, Quadrant 4 is assumed.
It looks very messy and difficult to read. How could I improve it? I'd specifically like to pull the whole thing into a reduce function if I can to avoid the nasty if/else tree at the end.
calculateResult = (questions, answers) => {
const res = _.zip(questions, answers)
.filter(x => x[1]) // Only get correct answers
.map(x => x[0].quadrant) // Pluck the quadrant number
.reduce(
(res, x) => {
if (x == 1 || x == 4) {
res.dominance++;
} else {
res.dominance--;
} | {
"domain": "codereview.stackexchange",
"id": 26316,
"lm_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, functional-programming, mapreduce",
"url": null
} |
quantum-mechanics, angular-momentum
Title: Vector model of addition of angular momenta I'm trying to understand what Landau and Lifshitz mean in their $\S31$ of "Quantum mechanics. Non-relativistic theory" about vector model of addition of angular momenta:
... This result can be illustrated by means of what is called the vector model. If we take two vectors $\mathbf L_1,\mathbf L_2$ of lengths $L_1$ and $L_2$, then the values of $L$ are represented by the integral lengths of the vectors $\mathbf L$ which are obtained by vector addition of $\mathbf L_1$ and $\mathbf L_2$; the greatest value of $L$ is $L_1+L_2$, which is obtained when $\mathbf L_1$ and $\mathbf L_2$ are parallel, and the least value is $|L_1-L_2|$, when $\mathbf L_1$ and $\mathbf L_2$ are antiparallel. | {
"domain": "physics.stackexchange",
"id": 34476,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, angular-momentum",
"url": null
} |
javascript, performance, html, css, animation
window.addEventListener('resize', function() {
window.clearTimeout(resizeTimer);
resizeTimer = window.setTimeout(function() {
initialize();
}, 100);
});
#projectContainer {
background-color: #333;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
#starSuperContainer {
width: 100vw;
height: 70vh;
position: relative;
}
#starContainer {
width: 100%;
height: 100%;
}
#starFade {
width: 100%;
height: 100%;
background: -webkit-linear-gradient(transparent, #333);
/* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(transparent, #333);
/* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(transparent, #333);
/* For Firefox 3.6 to 15 */
background: linear-gradient(transparent, #333);
/* Standard syntax */
position: absolute;
top: 0;
}
.star {
background-color: #fff;
border-radius: 50%;
position: fixed;
} | {
"domain": "codereview.stackexchange",
"id": 17036,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, html, css, animation",
"url": null
} |
robotic-arm, communication, c
[191] [146] [242] [158] [148] [114] [240] [57] [188] [224] [224] [96] [66] [68] [102] [103] [66] [37] [153] [154] [66] [127] [153] [154] [253] [0] [0] [0] [53] [4] [63]
[217] [153] [52] [224] [36] [238] [93] [191] [217] [153] [169] [67] [241] [211] [23] [63] [207] [255] [137] [8] [22] [253] [198] [63] [240] [0] [170] [111] [207] [54]
[176] [63] [243] [51] [88] [137] [58] [151] [217] [63] [201] [148] [119] [151] [70] [237] [237] [0] [0] [0] [29] [5] [64] [143] [64] [0] [0] [0] [0] [0] [64] [143] [64]
[0] [0] [0] [0] [0] [64] [143] [64] [0] [0] [0] [0] [0] [0] [0] [0] [61] [3] [0] [63] [0] [0] [0] [0] [63] [123] [129] [184] [27] [129] [184] [28] [63] [112] [225] | {
"domain": "robotics.stackexchange",
"id": 1233,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robotic-arm, communication, c",
"url": null
} |
## Equivalent Sets
In Preview Activity $$\PageIndex{1}$$, we introduced the concept of equivalent sets. The motivation for this definition was to have a formal method for determining whether or not two sets “have the same number of elements.” This idea was described in terms of a one-to-one correspondence (a bijection) from one set onto the other set. This idea may seem simple for finite sets, but as we will see, this idea has surprising consequences when we deal with infinite sets. (We will soon provide precise definitions for finite and infinite sets.)
Technical Note | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936082881854,
"lm_q1q2_score": 0.8157533746136748,
"lm_q2_score": 0.8289387998695209,
"openwebmath_perplexity": 63.19698834679683,
"openwebmath_score": 0.9840684533119202,
"tags": null,
"url": "https://math.libretexts.org/Bookshelves/Mathematical_Logic_and_Proof/Book%3A_Mathematical_Reasoning_-_Writing_and_Proof_(Sundstrom)/9%3A_Finite_and_Infinite_Sets/9.1%3A_Finite_Sets"
} |
c#, asp.net-mvc
List<MaterialRequestModel> model= new List<MaterialRequestModel>();
foreach (MaterialRequest req in query)
{
model.Add(new MaterialRequestModel(req, DB.Employees.Find(req.ConcernedEmployeeId), DB.Employees.Find(req.OrderedByEmployeeId), DB.Offices.Find(req.OfficeId)));
}
return View(model);
} | {
"domain": "codereview.stackexchange",
"id": 11241,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, asp.net-mvc",
"url": null
} |
general-relativity, cosmology, spacetime, time, space-expansion
So it seems very strange to me that the volume of the entire universe's space-time could change over time when time is part of the thing that's changing. It sounds like we're talking about two different kinds of time... One talks about the size of the universe in the context of a model where spacetime is foliated by three-dimensional spacelike leaves. The "size of the universe" means the size of one of those leaves, not of all spacetime.
For example: If you imagine spacetime to be filled with galaxies, the worldlines of those galaxies give a preferred global time coordinate, and you can take your three-dimensional leaves to be the three-manifolds whose tangent spaces are everywhere orthogonal to the tangents to those worldlines. You can then talk about the volume of a leaf as a function of the global time coordinate to get the rate at which the universe is expanding. | {
"domain": "physics.stackexchange",
"id": 32327,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, cosmology, spacetime, time, space-expansion",
"url": null
} |
python, python-3.x, multithreading
self.dict_shared_errors[self.thread_id] = self.fnc(position)
# set to not ready
self.dict_shared_is_ready[self.thread_id] = False
threadLock.release()
# print(f'{self.name} working on task')
it +=1
# print(f'{self.name}, {it}') | {
"domain": "codereview.stackexchange",
"id": 41526,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, multithreading",
"url": null
} |
python, object-oriented, design-patterns
# set various values
stream_name = data['stream']
firehose_name = data['firehose']
bucket_name = data['bucket']
prefix_name = data['prefix']
s_three = aws_pipeline.S3(config_file)
stream = aws_pipeline.Stream(stream_name)
firehose = aws_pipeline.Firehose(firehose_name, bucket_name, prefix_name)
# upload config file to s3
s_three.upload_file_to_config_folder()
# check if stream exists, if not create
if stream_name not in stream.list():
stream.create()
stream.add_tags()
else:
print 'STATUS: Stream found - do nothing'
# check if firehose exists, if not create
if firehose_name not in firehose.list():
firehose.create()
else:
print 'STATUS: Firehose found - do nothing'
stream_arn = stream.get_arn()
lambda_exception_handler = aws_pipeline.Lambda(stream_arn, LAMBDA_FUNC_EXCEPTION) | {
"domain": "codereview.stackexchange",
"id": 20810,
"lm_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, design-patterns",
"url": null
} |
java, unit-testing, junit
public CostMatrix(
int[][] costMatrix,
int nRows,
int nCols,
boolean transposed
)
{
this.costMatrix = costMatrix;
this.nRows = nRows;
this.nCols = nCols;
this.transposed = transposed;
}
}
And then:
...
public int[][] solve(CostMatrix costMatrix) {
CostMatrix reducedCostMatrix = this.hungarianMatrixReducer.reduce(costMatrix);
return this.hungarianSolver.solveReducedMatrix(reducedCostMatrix);
} | {
"domain": "codereview.stackexchange",
"id": 42094,
"lm_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, unit-testing, junit",
"url": null
} |
(EDITED) For the $2 \times m$ case, it seems to me the recursion is $$L(2,m) = 2 \sum_{j=0}^{m-3} L(2,j)$$ where $L(2,0) = 1$, and the solution to that is $$L(2,m) = \sum_r \dfrac{9-3r-2r^2}{29 r^m}$$ the sum being over the three roots $r$ of $2 z^3+z-1$ (approximately $.58975$ and $-.29488 \pm .87227 i$). Cases with $N > 2$ are going to be more complicated. Essentially you want to look at all possibilities for what happens at one end of the grid. But even for $N=3$ there are quite a few possibilities. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426382811477,
"lm_q1q2_score": 0.8462743154114091,
"lm_q2_score": 0.8688267660487573,
"openwebmath_perplexity": 457.28023752333763,
"openwebmath_score": 0.8533415198326111,
"tags": null,
"url": "http://math.stackexchange.com/questions/674564/how-many-ways-can-you-tile-an-nxm-rectangle-with-l-polyominos"
} |
astronomy, speed-of-light, stars, observable-universe
Title: How long would it take to see the nearest star die? If you were in the general proximity to the nearest star to Earth (besides the Sun) and you saw it turn to a neutron star or black hole at the very end of it's star cycle, how much longer would it take the people on Earth to see it?
-please feel free to correct me on any of these phrases I might have misused. If by "general proximity" you mean "reasonably close", i.e. a few light minutes away (Earth is 8 light minutes away from the Sun), then people on Earth would see the star evolve in the future, the time dictated by how far away the star is. | {
"domain": "physics.stackexchange",
"id": 25492,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy, speed-of-light, stars, observable-universe",
"url": null
} |
Elements of the range are precisely those elements of the codomain with nonempty preimages.
Proof
Now would be a good time to return to Figure 7.48 which depicted the pre-images of a non-surjective linear transformation. The vectors $\vect{x},\,\vect{y}\in V$ were elements of the codomain whose pre-images were empty, as we expect for a non-surjective linear transformation from the characterization in Theorem RPI.
SubsectionSLTDSurjective Linear Transformations and Dimension¶ permalink
Proof
Notice that the previous example made no use of the actual formula defining the function. Merely a comparison of the dimensions of the domain and codomain are enough to conclude that the linear transformation is not surjective. Archetype O and Archetype P are two more examples of linear transformations that have “small” domains and “big” codomains, resulting in an inability to create all possible outputs and thus they are non-surjective linear transformations. | {
"domain": "ups.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9907319866190857,
"lm_q1q2_score": 0.8420936314281889,
"lm_q2_score": 0.8499711756575749,
"openwebmath_perplexity": 264.7288847323717,
"openwebmath_score": 0.9572227001190186,
"tags": null,
"url": "http://linear.ups.edu/fcla/section-SLT.html"
} |
asymptotics
Title: how can i proof $3^n$ has a greater growth than $n2^n$? i want to prove that $3^n$ has a greater growth than $n2^n$ or $3^n = O(n2^n)$. but how can i do it mathematically? by induction or contradiction or other ways of proof. One simple way would be divide both sides by $2^n$ to get $n$ and $(1.5)^n$. You can simply take a limit of $l i m_{n\to\infty} \frac{(1.5)^n}{n} = \infty$ To show that $(1.5)^n$ grows larger. This limit holds for any number larger than 1. | {
"domain": "cs.stackexchange",
"id": 11052,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asymptotics",
"url": null
} |
organic-chemistry, nomenclature
Title: What does the newest IUPAC nomenclature have against unsaturation? IUPAC nomenclature 2013 changed a couple of rules very commonly used in naming simple acyclic compounds. As a result, depending on which nomencalture we choose, the answer to this question varies greatly, as demonstrated in the comments. Educational textbooks, hence, would propose an outdated name that is not PIN (Preferred IUPAC Name) according to the newest standards.
This change has been illustrated in the draft, page 442 (page 58 of P-4, section P-44.3), which reads: | {
"domain": "chemistry.stackexchange",
"id": 7379,
"lm_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, nomenclature",
"url": null
} |
optics, visible-light, lenses
Secondly, the magnification, by the similar triangles you mention, is given by the image distance divided by the object distance. So, the above paragraph implies that the magnifications for the two situations are reciprocals.
Consider the two situations described, with $x$ the object height and $M_1$ and $M_2$ the two magnifications:$$M_1 = \frac{8}{x}$$ $$M_2=\frac{50}x$$ $$\frac{1}{M_2}=M_1$$ $$\frac{x}{50}=\frac8x$$ Solve for $x$... | {
"domain": "physics.stackexchange",
"id": 29865,
"lm_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, visible-light, lenses",
"url": null
} |
quantum-operation
Title: Does $\Phi(A^\dagger) = \Phi^\dagger(A)$? Define linear map $\Phi \in T(X)$, linear operator $A \in L(X)$.
Is it true that
\begin{equation}
\Phi(A^\dagger) = \Phi^\dagger(A)?
\tag{1}
\end{equation}
What are the conditions that will let equation $(1)$ hold? The adjoint map $\Phi^\dagger$ is linear by definition. However, $^\dagger$ is anti-linear. Therefore, the right hand side of $(1)$ is linear, but the left hand side is anti-linear. This is only possible if $\Phi$ is the zero map.
In a little more detail, on one hand
$$
\Phi^\dagger(iA)=\Phi((iA)^\dagger)=\Phi(-iA^\dagger)=-i\Phi(A^\dagger)\tag2
$$
but on the other
$$
\Phi^\dagger(iA)=i\Phi^\dagger(A)=i\Phi(A^\dagger)\tag3
$$
so $\Phi(A^\dagger)=-\Phi(A^\dagger)$ and $\Phi$ is the zero map. | {
"domain": "quantumcomputing.stackexchange",
"id": 4525,
"lm_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-operation",
"url": null
} |
data-structures, trees
Retrieval operations. To retrieve the location of a node $v$ in the original tree, we follow the path in the path tree from the root to $v$. This will involve traversing at most $O(\log n)$ light edges. It also traverses at most $O(\log n)$ heavy paths. In each heavy path, we might potentially traverse many vertices of the heavy path (possibly much more than $O(\log n)$ of them), but we don't need to visit all of them; since that is a consecutive subpath of the heavy path, we can quickly retrieve the transformation associated with that subpath (i.e., the composition of the transformations of the nodes in that heavy path) using the index tree for that subpath. This takes $O(\log n)$ time per heavy path, and there are at most $O(\log n)$ heavy paths to visit. Finally, we compose all of these transformations and apply it to the original location of $v$. | {
"domain": "cs.stackexchange",
"id": 12151,
"lm_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-structures, trees",
"url": null
} |
pcl, rosmake, pcl-ros
[rosmake-3] Finished <<< message_filters ROS_NOBUILD in package message_filters
[rosmake-0] Starting >>> topic_tools [ make ]
[rosmake-3] Starting >>> nodelet_topic_tools [ make ]
[rosmake-2] Finished <<< test_rosgraph ROS_NOBUILD in package test_rosgraph
[rosmake-3] Finished <<< nodelet_topic_tools ROS_NOBUILD in package nodelet_topic_tools
[rosmake-1] Finished <<< bullet ROS_NOBUILD in package bullet
[rosmake-0] Finished <<< topic_tools ROS_NOBUILD in package topic_tools
[rosmake-3] Starting >>> angles [ make ]
[rosmake-3] Finished <<< angles ROS_NOBUILD in package angles | {
"domain": "robotics.stackexchange",
"id": 10088,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl, rosmake, pcl-ros",
"url": null
} |
optics, laser, lenses, fiber-optics
Title: Calculating focal length for contracting a Gaussian beam A typical experiment problem, I have to choose two lens such that I can couple laser from one fiber of diameter D1 into another fiber of diameter D2. The fiber one has twice the diameter of the second fiber, i.e. D1 = 2D2. It is clear that two focal lengths must be different to achieve this, I tried to calculate this by meeting the condition that the waist of Gaussian beam in first fiber must be twice of that second fiber. The problem can be seen in the schematics below. I have attempted to calculate it, but i am not sure if I am doing it correctly.
My attempt: applied paraxial approximation to Gaussian beam, and use ABCD formalism for both lens. I quoted the formula for focusing a beam using a lens, I rearranged that formula to use it for collimation, and use the same formula for the second lens. And I arrived the steps shown below.
n,n' : refractive index of the medium,
f,f' : focal lengths
Zr,Zr': Rayleigh range | {
"domain": "physics.stackexchange",
"id": 40449,
"lm_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, laser, lenses, fiber-optics",
"url": null
} |
vba, excel
'/ Workbooks
Public WbSubsheet As Workbook '/ Contains all Lumin Wealth submitted Business
Public WbAdviserReport As Workbook '/ Will Contain an aggregation of the subsheet and a submission report (by month) for each adviser
'/ Adviser Report worksheets
Public WsAggregatedData As Worksheet '/ Will contain the aggregated subsheet data
Public WsAdviserReport As Worksheet '/ Will contain the submissions report, reported by Adviser
Public WsProviderReport As Worksheet '/ Will contain the submissions report, reported by Provider
Public WsProductReport As Worksheet '/ Will contain the submissions report, reportrd by Type of Business
Public WsChangedData As Worksheet '/ Record of Data CleanUp | {
"domain": "codereview.stackexchange",
"id": 17368,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
thermodynamics, astrophysics, entropy, dark-matter, virial-theorem
If we want to examine gravitational collapse from a statistical mechanics point of view, we find that there's a tradeoff between the fact that a more spread-out collection of matter has more possible position states, whereas a more concentrated collection has more possible momentum states (because more of the system's potential energy has been converted to kinetic energy and thus the particles have higher average velocity/momentum). And in statistical mechanics, entropy is a function of the total number of states available, with higher entropy = more possible states. It turns out, though, that this tradeoff alone is not enough to explain why gravitational collapse can happen in some systems--the decrease in the number of possible position states when a cloud collapses is actually greater than the increase in the number of momentum states, as derived on this page from physicist John Baez, so if these were the only factors at play the entropy would be lower in the collapsed state than | {
"domain": "physics.stackexchange",
"id": 17225,
"lm_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, astrophysics, entropy, dark-matter, virial-theorem",
"url": null
} |
electromagnetism, special-relativity, electric-current, charge
Also, isn't this what a magnetic field due to moving charges is? (electric field from a different frame of reference). Or is that different.. You're completely correct to say in the reference frame of the electrons, the charge density of positive ions increases by a factor of $\gamma$. However if we're in the middle of the wire, there'll be a roughly equal amount of charge either side of the electrons, so no net force overcoming the electromotive force. Even if there was some net force on the electrons from these positive ions, it would be swamped by the force from the potential difference, otherwise we would have had no current to begin with. You could maybe even argue that whatever force is pulling the electric current along (e.g. a charged plate at the end of the wire) would be closer to the electrons by the same length contraction, so this might counter your increased force from a larger positive charge density. | {
"domain": "physics.stackexchange",
"id": 87891,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, special-relativity, electric-current, charge",
"url": null
} |
clojure, simulation
(defrecord Simulation-State [game-state tiles-visited])
(defn new-state [rand-gen]
(->Simulation-State (s/new-state rand-gen) []))
(defn roll-dice [n-dice rand-gen]
(mapv (fn [_]
(g/random-int 1 7 rand-gen))
(range n-dice)))
(defn react-to-roll
"Moves the player according to the roll, and records the roll if all the dice are the same."
[game-state dice-rolls]
(let [sum (apply + dice-rolls)]
(-> game-state
(sh/move-player-by sum)
(update :consec-match-dice #(if (apply = dice-rolls)
(inc %)
0)))))
(defn too-many-consec-multiples? [game-state]
(>= (:consec-match-dice game-state)
max-allowed-consec-multiples)) | {
"domain": "codereview.stackexchange",
"id": 26651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "clojure, simulation",
"url": null
} |
organic-chemistry, redox
oxygen is depleted (by microbes) and the redox conditions change: the dominant reduction reaction changes. Usually in this order: $\ce{O2}$, nitrate, manganese(III,IV), iron(III), sulfate and finally $\ce{H2}$. When the conditions become so reducing that the microbes are using $\ce{H2}$ as an electron acceptor, they making methane via a process called methanogenesis. This order arises because of reduction potentials. Microbes get the most energy for the least effort from reducing $\ce{O2}$, so they do that until it runs out, which is when they switch to the next best thing available. | {
"domain": "chemistry.stackexchange",
"id": 356,
"lm_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, redox",
"url": null
} |
c#, performance, reinventing-the-wheel, binary-search
int BinarySearch(int[] data, int target)
{
int min = 0;
int max = data.Length - 1;
int mid = (data.Length - 1) / 2;
while (min != mid && max != mid)
{
if (data[mid] == target)
{
return mid;
}
if (data[mid] < target)
{
min = mid;
mid = (min + max) / 2;
}
else if (data[mid] > target)
{
max = mid;
mid = (min + max) / 2;
}
}
return -1;
} | {
"domain": "codereview.stackexchange",
"id": 24016,
"lm_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, reinventing-the-wheel, binary-search",
"url": null
} |
thermodynamics, phase-transition, bose-einstein-condensate, cold-atoms
Title: Is there an intuitive reason as to why there is no phase transition to get to a degenerate Fermi gas? Cooling a bosonic gas leads to a phase transition into the Bose-Einstein condesate. This is characterised by a symmetry broken ( U(1), by choosing a specific phase for the macroscopic wavefunction) and by discountinuous behavoiur of some thermodyamics quantities and their derivates - e.g. the heat capacities.
On the other hand, cooling a fermionic gas leads to a crossover into the a Fermi degenerate gas. | {
"domain": "physics.stackexchange",
"id": 49918,
"lm_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, phase-transition, bose-einstein-condensate, cold-atoms",
"url": null
} |
quantum-gate, qiskit, programming, gate-synthesis, pauli-gates
Title: Principal square root of Pauli Y gate in Qiskit? I've seen a similar question asked (How do I compute the square root of the $Y$ gate?) but I'm trying to understand how I can use the gates $Y^{\frac{1}{2}}$ or $Y^{\frac{1}{4}}$ in Qiskit in terms of other building blocks, if it is possible.
Is there a way to use the gate $Y^{\frac{1}{2}} = \begin{bmatrix}
\frac{1}{2}
+ \frac{1}{2}i & -\frac{1}{2} - \frac{1}{2}i\\
\frac{1}{2} + \frac{1}{2}i & \frac{1}{2} + \frac{1}{2}i
\end{bmatrix}$ in Qiskit? I can say that $Y = iRY(\pi)$ and compute the square root manually, but how can I describe such an operation, if possible, in Qiskit? For some reason this took a while to find, but has a simple solution:
circ.append(YGate().power(1/2), [qbit])
Where circ is the QuantumCircuit object and qbit is the register to apply the gate on. | {
"domain": "quantumcomputing.stackexchange",
"id": 1873,
"lm_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, qiskit, programming, gate-synthesis, pauli-gates",
"url": null
} |
quantum-algorithms
Thank you in advance for your help! Yes, it certainly seems possible with current quantum technology.
First of all, the TSP can be converted into a decision/search problem by iteratively asking if there is a path of weight $k$, then looking for a path of weight $k-1$ etc... This procedure will eventually find you the optimal solution provided the weights are integer.
The number of Hamiltonian paths in an undirected graph on $4$ vertices is $(4-1)!/2=3$ and so in any case the search size over all possible tours is at most $3$. Theoretically, this means you could implement a Grover search approach to the TSP on 4 nodes using a device with only $2$ qubits to represent the search space. | {
"domain": "quantumcomputing.stackexchange",
"id": 3946,
"lm_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-algorithms",
"url": null
} |
thermodynamics, temperature, atmospheric-science, kinetic-theory
Title: Why is it severely cold high up in the atmosphere? In the upper part of the atmosphere the kinetic temperature of air is of the order of 1000 K, even then one feels severe cold, why? As we go up in the atmosphere , the number of molecules per unit volume decreases . The quantity of heat per unit volume or the heat density is low . But the translational kinetic energy per molecule is quite large. As the kinetic temperature is the measure of translational kinetic energy, so the kinetic temperature is quite high in the upper atmosphere but one feels severe cold due to low heat density. | {
"domain": "physics.stackexchange",
"id": 47596,
"lm_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, atmospheric-science, kinetic-theory",
"url": null
} |
c++, chess
// Define an alias for passing calculate<Piece>AttackBoard() as a parameter to another function
using calculateAttackBoardFunction = Bitboard (*)(const Square & square, const Bitboard & blockerVariation);
void initializeHashInformationEntries();
void generateBlockerMasks();
Bitboard calculateBishopBlockerMask(const Bitboard &bitboard);
Bitboard calculateRookBlockerMask(const Bitboard &bitboard);
std::array<std::vector<Bitboard>, Square::NUMBER_OF_SQUARES> calculateBlockerVariations(HashInformation const * HASH_INFORMATION_TABLE);
std::array<std::vector<Bitboard>, Square::NUMBER_OF_SQUARES> calculateAttacks(calculateAttackBoardFunction calculateAttackBoard,
const std::array<std::vector<Bitboard>,
Square::NUMBER_OF_SQUARES> & blockerVariations); | {
"domain": "codereview.stackexchange",
"id": 44989,
"lm_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++, chess",
"url": null
} |
energy-conservation, reference-frames
At the higher level it has speed $v_0$, then it goes down a slope and at the end it has speed $v_0 + \Delta v$. The carriage is not powered and has negligible friction.
So by conservation of energy we should, after eliminating mass $m$ that appears in all terms, have
$$
\frac{1}{2}v_0^2 + gh = \frac{1}{2}(v_0 + \Delta v)^2 \\
\frac{1}{2}v_0^2 + gh = \frac{1}{2}v_0^2 + v_0\Delta v + \frac{1}{2}\Delta v^2 \\
gh = \frac{1}{2}\Delta v^2 + v_0\Delta v
$$
(left side is energy at the beginning, right side energy at the end).
But what if we consider the same situation in a reference frame moving left with speed $v_0$. Then we should get just
$$ gh = \frac{1}{2}\Delta v^2 $$ | {
"domain": "physics.stackexchange",
"id": 15809,
"lm_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-conservation, reference-frames",
"url": null
} |
Here is an example of matrix multiplication for two concrete matrices
Example: Find the product $AB$ where $A$ and $B$ are matrices:
$A = \left[ {\begin{array}{*{20}{l}} 1&3&5\\ 2&4&6 \end{array}} \right] \ \ \ \ B = \left[ {\begin{array}{*{20}{l}} 3&6\\ 1&4\\ 5&2 \end{array}} \right]$
Solution:
The product $AB$ is defined since $A$ is a $2 \times 3$ matrix and $B$ is a $3 \times 2$ matrix. The answer is a $2 \times 2$ matrix. The multiplication is divided into 4 steps.
Step 1:
Multiply the 1st row of the first matrix and 1st column of the second matrix, element by element. The result goes in the position (1, 1) | {
"domain": "mathportal.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9946150617189832,
"lm_q1q2_score": 0.8266674021630286,
"lm_q2_score": 0.8311430562234877,
"openwebmath_perplexity": 262.4977137983196,
"openwebmath_score": 0.8934695720672607,
"tags": null,
"url": "https://www.mathportal.org/linear-algebra/matrices/matrix-operations.php"
} |
python, algorithm, pygame
[758, 471, 620, 710, 754, 593, 710, 597, 550, 671, 687, 746, 571, 614, 582, 668, 705, 650, INF, 930, 747, 599,
586, 404, 887, 567, 915, 476, 822, 523],
[39, 434, 269, 131, 211, 240, 359, 227, 178, 324, 315, 167, 391, 396, 212, 296, 333, 276, 452, INF, 375, 439,
214, 365, 410, 214, 509, 316, 450, 213],
[526, 513, 443, 496, 534, 485, 533, 377, 328, 284, 441, 165, 389, 641, 362, 306, 483, 428, 698, 487, INF, 535,
332, 611, 710, 459, 769, 412, 460, 459],
[784, 654, 691, 552, 604, 336, 781, 447, 576, 532, 624, 588, 721, 492, 432, 694, 731, 484, 1027, 976, 684, INF,
580, 791, 709, 635, 902, 741, 729, 788],
[435, 220, 576, 527, 607, 569, 450, 513, 464, 420, 495, 563, 689, 363, 498, 582, 619, 564, 718, 396, 555, 601,
INF, 631, 806, 543, 686, 478, 617, 479],
[354, 402, 216, 306, 350, 189, 306, 193, 146, 294, 283, 342, 167, 345, 178, 264, 301, 246, 358, 526, 343, 195, | {
"domain": "codereview.stackexchange",
"id": 2006,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, pygame",
"url": null
} |
c++, algorithm, strings, palindrome
Title: Determining if a string is a palindrome of a permutation I wrote code to determine if a string is a palindrome of a permutation. This exercise was taken from Cracking the Coding Interview. I'm looking for any tips on improving it.
#include <iostream>
#include <string>
/*
* Determine if a string is a palindrome of a permutation.
* For simplicity, assume each string contains ONLY alphabetical characters.
*/
//strip string of non-alphabetical characters
std::string strip_junk(std::string s){
std::string output("");
for(char& c : s)
if(isalpha(c)){
c = tolower(c);
output += c;
}
return output;
}
//determine how many times each character appears in the string
int *get_char_counts(std::string input){
static const int ascii_sub = 97;
static int counters[26]{0};
for(char c : input){
counters[c - ascii_sub]++; //if c='a', c-ascii_sub = 0. if c='z', c-ascii_sub = 25
}
return counters;
} | {
"domain": "codereview.stackexchange",
"id": 19675,
"lm_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, strings, palindrome",
"url": null
} |
thermodynamics, dimensional-analysis, volume, scaling
Title: Why we can't multiply two extensive quantities together? I have read that regarding the equation of state $PV=nRT$, since $V$ is an extensive quantity $P$ should be an intensive one because the product of extensive quantities is inherently non-linear.
Could someone explain this statement? Assume for now that both P,V are extensive quantities. By the definition of an extensive quantity if the size of system is increased by a factor of λ the extensive quantity is multiplied by λ but the intensive quantities remain the same. So P->(λP) and V->(λV) therefore $$(PV)\rightarrow λ^{2}(PV) $$ This λ square might be the non-linearity that the statement is reffering to.
n->(λn), so if it is also known that T is an intensive quantity then P should be necessarily an intensive quantity | {
"domain": "physics.stackexchange",
"id": 49851,
"lm_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, dimensional-analysis, volume, scaling",
"url": null
} |
fluid-dynamics, kinematics
Title: What is the upper speed limit for wind powered Blackbird? Background
Imagine you have wind powered car "Blackbird". The objective is simple make the fastest wind powered car.
So I was watching Veritasium and learned that "Blackbird" can go counterintuitively faster than the windspeed! In fact the claim is at one point it was going $2.8$ times the windspeed (3:12).
Question
Assuming parameters such as mass, etc is there a theoretical upper limit at what percentage of the windspeed such a vehicle can go at? I expect that the vehicle speed that they attained is very close to the limit for that type of design.
The blackbird vehicle is very flimsy, they are desperately trying to keep the weight down. | {
"domain": "physics.stackexchange",
"id": 81938,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, kinematics",
"url": null
} |
-
Thank you! What is the purpose of the last statement? – mattecapu Mar 20 '14 at 17:11
@mattecapu Just to be reassured that both approaches are the same i.e. they give the same answer. – Chazz Mar 20 '14 at 22:17
Otherwise $x^\alpha$ wouldn't be a crescent function? – mattecapu Mar 21 '14 at 17:19
@mattecapu You can prove any property of exponentiation with any of the definitions given above. When one is defining exponentiation it is more natural to proceed first defining it for $\mathbb{N}$, then for $\mathbb{Z}$, then for $\mathbb{Q}$ and finally for $\mathbb{R}$ as we outline above. But this is a little bit complicated to work with, so one proves $x^{\alpha} =\text{sup} \lbrace x^{r}\mid \alpha\in\mathbb{Q}\,\text{ and }\,r\leq\alpha \rbrace=\text{exp}(\alpha\ln(x))$, as the latter is easier to work with. – Chazz Mar 21 '14 at 17:54
Get it, thanks! – mattecapu Mar 21 '14 at 22:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363750229257,
"lm_q1q2_score": 0.8419036405656215,
"lm_q2_score": 0.8539127492339909,
"openwebmath_perplexity": 499.04684890444605,
"openwebmath_score": 0.9817405939102173,
"tags": null,
"url": "http://math.stackexchange.com/questions/718727/does-nth-roots-with-non-natural-indexes-exists"
} |
natural-selection
Title: Will moths evolve to become blue if we paint walls in blue? I know dark moths are more frequent than white moths when the environment is full of dirty (dark) walls/trees; it is a consequence of natural selection. Will moths evolve to become blue if walls/trees are painted in blue? Note that the following answer is an over simplification. For example, I don't consider cases of balancing selection.
What is Natural Selection?
Definition
Natural selection is the process that yield to a change in allele (≈variant of a gene) at a given locus (=position on a chromosome) frequency in a population due to a differential in fitness (≈reproductive success) between individuals carrying the different alleles.
What Natural selection does | {
"domain": "biology.stackexchange",
"id": 4587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "natural-selection",
"url": null
} |
reference-request, graph-theory, co.combinatorics, graph-minor
Since $G$ is a minor of $H$, $G$ can be obtained from $H$ by deleting edges, isolated vertices and performing edge contractions. It's also easy to show that we can insist that the subgraph operations are done first, i.e., we can first perform all the edge and vertex deletions and then perform all the edge contractions. Moreover, let us restrict the definition of "edge contraction" to disallow contracting edges where one of the vertices has degree 1. Contracting such an edge is the same as deleting it, so this will not change the definition of graph minors.
Let $H'$ be the graph obtained from $H$ by performing all the edge/vertex deletions first. $H'$ still contains $G$ as a minor. If we show that $H'$ contains $G$ as a topological minor then we're done, since the definition of topological minor also allows edge/vertex deletions. | {
"domain": "cstheory.stackexchange",
"id": 963,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, graph-theory, co.combinatorics, graph-minor",
"url": null
} |
concept in Calculus. (b) Z 2 0 x dx. As a memory aid, it is worth noting that the symbol used for the sum is an upper case sigma, or S for sum in the Greek alphabet. Area from Riemann Sums - A Area from Riemann Sums - B Evaluation of a definite integral as a limit- Part I Evaluation of a definite integral as a limit- Part II…. A Definite Integral can be used to find the Area under a curve if the curve is above the x - axis, and if. It is helpful to remember that the definite integral is defined in terms of Riemann sums, which consist of the areas of rectangles. The online service at OnSolver. Redefine W by recalling and executing the command. MATH 3B Worksheet: Riemann sums and de nite integrals Name: Perm#: 1. The Riemann integral One of the basic problem of mathematics in its beginning was the problem of measurement of lengths, areas and volumes. Such improper Riemann integrals involve two limits — a limit of Riemann sums. 1 can be used. The number a is the lower limit of the in | {
"domain": "clandiw.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9907319852508434,
"lm_q1q2_score": 0.8168208053559453,
"lm_q2_score": 0.8244619306896955,
"openwebmath_perplexity": 347.2748526542643,
"openwebmath_score": 0.9633388519287109,
"tags": null,
"url": "http://clandiw.it/jqeo/definite-integral-as-the-limit-of-a-riemann-sum-calculator.html"
} |
sufficient., and for a graph all continuous functions have continuous derivatives differentiable without! Differentiability is a function that does not imply that every continuous function whose derivative exists at point. Find the corresponding ( unique! for Your response at point, must.! Are sufficient for a function is a function is continuous at, it can not be a differentiable! If a function that does not have a continuous derivative: not all continuous functions continuous. ( in a rectangular ( Cartesian ) coordinate plane ) a continuous function f ( ). Continuous ( though not differentiable. or Spivak ( for RN ) or Cheney for. Gateaux differentials are continuous does not have a continuous derivative: 1 never... X=A means f ' ( a ) exists why this is so, and to! See if we can use all the power of calculus when working with it C0 consists of all differentiable.. For each, find the slope of a continuous function f ( ). F is a pivotal concept in calculus because it directly links | {
"domain": "webwriter.ie",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9688561694652216,
"lm_q1q2_score": 0.8094633833780669,
"lm_q2_score": 0.8354835411997897,
"openwebmath_perplexity": 290.2482914011687,
"openwebmath_score": 0.8581441044807434,
"tags": null,
"url": "http://webwriter.ie/international-trade-tszq/6cca65-differentiable-vs-continuous-derivative"
} |
beginner, game, f#
member this.Name
with get() = _name
and set(value: string) = _name <- value
member this.Count
with get() = _count
and set(value: int) = _count <- value
/// <summary>
/// Increment or decrement the how much of this
/// specific item you have.
/// </summary>
/// <param name="amount">The amount to change by.</param>
member this.ChangeCount(amount: int) =
if this.Count + amount >= 0 then
this.Count <- this.Count + amount
else
printfn "You cannot have less than zero items."
/// <summary>
/// Return this type in the following format:
/// Name={item name}, Count={item count}.
/// </summary>
override this.ToString() =
String.Format("Name={0}, Count={1}", this.Name, this.Count)
Inventory.fs
namespace InventorySystem
open System | {
"domain": "codereview.stackexchange",
"id": 14987,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, game, f#",
"url": null
} |
cosmology, space-expansion, big-bang, faster-than-light
The misconceptions:
1) You seem to be thinking of the "Big Bang" as an explosion that scatters everything in the Universe far and wide to get to their positions today. This is not accurate.
2) Stars have been outputting light constantly since the big bang. So even in your "explosion" model, there would be no contradiction. You seem to be imagining all the light in the universe being created at once and then "outrunning" everything aways from the explosion centre. But imagine two observers coasting in diverging but roughly parallel paths: observer $A$ to shine a light *at any time after the "explosion" that reaches $B$ sometime afterwards. $B$ does not need to wonder "how did I get here before the light did?". $B$ simply calculates where $A$ was when they sent the light pulse and knows it has to be after the explosion. | {
"domain": "physics.stackexchange",
"id": 19547,
"lm_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, space-expansion, big-bang, faster-than-light",
"url": null
} |
python, python-3.x, regex, reinventing-the-wheel, chat
(
[ ][^\x00\x0A\x0D\x20\x3A]
# Then a colon or the same as above, minus the space
(:|[^\x00\x0A\x0D\x20\x3A])*
){,14}
# then the last element, which is the above but clumped into one
([ ]:(:|[ ]|[^\x00\x0A\x0D\x20\x3A])*)?
)|
(
# identical to above, except exactly 14 of the first, then
# the first of the last-segment's colons is optional
([ ][^\x00\x0A\x0D\x20\x3A](:|[^\x00\x0A\x0D\x20\x3A])*){14}
([ ]:?(:|[ ]|[^\x00\x0A\x0D\x20\x3A])*)?
)
)
# Then a newline
\r\n
$ # to the end
"""
, re.VERBOSE) | {
"domain": "codereview.stackexchange",
"id": 17971,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, regex, reinventing-the-wheel, chat",
"url": null
} |
vacuum, fermions, virtual-particles, bosons
Title: Can all types of particle be created in quantum fluctuation? In quantum / vacuum fluctuation, a pair of virtual particles is formed. But can all different types of particles be created, both virtual fermions and virtual bosons? For example electrons, quarks, photons, W boson...? Virtual particles don't exist. They are a computational device used in calculating interactions between quantum fields. For more on this see What actually are virtual particles? and Do virtual particles actually physically exist?
Furthermore vacuum fluctuation also don't exist, or at least not in the sense of pairs of (non-existant) virtual particles appearing and disappearing. For more on this see Are vacuum fluctuations really happening all the time? | {
"domain": "physics.stackexchange",
"id": 35314,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vacuum, fermions, virtual-particles, bosons",
"url": null
} |
homework-and-exercises, electrostatics, superposition
Update in response to some comments.
I have tried to show diagrammatically how superposition works for this example.
If the line of charge with line charge density $\rho_1$ produces an electric field of magnitude $E$ the a line of charge with half the line charge density pr4oduces an electric field of magnitude $\frac E 2$.
Diagram 1 shows the initial problem.
Diagram 2 shows the three equal line charges producing zero electric field.
Diagram 3 shows the electric field which must be added to the arrangement of changes in diagram 2 to produce the charges and electric fields in diagram 1.
@DWin Your comment was correct.
Looking at diagram 1 and adding the electric field vectorially a resultant electric field of magnitude
$E + \frac E 2 \; \cos 60^\circ + \frac E 2 \; \cos 60^\circ = \frac{3E}{2}$ | {
"domain": "physics.stackexchange",
"id": 36836,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, electrostatics, superposition",
"url": null
} |
But with an exponent of only 7, direct computation can be done straight-forwardly, without involving more abstract results. Is this preferable? It depends on your point of view, I suppose. One thing that CAN be said about your solution/caffeinemachine's solution is that it is more widely applicable to a greater range of problems | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971992481016635,
"lm_q1q2_score": 0.8577132482279559,
"lm_q2_score": 0.8824278633625322,
"openwebmath_perplexity": 641.4107890602463,
"openwebmath_score": 0.7664651870727539,
"tags": null,
"url": "https://mathhelpboards.com/threads/eulers-theorem-for-calculating-mod.6407/"
} |
Though Euclid did offer an exterior angles theorem specific to triangles, no Interior Angle Theorem exists. To help you remember: the angle pairs are Consecutive (they follow each other), and they are on the Interior of the two crossed lines.. The diagonals of a convex regular pentagon are in the golden ratio to its sides. All the interior angles in a regular polygon are equal. Parallel Lines. Jyden reviewing about Formula For Interior Angles Of A Polygon at Home Designs with 5 /5 of an aggregate rating.. Don’t forget shares to your Social Media Or Bookmark formula for interior angles of a polygon using Ctrl + D (PC) or Command + D (macos). A polygon is a plane geometric figure. Based on the number of sides, the polygons are classified into several types. Example 2. Polygons are broadly classified into types based on the length of their sides. Alternate interior angles formula. Jyden reviewing about Formula For Interior Angles Of A Polygon at Home Designs with 5 /5 of an aggregate | {
"domain": "zoldterv.hu",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799482964025,
"lm_q1q2_score": 0.8093187522147852,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 416.93700671048686,
"openwebmath_score": 0.5235893130302429,
"tags": null,
"url": "https://zoldterv.hu/9l9k9sp/77c0a4-interior-angles-formula"
} |
phase-transition
We can note that in general, both parabolas have different curvatures, just like the one shown by Chaikin and Lubensky, and the values for $a^2$ change discontinuously. Thus a first-order transition.
Final remarks:
The solution and the phase diagram given by Meng Cheng correctly describe the phase diagram for a vector order parameter. I encourage you to try and corroborate that yourself!
Hope my answer adds some clarity :)) | {
"domain": "physics.stackexchange",
"id": 89867,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phase-transition",
"url": null
} |
-
Awesome! Many thanks...Might I ask what motivated the choice of subtracting 1/n? – Paquito Jul 24 '12 at 22:21
@Paquito To a certain extent, intuition - since the difference between consecutive terms of the form $1/n$ is on the order of $1/n^2$, I could see that adding a quadratic term to a $1/n$-sized 'gap' between the sum and 1 would give a $1/n+1$-sized gap; from there it was just a quick dig to see whether $1-1/n$ itself would work or whether I would need to do something like $1-1/(n+1)$. – Steven Stadnicki Jul 24 '12 at 22:26
That's beautiful, Steven! – Bruno Joyal Jul 24 '12 at 22:40
Of course, this is also the "integral test" estimate. – Robert Israel Jul 24 '12 at 23:53 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534316905262,
"lm_q1q2_score": 0.8399780470115501,
"lm_q2_score": 0.8558511488056151,
"openwebmath_perplexity": 298.05780074192336,
"openwebmath_score": 0.8994263410568237,
"tags": null,
"url": "http://math.stackexchange.com/questions/174828/a-probably-trivial-induction-problem-sum-2nk-2-lt1/174857"
} |
# Math Help - Geometry with Vectors
1. ## Geometry with Vectors
Let A=(4,2,0), B=(1,3,0) and C=(1,1,3) form a triangle.
Find the coordinates of the point in which the medians of triangle ABC intersect.
---
There is probably a very simple yet elegant solution to this but I can't seem to find it. Any help would be greatly appreciated.
2. Originally Posted by rualin
Let A=(4,2,0), B=(1,3,0) and C=(1,1,3) form a triangle.
Find the coordinates of the point in which the medians of triangle ABC intersect.
---
There is probably a very simple yet elegant solution to this but I can't seem to find it. Any help would be greatly appreciated.
i suppose you are talking about the point where vectors that perpendicularly bisect the sides of the triangle meet?
find such vectors and equate them. of course, here i am referring to the vector equations of lines. recall that we can represent a line by the equation:
$\vec{r} = \vec{r}_0 + t \vec{v}$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419674366167,
"lm_q1q2_score": 0.8385061027179478,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 304.27613997838904,
"openwebmath_score": 0.7921313047409058,
"tags": null,
"url": "http://mathhelpforum.com/geometry/19592-geometry-vectors.html"
} |
• So in this case I have the matrix $\begin{pmatrix}1&0&1\\-1&1&0\end{pmatrix}$ with columns $\begin{pmatrix}1\\1\end{pmatrix}$,$\begin{pmatrix}0\\1\end{pmatrix}$, $\begin{pmatrix}1\\0\end{pmatrix}$. Are these column-vectors the image of $L$? Is it always the case that the column-vectors are the image? – qmd Jun 13 '15 at 14:51
• The column-vectors are not the image of $L$: they span the image of $L$. But $\begin{pmatrix}1\\-1\end{pmatrix}$ andt $\begin{pmatrix}0\\1\end{pmatrix}$ also generate the image. – Bernard Jun 13 '15 at 14:55
• I see. So I have to look at that column vectors and calculate the span. In this case $\begin{pmatrix}1\\0\end{pmatrix}$ and $\begin{pmatrix}0\\1\end{pmatrix}$ span $\Bbb R^2$ and therefore Im($L$)=$\Bbb R^2$? – qmd Jun 13 '15 at 14:58
• Yes. You also know that here without any calculation thanks to the rank-nullity theorem. – Bernard Jun 13 '15 at 15:16 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357184418847,
"lm_q1q2_score": 0.8725262627750974,
"lm_q2_score": 0.8887588038050466,
"openwebmath_perplexity": 165.0836357096202,
"openwebmath_score": 0.8888595104217529,
"tags": null,
"url": "https://math.stackexchange.com/questions/1323827/kernel-and-image-of-a-linear-transformation"
} |
n. All Bessel type functions can 1) be differentiated, and the derivatives expressed in terms of similar functions and 2) be rewritten in terms of other bessel-type functions. Know the parametric form of Bessel's equation. If scale is 1, then the output of bessely is scaled by the factor exp(-abs(imag(Z))). Some info: Bessel functions for integer α are also known as cylinder functions or the. By separating the radial and angu-. here Example of Bessel Function General Solution (in Bangla) has been discussed. where the coefficients $$f_n(z)$$ are available as polys. Bessel polynomials, explicit formulas, modified functions, spherical Bessel functions Notes: Use the same method as for § 10. All of the zeros of the normalized sinc function are at nonzero integer values of x. It is implemented in Mathematica as DiracDelta[x]. Riccati-Bessel functions only slightly differ from spherical Bessel functions: They satisfy the differential equation: This differential equation, and the | {
"domain": "ajte.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750492324249,
"lm_q1q2_score": 0.8206499016036223,
"lm_q2_score": 0.8311430415844384,
"openwebmath_perplexity": 843.0734275604377,
"openwebmath_score": 0.834372341632843,
"tags": null,
"url": "http://scdw.ajte.pw/mathworld-spherical-bessel-function.html"
} |
But there are situations in which you'll get nowhere if you don't change the bounds. For example, the Beta function is defined by $$B(\alpha,\beta) = \int_0^1 x^{\alpha-1} (1-x)^{\beta-1}\,dx.$$ So suppose we have $$\int_0^5 x^{\alpha-1}(5-x)^{\beta-1} \,dx.$$ (I've seen integrals like this arising in statistics problems.) Then let \begin{align} u & = x/5, \\ du & = dx/5. \end{align} The integral then becomes $$\int_0^1 (5u)^{\alpha-1} (5-5u)^{\beta-1}\,\Big(5\,du\Big) = 5^3 \int_0^1 u^{\alpha-1}(1-u)^{\beta-1}\, du = 125 B(\alpha,\beta).$$
Without changing the bounds, how could one recognize this as being the Beta function? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426450627305,
"lm_q1q2_score": 0.8336355113906874,
"lm_q2_score": 0.855851143290548,
"openwebmath_perplexity": 223.90199439831088,
"openwebmath_score": 0.9535366892814636,
"tags": null,
"url": "https://math.stackexchange.com/questions/560380/is-there-ever-a-requirement-to-change-the-limits-of-integration"
} |
special-relativity, electricity
However, a wire that's conducting electricity is carrying electromagnetic energy, and that energy contributes to the (rest) mass of the wire, but it's still very tiny. In what follows, I'll use the approximation $c=3×10^8$ m/s.
Let's say we have a span of cable 300 m long carrying 1 megawatt, that is 1 million joules / second. The energy travels through the cable at close to the speed of light, let's be generous and say that it's travelling at $c$. So it takes 1 microsecond for electromagnetic energy to travel from one end of the cable to the other, so the total amount of energy "in" the cable at any given moment is 1 joule. (The energy isn't exactly inside the cable, it's in the electromagnetic field surrounding the cable, but it's still essentially being carried by the cable). Thus the mass of the cable is increased by the mass equivalent of 1 joule, which is $1 \,\mathrm{joule}/c^2=1.11×10^{-17}$ kg or 11.1 femtograms. | {
"domain": "physics.stackexchange",
"id": 72371,
"lm_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, electricity",
"url": null
} |
algorithms, graphs, shortest-path
Where is the error, and how can I fix it?
Full story
https://github.com/mvglasow/navit/tree/traffic. The commit which added the actual LPA* implementation is 61d9a1a; some preparation work was also done in the previous ones. I have solved the issue, and my LPA* implementation now gives me a valid route that is identical to the one I get when I run Dijkstra from scratch on the updated route graph for the test cases that I have tried.
Fist off: The two things that I tried above would break LPA*, so I reverted them.
The first fault was simply a sign error when calling the function to determine edge costs, leading the program to use costs for the wrong direction (though only in one place, not in another).
The other fault was in the call to the function which determines edge costs. Arguments passed to it are a vehicle profile (which determines which edges are usable and what their costs are), the edge, a direction (i.e. first to second vertex or vice versa) and, optionally, a vertex. | {
"domain": "cs.stackexchange",
"id": 11527,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, graphs, shortest-path",
"url": null
} |
php, rest, curl, phpunit
/**
* Returns request header for last request
*
* @return string
*/
public function getRequestHeader() {
return $this->requestHeader;
}
/**
* Returns reespsone code for last request
*
* @return integer
*/
public function getResponseCode() {
return $this->responseCode;
}
/**
* Returns cURL response information array from last request
*
* @return array
*/
public function getResponseInfo() {
return $this->responseInfo;
}
/**
* Returns response body from last request
*
* @return string
*/
public function getResponseBody() {
return $this->responseBody;
}
/**
* Method to initialize cURL handle in object
*
* @return void
* @throws \Exception
*/
protected function curlSetup() {
// reset all request/response properties
$this->resetRequestResponseProperties(); | {
"domain": "codereview.stackexchange",
"id": 24574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, rest, curl, phpunit",
"url": null
} |
javascript, jquery, html, html5
output.correct = each.slice(0, -2).join("") + stemlast + "워";
output.incorrect[0] = each.slice(0, -1).join("") + buildhangeul({
"lead": "ㅇ",
"vowel": lastjamo["vowel"],
"tail": "0"
});
output.incorrect[1] = each.slice(0, -1).join("") + "워";
output.incorrect[2] = each.slice(0, -2).join("") + stemlast + "와";
} //ㅏ and ㅗ regular
else if (lastjamo["vowel"] == "ㅏ" && lastjamo["tail"] != "0" || lastjamo["vowel"] == "ㅗ" && lastjamo["tail"] != "0") {
output.correct = stemlast + "아";
output.incorrect[0] = buildhangeul({
"lead": lastjamo["lead"],
"vowel": lastjamo["vowel"], | {
"domain": "codereview.stackexchange",
"id": 3064,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, html, html5",
"url": null
} |
ros2
My Linux distribution is Ubuntu 18.04.
Originally posted by ananya.muddu on ROS Answers with karma: 13 on 2019-06-13
Post score: 0
Original comments
Comment by sloretz on 2019-06-13:
On ubuntu that should search LD_LIBRARY_PATH. What is the output of echo $LD_LIBRARY_PATH? Was that variable modified after sourcing /opt/ros/dashing/setup.bash?
Comment by ananya.muddu on 2019-06-14:
@sloretz: Thanks! I have edited the question to include LD_LIBRARY_PATH and the ldconfig cache. No problems there.
I was bitten by this issue as well.
Make sure LD_LIBRARY_PATH is set. This is important, even if the librmw_fastrtps_cpp.so file exists in /usr/lib, since the RMW code will explicitly look for LD_LIBRARY_PATH.
See also this interesting issue: https://github.com/ros2/rcpputils/issues/40
Originally posted by Windel with karma: 36 on 2020-11-23
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 33174,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
homework-and-exercises, quantum-electrodynamics, path-integral, correlation-functions, propagator
The free partition function $Z_0$ is the exponential of a quadratic expression of sources with their corresponding free propagator sandwiched in between (up to factors of $2$, $i$ & $\hbar$), cf. OP's above formula for $\phi^4$-theory. For details, see e.g. formulas (43.14) & (58.18) in Ref. 1.
References:
M. Srednicki, QFT, 2007; chapter 43 + 58. A prepublication draft PDF file is available here. | {
"domain": "physics.stackexchange",
"id": 70097,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, quantum-electrodynamics, path-integral, correlation-functions, propagator",
"url": null
} |
general-relativity, differential-geometry, coordinate-systems, vector-fields, variational-calculus
Inserting it into the definition gives us the Lie derivative
$$\mathcal{L}_{\mathbf{v}} \mathbf{u}= [\mathbf{v},\mathbf{u}] = \left(v^\beta \frac{\partial u^\alpha}{\partial x^\beta}- u^\beta \frac{\partial v^\alpha}{\partial x^\beta}\right)\mathbf{e}_\alpha$$
The infinitesimal coordinate transformation is only part of the construction of the Lie derivative. If you simply perform an infinitesimal coordinate transformation (which is what you did in your first equation), you will, of course, not obtain the term arising from the Taylor expansion. | {
"domain": "physics.stackexchange",
"id": 84210,
"lm_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, differential-geometry, coordinate-systems, vector-fields, variational-calculus",
"url": null
} |
particle-physics, symmetry, field-theory, coordinate-systems, cp-violation
Also, CPT (or T, in theories where it holds), only applies to the microscopic laws of Nature. It doesn't mean that the actual macroscopic processes or effective theories are time-reversal-invariant. They're surely not, the phenomena in our world are self-evidently irreversible: the second law of thermodynamics is the most well-known example of the inherent arrow of time that treats the past and future asymmetrically and can't ever be "revoked" in any way, by any genuine symmetry.
Just like the OP underestimates the importance of symmetries, he seems to underestimate the importance of the Lagrangians, too. He asks whether there is "anything else than just a property of the Lagrangians". But Lagrangians, whenever they exist, actually contain all the dynamical information about the laws of Nature. They're the whole thing. So saying that something is "only" about a property of the Lagrangian is missing the point of physics. Everything in science is just about a property of the Lagrangian. | {
"domain": "physics.stackexchange",
"id": 1858,
"lm_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, symmetry, field-theory, coordinate-systems, cp-violation",
"url": null
} |
fluid-dynamics, waves, acoustics, lightning, meteorology
The final image in the question shows a lightning rod (also called lightning conductor) not a bell. Such rods were introduced in the 1750s (says Wiki). They work via two effects: a gradual one and a sudden one. The electric field near a charged conductor has a much larger value near a sharp point. So by using a pointed conductor one encourages modest currents in the air near the tip of the lightning rod which, gradually, tend to reduce the charge build-up in the cloud and thus reduce the overall frequency and strength of lightning strikes. This is not enough to entirely suppress strikes but overall it does help. These currents also have the effect of making the lightning more likely to strike the rod than other nearby things. This offers protection to the building as long as the long thick copper wire from ground to rod can itself conduct most of the current without melting. | {
"domain": "physics.stackexchange",
"id": 88817,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, waves, acoustics, lightning, meteorology",
"url": null
} |
general-relativity, black-holes, electromagnetic-radiation
$$
\alpha(\xi)~=~\frac{4\pi G}{c^2}\frac{\Sigma(\xi) d_{ls}\xi}{d_s}
$$
where for small angles $|\vec\xi|~=\xi~=~d_l\theta$ and
$$
\alpha(\xi)~=~\frac{4\pi G\Sigma}{c^2}\frac{d_{ls}d_l}{d_s}~=~\frac{\Sigma}{\Sigma_c}\theta
$$
for the critical mass density $\Sigma_c~=~(c^2/4\pi G)(d_s/d_{ls}d_l)$. This is the minimal mass density which might be distributed in the area of an Einstein ring. | {
"domain": "physics.stackexchange",
"id": 537,
"lm_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, black-holes, electromagnetic-radiation",
"url": null
} |
amount of a given frequency and the argument representing the phase shift from a sine wave of that frequency. Last week I showed a couple of continuous-time Fourier transform pairs (for a cosine and a rectangular pulse). Actually, in the mathematics sine and cosine functions are defined based on right angled triangles. IX(w)| = |ej5wI = 1 for all w, Fourier coefficients) and backward analysis (Fourier coefficients => data); sine and cosine transform routines; quarter wave sine and cosine transform routines; the amount of data is NOT required to be a power of 2. Fourier Cosine Transform(F. Table of Fourier Transform Pairs Function, f(t) Fourier Transform, F( ) Trigonometric Fourier Series 1 ( ) 0 cos( 0 ) sin( 0) n f t a an nt bn nt where T n T T n. 5 1-10 -5 5 10 0. The input time series can now be expressed either as a time-sequence of values, or as a. The authors also presented very short form of general properties of Fourier cosine and sine transform with a product of a power series | {
"domain": "horseitaly.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303434461161,
"lm_q1q2_score": 0.8115553066325789,
"lm_q2_score": 0.819893340314393,
"openwebmath_perplexity": 809.6156763894696,
"openwebmath_score": 0.913366973400116,
"tags": null,
"url": "http://yecw.horseitaly.it/fourier-transform-of-cosine.html"
} |
c#, performance, asp.net-core, entity-framework-core
[Column("BULKPICKPRNT")]
public byte Bulkpickprnt { get; set; }
[Column("INDPICKPRNT")]
public byte Indpickprnt { get; set; }
[Column("ISLINEINTRA")]
public byte Islineintra { get; set; }
[Required]
[Column("SOFULFILLMENTBIN")]
[StringLength(15)]
public string Sofulfillmentbin { get; set; }
[Column("MULTIPLEBINS")]
public byte Multiplebins { get; set; }
[Column("Print_Phone_NumberGB")]
public short PrintPhoneNumberGb { get; set; }
[Column("DEX_ROW_TS", TypeName = "datetime")]
public DateTime DexRowTs { get; set; }
[Column("DEX_ROW_ID")]
public int DexRowId { get; set; } | {
"domain": "codereview.stackexchange",
"id": 43287,
"lm_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, asp.net-core, entity-framework-core",
"url": null
} |
cg.comp-geom, permutations
Title: List the $k$-faces of an $n$-dimensional simplex Suppose you are given an $n$-dimensional simplex
S = [ 0 1 ... n ]
which for the time being we think of as an ascending array of numbers from $0$ to $n$. Given $1 \leq k \leq n$, how can we enumerate the $k$-faces of S, i.e. the $k$-dimensional subsimplices? - In less geometric words, we want a complete and multiples-free list of all $k$-sized strictly ascending sequences of numbers between in $\{ 0, \dots , n \}$.
The straight-forward algorithm is to create the list of all $k$-sized tuples of numbers between $0$ and $n$, and pop out those that are not strictly ascending or contain duplicates. This can be done in space and time $O(n^3)$.
But can we do better? We do not impose restrictions on a particular ordering of the output. See chapter 3 of Nijenhuis and Wilf, "Combinatorial Algorithms" (the entire book is available free online and despite its age contains many useful algorithms). | {
"domain": "cstheory.stackexchange",
"id": 913,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cg.comp-geom, permutations",
"url": null
} |
ros
'rqt_nav_view':
['/opt/ros/indigo/share/rqt_nav_view/msg'],
'turtlebot_navigation':
['/opt/ros/indigo/share/turtlebot_navigation/msg'],
'urdf_tutorial':
['/opt/ros/indigo/share/urdf_tutorial/msg'],
'kobuki_auto_docking':
['/opt/ros/indigo/share/kobuki_auto_docking/msg'],
'ecl_time_lite':
['/opt/ros/indigo/share/ecl_time_lite/msg'],
'rosservice':
['/opt/ros/indigo/share/rosservice/msg'],
'rospy':
['/opt/ros/indigo/share/rospy/msg'],
'kdl_conversions':
['/opt/ros/indigo/share/kdl_conversions/msg'],
'turtle_tf':
['/opt/ros/indigo/share/turtle_tf/msg'],
'roscpp_tutorials':
['/opt/ros/indigo/share/roscpp_tutorials/msg'],
'ecl_build':
['/opt/ros/indigo/share/ecl_build/msg'],
'roscpp':
['/opt/ros/indigo/share/roscpp/msg'],
'openni_launch':
['/opt/ros/indigo/share/openni_launch/msg'],
'turtle_actionlib':
['/opt/ros/indigo/share/turtle_actionlib/msg'],
'python_orocos_kdl':
['/opt/ros/indigo/share/python_orocos_kdl/msg'],
'stage':
['/opt/ros/indigo/share/stage/msg'],
'roslint': | {
"domain": "robotics.stackexchange",
"id": 20759,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
python, algorithm, parsing, python-3.x
for char in calculation:
if char not in ' \t':
buf.append(char)
continue
token = ''.join(buf)
if not token:
continue
if token in TOKENS:
a = pop()
b = pop()
function = TOKENS[token]
try:
return_value = function(b, a)
except ZeroDivisionError:
raise CalculatorError("Can't devide by zero")
else:
stack.append(return_value)
else:
try:
token = float(token)
except ValueError:
raise CalculatorError('{!r} is not a number'.format(token))
stack.append(token)
buf = []
if len(stack) > 1 or buf:
raise CalculatorError('Invalid function, not enough operators.', stack, buf)
if stack[0] % 1:
print(stack[0])
else:
print(int(stack[0])) | {
"domain": "codereview.stackexchange",
"id": 16002,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, algorithm, parsing, python-3.x",
"url": null
} |
c++, optimization, c, algorithm
Title: Date Time - Seconds Difference For trivial reasons, I decided to have a go at differentiating dates. Low and behold having no idea how much of a non-trivial task it was to become.
It was originally a small sidetrack from a project I'm doing.
And, whilst performance isn't a huge concern here, the code I've posted below performs highly optimally in comparison to its alternative (shown below it). This is preferred, as originally this was used in a real-time program, and without other changes to the high-level algorithm, the cost of re-calculating the date difference every frame (up to 60FPS) was creating a significant run-time penalty.
But what I'm looking for in my solution, is algorithmic improvements, not optimizations (it runs more than fast enough). Such as removing the for loop for calculating which years are leap years (perhaps using 365.242199 constant?). | {
"domain": "codereview.stackexchange",
"id": 30828,
"lm_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++, optimization, c, algorithm",
"url": null
} |
ros, gazebo, gazebo-ros
World file:
<?xml version="1.0" ?>
<sdf version="1.4">
<world name="test_world">
<include>
<uri>model://sun</uri>
</include>
<include>
<uri>model://ground_plane</uri>
</include>
<model name="duck">
<pose>0 0 0 0 0 0</pose>
<static>true</static>
<link name="body">
<visual name="visual">
<geometry>
<mesh><uri>model://duck.dae</uri></mesh>
</geometry>
</visual>
</link>
</model>
</world>
</sdf>
And the folder structure is:
my_package
models
test_world.world
duck.dae
lauch
test_launch.launch
CMakeLists.txt
package.xml
Originally posted by Javier V. Gómez on ROS Answers with karma: 1305 on 2015-06-25
Post score: 0
I guess you need to add an export to your package.xml
<export>
<!-- You can specify that this package is a metapackage here: -->
<!-- <metapackage/> --> | {
"domain": "robotics.stackexchange",
"id": 22006,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, gazebo, gazebo-ros",
"url": null
} |
php, object-oriented, url
Title: Php class for url generator I wrote a class to generate URL as I need. (Using http or https and switching off the rewrite rules)
That is my first OOP code. It's the right approach, any suggestion?
inc/class.urls.inc.php
class Url {
public function __construct() {
$this->rewrite = SITE_REWRITE;
$this->domain = SITE_URL;
}
public function home() {
return $this->domain;
}
public function page($page) {
if ($this->rewrite == 1) {
return $this->domain . '/' . $page . '.html'; // https://www.example.com/contact.html
} else {
return $this->domain . '/' . $page . '.php'; // https://www.example.com/cantact.php
}
} | {
"domain": "codereview.stackexchange",
"id": 24704,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented, url",
"url": null
} |
This solution essentially follows M. Winter's solution algebraically rather than geometrically.
Plugging $(1,7)$ into $(x-a)^2 + (y-b)^2 = r^2$, we get $$(1-a)^2 + (7-b)^2 = r^2 \text{.}$$ In the same manner, $(-6,0)$ gives $$(-6 - a)^2 + b^2 = r^2 \text{.}$$ Eliminating $r^2$ between these, multiplying out the binomials, then collecting the like powers of $a$ and $b$, these reduce to $$a + b = 1 \text{,}$$ the equation of the perpendicular bisector of the segment between the given points.
The slope of the given tangent line is $2/9$, so the slope of the line through the center of the circle and $(1,7)$ is $-9/2$. The equation of this line is $$(b - 7) = (-9/2)(a - 1) \text{.}$$
These two lines intersect at the center of the circle. Taking $b = 1-a$, plugging into this last equation, and solving for $a$, we get $$a = 3$$ and then $$b = -2 \text{.}$$
Putting these back into either of the first two displays gives $$r^2 = 85 \text{.}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806552225684,
"lm_q1q2_score": 0.8213539364476403,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 118.40583528919696,
"openwebmath_score": 0.8069764971733093,
"tags": null,
"url": "https://math.stackexchange.com/questions/2464364/how-can-i-find-the-equation-of-a-circle-given-two-points-and-a-tangent-line-thro"
} |
javascript, jquery, html, form, dom
//Hidden pages
function handleHiddenPages() {
jQuery(".revealer").each(function(i){
var page = jQuery(this).attr("page");
jQuery(this).click(function(){
if (jQuery(this).is(":checked")) {
jQuery("."+page).removeClass("disabled");
} else {
jQuery("."+page).addClass("disabled");
}
});
});
}
handleHiddenPages(); | {
"domain": "codereview.stackexchange",
"id": 7228,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, html, form, dom",
"url": null
} |
c, linked-list
first_node = head->first;
head->first = head->first->next;
reverse_list_recur( head );
head->last = head->last->next = first_node;
first_node->next = NULL;
}
// Concatanate two lists: List1 = List1+List2, no separate header for list2 affter concat
void cat_list( head_t *head1, head_t *head2)
{
assert( head1 != NULL || head2 != NULL );
if( head2 == NULL || head2->last == NULL )
return;
else if( head1 == NULL || head1->last == NULL ) {
*head1 = *head2;
return;
}
head1->last->next = head2->first;
head1->last = head2->last;
head1->len += head2->len;
init_list( head2 );
}
// Copy a list
head_t *copy_list( head_t *head )
{
head_t *new_head = NULL;
node_t *inode = NULL, *new_node = NULL, *prev_node = NULL; | {
"domain": "codereview.stackexchange",
"id": 28259,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, linked-list",
"url": null
} |
special-relativity
EDIT: As requested, I will present a direct derivation which gives first a conventional meaning to simultaneity (the $t=\rm const.$) before requesting the consistency of the $x$ coordinate and without any explicit statement of length contraction. We only have to presume we already know the standard derivation of the relation
$$\Delta t' = \frac{\Delta t}{\sqrt{1- v^2/c^2}}$$
Consider the following simultaneity convention:
Consider an array of clocks in rest with respect to $O$, this is a fixed observable feature. A light signal is sent from the origin of $O$ (this is the conventional point, the referential signal point could be anywhere in the coordinate system, even moving with respect to it) denoting the $t=0$ moment. | {
"domain": "physics.stackexchange",
"id": 15645,
"lm_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",
"url": null
} |
kinect, ros-kinetic
Bus 001 Device 054: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 052: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 050: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 101: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 001 Device 100: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
It looks like it is being detected as an NEC hub, but after many days of this I am not sure of anything.
Has this been encountered before? What can I do next?
Thanks,
Dave | {
"domain": "robotics.stackexchange",
"id": 32108,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinect, ros-kinetic",
"url": null
} |
oceanography, paleoclimatology, ocean-currents
Googling "how old is" or "age of" for these currents only returns dates for when they were discovered - and I'm fairly sure the gulf stream existed prior to 1513.
So I hope that someone here has knowledge beyond that: how did these ocean currents come to be? And roughly when in our planet's long history would that have happened? This is what I found on Wiki, researching the same question:
The isthmus of Panama is thought to have been formed around 3 million years ago, separating the Atlantic and Pacific Oceans and causing the creation of the Gulf Stream. This was first suggested in 1910 by North American paleontologist Henry Fairfield Osborn. He based the proposal on the fossil record of mammals in Central America. This conclusion provided a foundation for Alfred Wegener when he proposed the theory of continental drift in 1912.
What now bugs me is the outline of sea/oceanic currents before the isthmus closed. | {
"domain": "earthscience.stackexchange",
"id": 2601,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "oceanography, paleoclimatology, ocean-currents",
"url": null
} |
thermodynamics
Microcanonical Ensemble: This is used to describe closed systems. The number of particles and the total energy are constant (since no interaction with the environment takes place). In such a system, the entropy will eventually be maximized.
Canonical Ensemble: Now, your system is in contact with a big reservoir and allowed to exchange energy with the system. This means that your system will be in thermal equilibrium with the bath.
Grand Canonical Ensemble Now, your system can exchange both energy and particles with the system. Hence, it will be in thermal equilibrium with the bath and in chemical equilibrium, i.e. the chemical potential for adding a particle to your system equals the chemical potential for adding a particle to the bath.
If exchanging particles wasn't allowed in the grand canonical ensemble, it would become the canonical ensemble. | {
"domain": "physics.stackexchange",
"id": 850,
"lm_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",
"url": null
} |
javascript, performance, canvas, processing
repeller = Force(mouse, -500, 2, 100);
const leftAttractor = Force(Vec(0, height / 2), 1150, 5, 50);
const rightAttractor = Force(Vec(width, height / 2), 1150, 5, 50);
particleSystems.push(Particles({origin : Vec(width / 5, height / 2), min: Vec(-4,-4), max: Vec(0, 4)}, "#00F", [repeller, rightAttractor]));
particleSystems.push(Particles({origin : Vec(width * 4 / 5, height / 2), min: Vec(0,-4), max: Vec(4, 4)}, "#F00", [repeller, leftAttractor]));
// Ones not affected by attractor
particleSystems.push(Particles({origin : Vec(width / 5, height / 2), min: Vec(-2,-2), max: Vec(1, 2)}, "#0FF", [repeller]));
particleSystems.push(Particles({origin : Vec(width * 4 / 5, height / 2), min: Vec(-1,-2), max: Vec(2, 2)}, "#FF0", [repeller]));
requestAnimationFrame(draw);
} | {
"domain": "codereview.stackexchange",
"id": 34809,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, canvas, processing",
"url": null
} |
ros, ros-groovy, pluginlib, pr2-controller-manager
pr2_manipulation_controllers /opt/ros/groovy/stacks/pr2_object_manipulation/manipulation/pr2_manipulation_controllers/controller_plugins.xml
ethercat_trigger_controllers /opt/ros/groovy/stacks/pr2_controllers/ethercat_trigger_controllers/controller_plugins.xml
my_controller_pkg /home/mpan/rosbuild_workspace/joint_controller_tutorial/my_controller_pkg/controller_plugins.xml
robot_mechanism_controllers /opt/ros/groovy/stacks/pr2_controllers/robot_mechanism_controllers/controller_plugins.xml
pr2_gazebo_benchmarks /opt/ros/groovy/stacks/pr2_simulator/pr2_gazebo_benchmarks/gazebo_physics_controller_plugins.xml | {
"domain": "robotics.stackexchange",
"id": 19145,
"lm_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-groovy, pluginlib, pr2-controller-manager",
"url": null
} |
qiskit, textbook-and-exercises, quantum-phase-estimation
Blue line - our "best estimation", i.e the most measured result. Green lines - $e$ results to each direction from our "best estimation".
Regarding the code you have tried yourself:
This equation: $|m - b| \leq \frac{e}{2^{t}}$ simply describes the functionality of $e$ - Set $e$ to some value, then that's the maximum difference you allow from $b$ ($b$ is the "best estimation"), and every other measurement $m$ of phases within the $e$ range determined - would satisfy this equation. So no need to "use" that equation.
The value $e = 10$ is clearly doesn't make any sense in the case of $t = 4$, becasue it allows deviation of $10$ phases to each direction (i.e $20$ total), and the overall discrete phases we have available are $2^4 = 16$. | {
"domain": "quantumcomputing.stackexchange",
"id": 4081,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "qiskit, textbook-and-exercises, quantum-phase-estimation",
"url": null
} |
neural-networks
(Xtrain, ytrain) , (Xtest, ytest) = tf.keras.datasets.fashion_mnist.load_data()
Xtrain_norm = Xtrain.copy()/255.0
Xtest_norm = Xtest.copy()/255.0
model = tf.keras.models.Sequential([tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activation="relu"),
tf.keras.layers.Dense(10, activation="softmax")]) | {
"domain": "ai.stackexchange",
"id": 1292,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks",
"url": null
} |
electromagnetism, charge, voltage
Title: How to calculate the voltage induced in a toroid by a charged particle moving through the center? I'm trying to derive the expression for the voltage induced in a toroid by a charged particle moving perpendicularly through the opening/center of the toroid? For the purposes of clarification, the center of the toroid is where the magnetic field would be zero and the electric field lines would be parallel and unbending.
I've gotten to the expression that the induced voltage is
$\varepsilon = -N \frac{\Delta \phi_B}{\Delta t}$
$\phi_B = \vec{B} \cdot \vec{A}$
$\vec{B} = \frac{\mu _0 q_e \vec{v}}{4\pi r^2}$
$d\phi = |\vec{B}||\vec{A}|cos(\theta)d\theta$
$\theta = tan^{-1}(\frac{r_{tor}}{z})$
$d\theta = -\frac{r_{tor}}{r_{tor}^2 + z^2} dz$
These expressions are used in the first equation to give
$\varepsilon = -N |\vec{B}||\vec{A}|cos(tan^{-1}(\frac{r_{tor}}{z})) \frac{\Delta z}{\Delta t}$
$\varepsilon = -N |\vec{B}||\vec{A}|cos(tan^{-1}(\frac{r_{tor}}{z})) |\vec{v}|$ | {
"domain": "physics.stackexchange",
"id": 82874,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, charge, voltage",
"url": null
} |
homework-and-exercises, quantum-field-theory, scattering, feynman-diagrams
My attempt is: Yes, that is the correct one loop topology that appears assuming no snail and/or one particle reducible contributions (inclusion of these gives you a plethora of other diagrams, such as ones where you decorate the tree level contribution with snails etc). With a labelling of the external momenta in place, you can show by simple combinatorics the number of inequivalent permutations of the external legs you have. The contributing diagrams are essentially generated by attaching two legs to each vertex of a triangle.
Naively there are $6!$ permutations of the external legs but to avoid overcounting due to equivalent diagrams related by vertex relabelling we have to thereby divide out by the cardinality of the symmetry group of the triangle which is $|S_3| = 3!$ Now, we also need to divide out by the permutation of two legs at each of the three vertices. So the number of contributing diagrams is $6!/(3! \cdot (2!)^3) = 15$. | {
"domain": "physics.stackexchange",
"id": 40218,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, quantum-field-theory, scattering, feynman-diagrams",
"url": null
} |
matlab, discrete-signals, filtering, deconvolution, inverse-problem
mA = psfs;
vY = y;
vX = x;
vParamLambda = [1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1];
numParams = length(vParamLambda);
vValMse = zeros(numParams, 1);
mAA = mA.' * mA;
vAy = mA.' * vY;
mI = eye(size(mA));
for ii = 1:numParams
paramLambda = vParamLambda(ii);
vEstX = (mAA + paramLambda * mI) \ vAy;
vValMse(ii) = mean((vEstX(:) - vX(:)) .^ 2);
end
figure();
hL = plot(vParamLambda, 10 * log10(vValMse));
xlabel('Value of \lambda');
ylabel('MSE [dB]');
This is the result: | {
"domain": "dsp.stackexchange",
"id": 9179,
"lm_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, discrete-signals, filtering, deconvolution, inverse-problem",
"url": null
} |
# Integral of $\sin x \cdot \cos x$ [duplicate]
I've found 3 different solutions of this integral. Where did I make mistakes? In case there is no errors, could you explain why the results are different?
$\int \sin x \cos x dx$
1) via subsitution $u = \sin x$ $u = \sin x; du = \cos x dx \Rightarrow \int udu = \frac12 u^2 \Rightarrow \int \sin x \cos x dx = \frac12 \sin^2 x$
2) via subsitution $u = \cos x$ $u = \cos x; du = -\sin x dx \Rightarrow -\int udu = -\frac12 u^2 \Rightarrow \int \sin x \cos x dx = -\frac12 \cos^2 x = -\frac12 (1 - \sin^2 x) = -\frac12 + \frac12 \sin^2 x$
3) using $\sin 2x = 2 \sin x \cos x$
$\int \sin x \cos x dx = \frac12 \int \sin 2x = \frac12 (- \frac12 \cos 2x) = - \frac14 \cos 2x = - \frac14 (1 - 2 \sin^2 x) = - \frac14 + \frac12 \sin^2 x$
So, we have: $$\frac12 \sin^2 x \neq -\frac12 + \frac12 \sin^2 x \neq - \frac14 + \frac12 \sin^2 x$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104972521578,
"lm_q1q2_score": 0.8909549414413552,
"lm_q2_score": 0.9219218375365862,
"openwebmath_perplexity": 1471.5342871800144,
"openwebmath_score": 0.8569950461387634,
"tags": null,
"url": "https://math.stackexchange.com/questions/381243/integral-of-sin-x-cdot-cos-x"
} |
# Why the value of Gaussian curve drop to 1/19 at 2 standard deviation?
Taken from Guide to DSP where it says:
... at two ... standard deviations from the mean, the value of the Gaussian curve has dropped to about 1/19 ...
It seems to be a straight forward calculation but my math just didn't work out to 1/19. The Gaussian probability distribution function is given by:
$$P(x) = {1 \over \sqrt{2\pi} \sigma } e^{-{{(x - \mu)^2} \over {2 \sigma^2}}}$$
At the mean (where maximum probability occurs),
\begin{align} P(\mu) &= {1 \over \sqrt{2\pi} \sigma } e^{-{{(\mu - \mu)^2} \over {2 \sigma^2}}} \\ &= {1 \over \sqrt{2\pi} \sigma } e^{0} = {1 \over \sqrt{2\pi} \sigma} \end{align}
And at 2 standard deviation, or $$x = \mu +2\sigma$$
\begin{align} P(\mu + 2\sigma) &= {1 \over \sqrt{2\pi} \sigma } e^{-{{(\mu + 2\sigma - \mu)^2} \over {2 \sigma^2}}} \\ &= {1 \over \sqrt{2\pi} \sigma } e^{-{{4\sigma^2} \over {2 \sigma^2}}} = {1 \over \sqrt{2\pi} \sigma } e^{-2} \end{align} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9390248174286374,
"lm_q1q2_score": 0.8000048207963673,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 676.1945911666611,
"openwebmath_score": 0.9802769422531128,
"tags": null,
"url": "https://dsp.stackexchange.com/questions/76552/why-the-value-of-gaussian-curve-drop-to-1-19-at-2-standard-deviation"
} |
algorithms, math, integration, numerical-algorithms
$$ y = \int{sin(\omega t + \theta)dt} $$ You can rewrite x as $$ x = a\sin(\omega t) + b\cos(\omega t)$$
In Laplace
$$ y(s) = \frac{1}{s} \{\frac{a\omega + bs}{s^2 + \omega^2}\} $$
Using partial fraction expansion we get
$$ y(s) = \frac{a}{\omega s} + \frac{b}{s^2 + \omega^2} - \frac{\frac{as}{\omega}}{s^2+\omega^2} $$
Going back in the time domain we get
$$ y(t) = \frac{a}{\omega} + \frac{b}{\omega} sin(\omega t) - \frac{a}{\omega} cos(\omega t) $$
since a is related to your initial phase $ a = cos(\theta) $, that's why you get an offset. | {
"domain": "dsp.stackexchange",
"id": 10151,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, math, integration, numerical-algorithms",
"url": null
} |
java, authentication, javafx
}
public UserInfo showAndWait() {
this.stage.showAndWait();
return new UserInfo(this.username, this.password);
}
public static final class Builder {
private String title = "Login";
private String usernameLabel = "Username: ";
private String passwordLabel = "Password: ";
private String loginText = "Login";
private String cancelText = "Cancel";
private boolean canCancel = true;
private boolean canClose = true;
public Builder() {
}
public Builder title(final String title) {
this.title = title;
return this;
}
public Builder usernameLabel(final String usernameLabel) {
this.usernameLabel = usernameLabel;
return this;
}
public Builder passwordLabel(final String passwordLabel) {
this.passwordLabel = passwordLabel;
return this;
} | {
"domain": "codereview.stackexchange",
"id": 16271,
"lm_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, authentication, javafx",
"url": null
} |
quantum-mechanics, astrophysics, soft-question, vacuum
This means the accelerated expansion of the universe should be driven by either of these field and the a force which drives the field:
$$
F~=~-\frac{\partial V}{\partial\phi}
$$
which is larger for the steep potential, or the quartic. During this period a quantum fluctuation in the field is typically $\delta\phi~=~\pm\sqrt{V(\phi)}$. For the inflationary period the variation in the field due to the force is $\delta\phi_F~=~F/V$ $~sim~\phi^{-1}$ and the quantum fluctuation in the scalar field $\delta\phi_q~=~\pm const\sqrt{\phi}$ The quantum fluctuations can become larger than that classical variation in the field when
$$
\delta\phi_F~=~\delta\phi_q~\rightarrow~\phi~\simeq~a^{1/3}
$$
For the reheating potential $V(\phi)~=~b\phi^n $, $n~=~2,~4$ the condition for the fluctuation equal the classical field variation is
$$
\phi~\simeq~(n^2/a)^{1/{(n+2}}
$$ | {
"domain": "physics.stackexchange",
"id": 383,
"lm_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, astrophysics, soft-question, vacuum",
"url": null
} |
"Are there methods tailored for 4x4 matrices which can do better?"
Today, Deepmind's AI system discovered better result with just 47 multiplications. Was this result known previously? Apparently not, paper claims so. In fact some sites do not even know 48 case (https://fmm.univ-lille.fr) and so does not Deepmind paper. It is non-commutative, i.e. the pure 47 multiplications. But it is modulo 2 (modular in this table https://user-images.githubusercontent.com/31514790/194261146-0bcfad2d-1f40-44b7-96c7-3f9b247905ac.jpg, but some like 3, 4, 5 are improved in normal arithmetic)
https://www.nature.com/articles/s41586-022-05172-4/figures/6
The text form for this algorithm/decomposition is as follows | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464499040092,
"lm_q1q2_score": 0.817472223649857,
"lm_q2_score": 0.8376199572530448,
"openwebmath_perplexity": 723.4631948079791,
"openwebmath_score": 0.8126514554023743,
"tags": null,
"url": "https://math.stackexchange.com/questions/578342/number-of-elementary-multiplications-for-multiplying-4x4-matrices"
} |
Is it true for for general $a$, the eigenvalues lie in $[\lambda(a)^{-1}, \lambda(a)]$? If so, what is $\lambda(a)$?
Also, the eigenvectors seem to have a particularly regular form. In particular, they look like that could be expressed as simple combinations of trigonometric functions. Is this the case?
-
The matrix is a symmetric Toeplitz matrix and you can find several results with these buzzwords. Probably this helps. – Dirk Nov 28 '11 at 9:54
It is positive-definite for all $n$.
The way I see it is by noting that it has Cholesky decomposition $$A = LL^\top$$ where $$L = \begin{bmatrix} 1 & & & \\a & \sqrt{1-a^2} & & &\\a^2 & a\sqrt{1-a^2} & \sqrt{1-a^2} & &\\a^3 & a^2\sqrt{1-a^2} & a\sqrt{1-a^2} & \sqrt{1-a^2} &\\\vdots & \vdots & \vdots & \vdots & \ddots\end{bmatrix}.$$
It's not hard (though not "obvious", perhaps) to see that this decomposition is correct: the dot product of a row with itself telescopes to 1, and of two different rows, to the appropriate power of $a$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180685922241,
"lm_q1q2_score": 0.8397852667826777,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 181.85469375045406,
"openwebmath_score": 0.9403307437896729,
"tags": null,
"url": "http://math.stackexchange.com/questions/86316/is-this-matrix-obviously-positive-definite"
} |
From the ratio test, we know if $L< 1$, then the series converges.
Now, I need to find the sum. I have followed a video which explain how to find the sum using the ratio, which sincerely I have not understand well what it is. Can you explain a general rule to find the ratio, and what exactly is it?
Ok. So, following the same process done during the video, I have:
$$\sum_{i=0}^n \frac{4}{3^n} = 4 \sum_{i=0}^n \frac{1}{3^n} = 4 \sum_{i=0}^n \left(\frac{1}{3}\right)^n$$
Apparently, our ratio $r$ is $\frac{1}{3}$.
Now, to find the sum of the series, he uses a formula:
$$\frac{\text{first term}}{1 - r}$$
Where first term is the first term of the series. Can you explain where this formula comes from?
Applying that formula, we obtain:
$$\frac{\left(\frac{1}{3}\right)^0}{1 - \frac{1}{3}} = \frac{1}{1 - \frac{1}{3}} = \frac{1}{\frac{2}{3}} = \frac{3}{2}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426428022032,
"lm_q1q2_score": 0.8030610757582142,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 141.67931925286697,
"openwebmath_score": 0.9183456897735596,
"tags": null,
"url": "https://math.stackexchange.com/questions/1210267/does-this-series-sum-i-0n-frac43n-diverge-or-converge"
} |
``````# Function to return gcd of a and b
def gcd(a, b):
if a == 0 :
return b
return gcd(b%a, a)
Finding the gcd of 81 and 57 by the Euclidean Algorithm:
b=81
a=57
method1: substract
GCD(a, b) = GCD(b-a, a) = GCD(81-57, 57) = GCD(24, 57) = GCD(57-24, 24)=GCD(33, 24)=GCD(33-24, 24)=GCD(9,24)=GCD(24-9, 9)=GCD(15,9)=GCD(15-9,9)=GCD(6,9)=GCD(9-6,6)=GCD(3,6)=GCD(6-3,3)=GCD(3,3)=GCD(3-3,3)=GCD(0,3)
=>GCD=3
method2: divide
GCD(a, b) = GCD(b%a, a) = GCD(81%57,57)=GCD(24,57)=GCD(57%24,24)=GCD(9,24)=GCD(24%9,9)=GCD(6,9)=GCD(9%6,6)=GCD(3,6)=GCD(6%3,3)=GCD(0,3)
=>GCD=3
另一种表示方法:
81 = 1(57) + 24
57 = 2(24) + 9
24 = 2(9) + 6
9 = 1(6) + 3
6 = 2(3) + 0
``````
### Extended
#### Intro | {
"domain": "lyhistory.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308775555446,
"lm_q1q2_score": 0.8255670746296302,
"lm_q2_score": 0.8354835309589074,
"openwebmath_perplexity": 1776.2084251754034,
"openwebmath_score": 0.8331554532051086,
"tags": null,
"url": "http://lyhistory.com/docs/vuepress/docs/blockchain/cryptography/algebra_0_modular_arithmetic/"
} |
finite-impulse-response, linear-phase
Title: Finding remaining zeros of linear phase FIR filter Question given is: if $h(n)$ is a linear phase causal FIR of order $10$ with real coefficients, find the remaining zeros of this filter if the zeros given are
$$q_{1,2} = -2 \pm 2j$$
$$q_{3} = -\frac12 + \frac{j}{2} $$
$$q_{4} = -1$$
I know for sure that $-\frac {1} 2 - \frac j 2 $ has to be another zero, but there are 5 more zeros unaccounted for. How am I supposed to find them? For linear phase FIR filters, each zero at z = z0 will have a matching reciprocal zero at z = 1/zo. And for real-valued coefficients each zero at z = zo will have a matching conjugate zero at z = *zo. Thus for linear phase real-valued coefficients, when you place one zero on the z-plane you determine the location of the other three zeros. | {
"domain": "dsp.stackexchange",
"id": 7993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "finite-impulse-response, linear-phase",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.