text stringlengths 1 1.11k | source dict |
|---|---|
forces, free-body-diagram, fluid-statics, buoyancy
Title: Does Archimedes principle account for depth? The principle states that the upthrust acting on an object is equal to the weight of the fluid displaced by the object. However, this to me suggests that no matter how deep an object is immersed in the fluid, the upthrust acting on it is the same. Actually the density of the fluid increases with depth, since no fluid is perfectly incompressible. Therefore the pressure difference over the object
$\rho\ g(h2-h1)$
and therefore the buoyancy also increases with depth.
In the above formula, let's take a simplified example of a rectangular object, horizontal area $A$ , and vertical thickness $t$ with the top face a distance h1 from the surface and the bottom face a distance h2 from the surface. We will take the object to be small enough (a few cm) to use an average fluid density over its thickness $t$. Designate the value of that fluid density by $\rho 1$ at depth 1. The buoyant force up on that object is
$\rho 1\ g\ A\ (h2-h1)$ | {
"domain": "physics.stackexchange",
"id": 58372,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, free-body-diagram, fluid-statics, buoyancy",
"url": null
} |
python, algorithm, coordinate-system
newList = []
for host in coordinate:
newDict = {
'ne_lng': host[0],
'ne_lat': host[1],
'sw_lng': host[2],
'sw_lat': host[3],
"interval": interval
}
# print posts.insert(newDict)
newList.append(newDict)
return newList Here are three ways your code could be made more pythonic (which I consider to be more readable):
Use python keyword expansion:
Python allows the expansion of a dict object when calling a function. This means we can change:
def getCoordinate(Country, interval):
ne_lng = Country['ne_lng']
ne_lat = Country['ne_lat']
sw_lng = Country['sw_lng']
sw_lat = Country['sw_lat'] | {
"domain": "codereview.stackexchange",
"id": 24769,
"lm_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, coordinate-system",
"url": null
} |
newtonian-mechanics, forces, energy, work
Title: Validity of work-energy theorem in presence of non-conservative forces? How can the work-energy theorem be valid in presence of non-conservative forces since conservation of energy is not there?
How can the work energy theorem be valid in presence of
non-conservative forces since conservation of energy is not there?
The work-energy principle simply states that work is the net increase of KE
The principle of work and kinetic energy (also known as the
work-energy principle) states that the work done by all forces acting
on a particle (the work of the resultant force) equals the change in
the kinetic energy of the particle | {
"domain": "physics.stackexchange",
"id": 20213,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, forces, energy, work",
"url": null
} |
quantum-gate, circuit-construction, complexity-theory
You should probably also accept that you can convert any function written in $\mathsf{3CNF}$ having $\{\lnot,\lor,\land\}$ gates to the same function written with a polynomial number of clauses using only $\uparrow$, the Sheffer stroke (for $\mathsf{NAND}$). The Sheffer stroke $\uparrow$ is not reversible.
It would suffice to replace the Sheffer stroke $\{\uparrow\}$, or the $\mathsf{3CNF}$ gates $\{\lor,\land,\lnot\}$, with some reversible gates.
Enter the Toffoli gate, aka the $\mathsf{CCNOT}$ gate.
Quoting from Wikipedia: | {
"domain": "quantumcomputing.stackexchange",
"id": 735,
"lm_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, circuit-construction, complexity-theory",
"url": null
} |
quadcopter, flight-controller
Controller - FlySky FS-i6
Receiver - FS-iA6 (6 channels, 2.4 GHZ)
Power Supply - Tattu R-Line 14.8V 1300mAh
The board it connects to is using 5v. There were two issues that I resolved...
Firstly, I re-soldered the wires to the NAZE. I wanted to make sure that the connections were correct and it seemed they might be off.
Secondly, I switched the receiver to the iA6B.
The receiver is not heating up anymore. | {
"domain": "robotics.stackexchange",
"id": 1682,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quadcopter, flight-controller",
"url": null
} |
c#, asynchronous, winforms, task-parallel-library
ResetBackgroundWorker();
}
private void ResetBackgroundWorker()
{
BackgroundWorkerProgressBar.Value = 0;
StartBackgroundWorkerButton.Enabled = true;
CancelBackgroundWorkerButton.Enabled = false;
}
#endregion
#region Task
I don't get to write this kind of code very often, so I'm very interested in this part. I declared a private field and handled the Click event like this:
CancellationTokenSource _cancelTokenSource;
private void StartTaskButton_Click(object sender, EventArgs e)
{
StartTaskButton.Enabled = false;
_cancelTokenSource = new CancellationTokenSource();
var token = _cancelTokenSource.Token; | {
"domain": "codereview.stackexchange",
"id": 6045,
"lm_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#, asynchronous, winforms, task-parallel-library",
"url": null
} |
condensed-matter, laser, optical-lattices
The point is, if you want a weaker laser, for the same force you have to get closer to the resonance. This will correspondingly make the heating for a given force stronger, although if your atoms are relatively hot anyway that might not matter to you.
So, a few things you need to ask yourself are: | {
"domain": "physics.stackexchange",
"id": 33394,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, laser, optical-lattices",
"url": null
} |
python, object-oriented, inheritance
@staticmethod
def normalize_value_in_range(value: int, lower_bound: int, upper_bound: int) -> int:
if value < lower_bound:
return lower_bound
elif value > upper_bound:
return upper_bound
else:
return value
def increment(self):
self.seconds += 1
if self.seconds == 60:
self.seconds = 0
self.minutes += 1
if self.minutes == 60:
self.minutes = 0
self.hours += 1
if self.hours == 24:
self.hours = 0
def __eq__(self, other):
return self.hours == other.hours and self.minutes == other.minutes and self.seconds == other.seconds
def __str__(self):
return f"{str(self.hours).zfill(2)}:{str(self.minutes).zfill(2)}:{str(self.seconds).zfill(2)}"
class Clock:
def __init__(self, hours: int, minutes: int, seconds: int):
self.time = Time(hours, minutes, seconds) | {
"domain": "codereview.stackexchange",
"id": 40899,
"lm_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, inheritance",
"url": null
} |
thermodynamics, phase-transition
Title: Water steam drops after adding ice cubes Whenever I fill a glass with cold tap water and then add some ice cubes to it, I usually make the following observation:
After a few minutes, the glass' outer surface has (what I assume to be) a layer of (tiny) water steam drops on it.
How does this happen?
This seems to be the same kind of thing when steam condensates to water steam drops on a mirror after a hot shower in a bathroom. In that case I can perfectly see how the steam is reaching the mirror.
But I am failing to understand how the cold water from inside the glass is getting onto its surface. After a few minutes, the glass' outer surface has (what I assume to be) a layer of (tiny) water steam drops on it. How does this happen? | {
"domain": "physics.stackexchange",
"id": 58610,
"lm_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",
"url": null
} |
c++, recursion, template, c++20, constrained-templates
// recursive_reduce_all template function with execution policy, initial value and specified operation, overload for std::array
template<class ExPo,
template<class, std::size_t> class Container,
typename T,
std::size_t N,
class TI, class BinaryOp>
requires (std::is_execution_policy_v<std::remove_cvref_t<ExPo>> &&
arithmetic<recursive_array_unwrap_type_t<recursive_depth<Container<T, N>>(), Container<T, N>>> &&
std::same_as<recursive_array_unwrap_type_t<recursive_depth<Container<T, N>>(), Container<T, N>>, TI> &&
recursive_depth<Container<T, N>>() == 1 &&
std::regular_invocable<
BinaryOp,
recursive_array_unwrap_type_t<recursive_depth<Container<T, N>>(), Container<T, N>>,
recursive_array_unwrap_type_t<recursive_depth<Container<T, N>>(), Container<T, N>>>
) | {
"domain": "codereview.stackexchange",
"id": 44803,
"lm_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++, recursion, template, c++20, constrained-templates",
"url": null
} |
Sum of a geometric series:
$\displaystyle \sum_{k = 0}^{\infty} ar^k = \frac a {1-r}$
or
$\displaystyle \sum_{k = 1}^{\infty} ar^k = \frac {ar} {1-r}$
4. Dec 22, 2016
### Buffu
$$\sum_{n = 1}^{\infty} \frac 1 {2^k} = \sum_{n = 1}^{\infty} \left( \frac 1 2 \right)^k = \frac {\color{green}{1}} {1- \frac 1 2} = 2$$
The first term(a) is not 1.
5. Dec 22, 2016
### Ray Vickson
$$\sum_{n = 1}^{\infty} \frac 1 {2^k} = 2 \; \Longleftarrow \; \text{FALSE!}$$
$$\begin{array}{lcc} \frac{1}{2}+\frac{1}{4} &=& \frac{3}{4}\\ \frac{1}{2} + \frac{1}{4} + \frac{1}{8} &=& \frac{7}{8}\\ \frac{1}{2} + \frac{1}{4} + \frac{1}{8} +\frac{1}{16} &=& \frac{15}{16}\\ \vdots&\vdots&\vdots \end{array}$$
The sums are creeping up to 1, not to 2.
6. Dec 22, 2016
### Ryaners
Ah ok, my mistake. Thank you all for pointing that out, I didn't realise the formula would change if the index changed, though of course that makes sense. Cheers!
7. Dec 22, 2016
### SammyS | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232899814556,
"lm_q1q2_score": 0.8080666262465758,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 766.3572519516201,
"openwebmath_score": 0.8281604051589966,
"tags": null,
"url": "https://www.physicsforums.com/threads/finding-sum-of-infinite-series-sums-of-two-series-together.898098/"
} |
homework-and-exercises, waves, differential-equations
Physically, these represent two waves travelling in opposite directions with the speeds $v$, whose instantaneous "shapes" is given by the functions $F$ and $G$.
Thus, the functions $F$ and $G$ don't change their "shapes" as time progresses, but $F + G$ certainly would, in general. Now, if your solution was just a function of $x-vt$ (or of $x+vt$), in that case the "profile" wouldn't change with time. | {
"domain": "physics.stackexchange",
"id": 69001,
"lm_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, waves, differential-equations",
"url": null
} |
crystal-structure, solid-state-chemistry, crystallography
Title: Why Frenkel defect does not impact the density of the solid? The following text is from Chemistry Part I - Textbook for Class XII (NCERT), chapter "The Solid State", page 23, topic "1.9 Imperfections in Solids", sub topic "1.9.1 Types of Point Defects - (iii) Frenkel Defect":
This defect is shown by ionic solids. The smaller ion (usually cation) is dislocated from its normal site to an interstitial site. It creates a vacancy defect at its original site and an interstitial defect at its new location.
Frenkel defect is also called dislocation defect. It does not change the density of the solid. | {
"domain": "chemistry.stackexchange",
"id": 15292,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "crystal-structure, solid-state-chemistry, crystallography",
"url": null
} |
The problem is basically that division in a polynomial ring by several polynomials ($y^2-1$ and $xy-1$ in the example) is a priori not well-defined. For one, the problem is underdetermined. Choosing a monomial ordering and an ordering of the polynomials to be divided by allows you to define an unambiguous (multivariate) division algorithm. Unfortunately its output will depend on the orderings chosen. Furthermore, while a remainder of zero will mean that the input belongs to the ideal generated by the polynomials to be divided by, the converse is not necessarily true. Groebner bases were invented to address these issues. See for example the book Ideals, Varieties, and Algorithms by Cox, Little, and O'Shea. In fact I took the example from there; I just (slightly artificially) rephrased it to be about a quotient ring. If you are only interested in "a remainder" (any), then you can use the division algorithm of Theorem 3 in that book. If you want more, you have to read more. Good luck. | {
"domain": "sagemath.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464478051827,
"lm_q1q2_score": 0.8235964334057084,
"lm_q2_score": 0.8438951084436077,
"openwebmath_perplexity": 355.2088533340934,
"openwebmath_score": 0.8576695919036865,
"tags": null,
"url": "https://ask.sagemath.org/answers/50424/revisions/"
} |
robotic-arm, opencv2
Install OpenCV to a specific directory following the instructions on their website.
Create a CMakeModule folder within your working program directory, find a version of FindOpenCV.cmake to copy into that folder, then specify the path to OpenCV by adding the line:
set(OpenCV_DIR "/directory/to/opencv2")
In your program's CMake file, add:
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/CMakeModules/")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_definitions(${OpenCV_DEFINITIONS})
MESSAGE(STATUS "OpenCV at: ${OpenCV_INCLUDE_DIRS}")
more code
target_link_libraries(executable_name ${OpenCV_LIBRARIES})
There might be some specifics that are incorrect, but I think the general idea should work.
Originally posted by stantol with karma: 146 on 2013-03-06
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 13220,
"lm_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, opencv2",
"url": null
} |
Logarithmic inequality with substitution
I have this problem that I can solve halfway, but I'm struggling to find the interval for the solution.The inequality is this: $$\log_3(4^x+1)+\log_{4^x+1}(3)>2.5.$$
Now here is the method how I tried to solve this inequality:
$\log_3(4^x+1)+ \frac{1}{\log_{3}(4^x+1)}>2.5$
Substitute $\log_3(4^x+1)$ with $u$:
$\log_3(4^x+1)=u$
$u+ \frac{1}{u}>2.5$ multiply both side with $u$
$u^2-2.5u+1>0$
Now solving for $u$ I get $u_1=1$ and $u_2=2$
Next: going back to the substitution:
$\log _3(4^x+1)=u$
How do I proceed from now on assuming my calculations are right? How do I find the intervals?
We need to solve $$u^2-2.5u+1>0$$ or $$(u-2)(u-0.5)>0,$$
which gives $$u>2$$ or $$u<\frac{1}{2}.$$ For $u>2$ we obtain $$\log_3(4^x+1)>2$$ or $$4^x>8$$ or $$x>\frac{3}{2}.$$ While for $u<\frac{1}{2}$ we obtain $$4^x<\sqrt3-1$$ or $$x<\log_4(\sqrt3-1)$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138105645059,
"lm_q1q2_score": 0.814752965519643,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 417.68624174949366,
"openwebmath_score": 0.792220413684845,
"tags": null,
"url": "https://math.stackexchange.com/questions/2410261/logarithmic-inequality-with-substitution"
} |
physical-chemistry, thermodynamics
How to calculate the work done in a process where all 3 variables, $P$, $V$, and $T$ are changing simultaneously and $P$ is directly proportional to $V$? As far as I am aware, there is no generic formula for when all three variables are changing at once.
In this case, the easiest way is to simply use the area of a trapezium.
If you insist on integrating, then you need to know what $P$ is as a function of $V$. This derives from basic principles of integration - if you have a function $f(x)$, then $\int_a^b f(x)\,\mathrm{d}x$ gives the area under the curve of $f(x)$ from $x = a$ to $x = b$.
The line $\mathrm{C \rightarrow A}$ can be easily found since the beginning and end points are given. The gradient of the line is
$$m = \frac{2P_0 - P_0}{2V_0 - V_0} = \frac{P_0}{V_0}$$
and the the intercept is clearly 0 from the diagram (you can work it out anyway). In general the equation of a line $y = y(x)$ is given by $y - y_i = m(x - x_i)$ where $(x_i,y_i)$ is any point on the line. | {
"domain": "chemistry.stackexchange",
"id": 6339,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, thermodynamics",
"url": null
} |
list(betaHat >= 0)) result <- solve(problem) m <- matrix(result$getValue(betaHat), ncol = 1) rownames(m) <- paste0("$\\beta_{", 1:p, "}$") knitr::kable(m, format = "html") %>% kable_styling("striped") %>% column_spec(1:2, background = "#ececec") We can verify once again that these values are comparable to those obtained from another R package, say [nnls]( https://CRAN.R-project.org/package=nnls). {r} library(nnls) nnls.fit <- nnls(X, Y)$x {r} m <- cbind(result$getValue(betaHat), nnls.fit) colnames(m) <- c("CVXR est.", "nnls est.") rownames(m) <- paste0("$\\beta_{", 1:p, "}$") knitr::kable(m, format = "html") %>% kable_styling("striped") %>% column_spec(1:3, background = "#ececec") ## Okay that was cool, but... As you no doubt noticed, we have done nothing that other R packages could not do. So now suppose further, for some extraneous reason, that the sum of $\beta_2$ and $\beta_3$ is known to be negative and but all other $\beta$s are positive. It is clear that this problem would not | {
"domain": "github.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924793940118,
"lm_q1q2_score": 0.8035576423131398,
"lm_q2_score": 0.8267117898012105,
"openwebmath_perplexity": 3308.6161439743764,
"openwebmath_score": 0.6715719103813171,
"tags": null,
"url": "https://github.com/bnaras/cvxr_docs/blob/master/content/cvxr_examples/intro.Rmd"
} |
java, game, programming-challenge
The last class is the State class which has two banks, you can also compare two states and check if this state is permitted or if it is final.
The game class has the implemented play() method which calls solve(). This one calls himself recursively. There are two methods, stateExists() and addState(), to control the visited states. I would have liked to have moved these two into the State class as static methods but since State is a nested class of the game class I couldn't do it.
The steps of the solution are simply stored in a List<String>.
So here it is:
public class WolfGoatCabbageGame implements RiverCrossingGame {
private enum Element { FARMER, WOLF, GOAT, CABBAGE };
private Bank westBank;
private Bank eastBank;
private static Vector<State> states; // visited states
private List<String> steps; // steps to solve the puzzle | {
"domain": "codereview.stackexchange",
"id": 18249,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game, programming-challenge",
"url": null
} |
c#, performance, array
if (isWhiteListed)
{
outputList.Add(testArray);
}
}
return outputList;
}
This method now iterates once over its main argument, and returns a subsequence of that argument. This sounds like an ideal scenario for an extension method on IEnumerable.
public static IEnumerable<int[]> FilterByWhitelist(this IEnumerable<int[]> testArrays, List<int[]> whiteListedArrays)
{
foreach (var testArray in testArrays)
{
var isWhiteListed = whiteListedArrays.Any(
whiteListedArray => testArray.SequenceEqual(whiteListedArray));
if (isWhiteListed)
{
yield return testArray;
}
}
}
This would be called like:
var originalList = new List<int[]> { ... };
var whiteList = new List<int[]> { ... };
var filteredList = originalList.FilterByWhitelist(whiteList).ToList(); | {
"domain": "codereview.stackexchange",
"id": 17843,
"lm_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, array",
"url": null
} |
php, beginner, object-oriented, sql
if($stmt->execute()) {
$rowCount = $stmt->rowCount();
$success[0] = $rowCount;
$success[1] = $this->conn->lastInsertId();
return $success;
}
else {
$success[0] = 'Cannot Execute';
$stmt = NULL;
return $success;
}
}
else {
$success[0] = 'Cannot Prepare';
$stmt = NULL;
return $success;
}
}
public function executeSelect($theAttributes,$theTable,$theConditions = NULL,$fetch_style = "FETCH_ASSOC") {
if(is_array($theConditions)) {
foreach($theConditions as $index => $value){
$bind_conditions[] = "$index = :$index";
}
$sqlstmt = trim($this->st->setAttributes($theAttributes)->setTables($theTable)->setConditions($bind_conditions)->makeSelect());
}
elseif(!is_null($theConditions) && !is_array($theConditions)){ | {
"domain": "codereview.stackexchange",
"id": 2151,
"lm_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, beginner, object-oriented, sql",
"url": null
} |
Table 9. Theory: For a system in the absence of any net external torque, the angular momentum, L, is conserved (i. For stability the metacentric height GM must be positive. We used existing torque and Inertia equations to derive the formula and found that our Moment of Inertia was equal to 0. 000432 and 0. Area moment of Inertia : Definition – Polar Moment of Inertia, Transfer Theorem, Moments of Inertia of Composite Figures, Products of Inertia, Transfer Formula for Product of Inertia. 11110 Alondra Blvd. 3 Momentof Inertia -Dependenceof I on R2 The moment of inertia for a mass point is mR2. You can adjust the densities or thicknesses to get the same mass for both cylinders. Equipment rotating table with photo gate and pulley , with cylinder for string. Equipment Overview Centripetal Force Apparatus, WL0930 configured for moment of inertia experiment\Slotted Weight Set Vernier caliper Stopwatch Ruler and meter stick Scale (500 g capacity) Procedure conclusion From analyzing the data | {
"domain": "angelaleone.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587257892505,
"lm_q1q2_score": 0.8294545499481589,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 543.1601335549083,
"openwebmath_score": 0.5480412840843201,
"tags": null,
"url": "http://angelaleone.it/imhu/moment-of-inertia-lab.html"
} |
game-ai, search, efficiency, uninformed-search, informed-search
Informed Search Techniques
A* is probably one of the most canonical examples of informed search algorithms. In terms of worst-case memory requirements, it's really similar to BFS; it also stores a frontier of nodes to visit next, but prioritizes those based on some estimate of "goodness" rather than Breadth-First order. In cases where the information you're using (typically a combination of known/incurred costs + heuristic estimate of future costs) is of extremely poor quality, this can regress to the level of Breadth-First Search, so the worst-case space complexity is the same as that for BFS (see details). In practice, if you have high-quality information (good heuristics), the memory requirements will be much better though; in the case of an ideal/perfect heuristic, your search algorithm will pretty much go directly to the goal and hardly require any memory. | {
"domain": "ai.stackexchange",
"id": 612,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game-ai, search, efficiency, uninformed-search, informed-search",
"url": null
} |
deep-learning, keras, gan, generative-models
How would your Generator & Discriminator would look like???
Here's my attempt to create G & D that will be able to do so:
def create_G(num=100):
G_in = Input(shape=num)
x = Dense(num/2,activation=LeakyReLU())(G_in)
x = Dropout(0.5)(x)
x = Dense(num/4,activation=LeakyReLU())(x)
x = Dropout(0.5)(x)
x = Dense(num)(x)
G = Model(G_in,x)
G.compile(loss='binary_crossentropy',optimizer=Adam(learning_rate=0.001))
return G
def create_D(num=100):
D_in = Input(shape=num)
x = Reshape((-1,1))(D_in)
x = Conv1D(num,3,activation='relu')(x)
x = Dropout(0.5)(x)
x = Flatten()(x)
x = Dense(2,activation='sigmoid')(x)
D = Model(D_in,x)
D.compile(loss='binary_crossentropy',optimizer=Adam(lr=0.003))
return D
I'm training the right way, with fake and real examples.
But my G is not able to fool the D.
Here is an example of the values of G.predict(noise) in blue, compare to the real values in orange . | {
"domain": "datascience.stackexchange",
"id": 8262,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, keras, gan, generative-models",
"url": null
} |
roslaunch
Originally posted by tonybaltovski with karma: 2549 on 2015-01-05
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by A.M Dynamics on 2015-01-05:
Many thanks. My problem is solved but would you please explain why? Why mine was not correct? Is it because the command 'find' has already included " freenect_launch" package and there is no need for writing whole directory?
Comment by tonybaltovski on 2015-01-05:
If you do roscd freenect_launch it will take you to /opt/ros/<distro>/share that is basically what $(find freenect_launch) does thus you do not need to include it. Once in the correct directory, you need to advance to launch and then the file.launch.
Comment by A.M Dynamics on 2015-01-05:
Thanks. I got it. | {
"domain": "robotics.stackexchange",
"id": 20486,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "roslaunch",
"url": null
} |
quantum-fourier-transform, linear-algebra, superposition, simons-algorithm, hidden-subgroup-problem
However it can be convenient to think of $g$ as integers or bit-strings $\mathbb{Z}^n_2$, with $n=\log_2 \vert G\vert$. But then we will need to envision a bijection mapping $g$ (as abstract group elements) to/from integers/bit-strings in $\mathbb{Z}^n_2$ (as more concrete states of qubits on which we work).
One of the first steps in HSP algorithms is to prepare a first input register into the uniform superposition over all elements of $G$; later we evaluate our oracle $f$ on the second output register representing elements of $X$.
Hence once we can conceptualize the inputs $g$ as integers/bit-strings, this can be accomplished in a straightforward manner, by performing Hadamard transforms on the input qubits. | {
"domain": "quantumcomputing.stackexchange",
"id": 2582,
"lm_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-fourier-transform, linear-algebra, superposition, simons-algorithm, hidden-subgroup-problem",
"url": null
} |
algorithms
For next time, I'd expect you to do more research on your own. See especially "computational geometry", e.g., a textbook that covers that area. | {
"domain": "cs.stackexchange",
"id": 2447,
"lm_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",
"url": null
} |
ODE system in the form of. Generally, dynamical systems are. PHASE PLANE ANALYSIS OF NON-LINEAR SYSTEM ◮ phase plane analysis of nonlinear system,has two important points as follow: 1. Moreover, in a sense that we will not try to make precise, most planar autonomous systems are Morse-Smale. The problem that I encountered came from the fact that a huge amount of information on this topic is in books and published in articles. 1 1 (1) Among the seven critical points marked. }\) From the phase portrait it should be clear that even this simple system has fairly complicated behavior. 5*(r - r^3) \\dot{\\theta} = 1 I know how to do it in Mathematica field1 = {0. Study the phase portrait and check that it agrees with the results obtained in the last example. Global dynamics in one dimension: stability, linear stability, and bifurcations. How can I plot phase-plane portraits of a nonlinear system? Sign in to answer this question. My professor told us to use a plotter to check our work (the | {
"domain": "colagrossijeans.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713891776498,
"lm_q1q2_score": 0.8273658508922132,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 567.4945903919495,
"openwebmath_score": 0.6094440817832947,
"tags": null,
"url": "http://colagrossijeans.it/kzgz/phase-portrait-nonlinear-system.html"
} |
ros, rospkg, pythonpath, ros-fuerte
Title: rospkg not found in fuerte
Dear ROS users,
trying to use
rosrun tf view_frames
I get
Traceback (most recent call last):
File "/opt/ros/fuerte/stacks/geometry/tf/scripts/view_frames", line 43, in <module>
import roslib; roslib.load_manifest(PKG)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
from roslib.launcher import load_manifest
File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
import rospkg
ImportError: No module named rospkg
...but I cannot find any errors around my environmental variables.. :(
Originally posted by Rahndall on ROS Answers with karma: 133 on 2014-09-15
Post score: 0
I think this question has been answered before:
http://answers.ros.org/question/39657/importerror-no-module-named-rospkg/
Originally posted by Pep Lluis Negre with karma: 111 on 2014-09-16
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 19399,
"lm_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, rospkg, pythonpath, ros-fuerte",
"url": null
} |
quantum-field-theory, topological-field-theory, instantons, solitons
$$
n = \frac{1}{24 \pi^{2}}\left(\int d^{3}\mathbf r\epsilon_{ijk}\text{Tr}A_{i}A_{j}A_{k}\right)_{\tau = -\infty}^{\tau = \infty} = |(0)| = n[U^{(1)}] - n[U^{(0)}]
$$
So that you see that in the Coulomb gauge $A_{0} = 0$ the instanton solution $(0)$ really describes tunneling between vacua with topological charges $0$ and $1$. Since each instanton with arbitrary topological value can be described as set of instantons with topological value $1$ (look to 4)), and due to gauge invariance of $n$, the result stated above is true for configuration with arbitrary number $n$ and for each gauge.
2) Yes, instantons are solutions of classical equations of motion. But only the quantum system can be described as the superposition of different states. In the case of theories with nontrivial topological properties, in general the state of theory is
$$
|\text{vac}\rangle = \sum_{n = -\infty}^{\infty} c(n)| n\rangle
$$ | {
"domain": "physics.stackexchange",
"id": 27986,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, topological-field-theory, instantons, solitons",
"url": null
} |
quantum-gate, quantum-circuit, gate-synthesis, state-preparation
Title: How many quantum gates are needed to prepare an arbitrary state? In this paper there is this sentence:
[...] the description of a $2^n\times2^n$ unitary matrix $U$ (which is a poly($n$)-size quantum circuit) | {
"domain": "quantumcomputing.stackexchange",
"id": 3375,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, quantum-circuit, gate-synthesis, state-preparation",
"url": null
} |
quantum-mechanics, operators, definition, commutator, lie-algebra
Title: What is the Heisenberg-Weyl Algebra? I did all the courses on Quantum Mechanics and QFT which my faculty offers and up to now no one defined to me what a Heisenberg-Weyl algebra actually is.
This appears in my studies when studying the polymer representations in QM.
So the points not clear to me are:
What is and why is it important the Heisenberg-Weyl Algebra in QM?
I read that is a kind of operator algebra but it was very murky and unclear to me.
What is the role of the usual $\hat{X}$ and $\hat{P}$ operators here?
Regard to that Algebra, do the $\hat{a}$ and $\hat{a}^\dagger$ have a special role or, as it was told me, they are just "nice" operator since they create quanta? | {
"domain": "physics.stackexchange",
"id": 96205,
"lm_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, operators, definition, commutator, lie-algebra",
"url": null
} |
thermodynamics, statistical-mechanics
The Doctor catches the returned ball, and drifts with double (and a bit of heat energy) towards the cold wall. Until he strikes the cold wall, the whole box will be moving towards the TARDIS. But when he strikes the cold wall, all his momentum, exactly opposite to the box momentum, is given back to the box, and it stops.
No net change in the box momentum.
event box ball Dr
start 0 0
Throw 0 1 -1
StickHot 1(&ball) 0 -1
BounceHot 2+h -(1+h) -1
CatchHot 2+h 0 -(2+h){Dr&Ball}
StickCold 0 = 2+h - (2+h) | {
"domain": "physics.stackexchange",
"id": 8222,
"lm_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, statistical-mechanics",
"url": null
} |
Note that your premise is incorrect, and the given summand is in fact greater than $\left(\frac{4}{5}\right)^k$ for all $k>N$ for some $N$ (which turns out to be at least $1$, but this is irrelevant for convergence). If$$\frac{4^k+5}{5^k+k}>\frac{4^k}{5^k}$$ is true then $$20^k+5^{k+1}>20^k+k4^k$$ $$\left(\frac{5}{4}\right)^k>\frac{k}{5}.$$ Note that this is satisfied when $k=100$, as $(1+\frac{1}{4})^{100}\ge1+\frac{100}{4}>\frac{100}{4}$.
Both left and right sides are increasing functions. Comparing derivatives,$$\left(\left(\frac{5}{4}\right)^k\right)'=\left(\frac{5}{4}\right)^k\ln\left(\frac{5}{4}\right)>\left(\frac{k}{5}\right)'=\frac{1}{5}$$ and we are done (the last inequality is obviously satisfied for all $k>N$ for some $N$, as $\left(\frac{5}{4}\right)^k\ln\left(\frac{5}{4}\right)$ is increasing whereas $\frac{1}{5}$ is not).
A cleaner hint is to notice that if $k\geqslant1$, then $$\frac{1}{5^k}\geqslant\frac{1}{5^k+k}\geqslant\frac{1}{6^k}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290947248701,
"lm_q1q2_score": 0.8092657678970883,
"lm_q2_score": 0.8333246035907932,
"openwebmath_perplexity": 429.60460148046803,
"openwebmath_score": 0.9346926808357239,
"tags": null,
"url": "https://math.stackexchange.com/questions/526084/what-does-sum-k-1-infty-frac4k55k-k-converge-to"
} |
quantum-mechanics, harmonic-oscillator, spectroscopy
This is given by
\begin{equation}
P = \left\langle \psi^{\text{final}} \big| \hat{\mu} \big| \psi^{\text{initial}} \right\rangle
\end{equation}
where $\hat{\mu}$ is the dipole moment operator and $\psi^{\text{final}}$ and $\psi^{\text{initial}}$ are the wave functions of the final and the initial state, respectively. Since the wave functions of the harmonic oscillator are even functions for $\nu = 2n$ and odd functions for $\nu = 2n + 1$ (with $n = 0, 1, \dots$) and $\hat{\mu}$ transforms as a vector (and so can be considered an uneven function) the integral for $P$ vanishes if $\psi^{\text{final}}$ and $\psi^{\text{initial}}$ are both even (or uneven). | {
"domain": "physics.stackexchange",
"id": 2449,
"lm_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, harmonic-oscillator, spectroscopy",
"url": null
} |
ros, slam, navigation, roslaunch, rgbdslam-freiburg
* /rgbdslam/config/min_sampled_candidates
* /rgbdslam/config/min_time_reported
* /rgbdslam/config/min_translation_meter
* /rgbdslam/config/neighbor_candidates
* /rgbdslam/config/nn_distance_ratio
* /rgbdslam/config/observability_threshold
* /rgbdslam/config/octomap_online_creation
* /rgbdslam/config/octomap_resolution
* /rgbdslam/config/predecessor_candidates
* /rgbdslam/config/ransac_iterations
* /rgbdslam/config/store_pointclouds
* /rgbdslam/config/topic_image_depth
* /rgbdslam/config/topic_image_mono
* /rgbdslam/config/topic_points
* /rgbdslam/config/use_icp
* /rgbdslam/config/visualization_skip_step
* /rgbdslam/config/visualize_keyframes_only
* /rosdistro
* /rosversion | {
"domain": "robotics.stackexchange",
"id": 23452,
"lm_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, slam, navigation, roslaunch, rgbdslam-freiburg",
"url": null
} |
$$(5\times4!)\times3!=5!\times3!$$
Ways to seat the group of people corresponding to the constraints given by your question.
Hope this helps!
-
Temporarily replace the three boys by a single boy. Then you have $5$ people to seat, the $4$ girls and the boy. There are $5!$ ways to arrange $5$ people in a row, so there are $5!$ ways to seat the $4$ girls and the one boy. Now we’ll magically turn the boy back into $3$ boys sitting side by side. That is, if the arrangement was $$G_1G_2G_3BG_4\;,\tag{1}$$ we now have $$G_1G_2G_3BBBG_4\;,$$ with the $3$ boys occupying a block of $3$ seats where the single boy had his seat. But we can arrange the $3$ boys in any order within their block, and there are $3!$ possible orders, so each of the $5!$ original arrangements corresponds to $3!=6$ arrangements of all $8$ children. For example, $(1)$ corresponds to the following $6$ arrangements: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357205793903,
"lm_q1q2_score": 0.8094037318502724,
"lm_q2_score": 0.8244619350028204,
"openwebmath_perplexity": 272.7444889713845,
"openwebmath_score": 0.7603951096534729,
"tags": null,
"url": "http://math.stackexchange.com/questions/168341/permutation-seating-arrangment-5-3"
} |
( 7pi/10 ) radians that an. Step 1 navigate through the website to function properly central angle measuring ( 7pi/10 ) that! Measure of the radius r of the radius of the sector area units π x.!: 6Π radians and the chord length by double the result of step 1 improve... The symbol ° '' is written 3 ) an angle is the measure angles! Length 33 cm the circle note that the radian is the standard unit of sexagesimal measure is radians the! Angles has radian measure changes from 0 to 2π basic formula that to... R = radius of 2 distance along an arc contained by a radius of circle!, r, of the circle Chapter 2 rotation of an angle the!: r = radius of circle angle '' button, input arc length is r+r =2r functionalities and features! Arc: 6Π tackle the problem browser only with written permission prior to running cookies! And your answer is radius = 2.2825 us now tackle the problem only with your consent combined central of. R r 1 1 2 r ( a ) 2 radians r/2 r/2 1/2 1 r ( a 2. Which opposite arc is | {
"domain": "lukaszdlugosz.pl",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713861502773,
"lm_q1q2_score": 0.8488489510816853,
"lm_q2_score": 0.8615382147637196,
"openwebmath_perplexity": 712.996861022735,
"openwebmath_score": 0.8288950324058533,
"tags": null,
"url": "https://lukaszdlugosz.pl/shipping-container-djt/87153a-radian-measure-of-central-angle"
} |
heliports, etc. (Lists thousands of symbols and the corresponding L a T e X commands that produce them. It is notated by the symbol ⊆ which can be interpreted as "IS A PROPER SUBSET Or IS EQUAL TO". The flow reference symbol acts as a placeholder for the flow area sequence in the chart in every situation in which it is repeated. ctan. A PROPER subset is any subset of a set EXCEPT ITSELF. Info I've repaired Office and it didn't seem to make any difference but then I found out that the "from:" option in the lower right side of the Symbol panel should be "Unicode (hex)" in order to show the subset options. Share the icon nor its edited version Use the icon on merchandise for sale Check Mark Symbols. The letter Q designates the set of rational numbers. If A is not a subset of B, we write A ⊈ B. Viewed 71k times 23. Activity: Subsets . It is also always a proper subset of any set except itself. The symbols can be accessed via slots of Symbol (for example, Symbol::alpha for | {
"domain": "b2bimpactdata.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9621075766298657,
"lm_q1q2_score": 0.8505408821881333,
"lm_q2_score": 0.8840392725805822,
"openwebmath_perplexity": 1008.1600993666372,
"openwebmath_score": 0.6763939261436462,
"tags": null,
"url": "http://b2bimpactdata.com/nhpcht7s/subset-symbol.html"
} |
# interesting integral problem (from old post)
#### oblixps
$$\displaystyle \int_0^{\pi/2} \frac{dx}{1+(\tan x)^{\sqrt{2}}}$$
This problem was found on an old post and i thought it was an interesting problem. a hint was given which said remember that tan x = cot(pi/2 - x). i tried letting u = pi/2 - x and i got:
$$\displaystyle \int_0^{\pi/2} \frac{du}{1+(\cot u)^{\sqrt{2}}}$$
i'm not sure what to do next though. my substitution didn't seem to do much.
#### Drexel28
MHF Hall of Honor
$$\displaystyle \int_0^{\pi/2} \frac{dx}{1+(\tan x)^{\sqrt{2}}}$$
This problem was found on an old post and i thought it was an interesting problem. a hint was given which said remember that tan x = cot(pi/2 - x). i tried letting u = pi/2 - x and i got:
$$\displaystyle \int_0^{\pi/2} \frac{du}{1+(\cot u)^{\sqrt{2}}}$$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426443092216,
"lm_q1q2_score": 0.8074217467698002,
"lm_q2_score": 0.828938806208442,
"openwebmath_perplexity": 650.1598816518632,
"openwebmath_score": 0.976563036441803,
"tags": null,
"url": "https://mathhelpforum.com/threads/interesting-integral-problem-from-old-post.145776/"
} |
# Showing AB=0 does not imply either A,B=0, but that singular
Ex. 8.5 - Mathematical Methods for Physics and Engineering (Riley)
By considering the matrices $$A = \left( \begin{matrix} 1 & 0 \\ 0 & 0 \\ \end{matrix} \right) \text{ , } B = \left( \begin{matrix} 0 & 0 \\ 3 & 4 \\ \end{matrix} \right)$$ show that $AB = 0$ does not imply that either $A$ or $B$ is the zero matrix, but that it does imply that at least one of them is singular.
So, my reasoning was the following:
It's not difficult to compute $AB = \left( \begin{matrix} 0 & 0 \\ 0 & 0 \\ \end{matrix} \right)$, in fact it's really even implied in the question.
So, assume that $A, B$ are each non-singular - i.e. they are invertible.
Thus, $A^{-1}AB=B$, and $ABB^{-1}=A$.
But $AB$ is a zero matrix, so $A=B=0$.
Thus proven that the initial assumption $A, B$ are non-singular is false.
Is my reasoning correct? I ask because the 'hints and answers' said simply "Use the property of the determinant of a matrix product." | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211582993982,
"lm_q1q2_score": 0.8305016135668682,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 421.4373989778902,
"openwebmath_score": 0.9355512261390686,
"tags": null,
"url": "http://math.stackexchange.com/questions/783593/showing-ab-0-does-not-imply-either-a-b-0-but-that-singular"
} |
search-algorithms, search-trees
Use Dijkstra's algorithm to find the shortest path between the starting stop and the last stop.
The time required is $O(n\log n)$ where $n$ is the overall number of (not necessarily distinct) stops across the different lines. This is because is possible to assign edges to vertices so that: 1) each edge is assigned to a "stop" vertex, and 2) each "stop" vertex has at most $2$ edges assigned (i.e., the one towards the "next" stop w.r.t. an arbitrary direction of the line the vertex belongs to, if any, and possibly the one to a super-vertex), showing that the number of edges is at most $2n$.
EDIT:
Here is the graph obtained by applying the above transformation to the example in the question. | {
"domain": "cs.stackexchange",
"id": 14805,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "search-algorithms, search-trees",
"url": null
} |
java, performance, ai, compiler, prolog
Annuaire.ValSymbole.put(s1.code, Annuaire.val(s2.code));
Annuaire.AffSymbole.put(s1.code, Annuaire.aff(s2.code));
continue;
}
//case cste/var
if(Annuaire.val(s2.code)==null && Annuaire.val(s1.code)!=null){
if(caseDisplay){
System.out.println("cste/var");
System.out.println("variable 1: "+Annuaire.aff(s2.code)+ " ,variable 2: "+ Annuaire.val(s1.code));
System.out.println("UNIFICATION BETWEEN "+this+" AND "+c);
} | {
"domain": "codereview.stackexchange",
"id": 22490,
"lm_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, performance, ai, compiler, prolog",
"url": null
} |
You know that ball transferred from A to B is red with 4/11 probability.
Now you have 12 balls in bag B. What is probability it is red? You had 6 red and added 1 with 4/11 probability it is red.
Hint: there are two cases to consider. One case is that a green ball is moved to bag $B$. The other case is a red ball is moved to bag $B$.
• Yes, I got from @drhab, P(E)=P(E∣R)P(R)+P(E∣G)P(G) – Mipo Newton Aug 14 '15 at 13:16
• I can visualize it, not just mathematically. – Mipo Newton Aug 14 '15 at 13:17 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575178175919,
"lm_q1q2_score": 0.8122918883326091,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 381.4758691066932,
"openwebmath_score": 0.8765038847923279,
"tags": null,
"url": "https://math.stackexchange.com/questions/1397036/probability-colored-balls-in-bags"
} |
homework-and-exercises, quantum-field-theory
The departing point is:
$\Psi'(x') = S(\Lambda)\Psi(x)$
As $x' = \Lambda x$ => $\Psi'(x') = S(\Lambda)\Psi(\Lambda^{-1}x')$
Or renaming the independent variable:
$\Psi'(x) = S(\Lambda)\Psi(\Lambda^{-1}x)$
$\Psi'(x') = \Psi(x)$ only for scalar fields. | {
"domain": "physics.stackexchange",
"id": 67764,
"lm_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",
"url": null
} |
javascript, datetime, comparative-review, formatting
Title: Formatting milliseconds as days, hours, minutes, and seconds This is a function which aims to convert an amount of milliseconds to a more human-interpretable Day(s) Hour(s) Minute(s) Second(s) format:
function dhms(t) {
d = Math.floor(t / (1000 * 60 * 60 * 24)),
h = Math.floor((t % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),
m = Math.floor((t % (1000 * 60 * 60)) / (1000 * 60)),
s = Math.floor((t % (1000 * 60)) / 1000);
return d + 'Day(s) ' + h + 'Hour(s) ' + m + 'Minute(s) ' + s + 'Second(s)'
}
So for getting the variables values I have for now something quite verbose:
d = Math.floor(t / (1000 * 60 * 60 * 24)),
h = Math.floor((t % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)),
m = Math.floor((t % (1000 * 60 * 60)) / (1000 * 60)),
s = Math.floor((t % (1000 * 60)) / 1000);
Is it the way to go? Or should I go with:
d = Math.floor(t / 86400000),
h = Math.floor(t % 86400000 / 3600000),
m = Math.floor(t % 3600000 / 60000),
s = Math.floor(t % 60000 / 1000); | {
"domain": "codereview.stackexchange",
"id": 34077,
"lm_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, datetime, comparative-review, formatting",
"url": null
} |
where the flag -n 3 assigns three MPI tasks to three physical processors for the simulation.
For example, the following command will launch the simulation on 3 processors on a Windows OS,
D:\example>mpiexec -localonly -n 3 main.exe | {
"domain": "cdslab.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750536904564,
"lm_q1q2_score": 0.8095422222227788,
"lm_q2_score": 0.8198933315126792,
"openwebmath_perplexity": 7233.364536284518,
"openwebmath_score": 0.36154985427856445,
"tags": null,
"url": "https://www.cdslab.org/paramonte/notes/examples/fortran/mvn/"
} |
to - Darts. (Same picture from #1) A point in the figure selected at random. Each Side Of The Dartboard Is 17in, And The Radius Of The Shaded Region Is 6in The Shape Is A Circle On The Inside With Radius Of 6in. 6 Mike and John are playing a friendly game of darts where the dart board is a disk of a radius of 10 inches. Geometric Probability Problem Class in. Assuming he hits the map, what is the probability that he hit Erie County? Bert throws a dart at a scale map of Oneida County. No dart's strike affects any other. For one throw of the dart, what is the probability of winning a point? Note. method of estimating the probability, simulating the darts or counting the squares, produced better results?” their thinking was divided. Students find the the probability of a dart landing on a particular region of dart board. (a) Using the fact - 2237296. Pr(n)=1/20," "n=1,2,,20. Write your answer as a percent. a) 2/3*3/5=2/5. Matthew is playing darts. part b: is the probability of hitting the | {
"domain": "clodd.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986151392226466,
"lm_q1q2_score": 0.8085389568582907,
"lm_q2_score": 0.8198933381139645,
"openwebmath_perplexity": 835.8275025840575,
"openwebmath_score": 0.5500837564468384,
"tags": null,
"url": "http://clodd.it/cfop/probability-darts-answers.html"
} |
c#, design-patterns, email
mailMessage.IsBodyHtml = true;
SmtpClient client = new SmtpClient(ConfigSettings.EmailServer, ConfigSettings.EmailPort);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(ConfigSettings.EmailUser, ConfigSettings.EmailPassword); | {
"domain": "codereview.stackexchange",
"id": 17900,
"lm_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#, design-patterns, email",
"url": null
} |
moveit, catkin, cmake, ros-indigo
Title: Which package should I use in CMakeLists.txt?
I want to use the MoveIt! package on ROS indigo, and I am following the tutorial at http://docs.ros.org/hydro/api/pr2_moveit_tutorials/html/planning/src/doc/move_group_interface_tutorial.html.
As an example of how to use MoveIt! in C++, the tutorial provides the following line:
moveit::planning_interface::MoveGroup group("right_arm"); | {
"domain": "robotics.stackexchange",
"id": 21767,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moveit, catkin, cmake, ros-indigo",
"url": null
} |
computational-chemistry
minimization that P3M uses. However, in 2012 it has been shown that
the SPME influence function can be modified to obtain P3M [100]. This
means that the advantage of error minimization in P3M-AD can be used
at the same computational cost and with the same code as PME, just by
adding a few lines to modify the influence function. However, at
optimal parameter setting the effect of error minimization in P3M-AD
is less than 10%. P3M-AD does show large accuracy gains with
interlaced (also known as staggered) grids, but that is not supported
in GROMACS (yet). | {
"domain": "chemistry.stackexchange",
"id": 530,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-chemistry",
"url": null
} |
java
this.amount == aFood.getAmount();
}
}
Scanner scan = null;
try
{
scan = new Scanner(new File(IN_FILE_NAME));
BufferedReader in = new BufferedReader(new FileReader(IN_FILE_NAME));
String str;
List<String> list = new ArrayList<String>();
while((str = in.readLine()) != null){
list.add(str);
}
in.close();
} | {
"domain": "codereview.stackexchange",
"id": 26832,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
You are right. From
$$\ln \frac{x+1}{x-1} = 2.$$
we can write it as
$$e^{\ln \frac{x+1}{x-1}}=e^{2}$$
then
$$\frac{x+1}{x-1}=e^{2}$$
You can find the solution for $x$
-
Why not take the exponential of both sides immediately? We get $$x+1=(e^2)(x-1),$$ and it's over.
-
That would be a better way to do it. Most College Algebra texts I've seen have you "collect the logs" first. I suppose the authors want to give the student practice using the rules of logarithms. – David Mitra Dec 6 '11 at 16:39
That would be correct David, as we just went over the rules of logs the previous week. – erimar77 Dec 6 '11 at 16:44
Yes, you use the fact that $$\ln u=v\iff u=e^v.$$ So applying this to what you have (with $u={x+1\over x-1}$ and $v=2$): $$\tag{1}{x+1\over x-1}=e^2.$$ Multiplying both sides by $x-1$ gives $$\tag{2}x+1=e^2(x-1).$$ (note, here that $x=1$ is not a solution of (2); so (1) and (2) are equivalent equations)
Solving for $x$ in (2): | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713883126863,
"lm_q1q2_score": 0.8145354770784841,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 700.6173850014615,
"openwebmath_score": 0.9006146192550659,
"tags": null,
"url": "http://math.stackexchange.com/questions/88918/solving-a-logarithmic-equation?answertab=votes"
} |
lidar, roslaunch, ssh
NODES
/
lidar_driver (xv_11_laser_driver/neato_laser_publisher)
lidar_rotator (neato_real/lidar_rotator_raspi.py)
ROS_MASTER_URI=http://movies-PC:11311
core service [/rosout] found
process[lidar_driver-1]: started with pid [6349]
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
process[lidar_rotator-2]: started with pid [6350]
[lidar_driver-1] process has died [pid 6349, exit code -6, cmd /home/pi/catkin_ws/devel/lib/xv_11_laser_driver/neato_laser_publisher _port:=/dev/ttyUSB0 __name:=lidar_driver __log:=/home/pi/.ros/log/51d2060c-47c1-11e7-8a35-c417feb194f9/lidar_driver-1.log].
log file: /home/pi/.ros/log/51d2060c-47c1-11e7-8a35-c417feb194f9/lidar_driver-1*.log
^C[lidar_rotator-2] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
Thanks is advance,
Steve | {
"domain": "robotics.stackexchange",
"id": 28041,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lidar, roslaunch, ssh",
"url": null
} |
This number (of rice on the last square), as huge as it may look like, doesn't scar me. Indeed, there is 100 000 times more atoms of lead in a mole of lead, namely a small fragment of lead that you could have in one hand.
3. Originally Posted by arbolis
Welcome to MHF.
If you call "n" the nth square, there are $2^{n-1}$ grains in the nth's square.
So in the last square there is $2^{63}$ grains. To see how big or how small this number is, go there: http://www.wolframalpha.com/input/?i=2^63.
I don't really know the number of rice's grains in the world, though it shouldn't be so hard calculating it. If you can give us the rice world production in tons by year, we will have the order of magnitude of the number of rice grains in the world, assuming that 1 kilo contains a certain number of grains.
Notice also that on the 63 th square there is half of the grains in the 64th square and that you also have to sum it up. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964173268185,
"lm_q1q2_score": 0.8490428240397888,
"lm_q2_score": 0.8615382147637196,
"openwebmath_perplexity": 679.7921583683935,
"openwebmath_score": 0.6937201619148254,
"tags": null,
"url": "http://mathhelpforum.com/math-puzzles/133126-grains-rice-chess-board.html"
} |
c, strings, memory-management, priority-queue
The intent may have been to NULL out the pointer, but this line doesn't actually cause the pointer (in the caller) to be NULLed. It only affects the local copy inside of pq_free(), which isn't going to be used again. The compiler is probably optimizing that line out anyway, but the line may be misleading in the sense that it may suggest that the caller's copy is being NULLed when it isn't.
Make pq_adjust() do more
The current pq_adjust() function does one level of adjustment, and depends on the caller to call it in a loop. But the three call sites for this function all have the same loop, which adjusts from the top of the heap to as far down as necessary.
If you modified pq_adjust() to always start at the top of the heap and adjust as far down as necessary (using a loop), you could avoid the three loops at the call sites. It would also get rid of all the ugly *i pointer indirections.
Duplicated code | {
"domain": "codereview.stackexchange",
"id": 20422,
"lm_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, strings, memory-management, priority-queue",
"url": null
} |
representation-theory, noethers-theorem, classical-field-theory
The lowest non-trivial irreducible representation (labelled as "spin-1" in the usual diction) of $\mathrm{SO}(3)$, which is its fundamental representation, is the vector representation (let's call its representation space $V$). The tensor representations of rank $(k,l)$ are now $V\otimes\dots\otimes V\otimes V^*\otimes\dots\otimes V^*$ with $k$ factors of $V$ and $l$ factors of $V^*$. They are not irreducible, and split at least into the trace, symmetric traceless tensor and antisymmetric tensor representations.
The irreducible representations of higher spin do not usually play a special role, but they are not for "vectors"! For instance, the "next" representation labelled as "spin-2" is five-dimensional, and is that of the symmetric traceless matrices/rank-2 tensors. | {
"domain": "physics.stackexchange",
"id": 24632,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "representation-theory, noethers-theorem, classical-field-theory",
"url": null
} |
python, beginner, game-of-life
self.state.board = new_board
def neighbours(self, x, y):
count = 0
for hor in [-1, 0, 1]:
for ver in [-1, 0, 1]:
if not hor == ver == 0 and (self.infinite_board == True or (0 <= x + hor < self.width and 0 <= y + ver < self.height)):
count += self.state.board[(y + ver) % self.height][(x + hor) % self.width]
return count
def display(self):
return self.state.display()
class State(object):
def __init__(self, positions, x, y, width, height):
active_cells = []
for y, row in enumerate(positions.splitlines()):
for x, cell in enumerate(row.strip()):
if cell == 'o':
active_cells.append((x,y))
board = [[False] * width for row in range(height)]
for cell in active_cells:
board[cell[1] + y][cell[0] + x] = True
self.board = board
self.width = width
self.height = height | {
"domain": "codereview.stackexchange",
"id": 16283,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, game-of-life",
"url": null
} |
thermodynamics, entropy
ADDENDUM 1:
Found a little more time to bring this to the next level. This will tie in what I said above to the actual second law and the property of entropy.
So we needed a new law and property that would be violated if heat flowed naturally from a cold body to a hot body. The property is called entropy, $S$, which obeys the following inequality:
$$\Delta S_{tot}=\Delta S_{sys}+\Delta S_{surr}≥0$$
Where $\Delta S_{tot}$ is the total entropy change of the system plus the surrounding (entropy change of the universe) for any process where the system and surroundings interact. The equality applies if the process is reversible, and the inequality if it is irreversible. Since all real processes are irreversible (explained below), the law tells us that the total entropy of the universe increases as a result of a real process.
The property of entropy is defined as
$$dS=\frac {dQ_{rev}}{T}$$ | {
"domain": "physics.stackexchange",
"id": 57511,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, entropy",
"url": null
} |
c#, asp.net
/* update our DataTable to the POST'ed data */
int numPostedRows = dt.Rows.Count - 1;
for (int i = 0; i < numPostedRows; i++)
{
TextBox tbName =
(TextBox)NameLinksGridView.Rows[i].Cells[0].FindControl("Name");
string name = tbName.Text; // get POST'ed value
dt.Rows[i]["Name"] = name; // set DataTable val to the POST'ed value
TextBox tbLink =
(TextBox)NameLinksGridView.Rows[i].Cells[1].FindControl("Link");
string link = tbLink.Text;
dt.Rows[i]["Link"] = link;
}
/* store our DataTable in the ViewState for preservation across PostBack */
ViewState["CurrentTable"] = dt;
/* bind the displayed DataGrid to our DataTable */
NameLinksGridView.DataSource = dt;
NameLinksGridView.DataBind(); | {
"domain": "codereview.stackexchange",
"id": 978,
"lm_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",
"url": null
} |
orbit, orbital-mechanics, orbital-elements, python, eccentricity
It is my understanding that eccentricity varies as $0 ≤ e < 1$ for elliptical orbits (circular orbits being $e=0$), $e=1$ for parabolic orbits, and $e>1$ for hyperbolic orbits. So something must be off. Do I need to consider the coordinates from a specific reference frame? Or maybe I missed an assumption for the equations used to hold? Can someone point to the cause of this error? Less importantly, is the equation used to calculate eccentricity generalizable to all orbits or just elliptical ones? You are doing many things wrong.
You are computing the eccentricity of one body with respect to the center of mass. You need to compute the eccentricity of one body with respect to the other. | {
"domain": "astronomy.stackexchange",
"id": 4828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit, orbital-mechanics, orbital-elements, python, eccentricity",
"url": null
} |
ros-kinetic
Where/how do I get these sources.
Thanks and regards.
See detail:
jac@tros:~$ sudo apt install ros-kinetic-librealsense
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ros-kinetic-librealsense
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/325 kB of archives.
After this operation, 1,231 kB of additional disk space will be used.
Selecting previously unselected package ros-kinetic-librealsense.
(Reading database ... 332686 files and directories currently installed.)
Preparing to unpack .../ros-kinetic-librealsense_1.12.1-0xenial-20190607-170900-0800_amd64.deb ...
Unpacking ros-kinetic-librealsense (1.12.1-0xenial-20190607-170900-0800) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Setting up ros-kinetic-librealsense (1.12.1-0xenial-20190607-170900-0800) ... | {
"domain": "robotics.stackexchange",
"id": 33299,
"lm_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-kinetic",
"url": null
} |
c#, asp.net
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (PersonId != 0)
{
var person = GetPersonById(PersonId);
if (person != null)
{
BindFormToData(person);
ViewState.Add("PersonEntity", person);
}
}
}
}
protected bool BindDataToForm(PersonEntity person)
{
person.FirstName = txtFirstName.Text;
person.Lastname = txtLastName.Text;
ViewState.Add("PersonEntity", person);
// internal entity validation
return person.Validate();
}
protected void BindFormToData(PersonEntity person)
{
txtFirstName.Text = person.FirstName;
txtLastName.Text = person.Lastname;
} | {
"domain": "codereview.stackexchange",
"id": 727,
"lm_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",
"url": null
} |
machine-learning, python, scikit-learn, linear-regression, data-science-model
Title: How to use a a trained model I just trained my first model in Python 3.7/scikitlearn (Linear Regression) (well I copied most of the code but its something ^^).
Now I want to actually Use the model. Specifically its about sons heights incorrelating to their fathers. So I now want to enter a new Father-height and get a predictions for its sons height.
How could something like this look like?
I read about "Pickle" to save a model and use it later, seems awsome but how would I use such a saved model?
If anybody can give me a simple answer or even just a link to atutorial would be great. Below is a piece of "my" code just for some context.
#Spliting the data into test and train data
X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=0)
#Doing a linear regression
lm=LinearRegression()
lm.fit(X_train,y_train) | {
"domain": "datascience.stackexchange",
"id": 5978,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, python, scikit-learn, linear-regression, data-science-model",
"url": null
} |
finite-automata, pushdown-automata
Title: Why DFA's configuration space is finite and PDA configuration space is infinite? I read from this post the term configuration space. I don't know the meaning of configuration space.
What is the exactly meaning of configuration space?
And why DFA's configuration space is finite and PDA's configuration space is infinite? Give one example for both the cases then it could be better for me. A Configuration just Means "State"
A configuration of a machine $M$ is a snapshot of the machine at a particular moment during a computational process by the machine. It includes all setting/details of the machine. It means, basically, the "state" of a machine, where "state" is in the usual sense of plain English as in "the state of a game", "the state of a kitchen" or "the state of an electrical motor". (In fact, had we not used "state" in the definition of a DFA or a PDA, we would have preferred to use "state" instead of "configuration"!) | {
"domain": "cs.stackexchange",
"id": 19912,
"lm_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-automata, pushdown-automata",
"url": null
} |
three columns. The transpose of a matrix is a new matrix that is obtained by exchanging the rows and columns. Transpose (const vtkMatrix4x4 *in, vtkMatrix4x4 *out). To find the conjugate trans-pose of a matrix, we first calculate the complex conjugate of each entry and then take the transpose of the matrix, as shown in the following example. Free matrix transpose calculator - calculate matrix transpose step-by-step. The Matrix, Inverse. Now fold is over the main diagonal. The equation "C = A” should appear on your screen with the inverted L cursor around the A as shown in figure 6A. The original matrix and the transpose are both printed. I've been doing some 3D graphics in OpenGL lately and I needed a way to work with 4x4 matrices. Their values should be less than The program below then computes the transpose of the matrix and prints it on the screen. Interface 4x4 Matrix Keypad With Microcontroller. •Compute the cofactor matrix by alternating + and –signs. Obviously unitary matrices | {
"domain": "maboan.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138105645058,
"lm_q1q2_score": 0.821019501314712,
"lm_q2_score": 0.8397339716830606,
"openwebmath_perplexity": 530.073518005604,
"openwebmath_score": 0.5283272862434387,
"tags": null,
"url": "http://maboan.de/transpose-matrix-4x4.html"
} |
## Solution 3
Because the x-intercept of the equation is $\frac{2012}{20}$, and the y-intercept is $\frac{2012}{12}$, the slope is $\frac{\frac{-2012}{12}}{\frac{2012}{20}} = \frac{-5}{3}$. Now, notice the first obvious solution: (100,1). From it, we derive all the other solutions by applying the slope in reverse, i.e: $(100,1), (97,6), (94,11)...$ Because the solutions are only positive, we can generate only 33 more solutions, so in total we have $33+1=\boxed{34}$ solutions.
## Solution 4 (Designed to be very quick)
Note that a positive integer is divisible by 20 if it ends in 0.
Notice that if a multiple of 12 end in 2, 12 must be multiplied by an integer that ends in 1 or 6.
So let's start checking because 2012 ends in 2, same as 12.
When $n=1$, $m=100$. | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526441330527,
"lm_q1q2_score": 0.825951876064618,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 352.3082866165687,
"openwebmath_score": 0.6702089905738831,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2012_AIME_II_Problems/Problem_1&diff=cur&oldid=45847"
} |
python-3.x
if __name__ == '__main__':
for i in range(10):
threading.Thread(target=main, args=(i,)).start()
time.sleep(0.3)
However there is some script where I will use that I will not use the AvailableProxies and only ProxyManager (But the AvailableProxies should be available to import at any time to my scripts of course :) (If thats matters)
There is somethings I am concern about is that I am not sure if this method to set a proxy to "available" and "busy" is a valid way to do (but hey, it works!).
I am looking forward for any code review and I do hope this time I will not get shocked as I got on my previous review :) Availability of proxies
Documentation
The threading name refers to the module, the threading.Lock name refers to a class inside that module. Thus, the type of proxy_lock is wrong, since it's an instance of threading.Lock. You can replace it with
proxy_lock: threading.Lock = threading.Lock() | {
"domain": "codereview.stackexchange",
"id": 41931,
"lm_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-3.x",
"url": null
} |
% Back substitution
x3 = (b3_dash2 ) / i_dash2;
x2 = (b2_dash - f_dash*x3) / e_dash;
x1 = (b1 - b*x2 - c*x3) / a;
x = [x1 ; x2 ; x3];
• Assuming I haven't mis-counted, approximating $A^{-1}b$ by $2b - Ab$ is going to require 12 multiplications, 9 addition/subtractions, and no divisions. Approximating $A^{-1}b$ by $3(b - Ab) + A^2b$ is going to require 21 multiplications and 18 addition/subtractions. Calculating $A^{-1}b$ via this explicit formula looks to be 33 multiplications, 17 additions/subtractions, and 1 division. Like I said, my numbers might be off, so you might want to double check. Oct 10, 2014 at 23:19 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104972521579,
"lm_q1q2_score": 0.8053336405282908,
"lm_q2_score": 0.8333245994514084,
"openwebmath_perplexity": 8778.882659154056,
"openwebmath_score": 0.42442137002944946,
"tags": null,
"url": "https://scicomp.stackexchange.com/questions/14817/fast-explicit-solution-for-mathbfa-mathbfx-mathbfb-mathbfb-in/14820"
} |
Note that $a=f(0)$.
Since the derivative of $x\mapsto Tx+a$ is $T$ and the derivative is linear, all you need to show is that a function with zero derivative is constant. This can be done by using the Mean Value Theorem on the component functions of $f$.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759615719876,
"lm_q1q2_score": 0.8236748590710499,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 196.7134355642203,
"openwebmath_score": 0.9844304919242859,
"tags": null,
"url": "http://math.stackexchange.com/questions/121139/derivative-is-a-constant"
} |
digital-communications, demodulation, phase, bpsk, qpsk
Title: How to perform carrier phase recovery in software? What are the options for recovering the phase of a BPSK signal in software? The only resources I can find online contain circuit diagrams – there seems to be no one willing to explain this to people unfamiliar with analog circuits.
I'd like any explanation of how carrier recovery works in theory, and would also love pseudocode or code examples. To demodulate a phase-shift keyed signal, of which BPSK is the simplest, you have to recover the carrier frequency, phase, and symbol timing.
Bursty Signals | {
"domain": "dsp.stackexchange",
"id": 823,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "digital-communications, demodulation, phase, bpsk, qpsk",
"url": null
} |
python
listen() #!/usr/bin/python
# -*- coding: utf-8 -*-
import wx, sqlite3, datetime, threading
from appscript import *
import * is frowned upon as it makes it difficult to trace where names came from.
it = app('iTunes')
I recommend avoiding abbreviated names like it its hard to figure out what it means later.
from AppKit import *
# Create the DB
Tapedeck = sqlite3.connect('Tapedeck.db', check_same_thread = False)
TapedeckQuery = Tapedeck.cursor()
Tapedeck.execute('''CREATE TABLE IF NOT EXISTS plays (id INTEGER PRIMARY KEY, track_id TEXT, track TEXT, artist TEXT, album TEXT, genres TEXT, play_count INTEGER, rating INTEGER, skip_count INTEGER, year_released INTEGER, date_played DATE)''')
Tapedeck.commit()
Generally, performing actions at the module level is frowned upon. You should do it in a main function.
def getSec(s): | {
"domain": "codereview.stackexchange",
"id": 1080,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python",
"url": null
} |
c++, calculator
else if (function == "sqrt")
argument = sqrt(argument);
else if (function == "cbrt")
argument = cbrt(argument);
else if (function == "sin")
argument = sin(argument);
else if (function == "cos")
argument = cos(argument);
else if (function == "tan")
argument = tan(argument);
else if (function == "cot")
argument = 1 / tan(argument);
else if (function == "sec")
argument = 1 / cos(argument);
else if (function == "csc")
argument = 1 / sin(argument);
else if (function == "arctan")
argument = atan(argument);
else if (function == "arcsin")
argument = asin(argument);
else if (function == "arccos")
argument = acos(argument);
else if (function == "arccot")
argument = atan(1 / argument);
else if (function == "arcsec")
argument = acos(1 / argument);
else if (function == "arccsc")
argument = asin(1 / argument); | {
"domain": "codereview.stackexchange",
"id": 37688,
"lm_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++, calculator",
"url": null
} |
automata, finite-automata, regular-expressions
Is this some kind of extension of Thompson's construction algorithm? It's technically an "extension" in the sense that Ken Thompson's original paper (ACM DL subscription required) doesn't mention it. This is presumably because his regular expression compiler didn't support "+" syntax in 1968.
However, pretty much every textbook presentation of Thompson's algorithm (e.g. see Bruce Watson's 1995 review paper on FA construction) mentions it. It's likely that no one person "extended" the method in Thompson's paper, or the "extension" was done by Thompson when he decided to support "+". | {
"domain": "cs.stackexchange",
"id": 5488,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "automata, finite-automata, regular-expressions",
"url": null
} |
Solution 3:
Equation of the tangent at the point $P(a\cos {\theta}, b\sin{\theta})$ on the given ellipse is $\frac{x\cos{\theta}}{a} + \frac{y\sin{\theta}}{b}=1$. Thus,
$d= |\frac{-1}{\sqrt{\frac{\cos^{2}{\theta}}{a^{2}}+\frac{\sin^{2}{\theta}}{b^{2}}}}|$
$\Longrightarrow d^{2}=\frac{a^{2}b^{2}}{b^{2}\cos^{2}{\theta}+a^{2}\sin^{2}{\theta}}$
We know $PF_{1}+PF_{2}=2a$
$\Longrightarrow (PF_{1}-PF_{2})^{2}=(PF_{1}+PF_{2})^{2}-4PF_{1}PF_{2}$…call this equation I.
Also, $(PF_{1}.PF_{2})^{2}=[ (a\cos{\theta}-ae)^{2}+(b\sin{\theta})^ {2}].[(a\cos{\theta}+ae)^{2} + (b\sin{\theta})^{2}]$, which in turn equals,
$[a^{2}(\cos{\theta}-e)^{2}+a^{2}(1-e^{2})\sin^{2}{\theta} ]. [a^{2}(\cos{\theta}+e)^{2}+a^{2}(1-e^{2})\sin^{2}{\theta} ]$, that is, | {
"domain": "mathhothouse.me",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707979895382,
"lm_q1q2_score": 0.8144671267272782,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 488.81700475138933,
"openwebmath_score": 0.9390150308609009,
"tags": null,
"url": "https://mathhothouse.me/category/iitjee-mains/page/2/"
} |
linux, c++14, windows, networking, framework
int yes = 1;
rv = setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
if (rv != 0) {
perror("WW setsockopt SO_REUSEADDR");
close(sockfd);
continue;
}
rv = bind(sockfd, p->ai_addr, p->ai_addrlen);
if (rv != 0) {
perror("WW bind");
close(sockfd);
continue;
}
break; // exit loop after socket and bind were successful
}
freeaddrinfo(res);
assert(p != nullptr && "bind");
rv = listen(sockfd, 10);
assert(0 == rv && "listen");
// add the listener to the master set
FD_SET(sockfd, &fds);
printf("II %s: listen on socket %d\n", FUNCTION, sockfd);
} | {
"domain": "codereview.stackexchange",
"id": 43481,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linux, c++14, windows, networking, framework",
"url": null
} |
localization, navigation, robot-localization
0.0, 0.0, 0.0, 0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.04, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, | {
"domain": "robotics.stackexchange",
"id": 35755,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "localization, navigation, robot-localization",
"url": null
} |
to be true, a conditional proposition must have the same truth value as Given the truth table, which of the following correctly fills in the far right column? In the truth table above, when p and q have the same truth values, the compound statement (pq)(qp) is true. Notice that the truth table shows all of these possibilities. Is this statement biconditional? Make a truth table for ~(~P ^ Q) and also one for PV~Q. If I get money, then I will purchase a computer. 1. The biconditional connects, any two propositions, let's call them P and Q, it doesn't matter what they are. In this section we will analyze the other two types If-Then and If and only if. We can use the properties of logical equivalence to show that this compound statement is logically equivalent to $$T$$. Biconditional statement? text/html 8/18/2008 11:29:32 AM Mattias Sjögren 0. A double implication (also known as a biconditional statement) is a type of compound statement that is formed by joining two simple statements | {
"domain": "wildjusticemusic.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.952574129515172,
"lm_q1q2_score": 0.8564797613501972,
"lm_q2_score": 0.899121375242593,
"openwebmath_perplexity": 734.4940030100662,
"openwebmath_score": 0.5925559997558594,
"tags": null,
"url": "http://wildjusticemusic.com/american-satan-mkkicgb/biconditional-statement-truth-table-ad83f6"
} |
gazebo-camera, gazebo-ignition
Title: How to trigger a stereo camera on Gazebo Ignition with ROS2?
Hello,
I'd like to trigger a stereo acquisition from ROS Galactic with Gazebo Ignition (Fortress).
I don't find any documentation. Could someone provide me an example ?
I've found https://github.com/ros-simulation/gazebo_ros_pkgs/blob/galactic/gazebo_plugins/include/gazebo_plugins/gazebo_ros_camera.hpp but I'm not sure if those plugins are for ignition or gazebo classic...
Thanks in advance
Update
Ignition plugins are here: https://github.com/gazebosim/gz-sim/. Sensors have been fused into a single Sensor.cc.
To create a stereo camera you need two tags with type "camera" as described here: https://github.com/gazebosim/gz-sim/blob/3b6c0f2a0bc71c5ff391852615609deec3c03674/src/systems/sensors/Sensors.cc#L739-L770
The Load() function parses the tag: https://github.com/gazebosim/sdformat/blob/a51a76edd3b5d423b24034c4288fcda1d122c700/src/Camera.cc#L201-L404 | {
"domain": "robotics.stackexchange",
"id": 4665,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo-camera, gazebo-ignition",
"url": null
} |
newtonian-mechanics, reference-frames, coriolis-effect
Title: What does the term "Coriolis Effect" refer to? I am familiar with Coriolis Effect referring to the effect that deflects eastward a projectile moving north on the rotating Earth. That is, as something applicable to north/south motion only.
There is also a phenomenon where a projectile shot straight up into the sky will land slightly west of where it was launched, since it was not rotating with the Earth during the time it was in the air.
Recently, I've seen this second phenomenon referred to as "the Coriolis Effect." An example would be this Quora question.
Is this usage correct? There are usually three fictitious forces that classically arise in a rotating reference frame: | {
"domain": "physics.stackexchange",
"id": 60737,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, reference-frames, coriolis-effect",
"url": null
} |
performance, beginner, php, object-oriented, array
$index_data[$sector_mover["sector"]] = array("sector_weight" => $sector_mover["sector_weight"], "sector_coefficient" => $sector_mover["sector_coefficient"], "sector_value" => $index_value);
$index_data["Overall"]["sector_value"] += $index_data[$sector_mover["sector"]]["sector_value"];
}
// Calculate the index factor for better visibility between -1 and +1
$front_index_data = array();
foreach ($index_data as $sector_name => $sector_index_data) {
// $index_sign = $sector_index_data["sector_value"];
// if ($index_sign < 0) {
// $index_sign = - $index_sign;
// }
$index_sign = abs($sector_index_data["sector_value"]); | {
"domain": "codereview.stackexchange",
"id": 34035,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, beginner, php, object-oriented, array",
"url": null
} |
mass, temperature, water, physical-chemistry, home-experiment
From my guess, the hot water warms the scale and it sensors(Digital) or mechanical parts(Analog). A sensor is normaly calibrated for a specific temperature, so an increase in temperature of the scale and the sensor should result in a slowly changing reading. | {
"domain": "physics.stackexchange",
"id": 64506,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mass, temperature, water, physical-chemistry, home-experiment",
"url": null
} |
black-holes, gravitational-waves, perturbation-theory
\begin{equation}
r\left(r+2M\right)\partial_v^2\Psi
-4Mr\partial_v\partial_r\Psi
-r\left(r-2M\right)\partial_r^2\Psi
+2\left(sr+\left(1+s\right)M\right)\partial_v\Psi
+2\left(sr-\left(1+s\right)M\right)\partial_r\Psi
+\left(\left(l-s\right)\left(l+s+1\right)+\frac{2(1+s)M}{r}\right)\Psi
=
0
.
\end{equation} | {
"domain": "physics.stackexchange",
"id": 61232,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-holes, gravitational-waves, perturbation-theory",
"url": null
} |
algorithm, c, strings, pointers
It's now impossible to use next outside of its loop. Also, we should try to initialize our variables whenever possible.
Use const type* for inputs that are not supposed to change
That way we cannot accidentally modify your input values, e.g.
str[i][k] = '\0'
would not compile if str was const char**.
Check malloc's return
We should really check whether malloc returns NULL.
Split functions
find_first_recurring_letter doesn't follow its name completely. We find the first recurring letter on a set of strings on a per-string basis. That sounds perfect for a split:
const char * find_first_recurring_letter(const char * haystack) {
for(const char * current = haystack; *current != '\0'; current++) {
for(const char * next = current + 1; *next != '\0'; next++) {
if(*current == *next) {
return current;
}
}
}
return NULL;
} | {
"domain": "codereview.stackexchange",
"id": 29344,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, c, strings, pointers",
"url": null
} |
LCKurtz, I agree that the sets you gave are valid events assuming ##S_1## and ##S_2## are the sample spaces worked with.
The thing is, the book says {king} and {club} and does not mention the sample space sets ##S_1## and ##S_2## that I mentioned above. Given that the book claims that {king} and {club} are events, what is a (correct) sample space that is a superset of the {king} and {club} events? Is there any, or did the book make a mistake?
Mark44, when I try to be mathematically rigorous, what you're saying doesn't sit well with me, because neither {K} (K for king) nor {C} (C for club) is a subset of either ##S_1## or ##S_2##.
LCKurtz
Homework Helper
Gold Member
LCKurtz, I agree that the sets you gave are valid events assuming ##S_1## and ##S_2## are the sample spaces worked with. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9473810525948928,
"lm_q1q2_score": 0.8014298366920297,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 2135.964347277807,
"openwebmath_score": 0.7587580680847168,
"tags": null,
"url": "https://www.physicsforums.com/threads/sample-spaces-events-and-set-theory-intersection.792473/"
} |
graphs, np-complete, dynamic-programming, dag
Title: Maximum Vertex Set With a Minimum Pairwise Distance Requirement in Directed Acyclic Graphs Let $G=(V,E)$ be an unweighted directed acyclic graph with a set $V$ of vertices and a set $E$ of edges. The all-pairs shortest path problem can be solved efficiently using the Floyd-Warshall algorithm. The new objective is to find a subset of maximum cardinality $S \subseteq V$ such that for every pair of vertices $v$ and $u$ in $S$, the length of the shortest path from $v$ to $u$, if it exists, is greater than or equal to a positive natural number $k$.
This problem could be stated as a bottleneck capacity maximization problem in a complete directed weighted graph. You are given a complete weighted directed network and the objective is to find an induced subgraph with $m$ vertices where the minimum arc capacity is greater than or equal to $k$. | {
"domain": "cs.stackexchange",
"id": 21896,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, np-complete, dynamic-programming, dag",
"url": null
} |
classification, categorical-data, missing-data
Your specific situation: all features missing
Your specific situation is especially weird: it appears in your case either all features are missing, or none are. That's a weird one. For instances where the features are missing, you have absolutely no information about those instances. So, the best classification decision in that case is probably a very simple rule: take whichever class appears most frequently in your training set (or, most frequently among instances with missing data). Run the classifier on the remaining instances, i.e., the instances with no missing data.
But in real life this situation is pretty rare. It's more typical that some features are missing and others are present, and that requires more work to handle. | {
"domain": "datascience.stackexchange",
"id": 1566,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, categorical-data, missing-data",
"url": null
} |
javascript, beginner, jquery
Title: jQuery addClass I am a self confessed jQuery novice but I am conscious of learning the correct techniques. When I can see repetition like this I just know that there must be a better way.
jsFiddle
$(document).ready(function() {
var project1 = $('section').eq(0).offset();
var project2 = $('section').eq(1).offset();
var project3 = $('section').eq(2).offset();
var project4 = $('section').eq(3).offset();
var project5 = $('section').eq(4).offset();
var project6 = $('section').eq(5).offset();
var $window = $(window); | {
"domain": "codereview.stackexchange",
"id": 11565,
"lm_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, beginner, jquery",
"url": null
} |
discrete-signals, autocorrelation, correlation
For my data, which is only 0's and 1's, this is even more problematic. Using the above formula the correlations quickly decay to zero, but at the end they violently start to spike, because the contribution from the mean becomes so big, relatively. In my data the mean is 0.5 and the variance is 0.25, so for example, my final point $R(49)$ = $\frac{(0-0.5)(1-0.5)}{0.25}$ = -1
But -1 is huge, especially when 'previously' the correlations had died out to 0. How does one deal with this?
An illustration of this is First: you should really read some basic theory of autocorrelation. For example. | {
"domain": "dsp.stackexchange",
"id": 1705,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "discrete-signals, autocorrelation, correlation",
"url": null
} |
ros
looked in Change List. This list did not help in specific changes e.g. "0.4.1 (2011-03-03)
updated for new ompl_ros_interface"
I also used "svn diff old_url new_url" -> result here. It seems there is no change in class member of versions branches/0.4-branch-old2/, branches/0.4-branch-old1/ and the current branches/0.4-branch/ of class/namespace tabletop_collision_map_processing/
Any comments, hints about my debugging? am I lack of something to use these info source for debugging??
Much thanks!!
Originally posted by roskidos on ROS Answers with karma: 110 on 2012-11-12
Post score: 0
Based on the naming it is probably a service. A service is in two parts a request and a response. You should check out the ROS Service Client Tutorials
Originally posted by tfoote with karma: 58457 on 2013-07-09
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 11721,
"lm_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
} |
quantum-mechanics, operators, wavefunction, schroedinger-equation, calculus
Title: How to prove the Jackson-Feenberg identity in quantum mechanics? The Jackson-Feenberg identity for evaluating the expectation of kinetic energy is frequently used in the theory of quantum liquids and is given by:
$$<\hat{T}>=-\frac{\hbar^2}{8m}\int d^3r[(\nabla^2\psi^*)\psi+\psi^*(\nabla^2\psi)-2(\nabla\psi)\cdot\nabla(\psi^*)],$$ where $\psi$ is a normalized eigenstate.
How to prove this? | {
"domain": "physics.stackexchange",
"id": 66039,
"lm_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, operators, wavefunction, schroedinger-equation, calculus",
"url": null
} |
complexity-theory, reductions, complexity-classes, p-vs-np
Title: Implications of polynomial time reductions I'm reviewing for finals and have a sample problem that I think I understand, but would like someone to bless my understanding or smack me and tell me why I'm wrong.
I'm presented with a problem $\Pi$ of unknown complexity class. If I can transform $\Pi$ to some problem $X$, where $X \in {\sf P}$, what does that tell me about $\Pi$?
I think allows me to conclude that $\Pi \in {\sf P}$, right? If I can reduce $\Pi$ to another problem that's deterministically solvable in polynomial time, and the transformation itself can be done "easily" in polynomial time, then I can conclude that $\Pi$ is deterministically solvable in polynomial time, and therefore that $\Pi \in {\sf P}$ correct? | {
"domain": "cs.stackexchange",
"id": 806,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, reductions, complexity-classes, p-vs-np",
"url": null
} |
ros, rqt-gui
Title: rqt_gui error in perspective manager in ROS noetic
I run my code flawlessly in ROS Melodic but in ROS Noetic, I am having the following error (maybe because of python3):
Traceback (most recent call last):
File "/opt/ros/noetic/lib/rqt_gui/rqt_gui", line 13, in <module>
sys.exit(main.main())
File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/main.py", line 61, in main
return super(
File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/main.py", line 614, in main
perspective_manager.import_perspective_from_file(
File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/perspective_manager.py", line 360, in import_perspective_from_file
self._convert_values(data, self._import_value)
File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/perspective_manager.py", line 422, in _convert_values
self._convert_values(groups[group], convert_function) | {
"domain": "robotics.stackexchange",
"id": 35738,
"lm_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, rqt-gui",
"url": null
} |
As an adjunct to Misha Lavrov's answer, this is probably not the first time you have encountered this phenomenon.
In trigomometry, one might be faced with $\cos(\theta) = \frac{\sqrt{2}}{2}$. The solutions to this equation are, of course, $\theta = \pm \cos^{-1}\left( \frac{\sqrt{2}}{2} \right) + 2 \pi k = \pm \frac{\pi}{4} + 2 \pi k$, for any integer $k$. Some people normalize these so that all the particular angles are positive, so $\theta = \frac{\pi}{4} + 2 \pi k$ or $\theta = \frac{7\pi}{4} + 2 \pi k$, for any integer $k$.
Well this means \begin{align*} \left\{\frac{-\pi}{4} + 2 \pi k, k \in \mathbb{Z}\right\} &= \left\{\frac{7\pi}{4} + 2 \pi k, k \in \mathbb{Z} \right\} & &\text{True.} \\ \frac{-\pi}{4} &= \frac{7\pi}{4} & &\text{False.} \\ \end{align*}
Just because two sets are equal, which is what you have at $$\int \tan x \,\mathrm{d}x = -1 + \int \tan x \,\mathrm{d}x \text{,}$$ does not mean that two randomly selected elements of those sets are equal. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226307590189,
"lm_q1q2_score": 0.8323771623527363,
"lm_q2_score": 0.8519527963298947,
"openwebmath_perplexity": 264.9216735899209,
"openwebmath_score": 0.9963399767875671,
"tags": null,
"url": "https://math.stackexchange.com/questions/2523198/fallacious-proof-involving-trigonometry"
} |
general-relativity, special-relativity, spacetime, metric-tensor
$$
(I will suspend the summation convention in what follows...coordinates should be specified with upper indices if we were using the summation convention anyway.) So we write
$$
ds^2=\sum_{\mu\nu}g_{\mu\nu}^\prime dx^{\prime\,\mu}\otimes dx^{\prime\,\nu}=\sum_{\mu\nu}g^\prime_{\mu\nu}\frac{x^{\prime\prime\,\mu}\otimes x^{\prime\prime\, \nu}}{\sqrt{\lambda_\mu}\sqrt{\lambda_\nu}}.
$$
Assuming we have diagonalized $g_{\mu\nu}^\prime$, as you have done, then we see the denominators combine to just be some $\lambda_\mu$, which divides the corresponding diagonal element of $g_{\mu\nu}^\prime$ and hence rescales the eigenvalues as you have described (the elements of a diagonal matrix are the eigenvalues).
You will note that in the above arguments we never changed $ds^2$, we just changed the variables we used to describe it. | {
"domain": "physics.stackexchange",
"id": 74835,
"lm_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, special-relativity, spacetime, metric-tensor",
"url": null
} |
input size, i. Hence time complexity of the Binary search is O(LogN). The best case time in linear search is for the first element i. Most of the time we can speak on sorting integers in linear time, but as we can see later this is not the only case. Hourly Update. Time complexity Posted 28 December 2015 - 04:35 PM Hi guys,lets say I have algorithm ,which finds ,when the number in a list is bigger than the next one. It is easy to see that $$\widetilde{\mathcal {S}}$$ can be obtained in one pass through $$\widetilde{\mathcal {A}}$$ and $$\widetilde{\mathcal {B}}$$, therefore in linear time. Time complexity (linear search vs binary search) 1. I n linear search, we need to write more code whereas in binary search we need to write less code. algorithm solving a Boolean satis ability problem on n variables is improved i it takes time O(2cn) for some constant c < 1, i. now do a linear search starting from X(conservative but accurate second step - slow). So the option is 'B'. 무슨말인지모르겠다면 아래글을 | {
"domain": "marathon42k.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534327754854,
"lm_q1q2_score": 0.8612026083995186,
"lm_q2_score": 0.8774767906859264,
"openwebmath_perplexity": 614.0522630942693,
"openwebmath_score": 0.5858543515205383,
"tags": null,
"url": "http://marathon42k.it/zcy/time-complexity-of-linear-search.html"
} |
E-mail: co92@cornell. VECTOR ANALYSIS 3. For each velocity field in Problem 13, plot the graphs of typical particle paths. This Bregman divergence is coordinate independent, but dependent on not just the function: it depends also on the choice of the flat affine connection $abla$. Derive and expression for the divergence in polar coordinates (2D). Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites. PARAMETERS. However, if a new stream function is arbitrarily defined as, then the 2D continuity equation becomes. The polar coordinate system is a two-dimensional system in which each point on a plane is determined by a distance from a fixed point and an angle from a fixed axis. 2 Let ${\bf F}=\langle 2x,3y,z^2\rangle$, and consider the three-dimensional volume inside the cube with faces parallel to the principal planes and opposite corners at $(0,0,0)$ and $(1,1,1)$. ) there is a formula for divergence too, and. Let's summarize these results in a theorem. | {
"domain": "cesenaticoopen.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750507184356,
"lm_q1q2_score": 0.8026049069391735,
"lm_q2_score": 0.8128673155708975,
"openwebmath_perplexity": 661.5806275918751,
"openwebmath_score": 0.893095850944519,
"tags": null,
"url": "http://lmhp.cesenaticoopen.it/divergence-in-polar-coordinates-2d.html"
} |
php, http
# Specify content type (json)
CURLOPT_HTTPHEADER => array('Content-type: application/json'),
# Status 400 "Referrer http header is missing" without this line, but it needs to be the originating website
CURLOPT_REFERER => (empty($curl_ref) ? $curl_ref : $_SERVER['HTTP_REFERER'])
);
}
/**
* Wrap our cURL call in a function.
*
* @param array $options
* @return
*/
private function curl ($options){
$cUrl = curl_init();
curl_setopt_array( $cUrl, $options );
$response = curl_exec( $cUrl );
curl_close( $cUrl );
return $response;
} | {
"domain": "codereview.stackexchange",
"id": 6429,
"lm_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, http",
"url": null
} |
javascript, form
</form> Testability
Writing good code essentially boils down to, how well can your code be tested?
When mixing concepts such as DOM manipulation with domain logic, it greatly increases the difficulty to write proper tests for your code.
Your generatePassword method should be an independant and straight forward function with no concept of DOM manipuation.
const includeSymbols = symbols.checked; | {
"domain": "codereview.stackexchange",
"id": 43631,
"lm_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, form",
"url": null
} |
The outer circle surrounding it is called a circumscribed circle (or circumcircle) and the inner circle which is surrounded by the octagon is called the inscribed circle (or incircle). Also, we’ll use some basic operation of linear algebra. The segments are called edges or sides, and the points where two edges meet are the vertices. Depending upon the number of sides, the shape of a polygon differs. Area of a polygon calculator finds the primerer and area of a regular polygon. To find the area of a regular polygon, all you have to do is follow this simple formula: area = 1/2 x perimeter x apothem. Area = ½ * R² * Sin(2π / N) Polygon Volume Calculator . It's just going to be base times height. (See also: Computer algorithm for finding the area of any polygon.) You can calculate the area of a polygon by adding the areas of the trapezoids defined by the polygon’s edges dropped to the X-axis. A rectangle is a quadrilateral with four right angles. Active 2 years, 10 months ago. Case 1: Find | {
"domain": "tjoget.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540692607816,
"lm_q1q2_score": 0.8096435638103112,
"lm_q2_score": 0.8267117983401363,
"openwebmath_perplexity": 730.2853301703782,
"openwebmath_score": 0.5794916152954102,
"tags": null,
"url": "https://tjoget.com/2o423/cada66-find-the-area-of-a-polygon-calculator"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.