text stringlengths 1 1.11k | source dict |
|---|---|
reinforcement-learning, evolutionary-algorithms, q-learning
Policy gradient solvers learn a policy function $\pi(a|s)$ that gives the probability of taking action $a$ given observed state $s$. Typically this is implemented as a neural network. Neural networks are initialised randomly. For discrete action selection using softmax output layer, the initial function will roughly be choosing evenly from all possible actions. So if some actions oppose and undo each other, e.g. move left and move right are options - then the situation as described in your quote can easily happen. Nowadays there are many other solutions using policy gradients that don't suffer as much with this effect. For instance, deterministic policy gradient methods such as A2C or DDPG. | {
"domain": "ai.stackexchange",
"id": 783,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, evolutionary-algorithms, q-learning",
"url": null
} |
ros2, ros-humble, communication, composition, intraprocess-communication
# ROS 2 Component Container
container = ComposableNodeContainer(
name='zed_depth_to_laserscan',
namespace=camera_name_val,
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
zed_wrapper_component,
zed_cvt_component
],
output='screen',
)
``` Actually, yes! The code just has to provide the QoS override as a valid option:
node->create_publisher(
"chatter",
KeepLast{10},
QosOverridingOptions{true}); // allow_reconfigurable all qos
Then it can be set:
/my/ns/node_name:
ros__parameters:
qos_overrides: # group for all the qos settings
'my/fully/qualified/topic/name/here':
publisher:
reliability: reliable
history_depth: 100
history: keep_last | {
"domain": "robotics.stackexchange",
"id": 38815,
"lm_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, ros-humble, communication, composition, intraprocess-communication",
"url": null
} |
# Can we decompose a polynomial into difference of convex polynomials?
Given a multivariate polynomial $p(x_1, ..., x_n)$ on $\mathbb{R}^n$, can we always decompose it into the difference of two convex polynomials? i.e., is there a pair of convex polynomials $f$ and $g$, such that: $\forall (x_1, ..., x_n) \in \mathbb{R}^n$, $p(x_1, ..., x_n) = f(x_1, ..., x_n) - g(x_1, ..., x_n)$?
If given a bounded region $\mathbb{N}$ which is a convex subset of $\mathbb{R}^n$, can we then decompose polynomial $p(x_1, ..., x_n)$ such that in $\forall (x_1, ..., x_n) \in \mathbb{N}$ , $p(x_1, ..., x_n) = f(x_1, ..., x_n) - g(x_1, ..., x_n)$ where $f$ and $g$ are convex polynomials.
If we can (no matter under the unbounded or bounded case), is there any constructive method to find such a pair of $f$ and $g$ for a given $p$? | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759649262344,
"lm_q1q2_score": 0.8257265401550895,
"lm_q2_score": 0.8418256432832333,
"openwebmath_perplexity": 272.93447659508394,
"openwebmath_score": 0.934917688369751,
"tags": null,
"url": "http://mathoverflow.net/questions/157251/can-we-decompose-a-polynomial-into-difference-of-convex-polynomials"
} |
special-relativity, kinematics, momentum, vectors, differentiation
Title: What mean this momentum-derivative? I'm working with quantum gravity. I have to make a Taylor-series. I got some help for this, but I have problem with understanding the formalism. So, I have the operator $A((P-p)^2)$, which needs to expand in Taylor-series near $p$. The help that I got was to use operator $\partial_{p_{\mu}}$. Why? What does that mean? What is the difference beetween $p$ and $p_\mu$?. $p_\mu = (p_0,p_1,p_2,p_3)$ is that equation right ? So, $p_{\mu}$ is a (coordinate?) representation for $p$?
And why is that true:
$\partial_{p_{\mu}} (P-p)^2 = 2 (P_{\mu}- p_{\mu})$ A function of $p^2 = p_\mu p^\mu$ has a Taylor series near $q$ of
$$f(p^2) = f(q) + \frac{\partial f(p^2)}{\partial p^\mu}\bigg|_{p = q}(p_\mu - q_\mu) + \frac{1}{2!}\frac{\partial^2 f(p^2)}{\partial p^\mu\partial p^\nu}\bigg|_{p = q}(p_\mu - q_\mu)(p_\nu - q_\nu) + \cdots$$
With this and the hint given to you by @probably_someone you should be able to work this out. | {
"domain": "physics.stackexchange",
"id": 66176,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, kinematics, momentum, vectors, differentiation",
"url": null
} |
beginner, reinventing-the-wheel, random, rust
io::stdin()
.read_line(&mut pass_leng_str)
.expect("Faild to read the line");
let pass_leng_str = pass_leng_str.trim();
match pass_leng_str.parse::<u32>(){
Ok(i) => {
length = i;
break;
},
Err(..) => {
println!("Not a valid integer!");
},
}
}
println!("Enter the characters you want to exclude: ");
let mut exclude = String::new();
io::stdin()
.read_line(&mut exclude)
.expect("Faild to read the line");
let excluded : Vec<char> = exclude.chars().collect();
println!("{}", password::rand_pass(length, excluded));
}
password.rs :
use super::xorshift; | {
"domain": "codereview.stackexchange",
"id": 40885,
"lm_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, reinventing-the-wheel, random, rust",
"url": null
} |
kinematics, forward-kinematics, dh-parameters
In this picture I show your link lengths $L_1$, $L_2$, and $L_3$, along with coordinate systems $0$ through $5$. I left the $\hat Y$ axes out for clarity, but they follow the right-hand rule.
Your positional vector loop is $$\vec P_t = L_1 \hat Z_1 + L_2 \hat X_2 + L_3 \hat Z_5$$
where $\vec P_t$ represents the position of the center of your tool tip.
Now find the rotation matrices to define the unit vectors $\hat Z_1$, $\hat X_2$, and $\hat Z_5$.
I will use $_x^{x+1}R$ for the rotation matrix between coordinate systems $x$ and $x+1$, and $\theta_i$ to represent the $i$th joint angle.
$$_0^1R = \begin{bmatrix}
\cos \theta_1&-\sin \theta_1&0\\
\sin \theta_1&\cos \theta_1&0\\
0&0&1
\end{bmatrix}
$$
$$_1^2R = \begin{bmatrix}
\cos \theta_2&-\sin \theta_2&0\\
0&0&1\\
-\sin \theta_2&-\cos \theta_2&0
\end{bmatrix}
$$
(notice $\hat Y_2$ should point "down")
$$_2^3R = \begin{bmatrix}
0&0&1\\
-\sin \theta_3&-\cos \theta_3&0\\
\cos \theta_3&-\sin \theta_3&0
\end{bmatrix}
$$ | {
"domain": "robotics.stackexchange",
"id": 885,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, forward-kinematics, dh-parameters",
"url": null
} |
electromagnetism, lagrangian-formalism, gauge-theory, magnetic-monopoles
To make contact with the usual vector notation, observe that the Faraday tensor has the covariant matrix representation
$$F = \begin{bmatrix}0&-~\mathbf E^T\\\mathbf E&\star\mathbf H\end{bmatrix}$$
where $\star\mathbf H$ is the Hodge dual of the magnetic field $\mathbf H$, and can be thought as the linear map $(\star\mathbf H)\mathbf v = \mathbf v\times\mathbf H$ for any $\mathbf v\in\mathbb R^3$.
Skew-symmetric tensors as the one above are then represented by a polar vector $\mathbf E$ and an axial vector $\mathbf H$, and can be denoted as $F=(\mathbf E,\mathbf H)$. Having defined this notation, the action of the Hodge dual is then $\star(\mathbf E,\mathbf H) = (\mathbf H,-\mathbf E)$ (up to a sign which I can't be bothered remembering). The exterior derivative of the 4-current $A$ is a tensor of the form above, and it turns out that
$$\text dA = \left(\nabla A^0+\frac{\partial\mathbf A}{\partial t},\nabla\times\mathbf A\right),$$ | {
"domain": "physics.stackexchange",
"id": 19614,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, lagrangian-formalism, gauge-theory, magnetic-monopoles",
"url": null
} |
thermodynamics, volume
$$ \frac{dT}{dt} = \frac{1}{CM} \frac{dQ}{dt} $$
and we already have an expression for $dQ/dt$ from our equation (1) above. If we substitute this we get an expression for the rate of cooling:
$$ \frac{dT}{dt} = \frac{1}{CM} k A \Delta T $$
The last step is to replace the mass $M$ and the skin area $A$ with the equations from above, and do some rearranging to tidy up the expression, and we get:
$$ \frac{dT}{dt} = \frac{3k\Delta T}{C} \frac{1}{r} $$
and since $k$, $\Delta T$ and $C$ are all constants we get:
$$ \frac{dT}{dt} \propto \frac{1}{r} $$
So the rate of cooling is inversely proportional to the radius of the animal. Big animals cool slowly and small animals cool fast. | {
"domain": "physics.stackexchange",
"id": 30221,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, volume",
"url": null
} |
newtonian-mechanics, electromagnetism, magnetic-fields
the fact that the Lorentz force is perpendicular to motion should only guarantee a constant speed curvilinear motion
But if the speed is constant the Lorentz force is constant because it is proportional to the speed. That means the particle is moving with a constant centripetal force and therefore its path has a constant curvature. And the only way to move with constant curvature (in 2D) is to move in a circle. | {
"domain": "physics.stackexchange",
"id": 94393,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, electromagnetism, magnetic-fields",
"url": null
} |
python, image, steganography
If you were to link this up with PIL to get proper encoding and decoding.
Then you force the user to pass a PIL image,
then you could drasticly reduce the complexity of your program.
It allows you to do things like:
# You may want to have `chr` and `ord` done inside,
# but this is more flexible.
''.join(map(chr, decode(encode(map(ord, 'Hi'), [0, 0, 0, 0], 4), 4)))
# Hi
So I would say that it's safe.
But I would put a check on the size of the bits.
Also slap PIL onto this and put it into a class and then you have half your program in almost no lines. Where you could encode or decode any image.
Then you just need to get a couple of functions/a class to make the Imgur and other web aspects of the program. And it should be much easier to read.
Performance wise the above is the best I could get, but I didn't experiment too much. My speed test and results. | {
"domain": "codereview.stackexchange",
"id": 15973,
"lm_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, image, steganography",
"url": null
} |
machine-learning, convolutional-neural-networks, algorithm
At the moment, we have the ability to analayze each maze using a CNN algorithm for image classification and generate an xml that represents a way out of the maze - meaning that if the characters will be moved according to that file, they will cross the maze. That algorithm has been tested and can not be changed by any means.
The problem is that most of the times the generated file is not the best one possible (and quite often it is very noticeable). There are different, faster, better ways to cross the maze.
We also have thousands (and we can get as many as needed) files that were created manually for saved mazes and therefore they are representing an elegant and a fast way out of the maze. The ideal goal is that someday, our program will learn how to generate such a file without people creating them manually. | {
"domain": "ai.stackexchange",
"id": 452,
"lm_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, convolutional-neural-networks, algorithm",
"url": null
} |
reductions, np-hard
$$\text{CLIQUE-or-almost} = \{(G,k) \mid \text{ $G$ contains a $k$-clique with possibly one missing edge}\}.$$ If $G=(V, E)$ is the graph of an instance of CLIQUE-or-almost to CLIQUE,
then you can create a new graph $G'$ as the disjoint union of $G$ with all the graphs $G + e$ for $e \in \binom{V}{2} \setminus E$.
Then $G$ has a clique or an almost-clique on $k$ vertices if and only if $G'$ has a clique on $k$ vertices.
This shows that CLIQUE-or-almost $\le_p$ CLIQUE.
You can also show a polynomial reduction from CLIQUE to CLIQUE-or-almost.
Start with the graph $G=(V,E)$ in the instance of CLIQUE and build a graph $G'$ in which there are two copies $v_1, v_2$ of each vertex $v \in V$ along with the edge $(v_1, v_2)$. For each $(u,v) \in E$ add to $G'$ the four edges $(u_1, v_1), (u_1, v_2), (u_2, v_1), (u_2, v_2)$.
If there is a clique $C$ of size $k$ in $G$ then there is a clique of size $2k$ in $G'$ (consider all the copies of the vertices in $C$). | {
"domain": "cs.stackexchange",
"id": 14937,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reductions, np-hard",
"url": null
} |
estimate the values of definite integrals when a closed form of the integral is difficult to find or when an approximate value only of the definite integral is needed. I just wrapped up a semester of calculus TA duties, and I thought it would be fun to revisit the problem of integration from a numerical standpoint. Write this estimate for the integral of f'' Then notice that the integral on the left is easy to evaluate. Trapezoidal Rule Trapezoidal Rule In numerical analysis, the trapezoidal rule (also known as the trapezoid rule or trapezium rule) is an approximate technique for calculating the definite integral. Then nd the di erence between the. Numerical Integration. Now for solving such integrals using a two-points quadrature formula is applied and that is the Trapezoidal Rule. Proof of trapezoidal approximation 5. Indeed, we nd that the trapezoidal rule with n = 100 gives the approx-imation 0:200033333 to the integral, good to 4 but not to 5 decimal places, while Simpson’s rule | {
"domain": "tuerschliesser-spezialist.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180627184411,
"lm_q1q2_score": 0.8170999541679227,
"lm_q2_score": 0.828938806208442,
"openwebmath_perplexity": 470.40612101045696,
"openwebmath_score": 0.8388261198997498,
"tags": null,
"url": "http://bggx.tuerschliesser-spezialist.de/numerical-integration-trapezoidal-rule.html"
} |
through the course content to create an accelerated learning sequence, so this model is often, but not always, implemented through use of a computer lab. Modular Arithmetic and Cryptography! Khan Academy is a 501(c)(3) nonprofit organization. We've got the best prices, check out yourself! A remainder is left over. In modular arithmetic, we select an integer, n, to be our \modulus". Competitors' price is calculated using statistical data on writers' offers on Studybay, We've gathered and analyzed the data on average prices offered by competing websites. Modular arithmetic is often used to calculate checksums that are used within identifiers - International Bank Account Numbers(IBANs) for example make use of modulo 97 arit… The numbers go from $1$ to $12$, but when you get to "$13$ o'clock", it actually becomes $1$ o'clock again (think of how the $24$ hour clock numbering works). The following example uses several mathematical and trigonometric functions from the Math class to calculate | {
"domain": "webreus.net",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9697854111860906,
"lm_q1q2_score": 0.8299919493444887,
"lm_q2_score": 0.8558511396138365,
"openwebmath_perplexity": 1311.5734329508234,
"openwebmath_score": 0.30894050002098083,
"tags": null,
"url": "http://43929101674.srv040130.webreus.net/how-many-tludi/modular-system-math-cdb971"
} |
javascript, object-oriented, ecmascript-6, parse-platform
Title: Creating and finding posts using Parse.com The following code calls Parse. And uses its API to create two functions: post.create and post.find. As the names imply, one is for creating posts and the other for fetching them.
Example:
import Parse from 'parse'
Parse.initialize('APP_ID', 'CLIENT_KEY')
const post = {}
post.create = json => {
const Post = Parse.Object.extend('Post')
const post = new Post()
post.save(json).then(object => {
console.log('yay! it worked', object)
})
}
post.find = () => {
const query = new Parse.Query(Post)
let arr = []
query.find({
success: function (results) {
results.forEach(function (result) {
arr.push(result.toJSON())
})
},
error: function (error) {
alert('Error: ' + error.code + ' ' + error.message)
}
})
return arr
}
export default post | {
"domain": "codereview.stackexchange",
"id": 17881,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, object-oriented, ecmascript-6, parse-platform",
"url": null
} |
ros, ros-kinetic
typedef typename mpl::at_c<Events, 0>::type M0Event;
^~~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:84:47: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Events, 1>::type M1Event;
^~~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:85:47: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Events, 2>::type M2Event;
^~~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:86:47: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Events, 3>::type M3Event;
^~~~~~~
/opt/ros/kinetic/include/message_filters/synchronizer.h:87:47: error: ‘int’ is not a class, struct, or union type
typedef typename mpl::at_c<Events, 4>::type M4Event; | {
"domain": "robotics.stackexchange",
"id": 31583,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic",
"url": null
} |
ros, asus-xtion-pro-live, openni2, depth
Title: Format of depth value openni2_camera
I used the openni2 to install in my ARM-Board from this website link, now I want to know clearly how is the format of the depth data get from Asus Xtion looks like? Because I met some confuses when I display the depth data in image, it was just the black-white image not gray image. Now maybe I should calibration of this data but I dont know the format.
void imageCb_d(const sensor_msgs::ImageConstPtr& msg)
{
cv_bridge::CvImagePtr cv_ptr;
try
{
cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::TYPE_32FC1);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::imshow("Depth", cv_ptr->image);
cv::waitKey(3);
image_pub_.publish(cv_ptr->toImageMsg());
} | {
"domain": "robotics.stackexchange",
"id": 17104,
"lm_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, asus-xtion-pro-live, openni2, depth",
"url": null
} |
• Let $N$ be the closest integer to $b\alpha$.
• Write $N$ as $av - bu$ with $|v| \le \frac{b}{2}$ (using the extended Euclidean algorithm).
• Pick $n = b + v$ and $k = a + u$, then $|n\log\phi - k - \alpha| < \frac3b \le \frac{\beta}2$.
So $42$ is a prefix of the Fibonacci number $F_n$.
Doing this example with actual numbers:
• Here, $\frac6{\beta}$ is about $1174.26$, and the convergents of $\log\phi$ are $\frac14, \frac15, \frac4{19}, \frac5{24}, \frac9{43}, \frac{14}{67}, \frac{93}{445}, \frac{386}{1847}, \dots$, so we take $a = 386$, $b = 1847$.
• The closest integer to $1847\alpha$ is $N = 1806$.
• $1806 = 386v - 1847u = 386(-225) - 1847(-48)$. That is, $v = -225$, $u = -48$.
• $n = b + v = 1847 - 225 = 1622$, and $k = a + u = 386 - 48 = 338$, and indeed the Fibonacci number $F_{1622} = 425076879\dots326170761$. (339 digits) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806512500485,
"lm_q1q2_score": 0.8084514211559407,
"lm_q2_score": 0.8244619350028204,
"openwebmath_perplexity": 229.86216274347393,
"openwebmath_score": 0.9473696351051331,
"tags": null,
"url": "http://math.stackexchange.com/questions/74861/prefix-of-fibonacci-number?answertab=votes"
} |
ros, stack, ogre
Originally posted by ahendrix with karma: 47576 on 2012-01-17
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by weiin on 2012-01-17:
Thank you! It worked (for rviz as well). | {
"domain": "robotics.stackexchange",
"id": 7923,
"lm_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, stack, ogre",
"url": null
} |
javascript, beginner, jquery, animation
function fadeInParagraph() {
$(".soc" + config.iterator + " + p").fadeIn(config.socpAnimSpeed,
function() {
config.iterator++;
animateWidth(config);
});
}
}); | {
"domain": "codereview.stackexchange",
"id": 24700,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, beginner, jquery, animation",
"url": null
} |
fluid-dynamics, navier-stokes
It is low order in a statistical sense. If we needed our expression for $\mu$ to be based on a time averaged temperature, we can't solve the equations because we don't know a time averaged temperature until we solve the equations. It's circular. Time averaging is a first-order term. If it depended on the skewness or kurtosis or even higher order moments of variables, or high order moments of correlations of variables, then it's even harder to solve (although, "harder" isn't really true because it's already impossible...).
To summarize, to be determinant we must have equations relating all of the variables to all of the other variables. These expressions must depend only on known information, such as the instantaneous values of the variables and are thus low-order terms. | {
"domain": "physics.stackexchange",
"id": 18230,
"lm_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, navier-stokes",
"url": null
} |
ros-kinetic
Comment by gvdhoorn on 2022-04-05:
I've uploaded binaries for an interim release, which includes binaries for V9.10. See fanuc_driver_exp/releases.
Comment by nicob on 2022-04-07:
Thank you! The driver works fine for me. | {
"domain": "robotics.stackexchange",
"id": 32805,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-kinetic",
"url": null
} |
reinforcement-learning, markov-hidden-model
Of course I may not have a choice as creating an accurate environment is out of question. But just trying to understand.
Appreciate your thoughts. The performance of a classical agent strongly depends on how close the observation approximates the true state of the environment. The state is sometimes defined as all we need to know to model the dynamics forward in time. Therefore, the closer it is possible to infer the dynamics of the environment with the information provided, the better the performance.
A common case study in RL is Atari. There, one observation (pixel image) alone would be insufficient to make progress at all. But if you stack consecutive images together, then this can provide sufficient information for an agent developed for MDPs like DQN to learn games like Breakout, Space Invaders or Pong.
Now, this is not enough for games that require memory, like Montezuma's Revenge, which would be considered as a POMDP. | {
"domain": "datascience.stackexchange",
"id": 11112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, markov-hidden-model",
"url": null
} |
python, python-3.x
a = ["/desktop/folderA/fileA", "/desktop/folderA/folderX/file1", "/diskKH/folderA/fileA", "/desktop/folderB/folderC/fileX"]
res = get_res_array(a)
res = cir_array_to_result(res)
print("res:", res)
There are still some other ways to improve the code, but they're starting to get challenging to implement.
High Level Review
It's much easier to use dictionaries in a different way.
By only taking the folder names as the keys and having them point to child dictionaries we can build a tree.
root = {}
root.setdefault('desktop', {}).setdefault('folderA', {}).setdefault('fileA', {})
print(root)
# {'desktop': {'folderA': {'fileA': {}}}}
root.setdefault('desktop', {}).setdefault('folderA', {}).setdefault('folderX', {}).setdefault('file1', {})
print(root)
# {'desktop': {'folderA': {'fileA': {}, 'folderX': {'file1': {}}}}} | {
"domain": "codereview.stackexchange",
"id": 38319,
"lm_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",
"url": null
} |
programming-challenge, interview-questions, objective-c, ios
batteryLevelString = [NSString stringWithFormat:@"Battery Level = %0.2f", [thisDevice batteryLevel]];
return batteryLevelString;
}
- (NSString *)provideBatteryState
{
NSString *batterStateString = nil;
NSArray *batteryStateArray = @[
@"Battery state is unknown",
@"Battery is not plugged into a charging source",
@"Battery is charging",
@"Battery state is full"
];
batterStateString = [NSString stringWithFormat:@"Battery state = %@", batteryStateArray[thisDevice.batteryState]];
return batterStateString;
}
@end
PCINetworkingDataModel.h
//
// PCINetworkingDataModel.h
// PCIDataModelLibrary
//
// Created by Paul Chernick on 4/17/17.
// Provides an internet connection interface that retrieves the 15 minute delayed price of American Express.
#import <Foundation/Foundation.h> | {
"domain": "codereview.stackexchange",
"id": 25534,
"lm_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-challenge, interview-questions, objective-c, ios",
"url": null
} |
performance, vba, excel
Private Sub LogError(ByRef errorWS As Worksheet, _
ByVal desc As String, _
ByVal rowNum As Long, _
ByVal colNum As Long, _
ByVal monitorNum As Long, _
ByVal recData As Variant, _
ByVal errorType As Long)
Const DESCRIPTION As Long = 1
Const ROW_NUMBER As Long = 2
Const COLUMN_TEXT As Long = 3
Const COLUMN_NUMBER As Long = 4
Const MONITOR_TEXT As Long = 5
Const MONITOR_NUMBER As Long = 6
Const RECORD_TEXT As Long = 7
Const RECORD_DATA As Long = 8 | {
"domain": "codereview.stackexchange",
"id": 26817,
"lm_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, vba, excel",
"url": null
} |
sampling
Title: Reconstructing function from samples Assuming I have sampled my function with frequency above nyquist frequency, using the sampling theorem I can reconstruct my original function from the sampled values.
Let's assume though that I change my original function between the sampled values, such that I keep continuity, differentiability etc..
My samples will be the same (as I didn't change the function where it is sampled), but the function will be different.
So from the sampling theorem I should recover the new function from the samples, but I should also get the original function as the sampled values the same.
How can I solve this contradiction? The sampling theorem requires that your function is bandlimited to < samplerate/2.
If it is, then there is no ambiguity in what continuous time function produced your set of samples. | {
"domain": "dsp.stackexchange",
"id": 10835,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sampling",
"url": null
} |
java, strings, mysql, android, hash-map
}
else
{
final String no5 = this.noBTN5.getText().toString().trim();
}
if(yesBTN6.isChecked())
{
final String yes6 = this.yesBTN6.getText().toString().trim();
}
else
{
final String no6 = this.noBTN6.getText().toString().trim();
}
if(yesBTN7.isChecked())
{
final String yes7 = this.yesBTN7.getText().toString().trim();
}
else
{
final String no7 = this.noBTN7.getText().toString().trim();
}
if(yesBTN8.isChecked())
{
final String yes8 = this.yesBTN8.getText().toString().trim();
}
else
{
final String no8 = this.noBTN8.getText().toString().trim();
} | {
"domain": "codereview.stackexchange",
"id": 38868,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, strings, mysql, android, hash-map",
"url": null
} |
evolution, phylogenetics
Similarly, the Haldane is a unit of evolutionary change (I don't know who invented it and it is obviously named after JBS Haldane) and correspond to the number of standard deviation (of the distribution of individual trait in the population) change in the mean of individuals trait in a population per generation. The Haldane unit is therefore dependent on the selection pressure, the additive and non-additive genetic variance and environmental variance (therefore the heritability) and the mutational pressures. | {
"domain": "biology.stackexchange",
"id": 3272,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolution, phylogenetics",
"url": null
} |
matlab, fft, bandwidth
Addition based on nimrodm's comment: My initial statement has to be relativized if the bandwidth of the signal is smaller than $\frac12 f_s$. In that case, if there is additional knowledge about the true signal frequency, this knowledge can be used to resolve the ambiguity introduced by aliasing, and perfect reconstruction of the true signal is possible. See undersampling. However, it is not possible to determine the true frequency from the undersampled signal and nothing else.
A simulated example: Matlab code to generate a frequency-modulated signal with peak at 5 MHz and bandwidth 400 kHz, initially sampled at 24 MHz.
% signal properties
f0 = 5e6; % frequency 5 MHz
sf = 0.4e6; % bandwidth 400 kHz
% sample properties
fs = 24e6; % sampling frequency 24 MHz
N = 10e6; % number of samples | {
"domain": "dsp.stackexchange",
"id": 1418,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, fft, bandwidth",
"url": null
} |
ros, turtlebot, keyboard-teleop
Originally posted by Stefan Kohlbrecher with karma: 24361 on 2013-01-20
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by jd on 2013-01-21:
Teleop does work better when I'm not doing any visualization so that sounds like it could be the problem. I picked up an Xbox controller to try the joystick teleop. I'm going to connect it directly to the turtlebot so that the wireless doesn't have to send the teleop commands and see if that helps
Comment by jd on 2013-01-21:
I ran the gmapping app without RViz on the workstation and using the joystick teleop. Everything worked great. | {
"domain": "robotics.stackexchange",
"id": 12503,
"lm_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, turtlebot, keyboard-teleop",
"url": null
} |
and vertical distances from the origin. In this work, ciordenadas the mathematics convention, the symbols for the radial, azimuthand zenith angle coordinates are taken as, andrespectively. Lecture Video and Notes Video Excerpts. The following steps can be used for graphing polar curves: 1. In particular, it means that a point [r. 1 De ning Polar Coordinates oT nd the coordinates of a point in the polar coordinate system, consider Figure 1. Find the polar form of the vector whose Cartesian form is. Like Cartesian coordinates, polar coordinates are used to identify the locations of points in the plane. PARAMETRIC EQUATIONS & POLAR COORDINATES. 686 CHAPTER 9 POLAR COORDINATES AND PLANE CURVES The simplest equation in polar coordinates has the form r= k, where kis a positive constant. In this section you will study a coordinate system called the polar coordinate system. If a curve is a rectangular coordinate graph of a function, it cannot have any loops since, for a given xvalue there can | {
"domain": "ciadarredamenti.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303401461468,
"lm_q1q2_score": 0.8373394866206931,
"lm_q2_score": 0.8459424334245618,
"openwebmath_perplexity": 598.200690655468,
"openwebmath_score": 0.9244123101234436,
"tags": null,
"url": "http://hobp.ciadarredamenti.it/polar-coordinates-pdf.html"
} |
c#, design-patterns, inheritance
/// <summary>
/// Occurs when this object is about to be disposed.
/// </summary>
public event EventHandler Disposing;
/// <summary>
/// Gets a value indicating whether this object is in the process of disposing.
/// </summary>
protected bool IsDisposing
{
get { return Interlocked.CompareExchange(ref this.disposeStage, DisposalStarted, DisposalStarted) == DisposalStarted; }
}
/// <summary>
/// Gets a value indicating whether this object has been disposed.
/// </summary>
protected bool IsDisposed
{
get { return Interlocked.CompareExchange(ref this.disposeStage, DisposalComplete, DisposalComplete) == DisposalComplete; }
} | {
"domain": "codereview.stackexchange",
"id": 4701,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, design-patterns, inheritance",
"url": null
} |
python, python-3.x, multithreading, beautifulsoup, python-requests
response = requests.get(url)
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
if soup.find("span", {"data-search-type": "Repositories"}): # if there are sizes
self.compareData({
'title': soup.find("input", {"name": "q"})['value'],
'repo_count': {soup.find("span", {"data-search-type": "Repositories"}).text.strip(): None}
})
else:
logger.info(f"No diff for {url}")
else:
logger.info(f"Error for {url} -> {response.status_code}")
time.sleep(30)
def compareData(self, data):
if self.previous_state != data:
if filter_spam(3600, data['repo_count'], self._requests):
logger.info(f"The data has been changed to {data}")
self.previous_state = data | {
"domain": "codereview.stackexchange",
"id": 43588,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, multithreading, beautifulsoup, python-requests",
"url": null
} |
javascript, validation, integer, floating-point
Title: Parsing integers safely Background
I'm writing user input validation for a client-side JavaScript web application. Users enter numerals representing an integer into an <input>. As part of validation, the application must check that parseInt(input.value, 10) will result in the integer represented by the user's input.
In JavaScript, all numbers are floating-points. Within the interval [-253, 253], all integers have exact representations. The challenge is to guarantee that the user has provided a number within the interval. parseInt() doesn't work:
// Yields true
parseInt('9007199254740993', 10) === 9007199254740992;
I'm looking for any feedback. Firstly, correctness, then performance.
Current Solution
var isSafeIntegerString = function() {
'use strict';
// The digits of the greatest and least safe integers, 2**53 and
// -2**53 respectively.
var limDigits = [9, 0, 0, 7, 1, 9, 9, 2, 5, 4, 7, 4, 0, 9, 9, 2]; | {
"domain": "codereview.stackexchange",
"id": 10268,
"lm_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, validation, integer, floating-point",
"url": null
} |
probability-theory, pseudo-random-generators
Title: Why does the distribution of pseudorandom numbers change when operating like this? We were introduced to the standard C rand() function, and how to use it.
At some point during the class we were asked how to roll a die. The simple answer was to create a random number, take its modulo 6, and add 1.
rand()%6 + 1
However, the right answer was building a function that returns a value in the range [0,1) and then operating with that function to get a random number between 1 and 6.
Since most people in my class haven't seen probability yet, we weren't told why this was the right answer, but the class's assistant told us that taking the modulo of the random number produces a normal distribution of the numbers, while the other function we built:
rand / ((double) RAND_MAX + 1) | {
"domain": "cs.stackexchange",
"id": 11031,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "probability-theory, pseudo-random-generators",
"url": null
} |
c#
public static Func<LogicValue, LogicValue, LogicValue> ForwardOrOperation
{
get
{
return (x, y) => ForwardBinaryOperation(x, y, OrOperationTruthTable, _orOperationNumberOfElements);
}
}
public static Func<LogicValue, IEnumerable<Tuple<LogicValue, LogicValue>>> BackwardOrOperation
{
get { return (x) => BackwardBinaryOperation(x, OrOperationTruthTable, _orOperationNumberOfElements); }
} | {
"domain": "codereview.stackexchange",
"id": 16903,
"lm_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#",
"url": null
} |
java, swing, audio
Title: Keyboard music maker I enjoy making silly programs every once in a while. This is one of them. It makes nice sounding notes that vary slightly depending on the key being entered into a TextArea. When you press enter, it plays back all the notes you have entered. That's pretty much all it does. I'm looking for constructive criticism regarding the coding style, and perhaps usability.
package boop;
import java.awt.TextArea;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.HashMap;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;
import javax.swing.JFrame;
public class Boop extends JFrame implements KeyListener {
private final TextArea textArea;
private class Noise implements Runnable { | {
"domain": "codereview.stackexchange",
"id": 14230,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, swing, audio",
"url": null
} |
physical-chemistry, atoms, quantum-chemistry, orbitals
\end{align}
You find that the $2\ce{s}$ electrons are on average further away from the nucleus than the $2\ce{p}$ electrons.
So, for the hydrogenic atom your claim that $2\ce{p}$ electrons are further away from the nucleus than the $2\ce{s}$ electrons is wrong. But in real atoms you have more than one electron and those electrons will influence each other. One important effect here is, that the inner electrons (or electron density) screens nuclear charge from the outer electrons. Thus the outer electrons feel a lower effective nuclear charge $Z^{\mathrm{eff}}$ than the inner electrons. The extend of this screening is distance dependent, so $Z^{\mathrm{eff}}
= Z^{\mathrm{eff}} (r)$. | {
"domain": "chemistry.stackexchange",
"id": 1668,
"lm_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, atoms, quantum-chemistry, orbitals",
"url": null
} |
# Proof that square of an $\sqrt{2 - 4q}$ is not an integer
I want to find a solution for $x$ such that
$(2-x^2) = 0 \mod{4}$
If that is true, I can write
$(2 - x^2) = 4q$
for some integer $q$. We solve for $x$ and get the expression
$x = \sqrt{2 - 4q}$.
I can choose $q$ myself, but no matter what $q$ I choose, I always get $x$ equal to a decimal number. As long as $x$ is a decimal number, $(2-x^2) \mod{4}$ can not be equal to $0$ and so it seems like the equation has no solution. But in order to say this for sure I need to prove that $x$ can not be an integer for any value of $q$. How do I do that? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9546474207360066,
"lm_q1q2_score": 0.8224652345896887,
"lm_q2_score": 0.8615382147637196,
"openwebmath_perplexity": 172.98773451767798,
"openwebmath_score": 0.6583328247070312,
"tags": null,
"url": "https://math.stackexchange.com/questions/1919124/proof-that-square-of-an-sqrt2-4q-is-not-an-integer/1919129"
} |
algorithms, reference-request
They see three bitten apples and pictogram of three birds.
Getting back, people who share knowledge, say starting from primary school, will see it.
The missing part: how people can see the same things with the different distribution of rodes and cones?
First, they see small differences, but are able to infer it. Second, crucial point, when we learn to use sight, we also use touch as training set. Being able to touch something and remember shape, calibrates perception. Based on other senses and continuous training (brain consolidates every new piece of information all the time), the distribution of sensors doesn't matter, as we check out the world and surroundings for something like first five years, and then start to infer and learn abstract ideas, with calibrated sight.
This is solely based on senses and experience. | {
"domain": "cs.stackexchange",
"id": 19003,
"lm_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",
"url": null
} |
special-relativity, reference-frames, time
This example makes me wonder if this peculiarity arises because we have used light wave, which does not require a medium to travel, and hence must have constant speed for all inertial observers. What if we used some material wave instead, say sound?
Say there is a long horizontal tube closed off at both ends, and filled with water. The two clocks are placed at opposite ends of the pipe. A sound wave is generated at the center of the tube which travels through water towards both ends, and clocks begin to run once they receive the sound wave. The entire setup is inside the moving train. Observer on the train will as before say the clocks are synchronized.
But how can the observer on the platform now disagree that the two clocks are synchronized? The conclusion would be the same, but quantitative results would be harder to derive.
Why the conclusion would be the same: | {
"domain": "physics.stackexchange",
"id": 32203,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, reference-frames, time",
"url": null
} |
quantum-chemistry
equation we expand the orbitals as
$\psi{_i}=\sum C_{\mu i}\phi_i$
But for Helium atom we have just one orbital function so the coefficient $C_{\mu i}$ should be a vector not a matrix.
My question is what is the interpretation of the matrix coefficient $C$ in the Roothaan equation $FC=SC\epsilon$ for the helium atom since we've got just one spatial orbital function? The $\mathbf{C}$ matrix will always be $K\times K$, where $K$ is the size of the finite basis set you are using. That is to say, with a basis set of size $K$, you will produce exactly $K$ MOs. This means you will never wind up with $\mathbf{C}$ being a vector. In the example you linked, they use a basis set of size 2, so they get 2 MOs for helium and thus the $\mathbf{C}$ matrix is $2\times 2$. While helium has only one occupied spatial orbital, it will have $K-1$ virtual orbitals depending the size of the basis set you use to solve the restricted Roothaan-Hall equations. | {
"domain": "chemistry.stackexchange",
"id": 11166,
"lm_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-chemistry",
"url": null
} |
deep-learning, training
XML
<annotation>
<folder>VOC2007</folder>
<filename>000001.jpg</filename>
<source>
<database>The VOC2007 Database</database>
<annotation>PASCAL VOC2007</annotation>
<image>flickr</image>
<flickrid>341012865</flickrid>
</source>
<owner>
<flickrid>Fried Camels</flickrid>
<name>Jinky the Fruit Bat</name>
</owner>
<size>
<width>353</width>
<height>500</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>dog</name>
<pose>Left</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>48</xmin>
<ymin>240</ymin>
<xmax>195</xmax>
<ymax>371</ymax>
</bndbox>
</object>
<object>
<name>person</name>
<pose>Left</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>8</xmin>
<ymin>12</ymin>
<xmax>352</xmax>
<ymax>498</ymax>
</bndbox>
</object> | {
"domain": "datascience.stackexchange",
"id": 2615,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, training",
"url": null
} |
general-relativity, differential-geometry, coordinate-systems, geometry, geodesics
Title: Form of affinely parametrized geodesic equation under an arbitrary coordinate transformation? This question is based off of Chapter 3 of Hobson M.P., G. P. Efstathiou, A. N. Lasenby General Relativity An Introduction for Physicists (2006). The exact question is Q3.15. Not for homework though, but studying for exams.
For an affinely parameterised geodesic $x^a(u)$ that is parameterised by an affine parameter u.
The geodesic satisfies:
$$ \frac{d^2x^a}{du^2 }=\Gamma^{a}_{bc}\frac{d^2x^b}{du^2}\frac{d^2x^c}{du^2}$$
Under an arbitrary coordinate transformation $x^a \rightarrow x'^a$, the form of the equation should be unchanged. How do I show this? I am a little mixed up, does an arbitrary coordinate transformation just entail a change of parameter, e.g. $u \rightarrow u' $ or is the parameter changed to the new coordinate e.g. $x^a(u) \rightarrow x'^a(x^a) $ ? How do the coordinate vectors (e.g. $e^a $)change under a transformation?
Some thoughts I had on this: | {
"domain": "physics.stackexchange",
"id": 41548,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, coordinate-systems, geometry, geodesics",
"url": null
} |
algorithms, sets, propositional-logic
Title: How to find a minimum set of axioms within a set of propositions? I have a set of propositions, for example $\{a_1,a_2,\dots,a_n\}$. Some propositions depend on others (for example, $a_1,a_2\Rightarrow a_3$, means if $a_1,a_2$ are true, then $a_3$ is true). I want to find a subset of the propositions to be defined as axioms, in the sense that, these propositions being true imply that all the others are true. The number of axioms should be as small as possible. I want to know whether there are some methods? Determining whether a proposition follows from a set of axioms is an NP-Complete problem. Finding a minimal set of axioms from a set of propositions naturally invokes this problem many times as a subroutine.
For example, consider the following set of propositions:
$$P = \{v_1, v_3 \vee v_2, v_1 \wedge v_3\} $$ | {
"domain": "cs.stackexchange",
"id": 6648,
"lm_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, sets, propositional-logic",
"url": null
} |
'none'No lineNo line
Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.
The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.
Marker symbol, specified as one of the values listed in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.
MarkerDescriptionResulting Marker
'o'Circle
'+'Plus sign
'*'Asterisk
'.'Point
'x'Cross
'_'Horizontal line
'|'Vertical line
's'Square
'd'Diamond
'^'Upward-pointing triangle
'v'Downward-pointing triangle
'>'Right-pointing triangle
'<'Left-pointing triangle
'p'Pentagram
'h'Hexagram
'none'No markersNot applicable | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406012172462,
"lm_q1q2_score": 0.8050967972339044,
"lm_q2_score": 0.8128673201042492,
"openwebmath_perplexity": 6022.284879912213,
"openwebmath_score": 0.6265356540679932,
"tags": null,
"url": "https://au.mathworks.com/help/symbolic/fsurf.html"
} |
I want to show that $$(\exists \epsilon>0)(\forall \delta>0)(\exists x_1, x_2)(|f(x_1)-f(x_2)| \ge \epsilon \Rightarrow |x_1-x_2| \ge \delta$$
And so let's pick $\epsilon = 1$ I want to show that we can pick such $x_1, x_2$ that $|\ln(x_1)- \ln(x_2)| > 1 \Rightarrow |x_1 - x_2| > \delta$ for all $\delta$. We know that $x_1 \ge ex_2$. And now, let's take an arbitrary $\delta$, such that $$|x_1 - x_2| \ge \delta$$ Now, we can simply pick $$x_1 = ex_2 + \delta$$ And $$x_2 = 1$$ And it works. And so the function is not uniformly continuous.
I know that my solution is very chaotic and confusing,is there an easier way to tackle this? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018362008348,
"lm_q1q2_score": 0.8040167823770255,
"lm_q2_score": 0.8244619242200082,
"openwebmath_perplexity": 125.09915496519153,
"openwebmath_score": 0.9563086032867432,
"tags": null,
"url": "https://math.stackexchange.com/questions/2554314/check-if-lnx-x-0-is-uniformly-continuous"
} |
ros, navigation, differential-drive, dwa-local-planner, move-base
I uploaded another video on youtube with the latest knowledge: Trial N, success
After a lot of trials, I can conclude that one set of parameters is not enough for a reliable navigation. I would recommend having a couple of settings for different environmental situations. And change the parameters using dynamic reconfigure when the robot gets stuck or fails to reach the goal.
Originally posted by Amir Shantia with karma: 86 on 2015-01-26
This answer was ACCEPTED on the original site
Post score: 5
Original comments
Comment by David Lu on 2015-01-27:
Glad to hear it. Can we close this question?
Comment by Amir Shantia on 2015-01-28:
Yes, of course. I was waiting for enough karma to be able to select the answer. Thanks again for the guidance. | {
"domain": "robotics.stackexchange",
"id": 20656,
"lm_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, differential-drive, dwa-local-planner, move-base",
"url": null
} |
infinitesimals vs limits just as complex as the rule... To the discussion infinitesimals as an issue of neo-Kantian philosophy of science. they were trying to solve problems. Reading this sentence we switch sin ( x ) so different about limits compared to infinitesimals intuitive way of formulas! Illusion of a limit ratio would be undefined ( and it looks perfectly accurate in ours any! De ces deux vecteurs1 ( voir définition mathématique ci-dessous ) to analyze than dealing with the complex, amorphous directly... Circulatory system Newton and Leibniz developed the calculus based on an intuitive of. Lose information if we don ’ t have a rigorous standing was because they were a mean to end... Now we need to do math, it appeared that “ 0 + i,... Formulas in calculus, using the limit method — you just can ’ t to do math it... * i ), which is different entirely text is available under the Creative Commons Attribution/Share-Alike ;! Grandeur est égale au flux de l'induction magnétique B à | {
"domain": "com.br",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877044076956,
"lm_q1q2_score": 0.8227837889578651,
"lm_q2_score": 0.837619961306541,
"openwebmath_perplexity": 1486.1323035085018,
"openwebmath_score": 0.7404050827026367,
"tags": null,
"url": "http://www.jikatec.com.br/7bkfw3or/infinitesimals-vs-limits-365fb4"
} |
c#, object-oriented, library
private EntityManager()
{
entities = new Dictionary<int, TrackableEntity>();
}
public static EntityManager Instance
{
get { return instance; }
}
/// <summary>Adds the TrackableEntity in the container</summary>
public void Create(TrackableEntity entity)
{
entity.Id = next++;
entities[entity.Id] = entity;
}
/// <summary>Gets the TrackableEntity stored at id</summary>
public TrackableEntity Lookup(int id)
{
return entities.ContainsKey(id) ? entities[id] : null;
}
} | {
"domain": "codereview.stackexchange",
"id": 15720,
"lm_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, library",
"url": null
} |
symmetry, symmetry-breaking, axion
Now since you are particularly interested in unbroken PQ symmetry, let me tell you that it is also possible for a high quality PQ symmetry which is unbroken to solve the strong CP problem. This was the original hope of the 'massless up quark solution', which would have been the most beautiful way the problem could have been solved in the SM itself. Like we said above, if the only PQ-breaking effect is the anomaly, then the theta angle is unphysical. Is it possible that there is such a PQ symmetry acting on the SM fermions which is unbroken? A chiral rotation of only the up quark $\bar u \rightarrow e^{i \alpha} \bar u$ (where this is the 'right-handed' up quark written as a left-handed Weyl fermion) is such a symmetry. | {
"domain": "physics.stackexchange",
"id": 98636,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "symmetry, symmetry-breaking, axion",
"url": null
} |
quantum-mechanics, operators, quantum-spin, eigenvalue
\end{array}
\right]
$$
where $\cos(\theta)=\hat{n} \cdot \hat{m}$. It's easier to find the eigenvectors
of this matrix using:
$$
\sin(\theta/2)=
\sin(\theta-\theta/2)=
\sin(\theta)\cos(\theta/2)-\cos(\theta)\sin(\theta/2)
$$
and the analogous equation for cosine.
Therefore
$$
|n_{+}> =
\left[
\begin{array}{c}
\cos(\theta/2) \\
\sin(\theta/2) \\
\end{array}
\right]
$$
and finally:
$$
|<m_+|n_+>|^2=\cos^2(\theta/2)
$$ | {
"domain": "physics.stackexchange",
"id": 26224,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, quantum-spin, eigenvalue",
"url": null
} |
python, clustering, unsupervised-learning
# generate the linkage matrix
X = locations_in_RI[['Latitude', 'Longitude']].values
Z = linkage(X,
method='complete', # dissimilarity metric: max distance across all pairs of
# records between two clusters
metric='euclidean'
) # you can peek into the Z matrix to see how clusters are
# merged at each iteration of the algorithm
# calculate full dendrogram and visualize it
plt.figure(figsize=(30, 10))
dendrogram(Z)
plt.show()
# retrive clusters with `max_d`
from scipy.cluster.hierarchy import fcluster
max_d = 25 # I assume that your `Latitude` and `Longitude` columns are both in
# units of miles
clusters = fcluster(Z, max_d, criterion='distance')
The clusters is an array of cluster ids, which is what you want.
There is a very helpful (yet kinda long) post on HAC worth reading. | {
"domain": "datascience.stackexchange",
"id": 4835,
"lm_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, clustering, unsupervised-learning",
"url": null
} |
Reposted from comments in response to suggestion from OP:
$f(x;\theta)$ is the same as $f(x|\theta)$, simply meaning that $\theta$ is a fixed parameter and the function $f$ is a function of $x$. $f(x,\Theta)$, OTOH, is an element of a family (set) of functions, where the elements are indexed by $\Theta$. A subtle distinction, perhaps, but an important one, esp. when it comes time to estimate an unknown parameter $\theta$ on the basis of known data $x$; at that time, $\theta$ varies and $x$ is fixed, resulting in the "likelihood function". Usage of "|" is more common among statisticians, ";" among mathematicians. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9481545348152283,
"lm_q1q2_score": 0.8059040174552324,
"lm_q2_score": 0.84997116805678,
"openwebmath_perplexity": 454.52194326639363,
"openwebmath_score": 0.8217369318008423,
"tags": null,
"url": "https://stats.stackexchange.com/questions/30825/what-is-the-meaning-of-the-semicolon-in-fx-theta"
} |
gazebo, ros-kinetic
Originally posted by kane_choigo on ROS Answers with karma: 195 on 2020-01-22
Post score: 0
I can't load the file I saved which has turtlebot and garage willow.
When saving a world in Gazebo you don't save it with the robot in it, you have to create your world with only your obstacles and then save the world. To add your robot in a world you use a service : /gazebo/spawn_urdf_model that is called when you use the node spawn_model(you can find it here in the kobuki.launch that is included from turtlebot_world.launch).
To tell which world you want to use there is the argument world_file in the turtlebot_world.launch so you just have to specify it when using roslaunch :
roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/PATH/TO/YOUR/WORLD | {
"domain": "robotics.stackexchange",
"id": 34311,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, ros-kinetic",
"url": null
} |
plane pdf Reading this paper provides a new point of view to projectile motion and. 8, it had a force of -4. The coefficient of kinetic friction between this mass and the plane is 0. Normal force N perpendicular to the inclined plane, N = P cos θ Shear force V tangential to the inclined plane V = P sin θ If we know the areas on which the forces act, we can calculate the associated stresses. A block of wood was placed at the bottom. Raise one end of the table slowly turning the table into an inclined plane. Students can change the coefficient of friction, the mass of the block, and the angle of the inclined plane, and then observe the animation to determine whether the block will slide down the plane. The Eulerian angles are -15 degree about Z axis, -35. A cylinder of mass M and radius R is in static equilibrium as shown in the diagram. Determine the normal and shearing stresses on an inclined plane at an angle f through the bar subjected to an axial tensile force of P. The amplitude | {
"domain": "remmantova.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.979035762851982,
"lm_q1q2_score": 0.8071777131438522,
"lm_q2_score": 0.824461928533133,
"openwebmath_perplexity": 413.9387567314777,
"openwebmath_score": 0.5957896709442139,
"tags": null,
"url": "http://inlq.remmantova.it/inclined-plane-angle-calculator.html"
} |
quantum-mechanics, quantum-information, wavefunction-collapse
QM describes the outcomes with the wavefunction. If you make one measurement, it is random, which distribution you will get from the map. But if you make enough measurements, you will see the pattern.
Your question is really why QM does do it randomly. It is because although QM gives the best mathematical description for the outcome of the experiments about the microcosm, we still do not know exactly what is going on in the microcosm in classical (layman) terms. We do not know exactly if particles are really pointlike (they are pointlike in the current accepted views, but string theory gives another explanation) or what it means that an electron has rest mass but no spacial extension. We do not know what a quark really is, or what it looks like at the planck scale. We do not know why the Pauli principle really goes for one type of particle but not the other and how that looks in a classical view or our common sense. | {
"domain": "physics.stackexchange",
"id": 48407,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-information, wavefunction-collapse",
"url": null
} |
c#, performance, strings, comparative-review
static List<TickMessage> GetTickMessages(string data)
{
var convertedMessages = new List<TickMessage>();
var messages = data.Split(LineSplitDelimiter, StringSplitOptions.RemoveEmptyEntries);
for (var i = 0; i < messages.Length; i++)
{
// check for last message
var values = messages[i].Split(',');
var tick = new TickMessage(
DateTime.Parse(values[0]),
float.Parse(values[1]),
int.Parse(values[2]),
int.Parse(values[3]),
float.Parse(values[4]),
float.Parse(values[5]),
int.Parse(values[6]),
char.Parse(values[7]),
int.Parse(values[8]),
values[9]);
convertedMessages.Add(tick);
}
return convertedMessages;
} | {
"domain": "codereview.stackexchange",
"id": 30682,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, strings, comparative-review",
"url": null
} |
condensed-matter, superconductivity
Now, none of this answers your primary question, which is whether or not this theory solves HTSC. The answer to that question is definitely maybe. It does get the order of Tc and the energy gap correct, and has supporting evidence. However, the data that these papers provide as evidence present some ambiguities in the interpretation of the experimental result in light of sample preparation issues and choice of probe. Fundamentally, a theory of high Tc must have some predictive power of the Tc, the energy gap, be supported by most of the experimental evidence, and to some extent, what the sample makers could put into a crucible and have pop out as HTSC. It is not clear that this theory has done the last of these two sufficiently, and some reconciliation needs to be done. | {
"domain": "physics.stackexchange",
"id": 2046,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "condensed-matter, superconductivity",
"url": null
} |
performance, haskell
so that the x=0 column is included in the count but the y=0 row is not, because it's the same pixels as the x=0 column of the adjacent quarter circle. If you include both in the tally, you effectively count the border pixels twice. Your code returns 3.14199056 for approximatePi 10000 and with the bug fixed, it returns 3.14159052.
Style and Performance
Instead of clobbering the namespace with top level functions and types, define functions in where clauses. I removed the Point type in favor of taking separate x and y arguments and I put the pointInCircle function into a where clause in countPointsInDistance. Note how pointInCircle now captures n from the parent scope so that you only have to pass x and y as arguments. I also squared the right side of the comparison instead of taking the square root on the left side, which removes floating point calculations (and fromIntegral conversions) altogether.
countPointsInDistance :: Int -> Int | {
"domain": "codereview.stackexchange",
"id": 45126,
"lm_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, haskell",
"url": null
} |
newtonian-gravity, speed-of-light, dimensional-analysis, physical-constants, absolute-units
That more intresting, in Planck units the planck lengh depends on both $G$ and $c^3$:
$$ l_P = \sqrt{\frac{\hbar G}{c^3}} $$
In this case the equation transforms into
$$ l_P = \sqrt{\frac{\hbar K^3}{r_0^3} } $$
Is there any reason to use $c^3$ in $l_P$ or in $G$? Your first equation
$$G=(K\cdot c/r_0)^3$$
doesn't make sense.
The left-side has dimension $\frac{m^3}{kg\cdot s^2}$.
The right side has dimension $\left(\frac{kg}{s}\right)^3$.
Therefore the numerical equality is just an accident caused by the choice of your units. | {
"domain": "physics.stackexchange",
"id": 67760,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-gravity, speed-of-light, dimensional-analysis, physical-constants, absolute-units",
"url": null
} |
black-hole, supermassive-black-hole, collision
Title: Head on collision of two black holes Inspired by If two black hole event horizons overlap (touch) can they ever separate again?, I was wondering what would happen if two black holes collided into each other in a head-on collision.
In this model there's two black holes on a 3d Cartesian plane. Each black hole has a mass of 1 billion solar masses, and they're both going 0.9c. They're traveling on the z axis in opposite directions.
If both black holes are not spinning, one traveling positive z, the other in negative z, and collide at the origin in a perfect head-on collision what would be the result?
How long would a full merger take, and what would the resulting spin be? Would there be a large wave of gravitational energy, or some other emission? | {
"domain": "astronomy.stackexchange",
"id": 3803,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-hole, supermassive-black-hole, collision",
"url": null
} |
If matrices $A,B$ similar, find nonsingular $S$ s.t.$B=S^{-1}AS$
Consider the matrices below $$A=\begin{bmatrix}9&4&5\\-4&0&-3\\-6&-4&-2\end{bmatrix}$$ and $$B=\begin{bmatrix}2&1&0\\0&2&0\\0&0&3\end{bmatrix}$$
These matrices have the same eigenvalues $\{2,2,-3\}$ and the same Jordan Canonical Form so they are similar.
In trying to find $S$ s.t. $B=S^{-1}AS$ I set $$S=\begin{bmatrix}a&b&c\\d&e&f\\g&h&k\end{bmatrix}$$ and then tried to solve the system of 9 equations with 9 unknowns $$B=S^{-1}AS\Leftrightarrow SB=AS$$ but Matlab showed it is rank deficient so it provided only the zero solution.
How can I find such matrix $S$?
Is there a systematic way to do that in the general case when both $A,B$ are $n\times n$ matrices?
• Find a basis of eigenvectors and generalized eigenvectors. – amd Mar 12 '18 at 15:07
• I think you may have made an error with "Matlab". There are certainly nonzero solutions for these linear equations, see my answer. – Dietrich Burde Mar 12 '18 at 15:58 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9597620596782468,
"lm_q1q2_score": 0.8372459210389994,
"lm_q2_score": 0.8723473829749844,
"openwebmath_perplexity": 126.72257664591854,
"openwebmath_score": 0.89832603931427,
"tags": null,
"url": "https://math.stackexchange.com/questions/2687921/if-matrices-a-b-similar-find-nonsingular-s-s-t-b-s-1as"
} |
### Show Tags
09 Oct 2013, 18:23
4
35
00:00
Difficulty:
25% (medium)
Question Stats:
74% (00:52) correct 26% (00:50) wrong based on 1068 sessions
### HideShow timer Statistics
Three machines operating independently, simultaneously, and at the same constant rate can fill a certain production order in 36 hours. If one additional machine were used under the same operating conditions, in how many fewer hours of simultaneous operation could the production order be fulfilled?
A. 6
B. 9
C. 12
D. 27
E. 48
EMPOWERgmat Instructor
Status: GMAT Assassin/Co-Founder
Affiliations: EMPOWERgmat
Joined: 19 Dec 2014
Posts: 13095
Location: United States (CA)
GMAT 1: 800 Q51 V49
GRE 1: Q170 V170
Re: Three machines operating independently, simultaneously, and [#permalink]
### Show Tags
12 Feb 2015, 11:55
16
7
Hi All,
These type of "work" questions can be solved in a variety of ways (depending on how you want to do the math). | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9546474220263197,
"lm_q1q2_score": 0.8056222859883244,
"lm_q2_score": 0.8438951045175643,
"openwebmath_perplexity": 11640.766577591143,
"openwebmath_score": 0.8026163578033447,
"tags": null,
"url": "https://gmatclub.com/forum/three-machines-operating-independently-simultaneously-and-161325.html"
} |
homework-and-exercises, newtonian-gravity, approximations
Title: Working on Newton's Gravitational Law and cannot understand this approximation Working through some questions in a text book and came across one which I did not quite understand how to find the solution. I looked up the solution in the manual and was unable to understand how they came to their approximation. So, the answer is suggestively written to suggest they've factored out $\frac{1}{R^2_{ME}}$, so an initial step is to see what that gives you. Since $(R_{ME}+R_E)^2 = \left(R_{ME}(1+\frac{R_E}{R_{ME}})\right)^2 = R_{ME}^2\left(1+\frac{R_E}{R_{ME}}\right)^2$
$$F_1 - F_0 = \frac{GM_m m}{R^2_{ME}}\left(\frac{1}{(1-\frac{R_E}{R_M})^2} -\frac{1}{(1+\frac{R_E}{R_M})^2}\right).$$
Now since $R_E/R_{ME}$ is small, you can expand using your favourite method. e.g binomial expansion $(1+x)^n\approx 1+nx $ for small x. Here we have negative $n$, but it still works. | {
"domain": "physics.stackexchange",
"id": 45682,
"lm_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-gravity, approximations",
"url": null
} |
homework-and-exercises, general-relativity, linearized-theory
The quickest way to check is to start in Riemann normal coordinates in the neighborhood of a single point. This is very useful for every local calculation--- it's a freefalling frame with the best possible conventional local form for the bending of the coordinate axes. In such a frame the metric near a point gives a simple and canonical expression for the curvature,
$$ g = \delta_{\mu\nu} + {1\over 6} R_{\mu\alpha\nu\beta} x^\alpha x^\beta $$
Now you can add a constant perturbation to g, say in the diagonal component:
$$ g_{\mu\nu} = \delta_{\mu\nu} + h_{\mu\nu} - {1\over 6} R_{\mu\alpha\nu\beta} x^\alpha x^\beta$$
Were $h_\mu\nu$ is a diagonal perturbation, which can be reconverted back to Riemann normal coordinates by rescaling each x by the corresponding factor of $(1+h/2)$, and this has the effect of multiplying R by (1-h) for each x it contracts. The first order change in R and then in G is with a minus sign, as you said it should be. | {
"domain": "physics.stackexchange",
"id": 5081,
"lm_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, general-relativity, linearized-theory",
"url": null
} |
electrostatics, gauss-law, coulombs-law
Title: What is the mathematical reasoning behind the inverse square law of two charges? The Hon. Henry Cavendish performed an experiment with two spheres, by which he proved that no electric force is produced inside a hollow charged sphere. In other words, proving that no electric field is produced inside the sphere, means that the charge present on the surface is in equilibrium. How does it prove the inverse square law? Let's start with terminology, when I say charged I mean electrically or gravitationally charged (that is with mass). | {
"domain": "physics.stackexchange",
"id": 53319,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, gauss-law, coulombs-law",
"url": null
} |
object-oriented, regex, vba, delegates, meta-programming
result.AddParameter Trim(params(i))
Next
result.Body = methodName & " = " & regexMatch.SubMatches(1)
End If
Next
Set Create = result
End Function | {
"domain": "codereview.stackexchange",
"id": 10050,
"lm_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, regex, vba, delegates, meta-programming",
"url": null
} |
c++, performance, interview-questions, c++20
That’s just the most absolute basic starting point. But with that, you should be defining things like Waypoint like this:
struct Waypoint
{
coordinate_value x;
coordinate_value y;
penalty_value penalty;
// ... etc. ...
};
Now, using an alias of a bare int is only slightly better than using a bare int. So, the next step is this:
class coordinate_value
{
int _value = /* optional sensible default */;
public:
constexpr coordinate_value() noexcept = default;
// Explicit conversion from int.
constexpr explicit coordinate_value(int v) : _value{v}
{
// Validate here.
}
// Implicit conversion to int.
constexpr operator int() const noexcept
{
return _value;
}
}; | {
"domain": "codereview.stackexchange",
"id": 43820,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, interview-questions, c++20",
"url": null
} |
electrostatics, electric-circuits, electricity, energy-conservation, capacitance
During step 4, work is done on the system to pull the plates apart. Because the plates are charged and disconnected, their charge does not change but the capacitance, ruled by C = εA/d becomes smaller because d is increasing. If the charge remains the same because the capacitor is disconnected, the voltage between the plates is inversely proportional to the capacitance. It should increase during step 4.
During step 6, we inject more Joules back into the circuit than what was used to charge the plates. A transformer can bring this current back to the nominal voltage, recharge the plates, and use the remainder.
Now, we obviously don't use capacitors to generate electricity, so there must be some flaw in the process above. What is it? The electrophorus is a device which only needs to be charged at the start and then can be used to produce electric potential energy from the work done in separating charges. | {
"domain": "physics.stackexchange",
"id": 91690,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, electric-circuits, electricity, energy-conservation, capacitance",
"url": null
} |
electromagnetism, magnetic-fields
In the left-hand image the two surfaces of the soap film, $S_1$ and $S_2$, are relatively easy to see?
There is no magnetic flux through surface $S_1$ and the magnetic flux through surface $S_2$ is $B \,A$ where $A$ is the area of the surface $S_2$ ie the area of the coil.
The total magnetic flux through the soap film is $BA$.
This is equivalent to the left hand diagram in the OP's question.
The right hand circuit which represents a solenoid with two turns was more difficult to photograph whilst at the same time showing the soap film clearly so I had to pull out the two turns into a helix with a much larger pitch than I really wanted.
This has resulted in the area of the soap film being increased and the magnetic field not being at right angles to the soap film.
What I write below would work for such a circuit but to make things easier assume that the two turns are close together as in a "normal" solenoid of two turns.
Again surface $S_1$ does not contribute to the magnetic flux. | {
"domain": "physics.stackexchange",
"id": 55596,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, magnetic-fields",
"url": null
} |
c#, beginner
return jointLoads;
} You can use the LINQ extension method IEnumerable.OfType<TResult>(), it returns any elements matching the type of the specified generic type argument:
var jointLoads = AllLoadCases.OfType<JointsLoadingPattern>();
This will return an IEnumerable<JointsLoadingPattern>, you can always call .ToList() to convert it.
Update
As noted in the comments, since OfType<TResult> uses the is operator internally, it will also return any sub-types of TResult type. If you want to avoid this you can write your own extension method:
public static class Extensions
{
public static IEnumerable<TResult> OfExactType<T, TResult>(this IEnumerable<T> source)
where TResult : T
{
return OfExactType<TResult>(source);
}
public static IEnumerable<TResult> OfExactType<TResult>(this IEnumerable source)
{
if (source == null) throw new ArgumentNullException(nameof(source));
return OfExactTypeImpl<TResult>(source);
} | {
"domain": "codereview.stackexchange",
"id": 30303,
"lm_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",
"url": null
} |
beginner, scheme, programming-challenge, racket
(define (sum-multiples lower-limit upper-limit) (sum-multiples-rec lower-limit upper-limit 0))
(sum-multiples 0 1000) So, any time you want to write a "helper" recursive function, the standard way to write that is to use a named let. So here's how I might restructure your program (but keeping the same algorithm):
(define (sum-multiples start end)
(let loop ((sum 0)
(i start))
(cond ((>= i end) sum)
((or (zero? (modulo i 3))
(zero? (modulo i 5)))
(loop (+ sum i) (add1 i)))
(else (loop sum (add1 i))))))
Named let is a macro, which in this case expands to the same expression as:
(define (sum-multiples start end)
((letrec ((loop (lambda (sum i)
(cond ((>= i end) sum)
((or (zero? (modulo i 3))
(zero? (modulo i 5)))
(loop (+ sum i) (add1 i)))
(else (loop sum (add1 i)))))))
loop)
0 start)) | {
"domain": "codereview.stackexchange",
"id": 6932,
"lm_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, scheme, programming-challenge, racket",
"url": null
} |
c#, datetime, comparative-review, hash-map
ScheduledDays.Add(key, value);
}
} As far as your question is concerned, I'm not sure either choice is best, but if you had to choose one or the other, I would let them overwrite an existing one.
Consider that right now the user has no way to override a workday with a new one directly, so they would have to call GetWorkday to get a reference to it, and then change the properties of that object.
I think the best option would be to provide an overload that takes a Boolean that allows the user to determine if they want to overwrite a value:
public void SetWorkday( Workday value, bool overwrite)
Also, you haven't provided them with any way to RemoveWorkday, which might be a helpful addition.
For code reviewing thoughts, what are the fields DayStart and DayEnd for? I thought a workday was just a single day? Seems like it should just have a Date field. | {
"domain": "codereview.stackexchange",
"id": 11641,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, datetime, comparative-review, hash-map",
"url": null
} |
The finite subgroups of $GL_3(\mathbb{Z})$ are known in the literature:
$\qquad$ Tahara: On the finite subgroups of $GL(3,\mathbb{Z})$. Nagoya Math. J. 41(1971), 169-209.
In particular Proposition 3 states that there are exactly two non-conjugate subgroups of order three. Representants are $$U_1=\langle \begin{pmatrix}1 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & -1 \end{pmatrix}\rangle, \qquad U_2=\langle\begin{pmatrix}0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}\rangle$$
Added: In $PGL_3(\mathbb{Z})=GL_3(\mathbb{Z})/\langle -I\rangle$ there are also exactly two conjugacy classes of subgroups of order 3 and representants are $\bar{U}_1,\bar{U}_2$.
For, let $V_i=\langle x_i\rangle \le G := GL_3(\mathbb{Z}),i=1,2$ be subgroups of order 3. If $\bar{V}_i$ are conjugate in $\bar{G} :=PGL_3(\mathbb{Z})$ then there is $g \in G$ s.t. $x_2=(\pm I)gx_1^kg^{-1} (k=1,2)$ and hence $(\pm I)^3=I$ and $x_2=gx_1^kg^{-1}$, i.e. the $V_i$ are conjugated in $G$. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226287518852,
"lm_q1q2_score": 0.8204390865880502,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 196.24063858227652,
"openwebmath_score": 0.8857816457748413,
"tags": null,
"url": "https://mathoverflow.net/questions/144375/conjugacy-classes-of-pgl3-z/144398"
} |
java, chess
kingToSquare.setPiece(kingFromSquare.getSquarePiece());
kingFromSquare.getSquarePiece().setSquare(kingToSquare);
rookToSquare.setPiece(rookFromSquare.getSquarePiece());
rookFromSquare.getSquarePiece().setSquare(rookToSquare);
rookFromSquare.setPiece(null);
kingFromSquare.setPiece(null);
} else if (toNotation.equals("0-0-0")) {
int squareNotationCol = Integer.parseInt(fromSquare.getSquareNotation().substring(1, 2));
String squareNoteOverOne = String
.valueOf((char) (fromSquare.getSquareNotation().charAt(0) + 1) + "" + (squareNotationCol));
String squareNoteOverTwo = String
.valueOf((char) (fromSquare.getSquareNotation().charAt(0) + 2) + "" + (squareNotationCol));
String squareNoteOverFour = String
.valueOf((char) (fromSquare.getSquareNotation().charAt(0) + 4) + "" + (squareNotationCol)); | {
"domain": "codereview.stackexchange",
"id": 28306,
"lm_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, chess",
"url": null
} |
image-processing, filters
Title: Determining what filter (if any) has been applied to an image I'm trying to determine what "filter" has been applied to an image. I have the original, raw image and the processed image. The processed image has been put through a pipeline (black box) that does various things to the image in an iterative manner.
The filter, as far as I can tell, is similar to an unsharp-mask, but with "negative bowls" mitigated. However, the processed image cannot be reproduced by a simple unsharp mask.
I've attempted to measure the "filter function" by taking the ratio of the power spectra of the raw and unprocessed images, but the best I've been able to do with that is unsharp mask with a non-gaussian smoothing function.
What methods are available for determining the filter applied to an image? | {
"domain": "dsp.stackexchange",
"id": 2175,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, filters",
"url": null
} |
c++, tree
return 0;
} Use the C++ version of standard C header files
You are including <math.h>, but you should include <cmath>. Especially for the math functions, using the versions from std:: will make sure they automatically deduce whether they should return float or double.
Avoid unnecessary use of floating point arithmetic
Converting an integer to floating point, doing some operation, and then converting back is going to be slow. Floating point math is also not always exact, and this can cause problems if you assume it is. If possible, do everything using integer arithmetic where possible.
To see what you can do with just integers, look at Sean Eron Anderson's bit twiddling hacks, it includes how to check if an integer is a power of two and how to round up to the next power of two.
Even better, if you can use C++20, use std::has_single_bit() to check if something is a power of two, and std::bit_ceil() to round up to the nearest power of two.
Unnecessary use of std::shared_ptr | {
"domain": "codereview.stackexchange",
"id": 44148,
"lm_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++, tree",
"url": null
} |
of even/odd functions are Before the introduction to Fourier Series it is worthwhile refreshing some ideas and concepts about functions. Download the free PDF http://tinyurl. 1 The Real Form Fourier Series as follows: x(t) = a0 2 + X∞ n=1 an cosnω0t+bn sinnω0t (1) This is called a Signal odd/even properties and integration. = 2 n2πcos(nx) ∣∣∣ π. For instance, • an odd function will only have a sine functions in its Fourier series (no constant); • an even function will only have a cosine functions in its Fourier series and the constant term; FOURIER Series Univ. Recall: Fourier Let f(x) be the function of period 2L = 4 which is given on the The function is neither even nor odd. 4 Odd vs. 28 Sep 2013 FUNCTIONS. The cosine function is even, and we will have no cosines here. (1a) by cos nπx. To see what the truncated Fourier series approximation looks like with more terms, we plot the truncated Fourier series with the first 10 and 100 terms in Figures 6 and 7, respectively. At the points | {
"domain": "thesolutionsweb.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9925393578601738,
"lm_q1q2_score": 0.8091503248048043,
"lm_q2_score": 0.8152324826183822,
"openwebmath_perplexity": 514.1941983617381,
"openwebmath_score": 0.9046310782432556,
"tags": null,
"url": "http://thesolutionsweb.com/eezj/fourier-series-odd-and-even-functions-examples-pdf.html"
} |
geology, atmosphere, rocks, natural-conditions
Title: Radon is a naturally occurring radioactive gas. How does this work? Radioactive rocks can release a gas called radon when they decay, which can build up in the basements of buildings with serious effects on people's health.
Does anybody have information on how radon is produce naturally in nature? How do these rock’s become radioactively charged?
Are these rocks common? Pictures or examples? Radon (more specifically Radon-222) is produced in the decay chain of Uranium-238. Radon-223 is also produced by the decay chain of Uranium-235 and Radon-220 is produced by the decay chain of Thorium-232 but both Radon-223 and Radon-220 have half-lives of less than a minute, so they almost never reach the atmosphere where they can be breathed in because they mostly form underground and they decay too quickly to reach the atmosphere. | {
"domain": "earthscience.stackexchange",
"id": 1258,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geology, atmosphere, rocks, natural-conditions",
"url": null
} |
filters, frequency-spectrum, frequency, wavelet
Continuous wavelet transforms (CWT) hinge on a continuous wavelet $\psi$, for which for any (nice) function $f(x)$ can be represented as (or analyzed) a weighted ($c_{a,b}$) sum of translates and dilations $\psi\left(\frac{x-b}{a}\right)$. Whether the synthesis formula is equal to $f(x)$ requires $\psi$ to satisfy a moderately mild admissibility condition.
Then a question arose: how can we discretize all of the above to get tractable algorithms? In other words, are there $a_0$ and $b_0$ such that projections onto enumerable series
$$\psi\left(\frac{x-k b_0 a_0^j}{a_0^j}\right)$$
with $j$ and $k$ integers can still be perfect? The answer is a big yes, provided that $a_0b_0 < C_\psi$, a constant depending on $\psi$ (this is a king of Pauli-Heisenberg-Gabor inequality, result by Ingrid Daubechies, 1984). This becomes a wavelet frame: a redundant set of vectors that exactly recovers signals. | {
"domain": "dsp.stackexchange",
"id": 7985,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, frequency-spectrum, frequency, wavelet",
"url": null
} |
forces, water
But, the liquid drop's shape varies in presence of air or under free-fall due to gravity in air. See the possible Shapes of the liquid drop. Probably, it has a shape of a semi-sphere with a flat or curved surface at the bottom which is due to the air-flow. This also explains the difference that smaller rain drops have more surface tension and mostly they have a perfectly spherical shape, whereas comparatively larger drops have those flat or curved bottoms due to lower surface tension (since they have a larger area on the surface). Also, a raindrop has a critical limit. As it gets larger by combining with other drops, it has more possibilities for breaking
You can search for " Breaking of droplets" for more info | {
"domain": "physics.stackexchange",
"id": 36499,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, water",
"url": null
} |
newtonian-mechanics, vectors, work
Edit: As said by @anna: Please also note that work is part of the energy in a system (work and energy) and energy is a scalar. If it were not so we would not be talking of "conservation of energy" as an experimental observation. Energy is a scalar. | {
"domain": "physics.stackexchange",
"id": 41515,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, vectors, work",
"url": null
} |
description on sparse matrix data structure and [7] for a quick introduction on popular data. The step size h (assumed to be constant for the sake of simplicity) is then given by h = t n - t n-1. Numerical integration - MATLAB integral - mathworks. Section 4: Numerical Integration (Matlab Examples). However, I would like to integrate the function over a circle. A double integral can be carried out over this triangle. Mathematically, this is integration. Tutorials by MATLAB Marina. MATLAB has become an almost indispensable tool in the real-world analysis and design of control systems, and this text includes many MATLAB scripts and examples. Gives least squares solution for rectangular systems. The reason is because integration is simply a harder task to do - while a. Choose a web site to get translated content where available and see local events and offers. Such an integral is written as ∫b a f (x)dx where the term dx, referred to as the differential of x, indicates the variable of | {
"domain": "nemservices.in",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446494481299,
"lm_q1q2_score": 0.817602486536482,
"lm_q2_score": 0.83973396967765,
"openwebmath_perplexity": 834.2711683552066,
"openwebmath_score": 0.7501841187477112,
"tags": null,
"url": "http://nemservices.in/iqs33/2nw.php?dep=rectangular-integration-matlab"
} |
quantum-mechanics, angular-momentum, atomic-physics
Where did you get your paraphrased Hund's rule? I don't think it is accurate. Normally, you assume $LS$ coupling (Russell–Saunders coupling), so $L,S,J$ are conserved quantum numbers.
In your example, you have one electron in a $p$ orbital, so necessarily $S=1/2$ and $L=1$ (non need to apply the first two rules). For the third rule, your orbital is less than half filled, so the vectors anti align and $J=L-S$. In your case, this means that $J=1/2$, ie the term symbol is $^2P_{1/2}$. Therefore, using the Clebsch Gordon coefficients, your ground state (with $j_z=1/2$, there is another corresponding to $j_z=-1/2$) is rather:
$$
|\psi\rangle =\sqrt{\frac{2}{3}}|1,\downarrow\rangle-\sqrt{\frac{1}{3}}|0,\uparrow\rangle
$$
Hope this helps. | {
"domain": "physics.stackexchange",
"id": 95669,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, angular-momentum, atomic-physics",
"url": null
} |
java, algorithm, strings
public class HammingImplTest {
public static void main(String... strings) {
List<Boolean> resultlist = new ArrayList<>();
resultlist.add(testHammingAlgo("India is near to pakistan.", "India is neighbour of pakistan."));
resultlist.add(testHammingAlgo("India is near to pakistan.", "India is neighbour of nepal."));
resultlist.add(testHammingAlgo("Simmant Yadav", "Seemant Yadav"));
resultlist.add(testHammingAlgo("I love code in java", "I love coding in java"));
/*
* Specific result count
*
* System.out.println(resultlist.stream().filter(data->!data).count());
* if(resultlist.stream().filter(data->data).count()==3 &&
* resultlist.stream().filter(data->!data).count()==1) {
* System.out.println("Test cases satisfied"); }
*/
resultlist.forEach(data -> System.out.println(data));
}
private static boolean testHammingAlgo(String first, String second) { | {
"domain": "codereview.stackexchange",
"id": 38516,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, strings",
"url": null
} |
electromagnetism, waves, electromagnetic-radiation, dielectric, raman-spectroscopy
Title: Complex dielectric function and normal reflectance I am currently studying the textbook Surface Enhanced Raman Spectroscopy -- Analytical, Biophysical, and Life Science Applications by Sebastian Schlücker, Wolfgang Kiefer. Chapter 1.2.2 Planar Surfaces says the following: | {
"domain": "physics.stackexchange",
"id": 67426,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, waves, electromagnetic-radiation, dielectric, raman-spectroscopy",
"url": null
} |
image-processing, matlab, filters, convolution, kernel
Title: 2D Convolution in the Spatial Domain vs Frequency Domain Suppose, I have this kernel.
-1, -1, -1,
-1, 9, -1,
-1, -1, -1
Can this kernel be used in a FFT based convolution? How?
What could be the reason of my failure?
Related:
Image Convolution in Frequency Domain.
FFT Convolution - 3x3 Kernel To answer your question:
Can easily be done.
One must remember that the short signal (The Kernel) must be padded (With zeros) to have the same size as the image before the DFT conversion.
Once they have the same size all needed is to convert into the Frequency Domain have element by element multiplication and transform back.
A side note would be that this way you assume periodic boundary condition.
I'm not a C# / C Coder.
I can provide you a MATLAB reference if needed.
Just make sure you do the following steps:
Pad the kernel to the image size (Pad it with zeros to the right and left).
Convert into the Frequency Domain.
Multiply Element by element.
Convert back to the spatial domain. | {
"domain": "dsp.stackexchange",
"id": 4180,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, matlab, filters, convolution, kernel",
"url": null
} |
thermodynamics, special-relativity, statistical-mechanics
This is a classical system, I get that quantum theory would generally come into play here
EDIT:
This should be solvable utilizing the Maxwell-Boltzmann distribution:
$$f(v)=\left(1/2\pi a\right)^{3}4\pi v^{2}e^{\frac{-1}{2}\left(\frac{v}{a}\right)^{2}}$$
where $a=\sqrt{kT/m}$ (T and m being the temperature and mass of our clocks respectively). The time measured by a randomly chosen clock is then:
$$\Delta t=\int_{t_{2}}^{t_{1}}dt\gamma^{-1}$$
Where dt is the observers' (non moving clocks') proper time and the Lorentz factor gamma is going to depend upon the probablity of the particle having a particular speed at some particular time. I'm not sure how to proceed with this, but already it seems like an interesting problem if one considers that our consituent parts are continually getting “smeared” out in time. Surely there's a physically measureable consequence of this. Or maybe I should use the random walk?
EDIT 1 | {
"domain": "physics.stackexchange",
"id": 41187,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, special-relativity, statistical-mechanics",
"url": null
} |
reference-request, quantum-computing
Title: Branch prediction in quantum algorithms Are there any good examples of branching efficiency / prediction in quantum algorihms? Specifically suppose I have a set of CNOT gates one after the other that have the control line on the same line as the output of the CNOT gate? I agree with Artem, but perhaps this paper on a quantum circuit model for constructing conditional statements may be of some relevance to what you are trying to figure out. | {
"domain": "cstheory.stackexchange",
"id": 962,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, quantum-computing",
"url": null
} |
electromagnetic-radiation, photons, x-rays, gamma-rays
In this situation, will the photons, and any secondary energized particles, travel farther through the lead or the osmium?
The description of high-energy photon flux attenuation that I am familiar with says that a high-energy photon passing through conventional matter will lose energy by interaction with atomic nuclei that it passes, with more massive nuclei reducing the photon's energy by a greater amount. Thus lead, being the stable element with the highest atomic number, seems like an obvious choice for shielding against this type of radiation. The question arises because osmium has a close atomic number to lead but is much denser, meaning that a photon will interact with more atomic nuclei in the same distance. In a purely hypothetical sense, this might make osmium a superior shield. | {
"domain": "physics.stackexchange",
"id": 37103,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation, photons, x-rays, gamma-rays",
"url": null
} |
java, circular-list
//get the oldest element, move read pointer
public T get()
{
if(empty())
throw new ArrayIndexOutOfBoundsException("buffer empty");
final T ret = array[get_idx++];
get_idx %= size;
--count;
return ret;
}
}
Code to exercise class:
public class TestCircularBuffer {
static public void main(String args[]) {
new TestCircularBuffer().go();
}
void go() {
int SIZE = 1000;
int arr[] = new int[SIZE];
for(int i = 0; i < SIZE; ++i) {
arr[i] = i;
}
CircularBuffer<Integer> cb = new CircularBuffer<Integer>(10);
//exercise circ buffer
int i = 0;
while(i < SIZE) {
while(!cb.full())
cb.insert(arr[i++]);
while(!cb.empty())
System.out.print(cb.get() + " ");
} | {
"domain": "codereview.stackexchange",
"id": 3226,
"lm_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, circular-list",
"url": null
} |
javascript, animation, physics, processing.js
// main draw loop
var draw = function() {
// draw the background and push a new particle
background(11, 100, 209);
particles.push(new Particle(new PVector(mouseX, mouseY)));
// iterate through particles and run their methods
for(var p = particles.length-1; p >= 0; p--) {
var particle = particles[p];
particle.checkBounds();
particle.update();
particle.render();
if(particle.particleDead()) {
particles.splice(p, 1);
}
}
};
Now, I think that this could definitely be improved, as the Particle.prototype.checkBounds method seems to not work all the time. Anyways, what can I improve here? Interesting question,
there are few things that could be improved:
Read up on the revealing module pattern, it would be excellent to
Reduce your usage of this
Make your class look like 1 piece of code
Something like this:
// main particle constructor class
function Particle(position) { | {
"domain": "codereview.stackexchange",
"id": 10254,
"lm_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, animation, physics, processing.js",
"url": null
} |
cg.comp-geom
I am looking at the problem that is the reverse of this: Let $k$ be a parameter. I want to find an $\epsilon$-kernel of size at most $k$ such that $\epsilon$ is minimized. The running time could be exponential in $d$ but should be polynomial in $k$.
My general question is whether there is anything known for this problem. Some specific questions:
1. Is the problem NP-hard when d=2? (Any clue what problem we can reduce from?)
2. Is there any approximation algorithm for d=2?
Any general comments are also welcomed. Jeff Philips has a related result showing the stability of kernels: http://www.cs.utah.edu/~jeffp/papers/stable-kernel.pdf. | {
"domain": "cstheory.stackexchange",
"id": 144,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cg.comp-geom",
"url": null
} |
I assumed I'd need the reversed conditional probability of $$P(I|T^+)$$ and $$P(I|T^-)$$.
$$P(T^+)$$ = (0.8)(.4) + (0.1)(0.6) = 0.38 by law of total probability, and therefore $$P(T^-)$$ = 0.62.
$$P(I|T^+)$$ = $$\frac{P(T^+|I)P(I)}{P(T^+)} = \frac{(0.8)(0.4)}{0.38} = \frac{16}{19}$$
By similar computation, $$P(I|T^-)$$ = $$\frac{3}{19}$$
Final computation would be binomial distribution of $${5}\choose{3}(\frac{16}{19})^3(\frac{3}{19})^2$$
However this ends up not matching with the answer I'm given (studying for a test). Can anyone tell me where I've messed up or if my approach is all wrong?
• You can only use the binomial distribution when there are only two outcomes in an experiment, like rolling a die and using P(lower than three) and P(three or above). P$(I|T^+)\,$ and P$(I|T^-)\,$ don't qualify as such, though for example P$(T^+|I)\,$ and P$(T^-|I)\,$ would.
– A.J.
Nov 7, 2019 at 7:29 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308807013052,
"lm_q1q2_score": 0.8437775532690686,
"lm_q2_score": 0.8539127455162773,
"openwebmath_perplexity": 709.5813855772417,
"openwebmath_score": 0.9984814524650574,
"tags": null,
"url": "https://math.stackexchange.com/questions/3425379/probability-of-impurity-given-3-out-of-5-test-detections"
} |
photons, electrons, atoms, absorption, photon-emission
Although Raman processes are allowed, they generally occur with very low probability compared to absorption near a resonance, and also compared to scattering of photons without a change in photon energy. So in many cases they only have a very small impact on the overall atom-light interaction.
Because the photon never fully disappears, Raman scattering (as the name suggests) is normally thought of as an inelastic scattering process, instead of as a "partial absorption." | {
"domain": "physics.stackexchange",
"id": 32903,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photons, electrons, atoms, absorption, photon-emission",
"url": null
} |
In particular, define $$f \colon [0,1] \to \R$$ by
\begin{equation*} f(x) := \begin{cases} \nicefrac{1}{k} & \text{if } x=\nicefrac{m}{k} \text{ where } m,k \in \N \text{ and } m \text{ and } k \text{ have no common divisors,} \\ 0 & \text{if } x \text{ is irrational.} \end{cases} \end{equation*}
Show $$\int_0^1 f = 0\text{.}$$
If $$I \subset \R$$ is a bounded interval, then the function
\begin{equation*} \varphi_I(x) := \begin{cases} 1 & \text{if } x \in I, \\ 0 & \text{otherwise,} \end{cases} \end{equation*}
is called an elementary step function.
#### Exercise5.2.12.
Let $$I$$ be an arbitrary bounded interval (you should consider all types of intervals: closed, open, half-open) and $$a < b\text{,}$$ then using only the definition of the integral show that the elementary step function $$\varphi_I$$ is integrable on $$[a,b]\text{,}$$ and find the integral in terms of $$a\text{,}$$ $$b\text{,}$$ and the endpoints of $$I\text{.}$$ | {
"domain": "jirka.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795072052384,
"lm_q1q2_score": 0.804617753952394,
"lm_q2_score": 0.8152324826183822,
"openwebmath_perplexity": 364.93857567528283,
"openwebmath_score": 0.9992241859436035,
"tags": null,
"url": "https://www.jirka.org/ra/html/sec_rintprop.html"
} |
So for our example
$\begin{split} x_1 + 10^{4} x_2 &= 10^4 \\ x_1 + x_2 &= 2 \end{split}$
Doesn't this yield to $(x_1,x_2) = (1,1)$ as expected even when using $10^{-3}$ precision and using the first rows element as pivot?
-
Your question here boils down to questioning the difference between this (using the ill advised small pivot) $$\pmatrix{10^{-4} & 1 & 1 \\ 1 & 1 & 2} \overset{R_2 \leftarrow R_2 -10^4R_1}{\longrightarrow} \pmatrix{10^{-4} & 1 & 1 \\ 0 & -10^4 & -10^4}\overset{R_1 \leftarrow 10^4R_1}{\longrightarrow} \pmatrix{1 & 10^4 & 10^4 \\ 0 & -10^4 & -10^4}$$ and this (scaling then still using the ill advised small pivot) $$\pmatrix{10^{-4} & 1 & 1\\ 1 & 1 & 2}\overset{R_1 \leftarrow 10^4 R_1 }{\longrightarrow} \pmatrix{1 & 10^4 & 10^4 \\ 1 & 1 & 2}\overset{R_2 \leftarrow R_2 -R_1}{\longrightarrow} \pmatrix{1 & 10^4 & 10^4 \\ 0 & -10^4 & -10^4}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9669140177976359,
"lm_q1q2_score": 0.8036438657913582,
"lm_q2_score": 0.8311430499496096,
"openwebmath_perplexity": 562.1406352587086,
"openwebmath_score": 0.8016820549964905,
"tags": null,
"url": "http://math.stackexchange.com/questions/290595/multiplying-rows-to-get-great-pivots-for-numerical-lr-decomposition-of-inverti"
} |
matlab, estimation, linear-algebra, least-squares, parameter-estimation
m = 12*A - 6*B; # Recursive m_3 ... m_N
sum1 += (n-1)*y # Direct (not needed for recursive)
sum2 += y # Direct (not needed for recursive)
m_ref = 12*sum1/(n**3 - n) - 6*sum2/(n**2 - n) # Direct m_3 ... m_N
print("n="+str(n)+", A="+str(A)+", B="+str(B)+", sum1="+str(sum1)+", sum2="+str(sum2)+", m="+str(m)+", m_ref="+str(m_ref)) | {
"domain": "dsp.stackexchange",
"id": 7410,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, estimation, linear-algebra, least-squares, parameter-estimation",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.