text stringlengths 1 1.11k | source dict |
|---|---|
Maclaurin series and Taylor series respectively. If it is true, explain why. Keirstead AP Calculus 2. 7: Taylor and Maclaurin Series Taylor and Maclaurin series are power series representations of functions. h header file and power function pow(i, j). 2 Properties of Power Series 10. Spring 03 final with answers. 5: Taylor Series A power series is a series of the form X∞ n=0 a nx n where each a n is a number and x is a variable. And this is because they are composed of coefficients in front of increasing powers of x. If and the collection of are fixed complex numbers, we will get different series by selecting different values for z. Using Taylor polynomials to approximate functions. In other words, you're creating a function with lots of other smaller functions. Here's a complete rundown of every Power Rangers series in the franchise's history, from a superfan and someone who vaguely remembers yelling "Triceratops. (a) If lim n!1 a n = 0 then P a n converges. Otherwise, in terms of | {
"domain": "yiey.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130567217291,
"lm_q1q2_score": 0.8464479516882558,
"lm_q2_score": 0.8558511396138365,
"openwebmath_perplexity": 416.5164752725799,
"openwebmath_score": 0.9066948294639587,
"tags": null,
"url": "http://vvge.yiey.pw/power-series-and-taylor-series.html"
} |
quantum-algorithms, quantum-state, deutsch-jozsa-algorithm, textbook-and-exercises, oracles
Title: Why is the function $f_s(x)=\sum_i x_i s_i \pmod 2$ balanced?
A parity function $f_s:\{0,1\}^{n}\rightarrow\{0,1\}$, for some $s\in \{0,1\}^n$, is a function of the form $f_s(x) = x \cdot s$, where the inner product is taken modulo 2.
Show that $f_s$ is a balanced function for all $s$
We have $f_s(x) =\sum_i x_is_i \mod 2$. If $s \neq 0^n$, then there exist $i$ such that $s_i \neq 0$. So, for all $x$, $f_s(x) \neq f_s(x^i)$, where $x^i$ the string obtained from by inverting bit $i$. Hence $f_s$ is balanced. | {
"domain": "quantumcomputing.stackexchange",
"id": 1663,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-algorithms, quantum-state, deutsch-jozsa-algorithm, textbook-and-exercises, oracles",
"url": null
} |
javascript, jquery, validation, form, html5
.invalid,.invalid-radio {
border-color: #f7a716!important;
background-color: white;
background-color: rgba(255, 213, 0, 0.13)!important;
background-image: url(http://leftdeaf.com/ppi/quote/new/img/warning.png)!important;
background-position: 98% 50%;
background-size: 28px 28px;
background-repeat: no-repeat;
box-shadow: inset 0 3px 3px -3px white;
color: #b63910!important
}
.invalid-radio {
margin:0;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<form id="step-one" method="get" novalidate autocomplete="off">
<h1>Step 1 — Information</h1>
<p>Fill in all that apply.</p> | {
"domain": "codereview.stackexchange",
"id": 33062,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, validation, form, html5",
"url": null
} |
blast, sequence-homology, refseq
WP_001192973.1 TERDDVNFLKHTLAFRDADGTTRLEYSDVKITTLPPAKRVYGGEADAADKAEAANKKEKA
NP_418578.1 TERDDVNFLKHTLAFRDADGTTRLEYSDVKITTLPPAKRVYGGEADAADKAEAANKKEKA
************************************************************
WP_001192973.1 NG
NP_418578.1 NG
**
So, in summary, RefSeq will combine multiple identical sequences into a single WP_* multi-species accession. You should therefore expect to find one 100% identical WP_* sequence for your query and multiple, almost identical WP_* entries. And that's precisely what you see here. | {
"domain": "bioinformatics.stackexchange",
"id": 117,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "blast, sequence-homology, refseq",
"url": null
} |
ros2
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
from /home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:1:
/usr/include/c++/11/bits/std_function.h:469:7: note: candidate: ‘std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(const std::function<_Res(_ArgTypes ...)>&) [with _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
469 | operator=(const function& __x)
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:469:33: note: no known conversion for argument 1 from ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’ to ‘const std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&’
469 | operator=(const function& __x) | {
"domain": "robotics.stackexchange",
"id": 38287,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
turtlebot, rosnode, ros-electric, rostopic, topics
Originally posted by McMurdo on ROS Answers with karma: 1247 on 2012-05-16
Post score: 0
The temporary solution is to reinstall the ubuntu installation. I did that. Now everything seems to work so fine.
Originally posted by McMurdo with karma: 1247 on 2012-05-17
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Hordur on 2012-05-18:
I have similar errors with Fuerte on Ubuntu 12.04. Did you reinstall Ubuntu or ROS?
Comment by McMurdo on 2012-05-20:
I reinstalled ubuntu. Just reinstalling ROS did not work. I suggest you get back to 11.10. 12.04 is not supported by electric and fuerte is not yet full-fledged! | {
"domain": "robotics.stackexchange",
"id": 9412,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turtlebot, rosnode, ros-electric, rostopic, topics",
"url": null
} |
c++, binary-tree
bool BinarySearchTree::Search(string s, Node* &c, Node* &p)
{
Node* n = root;
Node* prev_n = NULL;
while(n)
{
if(s > n->word)
{
prev_n = n;
n = n->right;
}
else
{
if(s < n->word)
{
prev_n = n;
n = n->left;
}
else
{
c = n; //we use identical code to the 1st definition of search with the exception that instead of printing the node's content we store the node's and the node's parent's adress in the parameters
p = prev_n;
return true;
}
}
}
return false;
}
bool BinarySearchTree::Delete(string s)
{
Node* c = NULL;
Node* p = NULL;
if(!(Search(s, c, p)))
return false;
return Delete(c, p);
}
bool BinarySearchTree::Delete(Node* c, Node* p)
{ | {
"domain": "codereview.stackexchange",
"id": 37737,
"lm_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++, binary-tree",
"url": null
} |
- Duration:. Angles Games. The area of. 1165 1225 112. You can also design in the four standard shapes for roll labels. 28 square cm. The rectangle is 95m long and 74m wide. the diagram shows a square with a semi-circle on its left and on its bottom. Read customer reviews and common Questions and Answers for Orren Ellis Part #: W001872817 on this page. A square will be cut from each corner of the cardboard and the sides will be turned up to form the box. And now all you have to do is subtract area of the semi-circle from the area of the rectangle. If two identical circles are cut out of the wood and the area of EACH circle is x2 – 2, find the area of the remaining piece of wood. I only want the sides of the circle. Hence the shaded area = Area of the square - The area of the circle = 144 - 113. Tie the ribbon to zipper pull. Perimeter, Area and Volume Short Problems This is part of our collection of Short Problems. Record the length (l) and width (w) of a square or rectangle. The | {
"domain": "aidmbergamo.it",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773708026035286,
"lm_q1q2_score": 0.8326737956770336,
"lm_q2_score": 0.8519528038477824,
"openwebmath_perplexity": 642.7273038915572,
"openwebmath_score": 0.544926106929779,
"tags": null,
"url": "http://aidmbergamo.it/vuzw/area-of-a-rectangle-with-a-semi-circle-cut-out.html"
} |
c#, programming-challenge, dijkstra
bool[] visited = new bool[N + 1];
while (true)
{
int candNode = -1;
int candDist = int.MaxValue;
// find a vertex which is not visited
// and has the lowest distance from all unvisited vertices
for (int i = 1; i <= N; ++i)
{
if (!visited[i] && _dist[i] < candDist)
{
candDist = _dist[i];
candNode = i;
}
}
// if canNode == -1 there are no more unvisited nodes
if (candNode < 0)
{
break;
} | {
"domain": "codereview.stackexchange",
"id": 37611,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, programming-challenge, dijkstra",
"url": null
} |
beginner, ruby, parsing, unit-testing, xml
MACBETH_URL = "http://www.ibiblio.org/xml/examples/shakespeare/macbeth.xml"
IGNORE_SPEAKERS = %w(ALL)
def initialize(parser)
@parser = parser
@speaker_line_counts = analyze_speaker_line_counts
end
def analyze_speaker_line_counts
speaker_line_counts = Hash.new(0)
speakers = parser.parse(query: '//SPEAKER')
speakers.map do |speaker|
unless IGNORE_SPEAKERS.include? speaker.text
speaker_line_counts[speaker.text] += parser.parse(
node: speaker, query: '../LINE').count
end
end
speaker_line_counts
end
private
attr_reader :parser
end
if __FILE__ == $0
analyzer = MacbethAnalyzer.new(XmlParser.new(MACBETH_URL))
Printer.print_hash_val_capitalized_key(
hash: analyzer.speaker_line_counts, filter: 'ALL')
end
Now MacbethAnalyzer doesn't depend on a lower-level implementation; we use duck typing to make things flexible, removing the dependency and resulting in much more loosely coupled code. | {
"domain": "codereview.stackexchange",
"id": 22637,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, ruby, parsing, unit-testing, xml",
"url": null
} |
common-lisp
EDIT the Second:
...
(let ((valid-xhtml (chtml:parse body (cxml:make-string-sink))))
(let ((xhtml-tree (chtml:parse valid-xhtml (cxml-stp:make-builder))))
...
You use this nested let idiom in a couple of places. I assume this is just because the value of xhtml-tree depends on the value of valid-html. In this case, you can instead write
...
(let* ((valid-xhtml (chtml:parse body (cxml:make-string-sink)))
(xhtml-tree (chtml:parse valid-xhtml (cxml-stp:make-builder))))
... | {
"domain": "codereview.stackexchange",
"id": 17869,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "common-lisp",
"url": null
} |
quantum-mechanics, homework-and-exercises, quantum-information, quantum-entanglement
i.e. here $|0\rangle$ and $|1\rangle$ are two orthogonal states that depend on $|\Psi\rangle$. In general if $H_A$ and $H_B$ are two Hilbert spaces , and $|v\rangle\in H_A\otimes H_B$, you can find $|\psi_1\rangle\dots|\psi_n\rangle$ and $|\phi_1\rangle\dots|\phi_n\rangle$ bases of $H_A$ and $H_B$ such that
$$ |v\rangle=\sum_k a_k |\psi_k\rangle|\phi_k\rangle $$
for some coefficients $a_k$. This is the Schmidt decomposition and is easy to prove by writing
$$ |v\rangle=\sum_{ij} b_{ij} |\eta_i\rangle|\gamma_j\rangle $$
for some orthonormal bases $|\eta_i\rangle$ of $H_A$ and $|\gamma_i\rangle$ of $H_B$, and taking a singular value decomposition of $b_{ij}$. Notice though that the two bases $|\psi_i\rangle$ and $|\phi_i\rangle$ depend on $|v\rangle$. For two qubits, calling $|\psi_i\rangle=|i\rangle_A$ and $|\phi_i\rangle=|i\rangle_B$, we get
$$ |v\rangle=a_0|0\rangle_A|0\rangle_B + a_1 |1\rangle_A|1\rangle_B $$ | {
"domain": "physics.stackexchange",
"id": 68121,
"lm_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, homework-and-exercises, quantum-information, quantum-entanglement",
"url": null
} |
java, performance, beginner, formatting, complexity
/**No parameters or returns, Print circuit Characteristics */
protected void printCharacteristics() {
System.out.println("Ground voltage is located at Node "+this.ground+".");
System.out.println("Total voltage in circuit is: "+this.totalV+ " Volts.");
System.out.println("Total resistance in circuit is: "+this.totalR+" Ohms.");
System.out.println("Total current is: "+this.totalV/this.totalR+" Amps.");
}
/* get methods for testing private instance variables */
/** get nodeList, no parameters
* @return ArrayList<Node>
*/
public ArrayList<Node> getNodeList(){
return this.nodeList;
}
/** gets the list of components, no parameters
*
* @return ArrayList<Component>
*/
public ArrayList<Component> getComponents(){
return this.components;
}
/** get voltage, no parameters
* @return double
*/
public double getV() {
return this.totalV;
} | {
"domain": "codereview.stackexchange",
"id": 33411,
"lm_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, beginner, formatting, complexity",
"url": null
} |
c#, beginner, console, calculator
result = firstNumber*secondNumber;
break;
case "/":
case "division":
result = firstNumber/secondNumber;
break;
case "^":
case "exposant":
result = Math.Pow(firstNumber, secondNumber);
break;
case "%":
case "reste":
result = firstNumber%secondNumber;
break;
} | {
"domain": "codereview.stackexchange",
"id": 19580,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, console, calculator",
"url": null
} |
php, regex, url
function removeQueryParam($url, $param_to_remove) {
$parsed = parse_url($url);
if ($parsed && isset($parsed['query'])) {
$parsed['query'] = implode('&', array_filter(explode('&', $parsed['query']), function($param) use ($param_to_remove) {
return explode('=', $param)[0] !== $param_to_remove;
}));
if ($parsed['query'] === '') unset($parsed['query']);
return unparse_url($parsed);
} else {
return $url;
}
} | {
"domain": "codereview.stackexchange",
"id": 32162,
"lm_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, regex, url",
"url": null
} |
python, algorithm, time-limit-exceeded
# Instead of only moving the smaller bar inward by one step, there's two
# extra steps here:
# 1. While moving the smaller bar inward, skip all bars that are
# *even smaller*; those are definitely not the target, since both
# their height and horizontal delta will be smaller.
# 2. While skipping all smaller bars, we might hit the other bar:
# there is a 'valley' or at least nothing higher in between.
# Any more moving inwards would be a wasted effort, no matter the
# the direction (from left or right). We can return the current
# max. area.
#
# In the best case scenario, this may skip us right to the solution,
# e.g. for `[10, 1, 1, 1, 1, 1, 10]`: only one outer loop is necessary.
#
# Both loops look very similar, maybe there's room for some indirection | {
"domain": "codereview.stackexchange",
"id": 40693,
"lm_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, time-limit-exceeded",
"url": null
} |
slam
Title: Can anybody help me how to implement localization and mapping in ROS?
I am a new user of ROS. Before implementing SLAM on ROS, I want to go with either implementing mapping with known pose or localization with known map. Please help me how to start with.
...... Thank you
Originally posted by Spartan_007 on ROS Answers with karma: 73 on 2015-06-22
Post score: 0
First, you got to take a look at ROS navigation, the tutorials are very helpful.
For mapping with known pose, you can use gmapping package to handle that for you. But if you are using your own robot, you need to prepare the driver to bridge the robot hardware to ROS topics like /cmd_vel, /odom, etc.
As for localization with known map, amcl is the package you'll probably use.
BTW, please show what survey you did before instead of asking a vague question and looking forward to a detailed answer.
Originally posted by Po-Jen Lai with karma: 1371 on 2015-06-22
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 21973,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "slam",
"url": null
} |
= 1 p ˇ Z 1 1 e p2’(x p 4ktp)dp: ( ). 2D Heat Equation - Exact Solution. The dye will move from higher concentration to lower. Next we will solve Laplaces equation with nonzero dirichlet boundary conditions in 2D using the Finite Element Method. Transfer in a Mechanical Engineering Technology Course Abstract: Multi-dimensional heat transfer problems can be approached in a number of ways. FEM2D_HEAT, a FORTRAN90 program which solves the 2D time dependent heat equation on the unit square. Derivation Of Heat Equation. 10 for example, is the generation of φper unit volume per. The heat equation is a partial differential equation describing the distribution of heat over time. Stability of Finite Difference Methods In this lecture, we analyze the stability of finite differenc e discretizations. The above equation is the two-dimensional Laplace's equation to be solved for the temperature eld. Section 9-5 : Solving the Heat Equation. View License ×. FEM2D_HEAT_SQUARE , a FORTRAN90 library which | {
"domain": "fraggo.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754492759498,
"lm_q1q2_score": 0.8204709378220344,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 727.0711570699918,
"openwebmath_score": 0.7068103551864624,
"tags": null,
"url": "http://psli.fraggo.it/2d-heat-equation.html"
} |
In response to the second question, $$x+T_x(X)$$ is literally a shifted subspace tangent to the manifold $$X$$ at the point $$x$$. $$T_x(X)$$ can be visualized as $$x+T_x(X)$$ but shifted in an affine manner so it passes through the origin. The advantage to calling $$T_x(X)$$ the tangent space is that when it passes through the origin it is a bona fide linear subspace of $$\mathbb{R}^n$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9609517050371973,
"lm_q1q2_score": 0.8109424357859591,
"lm_q2_score": 0.843895100591521,
"openwebmath_perplexity": 104.27980473877577,
"openwebmath_score": 0.8419339060783386,
"tags": null,
"url": "https://math.stackexchange.com/questions/3112802/visualizing-tangent-space-from-its-definition"
} |
speed-of-light
$0 = c^2t^2 - x^2 - y^2 - z^2$
and rearranging this gives:
$c^2 = \frac {x^2 + y^2 + z^2}{t^2}$
but $x^2 + y^2 + z^2$ is just the distance (squared) as calculated by Pythagorus so the right hand side is distance divided by time (squared) so it's a velocity, $v^2$, that is:
$c^2 = v^2$ or obviously $c = v$
So that constant $c$ is actually a velocity, and what's more it's the fastest velocity that anything can travel because if $v > c$ the proper time becomes imaginary. That's why in special relativity there is a maximum velocity for anything to move. Although it's customary to call this the speed of light, in fact it's the speed that any massless particle will move at. It just so happens that light is massless. | {
"domain": "physics.stackexchange",
"id": 20199,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "speed-of-light",
"url": null
} |
c#, iterator, interface
public int Min { get; }
public int Max { get; }
public int Length => Max - Min;
public int Current => _current + Min;
private bool IsLast => _current == Length;
public (int Value, InfiniteCounterState State) Next()
{
if (IsLast)
{
Reset();
}
return
(
Current,
_current++ == 0
? InfiniteCounterState.First
: IsLast
? InfiniteCounterState.Last
: InfiniteCounterState.Intermediate
);
}
public void Reset()
{
_current = 0;
}
public IEnumerator<(int Value, InfiniteCounterState State)> GetEnumerator()
{
while (true)
{
yield return Next();
}
}
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
} | {
"domain": "codereview.stackexchange",
"id": 33767,
"lm_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#, iterator, interface",
"url": null
} |
ros-melodic
// Create an instance of the class that implements the node's behaviour
PickNPlacer pnp(nh);
// Wait until the node is shut down
ros::waitForShutdown();
ros::shutdown();
return 0;
}
tf_example.cpp
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <find_object_2d/ObjectsStamped.h>
#include <geometry_msgs/PoseStamped.h>
#include <QtCore/QString>
class TfExample
{
public:
TfExample() :
objFramePrefix_("object")
{
ros::NodeHandle pnh("~");
pnh.param("target_frame_id", targetFrameId_, targetFrameId_);
pnh.param("object_prefix", objFramePrefix_, objFramePrefix_);
ros::NodeHandle nh;
subs_ = nh.subscribe("objectsStamped", 1, &TfExample::objectsDetectedCallback, this);
blockPub_ = nh.advertise<geometry_msgs::PoseStamped>("block", 1);
} | {
"domain": "robotics.stackexchange",
"id": 37359,
"lm_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-melodic",
"url": null
} |
Blending parsley for soup, can I use the modulus ( % ) operator, complex private secure... Like - do not attach themselves to numbers the parsley whole or I., the result is prime number the exponent or power largest integer less than or equal to.. = 1 can cause precision loss for x % 1.0 when x is a,. Want to find the -5mod4 i.e ( seconds since the start of 1970 ) and turning it into the of... I still remove the stems // or the floor ( ) function of operands. C++ / operator ( with type int ) are not the same magnitude and opposite sign (. Handle integer division for negative number than it will become a huge blender ) z! Modulo positive number, e.g is dividend and “ b ” is dividend and divisor are positive operators! Python is called the modulo operation python modulo negative numbers // ), what is week... = 182, so the answer is 176 - 182 = -6 ) function of the is... This scenario the divisor a very small negative number than it will become a huge blender yields! 'S used to generate | {
"domain": "gridserver.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9362850093037731,
"lm_q1q2_score": 0.815127160549173,
"lm_q2_score": 0.8705972566572504,
"openwebmath_perplexity": 1108.810899254381,
"openwebmath_score": 0.451065331697464,
"tags": null,
"url": "https://s130894.gridserver.com/wbsddnik/python-modulo-negative-numbers-3fa651"
} |
homework-and-exercises, newtonian-mechanics, harmonic-oscillator, spring
Title: Does the spring constant of a spring depend on the mass of the object attached? Previously, I knew that the spring constant of a spring doesn't depend on the mass of the spring nor the mass of the object attached at the end of the spring.
However, after doing this numerical today, confusions arose in my mind:
We are concerned with 'c': | {
"domain": "physics.stackexchange",
"id": 84213,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, harmonic-oscillator, spring",
"url": null
} |
The QQ plot is an informal test of normality that can give you some insight into the nature of deviations from normality; for example, whether the distribution has some skew, or fat tails, or there are specific observations that deviate from what you would expect from a normal distribution (outliers). The QQ plot can often convince you that the distribution is definitely not normal, but this isn't such a case. Here, the points fall more or less along the line, which is broadly consistent with normality--intuitively, the sort of variation you would expect to see in a small sample.
The Shapiro-Wilk test is a formal test of normality. I'm not familiar with the shapiro function's output, so I'm not sure which number, if either, is supposed to be the p-value, but if you say it's largish, then we are led to accept the null hypothesis of normality. And this is consistent with what we see qualitatively in the QQ plot. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9473810407096792,
"lm_q1q2_score": 0.8014298266378231,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 866.7837286505995,
"openwebmath_score": 0.7398290038108826,
"tags": null,
"url": "https://stats.stackexchange.com/questions/396717/qq-plot-and-shapiro-wilk-test-disagree/396751"
} |
machine-learning, regression, feature-selection, feature-construction, missing-data
Title: What to do when testing data has less features than training data? Let's say we are predicting the sales of a shop and my training data has two sets of features:
One about the store sales with the dates (the field "Store" is not unique)
One about the store types (the field "Store" is unique here) | {
"domain": "datascience.stackexchange",
"id": 634,
"lm_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, regression, feature-selection, feature-construction, missing-data",
"url": null
} |
ros, kinect, ros-kinetic, freenect, image
The important difference here is the different encodings used, which results in different length of the data array. I don't know why this is the case, but nevertheless I would like to have the same encoding for both the real and the simulated depth image (I don't really care which one). How can I convert one encoding into the other? Also, is it possible to convert the data array so that it contains height * width entries, where each entry corresponds to the distance for this pixel in mm (or meter)?
I'm using the freenect drivers for the real kinect camera (sudo apt-get install libfreenect-dev, sudo apt-get install ros-indigo-freenect-launch), because the Openni drivers didn't work for me, as I'm on a Ubuntu VM, where Openni has their problems with.
Thanks & Cheers!
Originally posted by RedJohn on ROS Answers with karma: 31 on 2018-06-28
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 31113,
"lm_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, kinect, ros-kinetic, freenect, image",
"url": null
} |
____________________________________________________________________
$\copyright \ 2017 \text{ by Dan Ma}$
# The product of a normal countably compact space and a metric space is normal
It is well known that normality is not preserved by taking products. When nothing is known about the spaces $X$ and $Y$ other than the facts that they are normal spaces, there is not enough to go on for determining whether $X \times Y$ is normal. In fact even when one factor is a metric space and the other factor is a hereditarily paracompact space, the product can be non-normal (discussed here). This post discusses a productive scenario – the first factor is a normal space and second factor is a metric space with the first factor having the additional property that it is countably compact. In this scenario the product is always normal. This is a well known result in general topology. The goal here is to nail down a proof for use as future reference. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9920620049598216,
"lm_q1q2_score": 0.8016527754339622,
"lm_q2_score": 0.808067208930584,
"openwebmath_perplexity": 7027.181819724902,
"openwebmath_score": 1.0000100135803223,
"tags": null,
"url": "https://dantopology.wordpress.com/category/product-space/"
} |
c++, template
template<typename IteratorElem,
typename IteratorIndex>
static void check_indices(IteratorElem elem_begin,
IteratorElem elem_end,
IteratorIndex index_begin,
IteratorIndex index_end)
{
// Find the length of the element sequence:
typename std::iterator_traits<IteratorElem>
::difference_type elem_count = std::distance(elem_begin,
elem_end);
using IndexType =
typename std::iterator_traits<IteratorIndex>::value_type; | {
"domain": "codereview.stackexchange",
"id": 29016,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, template",
"url": null
} |
ros, tutorial, beginner-tutorials, server
Comment by End-Effector on 2015-02-28:
#include "beginner_tutorials/AddTwoInts.h"
^
/home/paulo/catkin_ws/src/beginner_tutorials/src/add_two_ints_server.cpp:2:43: fatal error: beginner_tutorials/AddTwoInts.h: No such file or directory
#include "beginner_tutorials/AddTwoInts.h" | {
"domain": "robotics.stackexchange",
"id": 21013,
"lm_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, tutorial, beginner-tutorials, server",
"url": null
} |
moonlanding
Title: Where are the Moon rocks from Apollo? There were so many Apollo Missions, and they landed on the moon (so they say). When astronauts came back to Earth from the moon, they brought Moon rock samples. Where are these moon rocks/samples now, and where can we see them? It's well-explained on NASA'a web site ... http://curator.jsc.nasa.gov/Lunar/index.cfm
About 380 kg of rocks and soil were brought back.
Note that ...
"The lunar sample building at Johnson Space Center is the chief repository for the Apollo samples." | {
"domain": "astronomy.stackexchange",
"id": 1698,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moonlanding",
"url": null
} |
quantum-mechanics, quantum-interpretations
Explaining how such correlations are generated in a consistent manner would probably have to use a Lagrangian/Action-style analysis, where the whole history is solved "all at once", constrained in part by future boundary conditions (as is normally done in action extremization). It's probably a mistake to think of things "flowing" or "going" forward or backward in time; instead, think in terms of static spacetime-diagrams.
There is currently no retrocausal model of all entanglement phenomena, but there is also no reason why one could not be developed. The best current models can handle two maximally-entangled qubits (the case normally discussed with regards to Bell's theorem). Some examples, and related models are discussed here: https://arxiv.org/abs/1906.04313 . | {
"domain": "physics.stackexchange",
"id": 62688,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-interpretations",
"url": null
} |
statistical-mechanics, entropy, information, complex-systems, network
So, to do something similar for networks, you first have to define an appropriate ensemble of networks that you want to consider. These would be your “equivalent topologies”. What makes sense here depends on how you want to interpret your entropy or, from another point of view, what properties of the network you consider variable for the purpose of encoding information. One way you may want to consider are network null models a.k.a. network surrogates. There are several methods available for obtaining such¹, but note that the properties of the underlying ensemble differ and are not always obvious.
Some further remarks: | {
"domain": "physics.stackexchange",
"id": 35806,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "statistical-mechanics, entropy, information, complex-systems, network",
"url": null
} |
turing-machines, computability
My problem is with the justification "[...] in particular $M$ does not accept it within $|x|$ steps, for all $x$. Thus, $K$ accepts every input [...]": Lets say that $M$ won't halt on $w$. In this case, when $K$ simulate $M$ - $M$ will not halt - and as a result, $K$ won't halt either, so how come we can say that it'll accept? I understand that in the construction we said that if during the simulation $M$ accepts, then $K$ rejects - but what if in the simulation $M$ doesn't stop at all, how will $K$ have the opportunity to accept? How will it know when to say "enough is enough, I'm going to accept this?"? I can't see what the "trick" is that they applied here. The input of $K$ is $x$, and $K$ will only simulate $M$ during at most $|x|$ steps. Therefore, there is no situation where the simulation of $K$ does not stop. | {
"domain": "cs.stackexchange",
"id": 19521,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines, computability",
"url": null
} |
java, console, windows, macos
Title: Java program that relaunches itself in OS's terminal application I wrote a Java program that when its executable .jar is opened manually, it re-opens itself inside the operating system's shell console. The purpose of this is to have a C#-style console application where the user can enter commands, without the user needing to manually open the shell console and run the java -jar ... command to open the application.
Would you consider this a good implementation?
Would you make a custom console GUI instead of using the OS's console?
public static void main(String[] args){
if(args.length == 0){ // then re-open in console with argument to indicate that there's no need to re-open next time.
try {
String os = System.getProperty("os.name").toLowerCase();
String path = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getAbsolutePath();
if(os.contains("mac")){ | {
"domain": "codereview.stackexchange",
"id": 33945,
"lm_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, console, windows, macos",
"url": null
} |
c++, file
// if the file is 1 byte in size or is empty, exit
if(mainFileSize <= 1)
{
printf("File is empty or the file is really small (not worthy)");
return -2;
}
inBuffer = new char[mainFileSize]; // allocate memory for the file content
if(inBuffer == nullptr)
{
printf("Couldn't allocate %d bytes of memory", mainFileSize);
return -3;
}
// read the whole file on the buffer
fread(inBuffer,sizeof(char), mainFileSize, mainFile);
if(consoleOutput) //TODO: if this option is enabled, display the file contents
{
for(int i = 0; i < mainFileSize; i++)
{
putchar(inBuffer[i]);
}
puts("");
}
fclose(mainFile);
keyFile = fopen(keyFile_in, "rb");
// if can't open for read, close
if(keyFile == nullptr)
{
printf("Couldn't open file %s!", keyFile_in);
return -1;
} | {
"domain": "codereview.stackexchange",
"id": 33649,
"lm_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++, file",
"url": null
} |
astronomy, visible-light, photons, sun
Finally, instead of trying even more distant stars, let me mention that there is also the Moon in the sky. It's actually dominating or almost dominating the luminosity at night, except for the new moon or eclipses. In average, we get 1 milliwatt from the moonlight which is 1/300,000 of the Sun's 342 Watts (averaged over places, seasons, day cycles). That's about the same what I got for the total strip of stars in the Milky Way – 3 parts per million of the Sun – but my estimate of the stars was probably an overestimate and I believe the Moon is brighter than the Milky Way combined. | {
"domain": "physics.stackexchange",
"id": 43889,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy, visible-light, photons, sun",
"url": null
} |
algorithms, greedy-algorithms, correctness-proof, integers
The algorithm makes sense intuitively; we essentially move the minimum digit in a window of size at most k into each possible position, and since we minimize leading digits each time starting from the first leading digit, it makes intuitive sense that the resulting number should be minimized. But I'm not sure how to prove it produces an optimal solution using an exchange argument. Let $A$ be the greedy algorithm you presented and $A'$ be the algorithm that correctly solves the problem.
Let $m=d_{n-1}d_{n-2}d_{n-3}...d_2d_1d_0$ be the solution obtained by $A$ and $m'=d'_{n-1}d'_{n-2}d'_{n-3}...d'_2d'_1d'_0$ be the number obtained by $A'$. | {
"domain": "cs.stackexchange",
"id": 19813,
"lm_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, greedy-algorithms, correctness-proof, integers",
"url": null
} |
performance, c, memory-management, c99
Standard conformance
Portability
Performance improvements
C best practices
All other reviews are welcome as well of course.
Header
#ifndef OBJECT_POOL_H
#define OBJECT_POOL_H
#include <stddef.h>
/*
* This is an implementation of a generic pre-allocated object pool with automatic growth. It pre-allocates
* storage for a number of objects of a defined size (a single object pool can only hold objects which are
* all of the same size). If the pool runs out of storage it will double its capacity automatically but adding
* an additional buffer with double the capacity of the previous buffer. It will try smaller capacity increases
* if the doubling fails.
* By default a maximum of OBJECT_POOL_MAX_NUM_BUFFERS will be created yielding at most 31 doubling steps (first
* buffer will hold initial_capacity items).
* So the default number of items it can hold at most is initial_capacity * (2^33 - 1)
* The pre-allocated objects are padded to the next multiple of 4 bytes.
*/ | {
"domain": "codereview.stackexchange",
"id": 18311,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, c, memory-management, c99",
"url": null
} |
cc.complexity-theory, algebraic-complexity
(Please refer: Section 2.2 Page 15 of "Complexity Lower Bounds Using Linear Algebra", by Satyanarayana V. Lokam, for candidate matrices conjectured to have an arithmetic complexity (multiplicative + additive complexity) of $\Omega(n^{1+\delta})$). Essentially, your are asking why people believe that DFT or DHT do not have linear size arithmetic circuits. First, researcher tried to find such circuits for decades but did not succeed. Second, there are superlinear lower bounds (Morgenstern's theorem, see the book by Bürgisser, Clausen, Shokrollahi) in restricted models. From Morgenstern's theorem, in follows that in linear arithmetic circuits of linear size over the complex numbers for the DFT, the absolute values of the constants used in the circuit go to infinity as $n$ goes to infinity. | {
"domain": "cstheory.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": "cc.complexity-theory, algebraic-complexity",
"url": null
} |
beginner, c, csv, converting
/**
* Read 1 byte as an int
* @param char *msg Message to prepend to debug output
* @return void
*/
int readIntByte(char *msg){
//read 4 bytes into memory location of int32buffer
fread(&intByteBuffer, 1, 1, savPtr);
cursor += 1;
//output for debug info
if(debug && !silent){
printOut(msg, "", "yellow");
printf("\t%d\n", intByteBuffer);
printf("\t<1 byte read, %d bytes total>\n\n", cursor);
}
return intByteBuffer;
}
/**
* Read 1 byte as an int
* @return void
*/
int readIntByteNoOutput(){
//read 4 bytes into memory location of int32buffer
fread(&intByteBuffer, 1, 1, savPtr);
cursor += 1;
return intByteBuffer;
}
/**
* Read 4 bytes as an int
* @param char *msg Message to prepend to debug output
* @return void
*/
int readInt32(char *msg){ | {
"domain": "codereview.stackexchange",
"id": 40900,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, c, csv, converting",
"url": null
} |
c#, .net, recursion
Title: Implement recursion The rules for this program are to:
Generate n X n grid.
Arbitrarily pick a point and grow a 'shape' based off that initial point.
Must have at least 3 points.
Strongly biased to not completely fill grid.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
namespace ShapeTestInConsole
{
class Program
{
static void Main(string[] args)
{
Shape.Initialize(4, 4);
Shape shape = new Shape();
Draw(shape);
Console.ReadLine();
} | {
"domain": "codereview.stackexchange",
"id": 3782,
"lm_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#, .net, recursion",
"url": null
} |
7. ## Re: Logarithmic and Exponential functions
Originally Posted by astuart
Hello,
Not sure if this is in the right forum - feel free to move it.
I have a question from my textbook that is throwing me off a bit.
The relative loudness of a sound D of intensity I is measured in decibels (db) where
$D = 10 log I/Io$
and Io is the standard threshold of audibility.
A) Express the intensity of I of a 30-db sound (the sound level of normal conversation) in terms of Io.
I think I'm supposed to form an equation for I in relation to Io, but I'm not sure what I'm supposed to do. Apparently the answer is "10^3(Io)".
I'm thinking it's something to do with the fact that I = 30, and the fact that there's a 10 log expression - something to do with the 3 being a divisor of 30 (by 10). I'm just not sure how the 30 gets turned into the exponent of 10 (expressed as 3).
Any tips?
While defining dB the base of logarithm is always 10.
$10 \log(\frac{I}{I_0})=30$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668739644687,
"lm_q1q2_score": 0.8176304841185763,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 775.1857149650317,
"openwebmath_score": 0.9095027446746826,
"tags": null,
"url": "http://mathhelpforum.com/calculus/201704-logarithmic-exponential-functions.html"
} |
free problems in 'Find the standard form of the equation of a parabola given a focus and directrix' and thousands of other practice lessons. click here for parabola. Online Integral Calculator » Solve integrals with Wolfram|Alpha. You can choose any. You can find the vertex of parabola by rewriting the original equation so that we have. Every quadratic equation describes a parabola, which looks like this graph. The coordinates are: (-1, -4) If the vertex is the maximum point as shown in the graph of , you only need to change one step. In the graph below, point V is the vertex, and point F is the focus of the parabola. This is a vertical parabola, so we are using the pattern Our vertex is (5, 3), so we will substitute those numbers in for h and k: Now we must choose a point to substitute in. Product presentation and graph of the parabola. State the vertex, State the y-intercept, Indicate if there is a maximum or minimum value and give the value. This video illustrates how to find some | {
"domain": "psychotherapie-im-schloss.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877012965885,
"lm_q1q2_score": 0.8206852011205793,
"lm_q2_score": 0.8354835350552603,
"openwebmath_perplexity": 483.2046075812748,
"openwebmath_score": 0.43395131826400757,
"tags": null,
"url": "http://yiob.psychotherapie-im-schloss.de/parabola-vertex-calculator.html"
} |
quantum-mechanics, wavefunction, hilbert-space, notation
Next, for each $|\psi\rangle$ in the Hilbert space, we define the position basis wavefunction $\psi$ corresponding to the state $|\psi\rangle$ as
$$
\psi(x) = \langle x|\psi\rangle
$$
So really, the value $\psi(x)$ of the position basis wavefunction $\psi$ at a point $x$ can simply be thought of as the basis component of $|\psi\rangle$ in the direction of $|x\rangle$ just as in the finite-dimensional case where one can find the component of a vector $|\psi\rangle$ along a basis vector $|e_i\rangle$ simply by taking the inner product $\langle e_i|\psi\rangle$. | {
"domain": "physics.stackexchange",
"id": 6623,
"lm_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, wavefunction, hilbert-space, notation",
"url": null
} |
c++, tic-tac-toe, ai
if((blockOne == 'X' && blockThree == 'X') && playerTurn == false && blockTwo == '2') //1 - 3 = 2 horizontal
{
blockTwo = 'O';
playerTurn = true;
}
if((blockTwo == 'X' && blockThree == 'X') && playerTurn == false && blockOne == '1') //2 - 3 = 1 horizontal
{
blockOne = 'O';
playerTurn = true;
}
}
if((playerChoice == 4 || playerChoice == 5 || playerChoice == 6) && playerTurn == false)
{
if((blockFour == 'X' && blockFive == 'X') && playerTurn == false && blockSix == '6') //4 - 5 = 6 horizontal line 2
{
blockSix = 'O';
playerTurn = true;
}
if((blockFour == 'X' && blockSix == 'X') && playerTurn == false && blockFive == '5') //4 - 6 = 5 horizontal line 2
{
blockFive = 'O';
playerTurn = true;
} | {
"domain": "codereview.stackexchange",
"id": 10043,
"lm_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++, tic-tac-toe, ai",
"url": null
} |
ros, actuator, urdf, ethercat
Originally posted by OEP on ROS Answers with karma: 33 on 2012-02-14
Post score: 3
Actuators are defined in config files for the ethercat_hardware package:
http://ros.org/wiki/ethercat_hardware
You don't really need actuators if you only use the gazebo_ros_controller_manager for simulation.
In the transmission documentation it says:
The transmission element is an extension to the URDF robot description model. This extension is only used for the PR2 robot, and is not meant to be reusable for other robots.
However I should mention that you do need the transmission and actuator tags in your model for the gazebo_ros_controller_manager plugin to work, but it doesn't matter what names you specify for the actuators.
Originally posted by Kai Bublitz with karma: 357 on 2012-02-14
This answer was ACCEPTED on the original site
Post score: 6 | {
"domain": "robotics.stackexchange",
"id": 8237,
"lm_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, actuator, urdf, ethercat",
"url": null
} |
ros, navigation, hokuyo-node, hokuyo
Title: Navigation Stack + Hokuyo_node
Ok, so I've been working with the navigation stack and I'm confused as to how to connect the hokuyo_node to everything. I keep getting the error
Message from [/hokuyo_node] has a non-fully-qualified frame_id [laser]. Resolved locally to [/laser]. This is will likely not work in multi-robot systems. This message will only print once.
and for everything I've tried nothing seems to get me past this. I was under the impression that AMCL would output what was needed from the laser data. My laser data tested in rviz seems to be fine.
Thanks ahead of time, and if you need more information that is question specific ill try to get it asap.
Edit 1 <---------------------------------------------->
I'v been working through the navigation stack tutorials, as well as following the Ardros blog. and most of the stuff is the same for both.
my robot configuration launch file.
<launch> | {
"domain": "robotics.stackexchange",
"id": 5740,
"lm_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, navigation, hokuyo-node, hokuyo",
"url": null
} |
solar-system, jupiter, gas-giants, saturn, uranus
The most important thing to take away from this is that every type of
material, in terms of composition and "phase", absorbs and scatters
light uniquely.
The prevalence and importance of each of the above four "phases"
depend on (a) the elemental composition of the giant planet's
atmosphere (defined as that layer responsible for light
reflected/emitted by planet), and (b) its equation of state (how
pressure changes as a function of density and temperature). The first
of these provides the raw materials, and the second arranges them in
"phase". Very roughly speaking, one may assign decreasing temperatures
(T) to the above 4 "phases" moving down the list 1-->4. Pressure (P)
also plays a role, and in general one may place the above phases on a
P-T diagram. Physics and Chemistry are at work to determine what kind
of "stuff" is present as a function of depth through the giant planet
atmosphere. One rule of thumb is that chemistry is much more effective | {
"domain": "astronomy.stackexchange",
"id": 745,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solar-system, jupiter, gas-giants, saturn, uranus",
"url": null
} |
visible-light, vision
Title: What are so-called opposite colors? Colors are said to be electromagnetic frequencies.
How is this compatible with the notion of color opponency, or opposite colors, since those frequencies form a single dimension? The notion of opposite colors has nothing to do with the electromagnetic spectrum. Human eyes have three different photoreceptors, named cones (I won't enter into subtleties such as rod spectrum sensitivity here) with each a certain response curve to the electromagnetic spectrum.
When those receptors are excited by light in their detection range, they inhibit their nervous discharge. Here the inhibition is irrelevant because neurons can convert that into an excitation again. Anyway, we are at neurons communication level now.
Neurons form circuits that tend to generate categories from rather continuous values, and these networks are the ones producing colors as categories instead of continuous values. | {
"domain": "physics.stackexchange",
"id": 77153,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, vision",
"url": null
} |
group-theory, group-representations, lie-algebra, tensor-calculus, invariants
As mentioned above, each diagram with at most $n$ rows corresponds to an irreducible representation of $GL(n)$. Again, this fact is useful because $GL(n)$ is closely related to many other groups of interest in physics. A Young diagram can be thought of as an efficient way to keep track of the symmetrization of tensor indices: after placing tensor indices $i_1$ through $i_r$ in the squares of a Young diagram, the corresponding irreducible tensors are symmetric (even) under permutations that preserve rows, and antisymmetric (odd) under permutations that preserve columns.
There is a general formula for the dimension of a $GL(n)$ representation labelled by a Young diagram, but in practice the dimension can be computed more efficiently for low rank using the decomposition rules for tensor products, to be explained now. | {
"domain": "physics.stackexchange",
"id": 27758,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "group-theory, group-representations, lie-algebra, tensor-calculus, invariants",
"url": null
} |
microbiology, pathology, epidemiology
Title: Have there been any positive public health effects due to UV lights? Occasionally, in hospitals and in eating establishments in the US, they have industrial grade UV lights in sconces attached to the wall (though they seem to be less prominent as the years go by). I understand the anti-microbial properties of UV light, but are these devices anything more than show pieces?
Have there been any lasting, significant public health gains that have been correlated with the use of UV light in public places? There have been some studies regarding the use of intensive UV light installations in surgical wards or other settings as a anti-microbial tool. Generally speaking, these are part of a general interest in non-cleaning based anti-microbials in hospitals, such as UV light, O3-based machines, and copper/silver coated surfaces. | {
"domain": "biology.stackexchange",
"id": 154,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "microbiology, pathology, epidemiology",
"url": null
} |
object-oriented, ruby, unit-testing, random, statistics
def predict!
acc = 0.0
roll = rand
selected_outcome = nil
normalized_outcome_probabilities.each do |outcome, probability|
acc += probability
if acc > roll
selected_outcome = outcome
break
end
end
selected_outcome
end
def self.from_hash(outcome_counts_hash)
event = new
outcome_counts_hash.each do |outcome, count|
event.add_outcome(outcome, count: count)
end
event
end
end First thing, it looks like RandomEvent.from_hash implements features of initialize method.
acc variable at RandomEvent#predict can be easily moved to inject iterator.
Code:
class RandomEvent
def initialize(outcome_counts = {})
@outcome_counts = outcome_counts
end
def add_outcome(outcome, count)
@outcome_counts[outcome] = count
end | {
"domain": "codereview.stackexchange",
"id": 20629,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, ruby, unit-testing, random, statistics",
"url": null
} |
– D.W.
Oct 20 '20 at 19:34
• @D.W. This is original problem created by my professor. Oct 20 '20 at 19:37
– D.W.
Oct 20 '20 at 19:37
• @AnarRzayev I have deleted your unnecessary remarks here. Please be aware that we cannot know that your professor prefers to remain anonymous before you tell us this. In general, we try to encourage people to post the source of their problems here, as this helps providing attribution to everyone who wants attribution. This is not relevant in all cases, but that is hard to tell if we don't ask. Oct 21 '20 at 6:05 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464513032269,
"lm_q1q2_score": 0.8195353897028473,
"lm_q2_score": 0.8397339716830605,
"openwebmath_perplexity": 380.83878477438765,
"openwebmath_score": 0.5764367580413818,
"tags": null,
"url": "https://cs.stackexchange.com/questions/131411/black-box-machine"
} |
human-biology, microbiology, digestive-system
In 1817, when the first cholera pandemic began [...]. In Calcutta and Jessore, cholera killed 5,000 British soldiers within weeks
However, those who survived would get used to it eventually. Cholera is much more serious than simple dysentery of course but its main symptom is also diarrhea.
The locals of wherever you happen to be are used to the pathogens that are common in the drinking water. If I am not from a place and drink water with new pathogens, I will be sick. I will also, however, eventually get over it and my body will be used to them. Depending on the details, either because I have developed an immunity or because I have developed the necessary intestinal fauna to deal with it.
So while the intestinal fauna may indeed have changed over time, this has absolutely nothing to do with what you're asking. First because your assumption is wrong (the British were subjected to the same health issues as modern Europeans visiting Asia) and second because people adapt. | {
"domain": "biology.stackexchange",
"id": 2807,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, microbiology, digestive-system",
"url": null
} |
physical-chemistry, equilibrium, pressure
At equilibrium the rates of the forward and reverse reactions are equal; the equilibrium constant is the ratio of the rate constants. This reduces to the reaction quotient. A simple increase in pressure will increase each factor in the reaction quotient by the same ratio. There are 4 factors one CO and 3H2 in the forward reaction and two in the reverse. Increasing the pressure accelerates the forward reaction more. In a quick pressure increase it could be possible to follow the reaction by monitoring the pressure. | {
"domain": "chemistry.stackexchange",
"id": 17375,
"lm_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, equilibrium, pressure",
"url": null
} |
c#, .net, rabbitmq
If it is intentional then adding some documentation comment might bring clarity
If it in unintentional then change the set to init
RabbitSslOptions
Yet again this could be a simple class because you are not taking advantage of any features of the record
Why did you define the CertificateValidationCallback in a way that it has a setter rather than being an init-only property?
RabbitConnectionFactory
Please implement the IDisposable interface as it should be
The initialization of the lazy fields can be simplified
_lazyConnection = new(_connectionFactory.CreateConnection, LazyThreadSafetyMode.ExecutionAndPublication);
_lazyChannel = new(CurrentConnection.CreateModel, LazyThreadSafetyMode.ExecutionAndPublication);
Inside the FromConfig I think it is unnecessary to perform a null check against the parameter
It is already done inside the From method
Since the RabbitBaseOptions is defined as abstract that's why you don't need to define the From as generic, simple just | {
"domain": "codereview.stackexchange",
"id": 43998,
"lm_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#, .net, rabbitmq",
"url": null
} |
java, object-oriented, immutability, spring
private void ensureInitialized() {
if (stateref.get() == null) {
throw new IllegalStateException(
"state must be set before this instance is used."
);
}
}
This pattern ensures usage is consistent, there can be only one initialization of the instance, and that any thread-unsafe practices are handled well. | {
"domain": "codereview.stackexchange",
"id": 5269,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, immutability, spring",
"url": null
} |
ros, python3
self.model.set('Parameters_INI_VALUES_COURSE_ANGLE', map_data[start_sim, 2])
Originally posted by m0gha on ROS Answers with karma: 3 on 2022-09-14
Post score: 0
Original comments
Comment by ravijoshi on 2022-09-14:
The question is hard to understand. Do you want to create a custom message? Furthermore, I could not understand the relation of your code snippet with the title of your question. Can you please provide more information?
Comment by m0gha on 2022-09-18:
I want to create a custom message, the message should be a 2D array " map_data[i, k] "
Comment by gvdhoorn on 2022-09-19:
Just to make it extra clear: there is no such thing as an "Nd array" (with N > 1) in ROS msg IDL. It's not supported.
The best you can do is use one of the work-arounds suggested/described by @ravijoshi in his answer below.
The following two approaches can be utilized in order to create a custom message that contains a 2D array, (map_data in your case): | {
"domain": "robotics.stackexchange",
"id": 37976,
"lm_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, python3",
"url": null
} |
python, python-3.x, object-oriented
return new_deck
. . .
playing_deck = Deck.new_populated() # instead of Deck('full')
I think it reads much better and will allow for less mistakes.
insert_card and view_card are more complicated than they need to be. You're having each doing multiple jobs based on a passed string. Trying to anticipate future needs and creating new features ahead of time can be helpful, but also remember: in many cases, you aren't going to need those features.
Look at your uses of both:
insert_card never uses the second parameter. Can you ever, within the context of a blackjack deck of cards, see ever needing to add a card to multiple positions (or really, would you ever add a card to a blackjack deck after the deck is formed?)
view_card is only used once, and is used to view the "bottom" card of a hand. I think normal indexing of a list would suffice here. | {
"domain": "codereview.stackexchange",
"id": 36907,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, object-oriented",
"url": null
} |
swift
DetailView
final class DetailView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setup() {
self.backgroundColor = .blue
}
} Factories/DI
Split into modules or something. For now OK, but if your app gets bigger and your single factory depends on everything it becomes rather hard to maintain. Could be as easy as adding extensions to your Factory protocol for every module. You still have everything in the same class, but your source code is more separated.
makeInitialView, makeDetailView: Get rid of the viewModel parameter as it is not used. You might even consider directly creating your views in the view controller as they have no other dependencies.
Coordinators | {
"domain": "codereview.stackexchange",
"id": 38493,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "swift",
"url": null
} |
mobile-robot, control, kinematics, matlab, trajectory
it looks like you've got acceleration as a linear function of the difference in reference and state speed, but what is $k_2$? The more important problem for me is that you have the same gain $k_2$ being used to drive both your linear and angular accelerations. This might make sense if you were doing some vector operation, but if you did it longhand like that then I'd expect a $k_1$ for the linear acceleration and a $k_2$ for the angular. Since I'm not seeing where $k_2$ (or $k_1$) is defined I can't give any feedback on that.
Now finally I work my way back up to your first set of equations, which have me totally lost. I would expect that your reference would be either a constant setpoint, like v=0, or the result of some profile, like v = MySpeedProfileGenerator(t). What I'm seeing instead is that your linear and angular speeds are again functions of distance, but not the x/y positions; just the radial distance $R$ from origin to the x/y point.
That is, you have:
$$ | {
"domain": "robotics.stackexchange",
"id": 2243,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mobile-robot, control, kinematics, matlab, trajectory",
"url": null
} |
light
Title: Do all stars of a given age and mass have relatively the same emission spectrum? My understanding is that much of the visible light that we see during the day is given off from the Sun, and that means that most of the colors that we see are dictated by (with the exception of atmospheric effects) the particular wavelengths of color that the Sun emits, which does not include the entire continuous color spectrum.
Here is an image of the wavelengths emitted by the Sun | {
"domain": "astronomy.stackexchange",
"id": 3756,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "light",
"url": null
} |
when either A or B is empty (for example, a function from â
âB cannot have an inverse, because there are no functions from Bââ
). For a function to have an inverse, it must be one-to-one (pass the horizontal line test). So every element has a unique left inverse, right inverse, and inverse. If only a left inverse $f_{L}^{-1}$ exists, then any solution is unique, ⦠We must define a function g such that fâ
ââ
gâ=âidB. Politically, story selection tends to favor the left âRoasting the Republicansâ Proposed Obamacare Replacement Is Now a Meme.â A factual search shows that Inverse has never failed a fact check. A matrix has a left inverse if and only if its rank equals its number of columns and the number of rows is more than the number of column . f(x)={tan(x)0âif sin(x)î â=0if sin(x)=0,â Valid Proof (âââ): Suppose f is bijective. Overall, we rate Inverse Left-Center biased for story selection and High for factual reporting due to proper sourcing. The | {
"domain": "ingenium-elearning.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551515780319,
"lm_q1q2_score": 0.8312595779357588,
"lm_q2_score": 0.8615382076534742,
"openwebmath_perplexity": 596.7027181393795,
"openwebmath_score": 0.9139620065689087,
"tags": null,
"url": "http://stereotypes.ingenium-elearning.com/qrbqo/jake-wood-mgfn/qg6ek.php?5e26de=left-inverse-is-right-inverse"
} |
general-relativity, earth, angular-velocity, gps
Finally, without any modification to a standard GPS, can anybody think of how I could achieving this, by using, say a well defined ground location on Earth and how would this be reflected on a standard GPS, e.g.? I know it will make my location inaccurate but what other effects may occur? Yes, see "Measurements of length of day [LOD] using the Global Positioning System" (its persistent Digital Object Identifier is doi:10.1029/96JB01889) and subsequent citing literature. Note that this is not a relativistic effect. LOD is a day-averaged measure of Earth's spinning rate, see Wikipedia for background (LOD variations). | {
"domain": "physics.stackexchange",
"id": 24088,
"lm_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, earth, angular-velocity, gps",
"url": null
} |
If $f(x)=P_n(x)+x^n\epsilon(x)$ then
$f(u(x))=P(u(x))+(u(x))^n\epsilon(u(x))$
with $\lim_{x\to 0}\epsilon(x)=0$.
thus we need that
$\lim_{x\to 0}\epsilon(u(x))=0$
so, we must have
$$\lim_{x\to 0}u(x)=0$$
• Hmm, I understand. And why is substitution allowed in the first place? When $\lim_{x\to 0}\epsilon(u(x))=0$? – GambitSquared Nov 12 '16 at 9:31
The quantity $2x$ is a product and as $x\to 0$ it remains a small number.
The quantity $x+n$ for $n\neq 0$ is not a little quantity anymore, and so you are not anymore around zero but you're around $n$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765610497293,
"lm_q1q2_score": 0.834893777049586,
"lm_q2_score": 0.8519528019683106,
"openwebmath_perplexity": 281.44598151630197,
"openwebmath_score": 0.9800888895988464,
"tags": null,
"url": "https://math.stackexchange.com/questions/2010255/why-is-substitution-allowed-in-taylor-series"
} |
# Question about the Fundamental Theorem of Algebra
I have been studying the Fundamental theorem of Algebra over the past few days, and I'm having a hard time finding the answers for my following question. I hope that someone will shine a light so I can move forward with my study.
From Wikipedia:
"The fundamental theorem of algebra states that every non-constant single-variable polynomial with complex coefficients has at least one complex root. This includes polynomials with real coefficients, since every real number is a complex number with its imaginary part equal to zero.
The theorem is also stated as follows: every non-zero, single-variable, degree n polynomial with complex coefficients has, counted with multiplicity, exactly n complex roots. The equivalence of the two statements can be proven through the use of successive polynomial division."
My question is: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9579122672782973,
"lm_q1q2_score": 0.8198303179270889,
"lm_q2_score": 0.8558511524823263,
"openwebmath_perplexity": 201.35349281762484,
"openwebmath_score": 0.8524845838546753,
"tags": null,
"url": "https://math.stackexchange.com/questions/3817464/question-about-the-fundamental-theorem-of-algebra"
} |
c#, linq
return Expression.Lambda<Func<T, bool>>(body, parameter);
}
// ">"
case OperatorRef.Item5:
{
var body = Expression.GreaterThan(Expression.Property(parameter, prop.Name), Expression.Constant(fieldValue, prop.PropertyType));
return Expression.Lambda<Func<T, bool>>(body, parameter);
}
// ">="
case OperatorRef.Item6:
{
var body = Expression.GreaterThanOrEqual(Expression.Property(parameter, prop.Name), Expression.Constant(fieldValue)); | {
"domain": "codereview.stackexchange",
"id": 21913,
"lm_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#, linq",
"url": null
} |
cosmology, general-relativity
Title: Strong force and metric expansion If the expansion of the universe (the metric) continues (and perhaps is accelerating), in a very large but finite time the expansion of the metric will clash with the effects of the strong nuclear force. What happens then? Would the energy required halt the expansion and if so what is the slowing effect of the "stretch" on the strong force today - too small to be measured?
Update: Thanks for the answers so far - I hadn't even considered the big rip scenario. I was merely thinking that as the metric expanded the strong force inside baryons would require unlimited resources of energy to be overcome - but I now understand that is wrong however it still looks to me like a potential perpetual motion machine - continually creating matter/anti-matter pairs. Perhaps that should be a separate question though... Excepting a Big Rip scenario, there is no eventual 'clash'.
Consider a Friedmann–Lemaître–Robertson–Walker universe: | {
"domain": "astronomy.stackexchange",
"id": 594,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, general-relativity",
"url": null
} |
classical-mechanics, atmospheric-science
Title: Does Atmospheric Pressure Affect Weight Of Objects The atmospheric pressure is around 100KPa which is 100,000 N/m2. If the gravitational acceleration is g = 10 m/s2, then it would be around 10 tons of weight of air per square metre!
Let's say that we have a thin sheet of metal weighing 10 kg. It is placed outdoors on top of a weight scale facing the sky.
The length and width are both 1 m and the thickness is negligible. Then we take the reading from the weight scale which is X.
Then place the sheet of metal vertical to the weight scale (i.e. perpendicular to the ground). Take the reading from the weight scale with is Y. | {
"domain": "physics.stackexchange",
"id": 85408,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, atmospheric-science",
"url": null
} |
fluid-dynamics, turbulence
Will structures appear in one that don't appear in the other?
See above: Yes, certainly! A single-point time record makes it hard to elucidate spatial flow structure, especially large-scale ones like that of VLSMs in turbulent boundary layers or the wave packets of turbulent jets. Much of the cutting-edge experimental work in turbulence is toward use of coherent spatio-temporal structures to form practical flow models.
Does combining the information into a spatio-temporal spectrum/structure function/etc yield new insights? | {
"domain": "physics.stackexchange",
"id": 29319,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, turbulence",
"url": null
} |
python, python-2.x, chess
def __str__(self):
return 'B'
class Rook(Piece):
def __init__(self, colour):
super(Rook, self).__init__(colour)
def enumerate_moves(self, board, x, y):
def not_invalid(square):
return square.can_move_to(self)
x_positive = takewhile(not_invalid,
(board.at(x + n, y) for n in board_size[1:]))
x_negative = takewhile(not_invalid,
(board.at(x - n, y) for n in board_size[1:]))
y_positive = takewhile(not_invalid,
(board.at(x, y + n) for n in board_size[1:]))
y_negative = takewhile(not_invalid,
(board.at(x, y - n) for n in board_size[1:]))
return list(chain(x_positive, x_negative, y_positive, y_negative))
def __str__(self):
return 'R'
class Queen(Piece):
def __init__(self, colour):
super(Queen, self).__init__(colour) | {
"domain": "codereview.stackexchange",
"id": 14405,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, chess",
"url": null
} |
## Monday, June 28, 2021
### SQL Group By with Limit in MySQL: Finding the top n values per group
Say you have the following database table called "tbl_test" which contains rows which can be grouped by a column.
idgroup_namevalue
1a0
2a8
3a9
4a3
5b5
6b6
7b4
8c2
9c9
If you want to find the maximum value in each group, that's easy using a Group By statement and a MAX function:
SELECT
tbl_test.group_name AS group_name,
MAX(tbl_test.value) AS value
FROM
tbl_test
GROUP BY
tbl_test.group_name
ORDER BY
tbl_test.group_name
; | {
"domain": "blogspot.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9546474155747541,
"lm_q1q2_score": 0.8114227879685589,
"lm_q2_score": 0.8499711775577735,
"openwebmath_perplexity": 392.9481583328906,
"openwebmath_score": 0.8286980986595154,
"tags": null,
"url": "https://geekyisawesome.blogspot.com/"
} |
nlp, recommender-system, word-embeddings
max_df : float in range [0.0, 1.0] or int, default=1.0 When building the vocabulary ignore terms that have a document frequency
strictly higher than the given threshold (corpus-specific stop words).
If float, the parameter represents a proportion of documents, integer
absolute counts. This parameter is ignored if vocabulary is not None.
min_df : float in range [0.0, 1.0] or int, default=1 When building the vocabulary ignore terms that have a document frequency strictly
lower than the given threshold. This value is also called cut-off in
the literature. If float, the parameter represents a proportion of
documents, integer absolute counts. This parameter is ignored if
vocabulary is not None. | {
"domain": "datascience.stackexchange",
"id": 4533,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nlp, recommender-system, word-embeddings",
"url": null
} |
moveit, transform
Originally posted by Lolita390 on ROS Answers with karma: 31 on 2015-11-27
Post score: 0
Original comments
Comment by paul3333 on 2021-03-04:
@Lolita390 where you able to solve your problem? Im facing the exact same issue right now.
Would be great if you could share your solution!
Comment by jayess on 2021-03-06:
Please don't use an answer to leave a comment. This isn't a forum
Comment by paul3333 on 2021-03-08:
Sorry about that.
Comment by jayess on 2021-03-09:
No worries
In fact, your slam node should broadcast transformation from map to odom. It seems missing.
It may be helpful if you can post the screenshot of rosrun tf view_frames output and your content of launch files with any relevant parameter (or .yaml) files.
Originally posted by Akif with karma: 3561 on 2015-11-28
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Lolita390 on 2015-11-28:
I replied in EDIT1. | {
"domain": "robotics.stackexchange",
"id": 23100,
"lm_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, transform",
"url": null
} |
java, object-oriented
Title: Implementing operations for Number classes I'm currently working on a library that provides a mathematical interface for different operations. Operations like solving an equation or calculate derivatives of a function. With a recent update in the requirements, I have to include Scalar and Complex numbers, as well as Vectors and Matrices. With this second part, I came up with a rough, not so elegant - to say the least - solution. To be honest, I don't see how I could simplify things.
Here's my current approach:
Extending the Number class, I added Scalar and Complex types:
public final class Scalar extends Number {
private String real;
public Scalar(String real) {
this.real = real;
}
public Scalar(Double real) { this.real = real.toString(); }
@Override
public int intValue() {
return Double.valueOf(real).intValue();
}
@Override
public long longValue() {
return Double.valueOf(real).longValue();
} | {
"domain": "codereview.stackexchange",
"id": 24904,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented",
"url": null
} |
way to other... ⁄ are £ there, and height 26 m Problem solving ( Substitution ) 4.7 3 reviews! Which one, as long as one of the parallelogram is 507 2... ; SAT formula ( iii ) Using slope ( ii ) Using midpoint formula iii... Problem Example: the figure is a quadrilateral where one pair and only one pair and only pair! As the base parallelogram Problems - length, width, perimeter and area are! A geometrical figure of a parallelogram is the sum of the parallelogram is the area of a by!: the figure is a quadrilateral in which both pairs of opposite sides are parallel, then an..., multiply the base by the height as that length two-dimensional geometrical shape, whose sides are in... That of a parallelogram is the area of a ⁄ are £ geometrical,!: have the students construct a quadrilateral where one pair of sides are equal in length and opposite angles a. The blue region, which is also base times the height the key to solving this to... Are equal in length and opposite angles are identical | {
"domain": "mouans-immobilier.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9518632316144274,
"lm_q1q2_score": 0.8071493271372351,
"lm_q2_score": 0.8479677545357569,
"openwebmath_perplexity": 778.5552834208993,
"openwebmath_score": 0.6112489104270935,
"tags": null,
"url": "http://blog.mouans-immobilier.com/hmx4d0/b32214-how-to-solve-parallelogram"
} |
standard-model, stability, beyond-the-standard-model, proton-decay, hadron-dynamics
In the Standard Model quarks can't just disappear so a proton is stable. Well, a quark and antiquark can annihilate and disappear, which is how mesons decay, but if we consider a single quark it can't just disappear. However theories have been suggested in which quarks can decay into non-quarks. As far as I know the earliest of these was the Georgi-Glashow model. In this model two up quarks can decay into an X boson, and this subsequently decays into a positron and an anti-down quark. This means a proton could decay into a positron and a neutral pion - the pion then decays into two photons. | {
"domain": "physics.stackexchange",
"id": 27071,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "standard-model, stability, beyond-the-standard-model, proton-decay, hadron-dynamics",
"url": null
} |
particle-physics, astrophysics, resource-recommendations, cosmic-rays
This book provides an exhaustive account of the origin and dynamics of cosmic rays.
It may be a little dated, having been printed in 2002 (pre-Fermi LAT), but it covers exactly what you want: the production & propagation of cosmic rays--it's been a while since I read it (having moved away from academia a few years ago), but I believe it covers galactic CRs (which ought to cover solar as well) and I think it does touch upon extra-galactic CRs.
I don't really recall it being particularly difficult with the maths beyond e.g. vector calculus. A background in astrophysics is probably useful, especially with radiative processes (i.e., having read/worked through Rybicki & Lightman). I don't think particle physics knowledge is needed in the book, but, again, it's been a while since I've needed to look at it. | {
"domain": "physics.stackexchange",
"id": 52947,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, astrophysics, resource-recommendations, cosmic-rays",
"url": null
} |
algorithms, reference-request, distributed-systems
where the algorithm sees only the events e1',e4' (the other events are lost and never received). You might notice that what the algorithm sees in both cases is identical, so its outputs will be identical in both cases. However, the correct answer differs in these two cases, so there is no hope for an algorithm that always produces a correct output. (The correct response in the first case is to produce no notifications; the correct response in the second case is to produce two notifications, one to indicate that the predicate is false after receiving e2', and one to indicate that the predicate is true after receiving e3'.)
It is not clear how to adapt the requirements to deal with this situation. The only plausible solution I can see is to say that the notifications that are produced should depend only on the received events, not on the events that are sent. This is equivalent to specifying that events cannot be dropped.
Impossibility result #2: re-ordered events | {
"domain": "cs.stackexchange",
"id": 16696,
"lm_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, reference-request, distributed-systems",
"url": null
} |
electric-circuits, capacitance, frequency, inductance
Title: How do I derive the frequency of oscillation of the capacitor voltage? The formula is $$\omega= \frac{1}{\sqrt{L \times C}}.$$ How do I derive this? Your equation is for the resonant frequency of a series LC circuit. Resonance occurs when the capacitive and inductive reactances are equal. Set the capacitive reactance equal to the inductive reactance and solve for ω.
Hope this helps. | {
"domain": "physics.stackexchange",
"id": 64915,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, capacitance, frequency, inductance",
"url": null
} |
vector-fields, mathematics, calculus, conservative-field
and by Stokes' theorem, the closed line intergral over any path would also be $0$, making the field conservative. I'm assuming that the domain of $\vec F$ is $\Bbb R^3$. Hope this is helpful. | {
"domain": "physics.stackexchange",
"id": 84037,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vector-fields, mathematics, calculus, conservative-field",
"url": null
} |
esters, organic-oxidation, decomposition
https://sutherland.che.utah.edu//USCI2013/PAPERS/1A07-070RK-0061.pdf | {
"domain": "chemistry.stackexchange",
"id": 11768,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "esters, organic-oxidation, decomposition",
"url": null
} |
automata, regular-languages, regular-expressions
(x+y)*: one of length 0, two of length 1, four of length 2, eight of length 3
y: one of length 1
(a+ab)*: one of length 0, one of length 1, two of length 2 (aa, ab), three of length 3 (aaa, aab, aba)
Now, how could you combine these to get length 4?
0 from the first (1), 1 from the second (1), 3 from the third (3)
1 from the first (2), 1 from the second (1), 2 from the third (2)
2 from the first (4), 1 from the second (1), 1 from the third (1)
3 from the first (8), 1 from the second (1), 0 from the third (1)
For each of those, multiply the number of possibilities. Taking 1 from the first, 1 from the second, and 2 from the third, for instance, gives 2×1×2=4 possibilities.
The sum of these is the total number of length-4 strings matched by this RE: (1)(1)(3)+(2)(1)(2)+(4)(1)(1)+(8)(1)(1) = 3+4+4+8 = 19. | {
"domain": "cs.stackexchange",
"id": 11793,
"lm_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, regular-languages, regular-expressions",
"url": null
} |
$= 2\pi \left[1 - 0\right]$
$= 2\pi$.
Since $I^2 = 2\pi$ that means $I = \sqrt{2\pi}$.
We have shown that
$\int_{-\infty}^{\infty}{e^{-\frac{1}{2}x^2}\,dx} = \sqrt{2\pi}$
So that means
$\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}{e^{-\frac{1}{2}x^2}\,dx} = \frac{1}{\sqrt{2\pi}}\sqrt{2\pi}$.
Therefore
$\int_{-\infty}^{\infty}{\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}\,dx} = 1$
which is what we require for any probability density function. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771782476948,
"lm_q1q2_score": 0.83675523564836,
"lm_q2_score": 0.8479677622198947,
"openwebmath_perplexity": 393.9815307405615,
"openwebmath_score": 0.9679954051971436,
"tags": null,
"url": "http://mathhelpforum.com/calculus/142395-double-integration.html"
} |
c++, strings, c++11, immutability
String & operator=(String other){
std::swap(_data, other._data);
return *this;
}
const char *c_str() const{
return _data.get();
}
int cmp(const String & other) const{
if (c_str() == nullptr)
return other ? -1 : 0;
return strcmp(*this, other);
}
operator bool() const{
return c_str();
}
operator const char *() const{
return c_str();
}
bool operator == (const String & other) const{
return cmp(other) == 0;
}
bool operator != (const String & other) const{
return cmp(other) != 0;
}
bool operator > (const String & other) const{
return cmp(other) > 0;
}
bool operator >= (const String & other) const{
return cmp(other) >= 0;
}
bool operator < (const String & other) const{
return cmp(other) < 0;
}
bool operator <= (const String & other) const{
return cmp(other) <= 0;
} | {
"domain": "codereview.stackexchange",
"id": 14836,
"lm_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, c++11, immutability",
"url": null
} |
8d problem solving methodology ppt free business plan templates for word freeBusiness plan review services how creativity and critical thinking relate to contingency planning quoting in essays how to make a business plan free templates essay verbs list research proposal example for phd cite an essay mla word problem solving solve word problems, amount of money invested, and a larger investment grows faster. steepness. An example of an exponential growth word problem is the following: '$1000 is invested at 9% interest compounded annually. The exponential decay of an element is given by the function: In this function, is the amount of the element left after days, and is the initial amount of the element. Benjamin Tuesday the 31st. Initial Value Problems for Growth and Decay Example 1: Unlimited Population Growth The number of bacteria in a liquid culture is observed to grow at a rate proportional to the number of cells present. It depreciates at a rate of 13% a year. From 2000 - 2010 a | {
"domain": "thebuildsuccess.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357567351325,
"lm_q1q2_score": 0.8470853127300599,
"lm_q2_score": 0.8652240808393984,
"openwebmath_perplexity": 853.2557488221838,
"openwebmath_score": 0.5186667442321777,
"tags": null,
"url": "http://thebuildsuccess.com/lw8kc/how-to-do-exponential-growth-and-decay-word-problems.html"
} |
php, object-oriented
public function __construct(UrlBuilderIface $urlBuilder) {
$this->urlBuilder = $urlBuilder;
}
public function searchPublicPosts($query) {
if (empty($query) || !is_string($query)) {
throw new InvalidArgumentException('query must be a non empty string.');
}
return $this->__apiCall($this->urlBuilder('search', array('q' => $query)));
}
private function __apiCall($url) {
$raw = file_get_contents($url);
return json_decode($raw, true);
}
}
Note how there is checking for the passed in parameter to the method. The check is simple, and it makes the rest of the code easy. It is also easy to think about it completely separately from the other code (because you know that an exception will be thrown if the guard condition is met).
Usage becomes:
$facebookGraphUrlBuilder = new UrlBuilder('https', 'graph.facebook.com', '');
$facebook = new Facebook($facebookGraphUrlBuilder); | {
"domain": "codereview.stackexchange",
"id": 1651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented",
"url": null
} |
c, matrix
deallocateList(&occ1);
deallocateList(&occ2);
deallocateArr(arr1, rows1);
deallocateArr(arr2, rows2);
return 0;
}
Example inputs/outputs:
test case 1
input:
2 2
1 1
1 1
3 4
1 1 3 4
1 2 3 4
1 2 3 4
output:
test case 2
input:
2 3
1 2 2
4 -5 -6
4 5
0 -3 2 1 -12
3 4 5 -5 -1
2 -6 2 9 0
11 22 33 44 55
output:
-5;-6
2;2
test case 3
2 2
1 1
1 1
3 4
1 2 3 4
1 2 3 4
1 2 3 4
output:
NO
test case 4
input:
4 4
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-4 -4 -4 -4
2 2
-1 -1
-2 -2
output:
-2;-2
-1;-1 Here, we print an error message to the standard output stream:
puts("Incorrect input.");
I'd expect to use standard error here:
fputs("Incorrect input.\n", stderr);
(Note that puts() appends a newline, but we have to provide our own for fputs().)
Don't use assert() for run-time checks. assert() compiles to nothing in non-debug builds, so we risk undefined behaviour here:
int **arr = malloc(sizeof *arr *rows);
assert(arr != NULL); | {
"domain": "codereview.stackexchange",
"id": 37141,
"lm_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, matrix",
"url": null
} |
programming, circuit-construction, cirq
Title: Multiplying quantum circuits in cirq using * and computing "expectation values" I am reading cirq guide about Simulation and there is an example in "Expectation values" paragraph that I don't understand.
Everything boils down to the following snippet:
import cirq
q0 = cirq.GridQubit(0, 0)
q1 = cirq.GridQubit(1, 0)
def basic_circuit():
sqrt_x = cirq.X**0.5
yield sqrt_x(q0), sqrt_x(q1)
yield cirq.CZ(q0, q1)
yield sqrt_x(q0), sqrt_x(q1)
circuit = cirq.Circuit(basic_circuit())
XX_obs = cirq.X(q0) * cirq.X(q1)
ZZ_obs = cirq.Z(q0) * cirq.Z(q1)
ev_list = cirq.Simulator().simulate_expectation_values(circuit, observables=[XX_obs])
print(ev_list)
# Output:
[(1+0j)] | {
"domain": "quantumcomputing.stackexchange",
"id": 2608,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming, circuit-construction, cirq",
"url": null
} |
organic-chemistry, reaction-mechanism
Title: Why are elimination reactions in organic chemistry known as beta eliminations? Why are organic elimination reactions known as beta eliminations? Why don't we call them alpha eliminations? In an elimination reaction we typically have a leaving group (denoted by "X" in the figure below), The carbon that the leaving group is attached to is referred to as the "alpha" carbon. If a hydrogen is removed from the "beta" carbon, then we have formed an olefin and the reaction is called a beta elimination.
[reference]
Sometimes an alpha hydrogen can be removed. In this case both the hydrogen and leaving group were attached to the same carbon and a carbene is formed. | {
"domain": "chemistry.stackexchange",
"id": 9207,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, reaction-mechanism",
"url": null
} |
antibody
Personally, I store antibodies I use at -20 (they are in PBS), and they work fine for the first freeze thaw cycle. I have never tried more than one freeze thaw, so cant comment on that.
http://www.abcam.com/ps/pdf/protocols/antibody_storage.pdf | {
"domain": "biology.stackexchange",
"id": 3896,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "antibody",
"url": null
} |
Actually, any even-degree graph can be decomposed into edge-disjoint cycles via the algorithm:
1. Pick a non-isolated vertex $v$ and go for a walk.
2. The first time we see a repeated vertex $u$, then the sub-walk from $u$ back to itself identifies a cycle. Remove it from the graph.
In the above illustration, we'd remove the orange edges (ignoring the directions).
3. If there are non-isolated vertices, go to Step 1. Otherwise, we have found a decomposition into cycles.
Since each vertex has even degree, it must be possible to continue walking until we revisit some vertex (otherwise there's a vertex of degree $1$). We also note the even-degree property does not change by removing a cycle. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97997655637136,
"lm_q1q2_score": 0.814500699842772,
"lm_q2_score": 0.831143045767024,
"openwebmath_perplexity": 309.2732311655416,
"openwebmath_score": 0.36707523465156555,
"tags": null,
"url": "https://math.stackexchange.com/questions/2164968/proving-that-a-4-regular-graph-has-two-edge-disjoint-cycles"
} |
go
} The code in the question cannot determine which result corresponds to which operation. Otherwise, the code is correct. Here are two alternatives for improving the code:
1. Eliminate the channel
Change the operations to simple functions that return an int. This makes it easier to test and reason about the implementation of the operations.
Collect the results in a slice instead of in a channel. With this change, we know that result of operations[0] is at slice index 0, operations[1] is at slice index 1 and so on.
Move all the waitgroup and goroutine related code together in main. This makes the concurrency aspect of the program easier to understand.
Here's the code:
package main
import (
"fmt"
"sync"
)
type f func(int, int) int
func add(x, y int) int {
return (x + y)
}
func sub(x, y int) int {
return (x - y)
}
func prod(x, y int) int {
return (x * y)
}
func main() {
var operations []f = []f{add, sub, prod}
x, y := 10, 20 | {
"domain": "codereview.stackexchange",
"id": 40307,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "go",
"url": null
} |
c++, console, windows, enum
DarkYellow = 6,
//
// Summary:
// The color gray.
Gray = 7,
//
// Summary:
// The color dark gray.
DarkGray = 8,
//
// Summary:
// The color blue.
Blue = 9,
//
// Summary:
// The color green.
Green = 10,
//
// Summary:
// The color cyan (blue-green).
Cyan = 11,
//
// Summary:
// The color red.
Red = 12,
//
// Summary:
// The color magenta (purplish-red).
Magenta = 13,
//
// Summary:
// The color yellow.
Yellow = 14,
//
// Summary:
// The color white.
White = 15,
}
} | {
"domain": "codereview.stackexchange",
"id": 6221,
"lm_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++, console, windows, enum",
"url": null
} |
c++, object-oriented, c++17, networking, web-services
The diagram below briefly explains the flow.
]
Codes:
There are quite a few helper classes. I will list them level by level up.
Utils
#ifndef SRC_INCLUDE_UTILS_H_
#define SRC_INCLUDE_UTILS_H_
#define NON_COPYABLE(class_name) \
class_name(const class_name &) = delete; \
class_name &operator=(const class_name &) = delete
#define NON_MOVEABLE(class_name) \
class_name(class_name &&) = delete; \
class_name &operator=(class_name &&) = delete
#define NON_COPYABLE_AND_MOVEABLE(class_name) \
class_name(const class_name &) = delete; \
class_name &operator=(const class_name &) = delete; \
class_name(class_name &&) = delete; \
class_name &operator=(class_name &&) = delete
#endif // SRC_INCLUDE_UTILS_H_
Buffer
#ifndef SRC_INCLUDE_BUFFER_H_
#define SRC_INCLUDE_BUFFER_H_
#include <string>
#include <vector>
#define INITIAL_BUFFER_CAPACITY 1024
namespace TURTLE_SERVER { | {
"domain": "codereview.stackexchange",
"id": 44217,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented, c++17, networking, web-services",
"url": null
} |
Laplace Equation, Markov Chain INTRODUCTION There are different methods to solve the Laplace equation like the finite element methods, finite difference methods, moment method and Markov chains method [7]. where u is the velocity and vis the vorticity. Due to stability problems which occur as a result of source. Use FD quotients to write a system of di erence equations to solve two-point BVP Higher order accurate schemes Systems of rst order BVPs Use what we learned from 1D and extend to Poisson’s equation in 2D & 3D Learn how to handle di erent boundary conditions Finite Di erences October 2, 2013 2 / 52. methods for treating these systems of equations. Lowengrub, C. u 5 u b at the boundary. The method is chosen because it does not require the linearization or assumptions of weak nonlinearity, the solutions are generated in the form of general solution, and it is more realistic compared to the method of simplifying the physical problems. And the Shortley-Weller method [2] is a basic | {
"domain": "cbeu.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419671077918,
"lm_q1q2_score": 0.8084519532964451,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 593.6983759923623,
"openwebmath_score": 0.6288873553276062,
"tags": null,
"url": "http://ufap.cbeu.pw/solution-of-poisson-equation-by-finite-difference-method.html"
} |
quantum-mechanics, quantum-spin, tensor-calculus
Questions:
If one would simply consider the direct sum of the three particles, i.e. $ℂ^2 ⊕ ℂ^2 ⊕ ℂ^2$ we would only have 6 states, correct?
What is the simplest picture to see the consequences of doing this instead of taking the tensor product?
Maybe one could also give me a good (physical) example for the difference of $ℝ^3 ⊗ℝ^2$ versus $ℝ^3 ⊕ℝ^2$ (phase space?). | {
"domain": "physics.stackexchange",
"id": 18652,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-spin, tensor-calculus",
"url": null
} |
linear-programming, integer-programming
Converting the formula in POS, i.e., in conjunctive normal form (CNF), to integer programming, we obtain the following system of linear inequalities
$$\begin{array}{rl} (1-x) + y &\geq 1\\ x + (1-y) + z &\geq 1\\ y + (1-z) &\geq 1\end{array}$$
which can be rewritten as follows
$$\begin{array}{rl} -x + y &\geq 0\\ x - y + z &\geq 0\\ y -z &\geq 0\end{array}$$
Verifying in Haskell:
λ> triples = [ (x,y,z) | x <- [0,1], y <- [0,1], z <- [0,1] ]
λ> filter (\(x,y,z)->(-x+y>=0) && (x-y+z>=0) && (y-z>=0)) triples
[(0,0,0),(0,1,1),(1,1,0),(1,1,1)] | {
"domain": "cs.stackexchange",
"id": 9142,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linear-programming, integer-programming",
"url": null
} |
javascript, dom
// create an array that will hold the values we wish to pass to our links
// in the menu
var listItem = [itemName, id, className, target, href];
// Create the labels so each input can have a unique label
var labels = ['Name', 'ID', 'Class', 'Target', 'Link'];
// Helper text
h2 = document.createElement('h2');
text = 'Fill in the fields below to create a new menu item';
h2.innerText = text;
f.appendChild(h2);
// loop through the list items
listItem.forEach(function(element, index){
// for each element, call the createDOMNode function and pass in required data
element = createDOMNode(labels[index], 'input', 'text', 'input_' + index);
// append each element to the form container
f.appendChild(element);
});
// create the button and give it an onclick handler
btn = document.createElement('button');
btn.innerText = 'Create Menu Item';
f.appendChild(btn);
btn.onclick = getUserInput;
} | {
"domain": "codereview.stackexchange",
"id": 23485,
"lm_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, dom",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.