text stringlengths 1 1.11k | source dict |
|---|---|
discrete-signals, sampling
Finally, would incorporating random selection into the selection of the signal help me in any way?
I am not sure how "Random Selection" would help you here. Given that K-means includes the initial random assignment step, it might be better to repeat each $K \in \left[a \ldots b\right], b>a$ for a number of times rather than randomly pick a few values across your interval.
Hope this helps. | {
"domain": "dsp.stackexchange",
"id": 5814,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "discrete-signals, sampling",
"url": null
} |
quantum-mechanics, heisenberg-uncertainty-principle, quantum-measurements
state in accordance with the uncertainty relation. For example in HEP momentum is measured through sequential position measurements in order to establish radius of curvature, but clearly you cannot produce momentum eigenstates by measuring position! Similarly for time-of-flight measurements, or anything else I can think of. Diffraction could be used to establish the expectation value of wavelength (and thus momentum) with an ensemble of identically prepared states, but you can't measure a diffraction pattern with a single particle! | {
"domain": "physics.stackexchange",
"id": 55925,
"lm_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, heisenberg-uncertainty-principle, quantum-measurements",
"url": null
} |
quantum-mechanics
In quantum mechanics once you specify the wavefunction there is a velocity determined for each configuration of the particles. So back to the 2d picture. Classically, it could have any starting point on the 2d plane and then move along an ellipse. Now it is more like a bar graph. You see that each location along the x axis has to have a particular velocity. | {
"domain": "physics.stackexchange",
"id": 24874,
"lm_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",
"url": null
} |
java, performance, algorithm, programming-challenge, primes
String n = JOptionPane.showInputDialog( "Input n (even) ");
int ene = Integer.parseInt( n );
for ( int i=1; i <= ene; i++ ) {
list.add( new Integer(i) );
}
exchange(list, 0);
long end = System.currentTimeMillis();
System.out.println(new SimpleDateFormat("ss.SSS").format(new Date(end - start)));
}
static void exchange(ArrayList arr, int k){
boolean passed = true;
for(int i = k; i < arr.size(); i++){
java.util.Collections.swap(arr, i, k);
exchange(arr, k+1);
java.util.Collections.swap(arr, k, i);
}
if (k == arr.size() -1){
int half = arr.size()/2; | {
"domain": "codereview.stackexchange",
"id": 34832,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, algorithm, programming-challenge, primes",
"url": null
} |
image-processing, filters, noise, opencv, denoising
Title: How to remove the noise without destroying the main edge? I am working on a project. I want to segment a logo from a car and the picture's size is 3648*2432. The logo is selected by the red rectangle.
I extracted this area and turn into gray level. The area's size is 249*173. Then, I use histogram equalize to enhance the edge. Finally, I use adaptive canny to find edge.
However, the result is not perfect.
So, I used median filter to smooth the left picture. The result is as following.
I remove the small parts. | {
"domain": "dsp.stackexchange",
"id": 2359,
"lm_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, noise, opencv, denoising",
"url": null
} |
audio
Title: Why would the audio from .mp4 files be audible on some devices but not others? I don't know if this question is best suited for Signal Processing, Sound Design, or Video Production. If someone knows for sure that can do so, please migrate this question to the best forum for it (I'm guessing "Signal Processing" for now).
I have posted some mp4 files on the Internet, both on YouTube and on a dedicated facebook page. Most people have no problem with seeing the video and hearing the audio emanating from these files.
Two people, though, have complained (or mentioned, anyway) that they cannot hear the audio. One of them was using a Windows desktop, and the other an iPhone.
What are the reasons why some may not hear audio, while others can - when they can hear audio otherwise on their device?
The files in question (half a dozen of them) are here.
For a direct link to one particular one, you can try this.
Or, from YouTube, here's one. | {
"domain": "dsp.stackexchange",
"id": 4351,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio",
"url": null
} |
surface-tension
Pierre-Gilles de Gennes; Françoise Brochard-Wyart; David Quéré (2002). Capillarity and Wetting Phenomena—Drops, Bubbles, Pearls, Waves. Alex Reisinger. Springer. ISBN 978-0-387-00592-8.
EDIT: As I defined above, $\theta$ is within that range for hydrophobic surface. If the surface is hydrophillic, $\theta$ will be less than $\frac{\pi}{2}$. You can take these angles as the definition of hydrophobic/hydrophillic surfaces. | {
"domain": "physics.stackexchange",
"id": 58676,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "surface-tension",
"url": null
} |
ros, roslauch, nodes, namespaces, getparam
Originally posted by rbaleksandar with karma: 299 on 2016-06-14
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by gvdhoorn on 2016-06-14:
Please look at the private parameter concept. That solves your problem and is really how you should approach this.
Comment by rbaleksandar on 2016-06-14:
With private you mean inside the node tag right? If so, I've just changed that since its more readable. Will check how it affects the namespaces. Thanks!
Comment by gvdhoorn on 2016-06-14:
No, that's just part of it. See wiki/roscpp/Overview/NodeHandles - Namespaces, http://wiki.ros.org/rospy_tutorials/Tutorials/Parameters and http://wiki.ros.org/rospy/Overview/Parameter%20Server.
Comment by rbaleksandar on 2016-06-15:
Thanks, will take a look. | {
"domain": "robotics.stackexchange",
"id": 24925,
"lm_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, roslauch, nodes, namespaces, getparam",
"url": null
} |
ruby, ruby-on-rails, active-record
private
def find_orders
@results_limitVar = nil
if results_limit.nil? == true
@results_limitVar = 50
else
@results_limitVar = results_limit
end
@subscribes_to_daily_emailsVar = nil
if subscribes_to_daily_emails.nil? == false
if subscribes_to_daily_emails
@subscribes_to_daily_emailsVar = 1
else
@subscribes_to_daily_emailsVar = 0
end
end
@order_is_deletedVar = nil
if order_is_deleted.nil? == false
if order_is_deleted
@order_is_deletedVar = 1
else
@order_is_deletedVar = 0
end
end
#Added orders explicitly because otherwise first_name, etc is ambiguous
#since it is in multiple models. | {
"domain": "codereview.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": "ruby, ruby-on-rails, active-record",
"url": null
} |
convolution, impulse-response, frequency-domain, real-time
Each partition length can be processed separately, giving for each a latency that is for fast Fourier transform (FFT) -based convolution perhaps a couple of times the partition length. Convolution outputs for all partition lengths are summed forming the final composite output. When partitioning the impulse response, the partition of a particular length must not appear before the time that equals the latency of convolution of that partition length. A time-domain finite impulse response (FIR) filter can be used for the beginning of the impulse response because that may be more efficient than doing the low-length convolution by FFT.
What is the optimal partitioning for a given impulse response length and the optimal split point between time-domain FIR and FFT convolution should be tested on the target platform. A challenging aspect of non-uniform partitioned convolution is scheduling of the work. | {
"domain": "dsp.stackexchange",
"id": 3101,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "convolution, impulse-response, frequency-domain, real-time",
"url": null
} |
As to which method (or some other method) is best, that would be a question for CrossValidated.
• Nice answer. I would suggest to use a defined SeedRandom when using RandomVariate so as to make your results replicable? – gwr Oct 11 '17 at 18:07
• @gwr Good suggestion! In fact, I thing I might open a question about that: Does the same SeedRandom selection get the same sequence of random numbers among versions of Mathematica and among different operating systems. – JimB Oct 11 '17 at 18:53
• I just tested RandomVariate[ NormalDistribution[ ] , 1000 ] given the same seed: Versions 10.4, 11.1.1, and 11.2 give the exact same values, which I confirmed by using Hash. – gwr Oct 12 '17 at 14:38
There are slight variations in the distribution obtained depending on the specific approach taken
Generating data
SeedRandom[0]
data = RandomVariate[LogNormalDistribution[3, 1.5], 1000];
FindDistribution will conclude that this data has a LogNormalDistribution | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9504109728022221,
"lm_q1q2_score": 0.847587005983289,
"lm_q2_score": 0.89181104831338,
"openwebmath_perplexity": 5824.639418180748,
"openwebmath_score": 0.4999738037586212,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/157464/confusion-on-using-lognormaldistribution-in-mathematica"
} |
ros, include
Title: Can't Find My Include
Hello all,
I have two packages: OpenRAVEROSInterp and myTestROS.
OpenRAVEROSInterp is a little package I developed which connects OpenRAVE and ROS. It works well and uses a file named ROSRobot.h which contains subscriptions/services to interact with robots in OpenRAVE. It is stored in
rospackages/OpenRAVEROSInterp/include/OpenRAVEROSInterp/ROSRobot.h
My other package myTestROS is attempting to use ROSRobot.h (just for fun). It's manifest.xml has
When I run rosmake, I get...
...workspace/rospackages/myTestROS/src/TestClass.cpp:36:40: error: OpenRAVEROSInterp/ROSRobot.h: No such file or directory
Where line 36 is:
#include <OpenRAVEROSInterp/ROSRobot.h>
Could anyone off any suggestions? Thank you.
Originally posted by Constantin S on ROS Answers with karma: 296 on 2011-11-15
Post score: 0
You'll need to set some export tags in your package's manifest.xml. See the wikipage on manifests. | {
"domain": "robotics.stackexchange",
"id": 7303,
"lm_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, include",
"url": null
} |
classification, scikit-learn, loss-function, f1score
When to use loss and when f1 score?
Let's say you have a dataset and a classification problem which you want to solve. You know that you can create a statistical model which returns probabilities of a given class. You also know that there is (hypothetically) an algorithm which classifies based on some heuristics which requires no training. You would like to know which of these is the best for your problem. What you do, if we simplify a little, is: | {
"domain": "datascience.stackexchange",
"id": 8215,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classification, scikit-learn, loss-function, f1score",
"url": null
} |
The trick is to make the expression easier to deal with. For example, for $x > 0$
$$\left| \frac{x}{x^2 + 1} - 0 \right| \leq \left| \frac{x}{x^2} \right| = \frac{1}{x}$$
Now it becomes straight forward to find an appropriate $M$ given $\epsilon > 0$.
• But you have made something bigger than the original expression, surely we would want something smaller than it to ensure that what we have found is still less than $\varepsilon$? – user2850514 Dec 19 '14 at 0:30
• Wrong way around. If you can bound $1/x$ by $\epsilon$, then the original expression is bound by $\epsilon$. – Simon S Dec 19 '14 at 0:31
• Oh that makes complete sense, thank you. – user2850514 Dec 19 '14 at 0:32
An important thing to note here is that this $M$ is not unique, you can take whatever $M$ that happens to work.
The most common way to do this is to "estimate" the thing somehow, making incremental changes to arrive at a simple expression. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138121879513,
"lm_q1q2_score": 0.821019504638692,
"lm_q2_score": 0.8397339736884712,
"openwebmath_perplexity": 162.1540851484293,
"openwebmath_score": 0.9546180963516235,
"tags": null,
"url": "https://math.stackexchange.com/questions/1074013/proving-limits-using-epsilon-definition"
} |
biochemistry, molecular-biology, theoretical-biology
Title: Goodwin oscillator explained Hello I have been reading papers about the Goodwin oscillator and I found that the equations are kind of tricky. Specially the part of the hill coefficient. In his paper "An entrainment model for timed enzyme synthesis in bacteria" from 1966, in the part of the differential equation of the mRNA concentration Xi, there is the term Zi and this term also exists in other books that talk about this oscillator. However, I don't know what it means. Goodwin never mentioned what this term means. I'm guessing it is about the hill coefficient, but still I do not quite understand well.
I share the link of a chapter book that explains the equations of this oscillator (page 244):
Biochemical Oscillations
Thanks for your help. The ODEs for the Goodwin oscillator are:
$$\begin{align}
\frac{dX}{dt}=&\ k_1\frac{K_i^n}{K_i^n+Z^n} -k_2X\\[1em]
\frac{dY}{dt}=&\ k_3X-k_4Y\\[1em]
\frac{dZ}{dt}=&\ k_5Y-k_6Z\end{align}$$ | {
"domain": "biology.stackexchange",
"id": 5303,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, molecular-biology, theoretical-biology",
"url": null
} |
rust
If you want to make even more improvements, I would suggest replacing the vector of people with a structure that keeps the order when adding elements, to avoid sorting the vector every time. You can also create structs for Department and Person and implement Display on them, which would be more idiomatic than having a separate function that handles the printing.
I would also recommend using rust-clippy to help you write more idiomatic code. | {
"domain": "codereview.stackexchange",
"id": 43563,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust",
"url": null
} |
python, performance, python-3.x, pygame
you could write:
layers = [canvas.copy() for _ in range(CANVAS_BACKUPS_COUNT)]
This looks inefficient:
for color in colors:
text = font.render(str(colors.index(color)+1),True,black)
Instead of searching the color in the list of colors, you could simply iterate over range:
for index in range(len(colors)):
text = font.render(str(index + 1), True, BLACK)
This:
if event.button == 4 and r < 100:
r += 1
elif event.button == 5 and r > 2:
r -= 1
is unclear for me. To understand what those 4 and 5 mean I had to go to documentation. What you could do is to use enum.IntEnum. And it would be something like this:
from enum import IntEnum
...
class MouseWheel(IntEnum):
UP = 4
DOWN = 5
...
if event.button == MouseWheel.UP and brush_size < max_size:
brush_size += size_delta
elif event.button == MouseWheel.DOWN and brush_size > min_size:
brush_size -= size_delta | {
"domain": "codereview.stackexchange",
"id": 32957,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-3.x, pygame",
"url": null
} |
ios, swift, sprite-kit
class CodedSprite: SKSpriteNode {
var simpleName: String
var simpleType: Double
init(simpleName: String, simpleType: Double) {
self.simpleName = simpleName
self.simpleType = simpleType
let spriteColor = SKColor.whiteColor()
let spriteSize = CGSize(width: 10.0, height: 10.0)
super.init(texture: nil, color: spriteColor, size: spriteSize)
}
required init?(coder aDecoder: NSCoder) {
self.simpleName = aDecoder.decodeObjectForKey("SIMPLE_NAME") as String
self.simpleType = aDecoder.decodeDoubleForKey("SIMPLE_TYPE")
super.init(coder: aDecoder)
}
override func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeObject(self.simpleName, forKey: "SIMPLE_NAME")
aCoder.encodeDouble(self.simpleType, forKey: "SIMPLE_TYPE")
super.encodeWithCoder(aCoder)
}
} | {
"domain": "codereview.stackexchange",
"id": 10779,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ios, swift, sprite-kit",
"url": null
} |
c#, tree, generics
if (node.Right != null)
{
GetOnLevel(node.Right, curLevel + 1, trgLevel, result);
}
}
}
}
And finally this is the new BinaryTreeSearch
public class BinaryTreeSearch
{
//returns the node that holds data equivalent to T data
public BinaryTreeNode<T> FindNode<T>(T value, BinaryTreeNode<T> source) where T : IComparable
{
if (source == null) return null;
var nodeToFind = new BinaryTreeNode<T> { Value = value };
if (nodeToFind == source)
{
return source;
}
if (nodeToFind > source)
{
return FindNode<T>(value, source.Right);
}
if (nodeToFind < source)
{
return FindNode<T>(value, source.Left);
}
return null;
}
}
I hope I didn't broke anything but it should be more of an example rather then fully tested code. | {
"domain": "codereview.stackexchange",
"id": 27847,
"lm_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, generics",
"url": null
} |
javascript
This is clearer, and it handles the equality case more elegantly. If you really hate nested conditional expressions with a passion, you could use a set of if statements instead, but I think this is perfectly readable when properly formatted.
This change eliminates the need for the largestAveragedArray function entirely, simplifying the code somewhat. As a final note, document.write makes me cringe, but I understand that it's useful in code snippets, so I'll let it slide here. Just don't use it in a real project. | {
"domain": "codereview.stackexchange",
"id": 9753,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript",
"url": null
} |
mechanical-engineering, fluid-mechanics, applied-mechanics, pipelines, product-engineering
Figure 1. A double-lipped seal in the false base of the tube.
This can then be inserted from the top of the tube to take advantage of the tapered edge. It seems to me that increasing the pressure in the top side will increase the seal tightness but check with someone that uses these things. (I'm an electrical engineer.)
w
Figure 2. Having three legs will simplify horizontal alignment of the base. | {
"domain": "engineering.stackexchange",
"id": 3352,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, fluid-mechanics, applied-mechanics, pipelines, product-engineering",
"url": null
} |
waves, computational-physics, simulations, differential-equations
Title: How to simulate 1D waves starting from the acceleration (second derivative)? Knowing that a 1D wave with the physical form parametrized by x and t
$$u = \sin(x-t)$$
will yield us the first time derivative $$\frac{\partial u}{\partial t} =-\cos(x-t)$$
and the second time derivative $$\frac{\partial^2 u}{\partial t^2} = -\sin (x-t)$$
This implies that we can re-create the original wave shape u by producing (through any means) the acceleration in the exactly correct proportion over all x and for each moment t as prescribed by the second derivative, is it right?
I did a simple animation of this, but the result is puzzlingly not the u wave shape above. What am I doing wrong?
The resulting physical wave form is a standing wave that gets higher and higher (seemingly unbounded) amplitude. Why is this so?
The algorithm is: | {
"domain": "physics.stackexchange",
"id": 83266,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "waves, computational-physics, simulations, differential-equations",
"url": null
} |
java, project-euler, primes
Title: Suggestions for improvement on Project Euler #7 Here is a solution for Project Euler Problem #7.
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can
see that the 6th prime is 13. What is the 10,001st prime number?
I've used the pseudo code from the Wikipedia page for the Sieve of Eratosthenes.
Input: an integer n > 1
Let A be an array of Boolean values, indexed by integers 2 to n, initially all set to true.
for i = 2, 3, 4, ..., not exceeding √n:
if A[i] is true:
for j = i^2, i^2+i, i^2+2i, ..., not exceeding n :
A[j] := false
Any suggestions would be much appreciated.
import java.util.*; | {
"domain": "codereview.stackexchange",
"id": 5456,
"lm_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, project-euler, primes",
"url": null
} |
ros, image, camera
Title: how to modify and publish camera_info?
Hello.
I would like to make a cropped image from raw image in python.
In my program,
I can subscribe /usb_cam/image_raw (sensor_msgs/Image, height=480, width=640) and /usb_cam/camera_info (sensor_msgs/CameraInfo).
Then, I modified roi in /usb_cam/camera_info like below,
edited_camera_info.roi.x_offset = 320
edited_camera_info.roi.y_offset = 240
and publish edited camera info and image.
pub_edited_image.publish(no_edited_image)
pub_edited_camera_info.publish(edited_camera_info)
However, there are no differences between /usb_cam/image_raw and /editted_image_raw.
Is it possible to crop a part of an image by modifying camera_info?
Or, is there any alternative ways to realize to crop an image? | {
"domain": "robotics.stackexchange",
"id": 25886,
"lm_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, image, camera",
"url": null
} |
react.js, jsx, to-do-list
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
} | {
"domain": "codereview.stackexchange",
"id": 40215,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "react.js, jsx, to-do-list",
"url": null
} |
biochemistry, energy-metabolism, intracellular-transport
Title: Why is GTP, rather than ATP, used in nuclear transport? Why is GTP used for nuclear transport and not ATP, given that ATP hydrolysis is used to drive most cellular energonic reactions? Disclaimer
Although this question appears to be either unclear or unanswerable (or both), and shows no evidence of research on the poster’s part, I have chosen to address one aspect of it to emphasize a general concept. This, despite the fact that my knowledge of nuclear transport processes is minimal.
Brief Answer | {
"domain": "biology.stackexchange",
"id": 7891,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, energy-metabolism, intracellular-transport",
"url": null
} |
java, numerical-methods
Why .plus()? That method literally does nothing.
if ( shouldSubstract() ) PI = PI.subtract( getCicleTerm() );
else PI = PI.add( getCicleTerm() );
Why doesn't the term include its sign, so that you always add? That would be more mathematically coherent and would make it easier to understand the code because it would remove the requirement to call the methods in the right order.
updateAverage();
Count = Count.add( ONE );
This seems like the appropriate place to ask why Count is a BigDecimal rather than just an int.
If you want to minimise the errors then as a rule of thumb you should add the terms in increasing size, i.e. starting with the last one. This is a problem for iterative refinement: serious calculation would not just iterative refinement. | {
"domain": "codereview.stackexchange",
"id": 33907,
"lm_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, numerical-methods",
"url": null
} |
java, design-patterns, factory-method
Interface Naming: Interfaces in Java aren't typically prefixed with an I, but if it's consistent through your code then that's a minor quibble.
Column Strings: Your TODO mentions this, but the column strings could also be placed into an enum, and then the checking could occur there. | {
"domain": "codereview.stackexchange",
"id": 3428,
"lm_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, design-patterns, factory-method",
"url": null
} |
ros, meta
Title: Accepting answers to someone else's questions [meta]
I've noticed that a lot of people don't accept an answer to their question, even if they comment that the solution worked. Is it OK to accept an answer for a question that I didn't ask? Is there a certain amount of time that should pass before doing so?
I have enough karma to accept the answer for others, but before doing that I want to make sure that that's not going against any kind of etiquette. I didn't find anything in the forum or wiki.
Some examples are: https://answers.ros.org/question/232355/tried-to-publish-before-configured-topic-id-125/?answer=232372#post-id-232372 and https://answers.ros.org/question/232187/publishing-multiple-data-types-in-one-ros-topic-in-arduino/?answer=232190#post-id-232190
Originally posted by jayess on ROS Answers with karma: 6155 on 2017-09-14
Post score: 4 | {
"domain": "robotics.stackexchange",
"id": 28849,
"lm_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, meta",
"url": null
} |
navigation, ekf, odometry, pose, robot-localization
0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9] | {
"domain": "robotics.stackexchange",
"id": 27478,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ekf, odometry, pose, robot-localization",
"url": null
} |
electromagnetism, gravity, theory-of-everything
Two Brazilian physicists connected the notion of force in special relativity (admittedly an approximation since Force usually involves acceleration) with a torsion based geometry.
They considered spin to be a manifestation of torsion. Toes today have more than 5 dimensions. There are more than two forces, electromagnetism and gravitation. In one unification there is electromagnetism andn the weak Force. Thereit is in fact the unification of all the fundamental forces except for gravitation. However if I'm rnot mistaken true toes are 11 or 21 dimensions. | {
"domain": "physics.stackexchange",
"id": 63309,
"lm_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, gravity, theory-of-everything",
"url": null
} |
ros-melodic
Edit 3:
After following the instructions on disabling proxy and returning to the unchanged configurations, I got this response when running sudo apt update for the first time:
Atingido:1 http://sft.if.usp.br/ubuntu bionic InRelease
Atingido:2 http://sft.if.usp.br/ubuntu bionic-updates InRelease
Atingido:3 http://sft.if.usp.br/ubuntu bionic-backports InRelease
Obter:4 http://sft.if.usp.br/ubuntu bionic-security InRelease [88,7 kB]
Atingido:5 http://archive.ubuntu.com/ubuntu bionic InRelease
Obter:6 http://sft.if.usp.br/ubuntu bionic-security/main Sources [114 kB]
Obter:7 http://sft.if.usp.br/ubuntu bionic-security/main i386 Packages [327 kB]
Obter:8 http://sft.if.usp.br/ubuntu bionic-security/main amd64 Packages [430 kB]
Obter:9 http://sft.if.usp.br/ubuntu bionic-security/main amd64 DEP-11 Metadata [17,9 kB]
Obter:10 http://sft.if.usp.br/ubuntu bionic-security/main DEP-11 48x48 Icons [10,4 kB] | {
"domain": "robotics.stackexchange",
"id": 33102,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-melodic",
"url": null
} |
c++, c++11, linked-list, memory-management, complexity
Sanitize user input
Right now, if the user inputs anything that is not a number, the program stays in a loop forever. Instead of extracting an int, get a std::string and use std::stoi() to convert it to an integer.
Use helper routines
Right now, there is a lot of code duplication. The search, insert and delete routines all search for the node first. If you extracted this code into a helper routine to find the node before a match, returning a node *, you could reuse searchPrev within insert and delete instead of duplicating it in every function:
node* searchPrev(node *head, int n)
{
for ( ; head && head->point && head->point->n < n; head = head->point ) {
}
return head;
} | {
"domain": "codereview.stackexchange",
"id": 16950,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, linked-list, memory-management, complexity",
"url": null
} |
newtonian-mechanics, reference-frames, orbital-motion, inertial-frames, solar-system
From our defined laws about equilibrium we know how it should be but what is it that defines that it is like that? Is it the mass distribution of the stellar system, if yes, which physical law defines that? If you're inside a windowless spaceship, and you have little thrusters you can position to apply angular acceleration to the craft, you could keep changing your angular velocity a little at a time and seeing how various experiments come out. You could connect two masses to either end of a spring, and then see what the equilibrium length of the spring is in various orientations (masses at rest in the spaceship). You would find one orientation in which the equilibrium length was shortest. That is the axis of rotation. With your thrusters, you apply some torque about this axis. If you find that the spring is more stretched afterward, then apply some torque in the opposite direction. After a few iterations, you reach a state where the length of the spring is the same regardless of | {
"domain": "physics.stackexchange",
"id": 46112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, reference-frames, orbital-motion, inertial-frames, solar-system",
"url": null
} |
• Since the choice of $t_0$ is arbitrary, your calculation seems to suggest that this variation $\frac{\delta f(t)}{\delta \dot{f}(t)}$ is not well defined. – taper Feb 25 '17 at 4:15
• @taper I have now addressed that, and you're right, only differences in that functional derivative are well defined. – Sean E. Lake Feb 25 '17 at 19:35
• Thanks for this insight. So combining with Valter Moretti's answer, the full solution is then $\delta f(t) / \delta \dot{f}(\tau) = \theta(t-\tau) + c(\tau)$. But what kinds of initial conditions would determine $c(\tau)$ - it seems like for this problem these should be context-independent of what $f$ actually is. One natural condition seems to be $\delta f(a) / \delta \dot{f}(b) = 0$ where $b>a$. Then $0 = \delta f(a) / \delta \dot{f}(b) = \theta(a-b) + c(b) = c(b)$, so the full solution is just $\delta f(t) / \delta \dot{f}(\tau) = \theta(t-\tau)$ - is this true? – smörkex Feb 26 '17 at 3:53 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936087546923,
"lm_q1q2_score": 0.8422376437758529,
"lm_q2_score": 0.8558511469672594,
"openwebmath_perplexity": 736.8252531007402,
"openwebmath_score": 0.9917231798171997,
"tags": null,
"url": "https://physics.stackexchange.com/questions/314638/variational-derivative-of-function-with-respect-to-its-derivative"
} |
visible-light, photons, electrons, double-slit-experiment
Size and density are two different things. The size is a particle property that is fixed. In the video you linked, the size of each blip is independent of whatever distance you place the detector at.
The same can’t be said of density though. The density of the blips is a measure of probability of detection in a certain region. Think about this, you have a diverging beam of light (equivalently electrons) using a lens. Then you know that the beam diameter depends on where you place the detector.
But since energy has to be conserved, the number of photons (electrons) detected in a cross section should be conserved. So a bigger diameter will have lower density of detection compared to a smaller diameter.
EDIT
Seems like I misunderstood what you meant by density.
by "density", I actually meant the density/intensity of the individual blips, not the overall pattern of blips | {
"domain": "physics.stackexchange",
"id": 83275,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, photons, electrons, double-slit-experiment",
"url": null
} |
ros, master, multiple-machines
Pis is set to 172.17.1.0
Is that a typo? Should it read .10?
Comment by wicked88 on 2017-03-04:
Yep, it is .10 sorry
Comment by gvdhoorn on 2017-03-12:
@wicked88: the postimg link doesn't work. Could I also ask you to attach images to your question directly? I've given you enough karma to do so.
Comment by gvdhoorn on 2017-03-12:\
all ROS_IP's are correctly set | {
"domain": "robotics.stackexchange",
"id": 27192,
"lm_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, master, multiple-machines",
"url": null
} |
ros, ros2, launch-file
With this code from ROS Documentation (Recording a bag from your own node (Python))
import rclpy
from rclpy.node import Node
from rclpy.serialization import serialize_message
from std_msgs.msg import String
import rosbag2_py
class SimpleBagRecorder(Node):
def init(self):
super().init('simple_bag_recorder')
self.writer = rosbag2_py.SequentialWriter()
storage_options = rosbag2_py._storage.StorageOptions(
uri='my_bag',
storage_id='sqlite3')
converter_options = rosbag2_py._storage.ConverterOptions('', '')
self.writer.open(storage_options, converter_options)
topic_info = rosbag2_py._storage.TopicMetadata(
name='chatter',
type='std_msgs/msg/String',
serialization_format='cdr')
self.writer.create_topic(topic_info)
self.subscription = self.create_subscription(
String,
'chatter',
self.topic_callback,
10)
self.subscription | {
"domain": "robotics.stackexchange",
"id": 37533,
"lm_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, ros2, launch-file",
"url": null
} |
for dividing the difference is so that we have a dimensionless quantity. It is the degree of distortion from the symmetrical bell curve or the normal distribution. For large samples of some variable, Y, the coefficient of skew (γ1) can be estimated using this formula: Unfortunately, the formula above provides biased estimates of γ1 when calculated from small samples of skewed populations. . For example, the following distribution 2. S k = 3 (mean – median) / Standard Deviation. For both the data sets, we can conclude the mode is 2. For a unimodal distribution, negative skew commonly indicates that the tail is on the left side of the distribution, and positive skew indicates that the tail is on the right. In probability theory and statistics, skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. As seen already in this article, skewness is used … Another way to calculate skewness by using the below formula: Kurtosis is | {
"domain": "abrasivosmolina.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668712109662,
"lm_q1q2_score": 0.8021769995112599,
"lm_q2_score": 0.8175744850834648,
"openwebmath_perplexity": 746.7789554414717,
"openwebmath_score": 0.8419783711433411,
"tags": null,
"url": "https://abrasivosmolina.com/blue-marble-djraqd/0aa3a8-coefficient-of-skewness-and-kurtosis-formula"
} |
gazebo-tutorial
Originally posted by Chris with karma: 67 on 2013-08-02
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by suvrat on 2013-08-02:
thanks @chris i will try this .thank you very much for help.
Comment by Chris on 2013-08-02:
No problem. If you have further questions, let me know
Comment by suvrat on 2013-08-03:
thanks a lot @chris ,i solved my problem
Comment by anonymous on 2014-11-21:
Hey. I am also doing the same work of obstacle avoidance but when i did it with polaris_ranger_model this control model tutorial is not working . Polaris dont stop. Can you plz suggest how will i do it with polaris ranger model so that it should stop when it detects the object. Thanks! | {
"domain": "robotics.stackexchange",
"id": 3409,
"lm_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-tutorial",
"url": null
} |
php, rest, curl, phpunit
/**
* Get URI Base setting
*
* @return string
*/
public function getUriBase() {
return $this->uriBase;
}
/**
* Get boolean setting indicating whether SSL is to be used
*
* @return boolean
*/
public function getUseSsl() {
return $this->useSsl;
}
/**
* Get boolean setting indicating whether SSL test mode is enabled
*
* @return boolean
*/
public function getUseSslTestMode() {
return $this->useSslTestMode;
}
/**
* Get timeout setting
*
* @return integer
*/
public function getTimeout() {
return $this->timeout;
}
/**
* Get follow redirects setting
*
* @return boolean
*/
public function getFollowRedirects() {
return $this->followRedirects;
} | {
"domain": "codereview.stackexchange",
"id": 24574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, rest, curl, phpunit",
"url": null
} |
nuclear-physics, temperature, nuclear-engineering, aircraft, explosions
I imagine the exact temperatures are probably classified; that said, the melting point of the turbine blades used in normal jet engines is around 1400 degrees Celsius (source: https://www.thenakedscientists.com/articles/interviews/how-do-you-stop-jet-engine-melting), so probably hotter than that.
But this doesn't really have anything to do with the fact that this missile happened to be powered by a nuclear reactor. Reading the article, the missile has to be capable of low-altitude supersonic flight. This makes the requirements quite different from those of a normal jet engine, which mostly operates under subsonic, high-altitude conditions, and also quite different from rocket engines, which do not usually enter the supersonic regime until high in the atmosphere (and also have a completely different propulsion mechanism, of course). | {
"domain": "physics.stackexchange",
"id": 60627,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, temperature, nuclear-engineering, aircraft, explosions",
"url": null
} |
Baire category theorem and Baire spaces are discussed in this previous post. We define the Banach-Mazur game and show how this game is related to the Baire property. We also define some completeness properties stronger than the Baire property using this game. For a survey on Baire spaces, see [4]. For more information about the Banach-Mazur game, see [1]. Good references for basic topological terms are [3] and [5]. All topological spaces are assumed to be at least Hausdorff.
__________________________________________________________________________
The Banach-Mazur Game | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982013790564298,
"lm_q1q2_score": 0.8204563532136758,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 579.0447059325933,
"openwebmath_score": 0.9998471736907959,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/baire-space/"
} |
satisfiability, constraint-satisfaction
Approach #2: Convert to CNF, then use a #SAT solver.
You can always convert your constraints to a CNF formula. Each linear inequality can be converted to a set of CNF clauses. A linear inequality of the form $x_i + \dots + x_j \ge 1$ corresponds immediately to the CNF clause $(x_i \lor \dots \lor x_j)$. For a more general linear inequality of the form $x_i + \dots + x_j \ge c$, you want to express the constraint that at least $c$ out of the $k$ variables $x_i,\dots,x_j$ are true. There are many standard ways of encoding that. See https://cstheory.stackexchange.com/q/23771/5038, Reduce the following problem to SAT, Encoding 1-out-of-n constraint for SAT solvers,
(One approach is to convert a Boolean circuit that computes $x_i + \dots + x_j$ and compares it to $c$, then convert the Boolean circuit to CNF using the Tseitin transform. You can create such a Boolean circuit by using standard adder and comparator circuits. However, there are many other ways as well.) | {
"domain": "cs.stackexchange",
"id": 16344,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "satisfiability, constraint-satisfaction",
"url": null
} |
context-free, automata, pushdown-automata
Your proof is erroneous since $L/R$ is larger than what you indicate. In fact, whenever $\epsilon \in R$, we always have $L/R \supseteq L$. In your case
$$
L/R = \{ a^{n_1} b^{n_2} : n_2 \leq n_1 \} \cup \{ a^n b^n a^{m_1} b^{m_2} : m_2 \leq m_1 \}.
$$ | {
"domain": "cs.stackexchange",
"id": 7609,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "context-free, automata, pushdown-automata",
"url": null
} |
quantum-mechanics, hilbert-space, wavefunction, singularities, spherical-harmonics
Title: Physically unacceptable solutions for the QM angular equation I'm reading Griffiths's Introduction to Quantum Mechanics 3rd ed textbook [1]. On p.136, the author explains:
But wait! Equation 4.25 (angular equation for the $\theta$-part) is a second-order differential equation: It should have two linearly independent solutions, for any old values of $\ell$ and $m$. Where are all the other solutions? (One is related to the associated Legendre function.)
Answer: They exist of course, as mathematical solutions to the equation, but they are physically unacceptable because they blow up at $\theta=0$ and/or $\theta=\pi$ (see Problem 4.5). | {
"domain": "physics.stackexchange",
"id": 70675,
"lm_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, hilbert-space, wavefunction, singularities, spherical-harmonics",
"url": null
} |
det(A −λI) = 0, stream That example demonstrates a very important concept in engineering and science - eigenvalues and eigenvectors- which is used widely in many applications, including calculus, search engines, population studies, aeronautics … EXAMPLE 1: Find the eigenvalues and eigenvectors of the matrix A = 1 −3 3 3 −5 3 6 −6 4 . which satisfy the characteristic equation of the. Any help is greatly appreciated. Since the zero-vector is a solution, the system is consistent. In linear algebra, the Eigenvector does not change its direction under the associated linear transformation. Eigenvalues and Eigenvectors of a Matrix Description Calculate the eigenvalues and corresponding eigenvectors of a matrix. 3xx3 matrices and their eigenvalues and eigenvectors. The eigenvectors for D 0 (which means Px D 0x/ fill up the nullspace. Finding of eigenvalues and eigenvectors. 2 Answers. To find all of a matrix's eigenvectors, you need solve this equation once for each individual eigenvalue. We | {
"domain": "easylia.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.963779946215714,
"lm_q1q2_score": 0.8535538542034362,
"lm_q2_score": 0.8856314738181875,
"openwebmath_perplexity": 350.64668699753804,
"openwebmath_score": 0.8721694946289062,
"tags": null,
"url": "http://nacretv.easylia.com/uamkx/1ea173-how-to-find-eigenvectors-of-a-3x3-matrix"
} |
newtonian-mechanics
Assume that:
Ground is rough enough so it will never slide
Mass centre, force applied and target's bullseye are all alighend at the top of cuboid.
Force will be applied perpendicularly to target. If that's unrealistic then it should be any angle from parallel to perpendicular to the ground. Sketch: There's a lot more to this question than OP imagines.
If $F$ was a continuous force, then from the geometry and with trigonometry $F_1$ could easily be calculated:
$$F_1=F\cos (\pi-2\alpha)$$
This creates counterclockwise torque about the forward pivot point of the stand:
$$\tau_1=F_1r$$
Which tries to topple the stand.
The weight $mg$ provides an opposing clockwise torque $\tau_2$:
$$\tau_2=mgr\cos\alpha$$
If there is a net, positive torque:
$$\tau_{net}=\tau_1-\tau_2>0$$
Then angular acceleration around the forward pivot point will occur, as per Newton. The ensemble will topple because as rotation proceeds, $\tau_2$ actually vanishes.
But that's far from the end of it. | {
"domain": "physics.stackexchange",
"id": 34751,
"lm_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",
"url": null
} |
-
I'm not sure what you mean by "an algebraic formula", but would you be happy with the observation that it satisfies the recurrence $f(n) = f(n-1) - f(n-2)$?
Addendum: Since you know that it satisfies the recurrence, each term depends only on the previous two terms. Now suppose you know that $f(m) = f(n)$ and $f(m+1) = f(n+1)$ for some $m$ and $n$. Then you know that $f(m+2) = f(n+2)$ also, and, by induction, $f(m+k) = f(n+k)$ for all positive $k$.
But from your enumeration above, you know that $f(0) = f(6)$ and $f(1) = f(7)$. So you can conclude that $f(k) = f(6+k)$ for all positive $k$. So the function has a period of 6.
In particular, for any $k$, $f(k) = f(6+k) = f(12+k) = … = f(6j+k)$ for any $j$. Now if someone gives you $n$, you can write $n$ in the form $n = 6j+k$ where $k$ is in $[0…5]$. You do this by dividing n by 6; $j$ is the quotient and $k$ is the remainder. And we know $f(n) = f(6j+k) = f(k)$. But $k$ is in $[0…5]$ so $f(k)$ is easy to calculate. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517482043892,
"lm_q1q2_score": 0.8426289570945446,
"lm_q2_score": 0.8615382147637196,
"openwebmath_perplexity": 130.93749105131874,
"openwebmath_score": 0.926360011100769,
"tags": null,
"url": "http://math.stackexchange.com/questions/131423/obtain-the-formula-for-the-following-sequence/131429"
} |
q-learning, markov-decision-process, off-policy-methods, on-policy-methods, markov-property
The OpenAI Gym CartPole environment is Markov. Whether or not you know the transition probabilities does not affect whether the state has the Markov property. All that matters is that knowing the current state is enough to be determine the next state and reward in principle. You do not need to explicitly know the state transition model, or the reward function.
An example of a non-Markov state for CartPole would be if one of the features was missing - e.g. the current position of the cart, or the angular velocity of the pole. It is still possible to have agents attempt to solve CartPole with such missing data, but the state would no longer be Markov, and it would be a harder challenge.
For me, there is something weird in updating a Q value based on the max Q for a state and a reward value that was not from the action taken? How does this make learning better and makes you learn the optimal policy? | {
"domain": "ai.stackexchange",
"id": 2650,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "q-learning, markov-decision-process, off-policy-methods, on-policy-methods, markov-property",
"url": null
} |
haar-distribution
The key observation is that $\rho(V)$ is a similarity transformation for every $V\in\mathbf{U}(d)$. In particular, $\rho(V)(\sigma_0)=\sigma_0$ and $\rho(V)$ sends traceless matrices to traceless matrices for every $V\in\mathbf{U}(d)$. Therefore, $\mathrm{span}(\sigma_0)\subset\mathrm{Lin}(\mathbb{C}^d)$ is a one-dimensional irreducible subrepresentation of $\rho$. Moreover, since $\sigma_k$ for $k>0$ have the same eigenvalues, for any two $\sigma_i$ and $\sigma_j$ with $i,j>0$ there exists $W\in\mathbf{U}(d)$ such that $\rho(W)(\sigma_i)=\sigma_j$. Therefore, $\mathrm{span}(\sigma_1,\dots,\sigma_{d^2-1})$ is another irreducible subrepresentation of $\rho$.
Thus, we obtain decomposition of $\rho$ into irreps as
$$
\mathrm{Lin}(\mathbb{C}^d)=\mathrm{span}(\sigma_0)\oplus\mathrm{span}(\sigma_1,\dots,\sigma_{d^2-1}).\tag1
$$
In other words, $\rho$ decomposes into the trace and the traceless matrices.
Twirling by Schur's lemma | {
"domain": "quantumcomputing.stackexchange",
"id": 5124,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haar-distribution",
"url": null
} |
• Okay so in this case I should check if all the divisors and then pick the lowest one as the order. How would you go about this problem given a much larger number say $p=101$ then $\phi(101)$ has a large number of divisors? Also, could you further explain the last statement about the number of elements? Aug 27, 2019 at 0:35
• Yeah. It's well known in case $n$ is $1,2,4$, a power of an odd prime or twice a power of an odd prime, the multiplicative group $U(n)$ is cyclic. The statement about the number of elements of order $d$ can be understood by taking a generator, and considering what happens when you raise it to various powers. Recall that $g^k$ has order $\dfrac {\mid g\mid}{\operatorname {gcd}(\mid g\mid,k)}$.
– user403337
Aug 27, 2019 at 0:50
• For the first question, the better you are at modular arithmetic, the easier it will be.
– user403337
Aug 27, 2019 at 0:54 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924777713886,
"lm_q1q2_score": 0.8057222841674004,
"lm_q2_score": 0.828938806208442,
"openwebmath_perplexity": 343.12633215594985,
"openwebmath_score": 0.9086388945579529,
"tags": null,
"url": "https://math.stackexchange.com/questions/3335382/orders-of-primitive-roots"
} |
javascript, beginner, jquery, html, adventure-game
<div class="sit_4a">
You eat the berries.
</div>
</div>
<div id="a1">
<input type="button" class="choice_1" value="Continue on...">
<input type="button" class="choice_2a"value="Go inside">
<input type="button" class="choice_2b" value="Look for food">
<input type="button" class="choice_3a" value="Eat the berries">
<input type="button" class="choice_3b" value="Don't eat the berries">
</div>
</html> | {
"domain": "codereview.stackexchange",
"id": 21291,
"lm_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, html, adventure-game",
"url": null
} |
mvc, objective-c, ios
Alternatively, if you fix up your notification method as I recommended, you'll have to change the methods that respond to the notifications to take an NSNotification object.
- (void)query2And3Complete:(NSNotification *)aNotification {
NSDictionary *userInfo = aNotification.userInfo;
self.fullImageMessages = userInfo[kQuery2And3Results];
[HALUserDefaults storeFullImageMessages: self.fullImageMessages];
[self.tableView reloadData];
}
And if you're going to stick with notifications, make sure you unregister for the notifications in dealloc! Otherwise the notification center may try sending messages to your deallocated object, and that's a crash every time.
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
} | {
"domain": "codereview.stackexchange",
"id": 8505,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mvc, objective-c, ios",
"url": null
} |
formal-languages, logic
Title: Language to define perfectly a programming problem Is there any language, which can be used to define all programming problems perfectly?
By perfectly, I mean with these two properties:
p is the problem.
d is the definition in the language.
P(d, p): "d is the definition of the problem p"
$$
\forall p\exists d(P(d, p))
$$
$$
\forall p\exists d1,d2((P(d1, p) \land P(d2, p)) \rightarrow (d1 \Leftrightarrow d2))
$$
Example: The simple problem to output the first N numbers, can be defined in many ways, for example in the english language. I want a language which restricts the number of definitions to 1 for every problem. In other words, no 2 distinct definitions can define the same problem, and every problem has a definition. | {
"domain": "cs.stackexchange",
"id": 14922,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, logic",
"url": null
} |
python, r, statistics, correlation
Here I will explain the first bullet which I think will at least allow you to get your final data frame without the memory issue: | {
"domain": "datascience.stackexchange",
"id": 7882,
"lm_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, r, statistics, correlation",
"url": null
} |
a discrete signal x[n] (where N is the size of its domain), we multiply each of its value by e raised to some function of n. Discrete Fourier Transform Discrete-time Fourier transform (DTFT) Discrete Fourier Transform (DFT) The relationship between DTFT and DFT. Python Plot 2d Gaussian. The Dirac delta, distributions, and generalized transforms. The discrete fractional Fourier transform Cağatay Candan, M. A Fourier transform is an operation which converts functions from time to frequency domains. The transfer function, H 1, of a symmetric pole-pair recursive filter is closely related to the discrete-time Fourier transform of the discrete Gaussian kernel via first-order approximation of the exponential:. The equation for the two-dimensional discrete Fourier transform (DFT) is: The concept behind the Fourier transform is that any waveform that can be constructed using a sum of sine and cosine waves of different frequencies. f (0) = ∞ −∞ f (x)δ(x)dx ∞ −∞ δ(x)dx = 1 (16) The Dirac delta | {
"domain": "programex.pl",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9902915232319999,
"lm_q1q2_score": 0.8252342807886346,
"lm_q2_score": 0.8333245932423309,
"openwebmath_perplexity": 676.1897974223843,
"openwebmath_score": 0.7972910404205322,
"tags": null,
"url": "http://jrat.programex.pl/discrete-fourier-transform-of-gaussian.html"
} |
deep-learning, keras, tensorflow, computer-vision, convolutional-neural-network
Case3 result: High training accuracy and validation accuracy, but the training accuracy is lower.. check the following image:
1- Why does using augmentation in validation and testing data ImageDataGenerator(rescale=1./255) in case3 give different result than case2?
2- Is adding ImageDataGenerator(rescale=1./255) to the testing and validation better than not adding it?
3- Do you think there is a problem in the result of the first case?
1 and 2: If you rescale you images, you should do it on all partitions: training, validation and test. If you only rescale your images on the training set, then your network will see very different values (0~255, vs 0.0~1.0) on validation/test set and therefore give poor accuracy. That's your case 2.
I don't see any obvious problem. | {
"domain": "datascience.stackexchange",
"id": 3774,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, keras, tensorflow, computer-vision, convolutional-neural-network",
"url": null
} |
python, python-3.x, file, file-system
f' items above Alpha-numerically (A-Z / 0-9) or by type? a/t/q: ')
while action1 != 'a' and action1 != 't' and action1 != 'q':
print(f'Invalid command {action1}')
action1 = input(f'Enter q to exit. Do you want to group the {len(folder_contents)}'
f' items above Alpha-numerically (A-Z / 0-9) or by type? a/t/q: ')
if action1 == 'a':
action2 = input(f"Enter q to exit. Are you sure, do you want to create Alpha-numeric (A-Z / 0-9) folders in "
f"{str(path).split('/')[-1]}? y/n/q: ")
while action2 != 'y' and action2 != 'n' and action2 != 'q':
print(f'Invalid command {action2}')
action2 = input(
f"Enter q to exit. Are you sure, do you want to create Alpha-numeric (A-Z / 0-9) folders in "
f"{str(path).split('/')[-1]}? y/n/q: ")
if action2 == 'n' or action2 == 'q': | {
"domain": "codereview.stackexchange",
"id": 35633,
"lm_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, file, file-system",
"url": null
} |
houses, but it's not necessarily a direct path. It’s also possible for a Graph to consist of multiple isolated sub-graphs but if a path exists between every pair of vertices then that would be called a connected graph. She has 15 years of experience teaching collegiate mathematics at various institutions. 5.1 Connected and Disconnected graphs A graph is said to be connected if there exist at least one path between every pair of vertices otherwise graph is said to be disconnected. The first is an example of a complete graph. In previous post, BFS only with a particular vertex is performed i.e. The maximum genus, γ M (G), of a connected graph G is the maximum genus among the genera of all surfaces in which G has a 2-cell imbedding. Cut Edges/Bridges Cut edges or bridges are edges that produce a subgraph with more connected components when removed from a graph. Now, let's look at some differences between these two types of graphs. Since there is an edge between every pair of vertices in a | {
"domain": "janomajercik.sk",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399043329856,
"lm_q1q2_score": 0.8187806997603904,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 709.2964371132405,
"openwebmath_score": 0.4230887293815613,
"tags": null,
"url": "http://janomajercik.sk/vgzda/7120d4-connected-vs-disconnected-graph"
} |
python, numpy, mean
Title: finding the mean for each of the channels (RGB) across an array of images How can I find the mean for each of the channels (RGB) across an array of images?
For example train_dataset[0]['image'].shape is (600, 800, 3) and len(train_dataset) is 720 meaning it includes 720 images of dimension 600x800 and 3 channels. train_dataset[0]['image'] is an ndarray.
I am looking to end up with 3 numbers each representing the mean for each of the channels across all these 720 images.
I have this very dumb solution but I wonder if there's a better solution?
I also did it this other way and got almost the same answer: Could probably be more elegant, but here's an idea:
mean[:, :, 0:2] = np.mean(imgs[:, :, :, 0:2], axis=0) | {
"domain": "datascience.stackexchange",
"id": 8447,
"lm_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, numpy, mean",
"url": null
} |
Now, because of Lemmas 3 and 4, to show that (i) implies (ii) is equivalent to showing that every vector in the null space of $M$ is orthogonal to every element of the row space of $M$. Indeed, Say that $M$ is an $m\times n$ matrix, and writing $M=[r_1^T\:\cdots\:r_m^T]^T$ where the $r_j$ are the rows of $M,$ we note that for any $n$-dimensional vector $x$ we have $$Mx=\left[\begin{array}{c}r_1\\\vdots\\r_m\end{array}\right]x=\left[\begin{array}{c}r_1x\\\vdots\\r_mx\end{array}\right]=\left[\begin{array}{c}r_1^T\cdot x\\\vdots\\r_m^T\cdot x\end{array}\right].$$ In particular, if $x$ is in the null space of $M$, then $r_j^T\cdot x=0$ for $1\le j\le m,$ meaning that $x$ is orthogonal to each row of $M$, so since the row space of $M$ is spanned by these rows then $x$ is in the orthogonal complement to the row space of $M,$ as desired. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517443658749,
"lm_q1q2_score": 0.8273754783420658,
"lm_q2_score": 0.845942439250491,
"openwebmath_perplexity": 82.42955111069816,
"openwebmath_score": 0.9577983617782593,
"tags": null,
"url": "https://math.stackexchange.com/questions/544395/a-vector-that-is-orthogonal-to-the-null-space-must-be-in-the-row-space"
} |
python, performance, classes, sudoku
@classmethod
def create_empty(cls, board, number):
'''Creates empty spaces in board according to number, returns the board'''
coors = [(y, x) for y in range(9) for x in range(9)]
shuffle(coors)
for idx in range(number):
y, x = coors[idx]
board[y][x] = 0
return board
@classmethod
def generate_board(cls):
'''Generates a random Sudoku board and returns it.'''
numbers = list(range(1, 10))
board = [[0 for _ in range(9)] for _ in range(9)]
for y in range(len(board)):
for x in range(len(board[0])):
shuffle(numbers)
for num in numbers:
if Sudoku.valid(board, num, (y, x)):
board[y][x] = num
if Sudoku.solve(board):
break
board[y][x] = num
return board
solver = Sudoku()
print('Original board')
print(solver.str_board(board)) | {
"domain": "codereview.stackexchange",
"id": 42051,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, classes, sudoku",
"url": null
} |
c++, performance, matrix, template, c++17
auto operator*(Value val)
{
return mul(val);
}
The most complicated part of my code so far. I have to calculate the size of my new matrix at compile time so that I am able to keep my goal to avoid dynamic allocation. The syntax of template templates is quite odd to me but it does work.
template< template<size_t,size_t,typename>class B, size_t I, size_t J, typename Type>
auto mul(B<I,J,Type>& b) -> decltype(Matrix<N, J, Value>{})
{
Matrix<N, J, Value> result;
for (auto i = 0; i < N; ++i)
for (auto j = 0; j < J; ++j)
{
for (int k = 0; k < I; ++k)
{
int _a = M * i + k;
int _b = J * k + j;
result.data()[J * i + j] += this->mGrid[_a] * b.data()[_b];
}
}
return result;
} | {
"domain": "codereview.stackexchange",
"id": 26182,
"lm_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, matrix, template, c++17",
"url": null
} |
algorithms, reinforcement-learning, monte-carlo
Is always trivially satisfied for the pair $(S_0, A_0)$ (it's the beginning of the trajectory, so we can't possible have observed that state-action pair before)
Is satisfied at time $t = 1$ if and only if $(S_1, A_1) \neq (S_0, A_0)$ (so at least one of the state or the action must be different from the preceding ones)
Is satisfied at time $t = 2$ if and only if $(S_2, A_2) \neq (S_1, A_1)$ AND $(S_2, A_2) \neq (S_0, A_0)$.
etc. | {
"domain": "cs.stackexchange",
"id": 12693,
"lm_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, reinforcement-learning, monte-carlo",
"url": null
} |
performance, beginner, vba, excel, macros
Based on the update, a loop is required, avoiding .Select will still help performance:
Sub test()
On Error GoTo CleanExit
' Application.ScreenUpdating = False
Dim row As Long
For row = 40 To 1539
With Sheet1
.Range("C2").FormulaR1C1 = "=R" & CStr(row) & "C2"
.Range("C3").FormulaR1C1 = "=R" & CStr(row) & "C3"
.Range.Cells.Item(4, row).Value2 = .Range("e2").Value2
End With
Next
CleanExit:
Application.ScreenUpdating = True
End Sub
Note in this case the With Sheet1 - you can use the worksheet's (Name) property as a direct reference to it (you'll have to modify this for your Workbook): | {
"domain": "codereview.stackexchange",
"id": 41375,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, beginner, vba, excel, macros",
"url": null
} |
Note that your diagram is simplifying (which is ok) in the following sense: an inclusion sometimes mean slightly different things. A Banach space is really the same structure as a normed vector space, it just has some extra property – that the induced metric is complete. In the same spirit you could add complete metric spaces in your diagram. On the other hand, a metric space is a topological space in the sense that the metric canonically induces a topology. But it is formally a different structure. Also, two different metric spaces may induce the same topological space this way, but two different Banach spaces always correspond to different normed vector spaces (since the corresponding functor is just the identity). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517411671125,
"lm_q1q2_score": 0.8018981026094133,
"lm_q2_score": 0.8198933337131076,
"openwebmath_perplexity": 527.5267374125108,
"openwebmath_score": 0.8257867097854614,
"tags": null,
"url": "https://math.stackexchange.com/questions/3326615/trying-to-visualize-the-hierarchy-of-mathematical-spaces"
} |
java, stream, lazy
I am opening a connection to the internet just to check if my stream is parallel. I don't know how terrible that is
Very.
TWR keeps getting forgotten.
If someone keeps forgetting to hold the steering wheel, the solution is not to remove the steering wheel and build a more complicated, less accessible steering wheel behind the dashboard. Your entry-level developers should be learning how to write idiomatic Java, rather than learning (or - as the case may be - not learning) a custom framework that attempts to be too clever. There are standard tools, some mentioned in the comments, that flag when resources are mismanaged. Learn to use these tools.
To quote a separate commenter,
I would like to consume a stream shared between threads. The stream should autodetect when it is not used any more | {
"domain": "codereview.stackexchange",
"id": 45492,
"lm_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, stream, lazy",
"url": null
} |
solid-state-physics
divergences, and there's a philosophy of "effective field theories" which explains how to think about these cancellations. Roughly speaking, depending on what energy scale you want to work in, you might interpret the electron as being a single particle, or a fuzzy cloud, but with regards to calculating measurable quantities, it doesn't really matter. For a better take on this, I like the first few sections of Howard Georgi's review "Effective field theory". | {
"domain": "physics.stackexchange",
"id": 82085,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solid-state-physics",
"url": null
} |
newtonian-mechanics, energy-conservation, reversibility, perpetual-motion
We imagine that there are two classes of machines : those that are not reversible, which includes all real machines, and those that are reversible, which of course are actually not attainable no matter how careful we may be in our design of bearings, levers, etc.
We suppose, however, that there is such a thing — a reversible machine — which lowers one unit of weight (a pound or any other unit) by one unit of distance, and at the same time lifts a three-unit weight. Call this reversible machine, Machine A.
Suppose this particular reversible machine lifts the three-unit weight a distance X. Then suppose we have another machine, Machine B, which is not necessarily reversible, which also lowers a unit weight a unit distance, but which lifts three units a distance Y. We can now prove that Y is not higher than X; that is, it is impossible to build a machine that will lift a weight any higher than it will be lifted by a reversible machine. | {
"domain": "physics.stackexchange",
"id": 64884,
"lm_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, energy-conservation, reversibility, perpetual-motion",
"url": null
} |
thermodynamics, statistical-mechanics
It follows that $TdS\geq\delta Q$.
Is the reasoning and conclusion correct? Yes, your argument is valid, but your proof is for adiabatic process only. The inequality is more general and applies whether heat is exchanged or not.
Start with entropy generation, which is defined as the entropy change of the system ($dS$) plus that of the surroundings. Assuming the surroundings to be at the temperature of the system the entropy of the surroundings is $dS_\text{surr}=-dQ/T$. Then,
$$
dS_\text{gen} = dS -\frac{dQ}{T}\geq 0
\Rightarrow
dQ \leq T dS
$$
which is the inequality we seek. If the surroundings are at a temperature different from that of the system there is additional entropy generation due to heat transfer between the system and the surroundings, and the inequality is even stronger. | {
"domain": "physics.stackexchange",
"id": 94401,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, statistical-mechanics",
"url": null
} |
c++, performance, c++11, collections, skip-list
template<typename Key, typename T>
typename Skip_list<Key,T>::iterator Skip_list<Key,T>::find(const key_type& key)
// same as const_iterator function, is there a way to not have this redundant?
{
auto level = head.size();
auto next = head.data();
while (level > 0) {
const auto index = level - 1;
if (!next[index] || next[index]->value.first > key) {
--level;
}
else if (next[index]->value.first == key) {
return iterator{ next[index] };
}
else {
next = next[index]->next;
}
}
return end();
}
template<typename Key, typename T>
void Skip_list<Key,T>::debug_print(std::ostream& os) const
//messy debug routine to print with all available layers
{
if (head[0] == nullptr) {
os << "empty" << '\n';
return;
} | {
"domain": "codereview.stackexchange",
"id": 31334,
"lm_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, c++11, collections, skip-list",
"url": null
} |
game, objective-c, ios, cocoa-touch
Title: iOS7 ChessGame UIChessboardView Design I've been designing UIChessboardView in the likeness of UITableView using protocols and delegates.
UIChessboardView.h
@interface UIChessboardView : UIView
@property (retain) id chessdelegate;
-(void) selectChesstileWithID:(NSInteger) tileID;
-(void) deselectChesstileWithID:(NSInteger) tileID;
@end
@protocol ChessboardViewDelegate <NSObject>
-(UIImage*) chessboardView:(UIChessboardView*)chessboardView imageForChesstile:(NSInteger) tileID;
-(void)chessboardView:(id)chessboardView mouseDown_chessTileWithID:(NSInteger)tileID;
-(void)chessboardView:(id)chessboardView mouseUp_chessTileWithID:(NSInteger)tileID;
@end
UIChessboardView.m
@implementation UIChessboardView
{
NSDictionary* chessTileViews;
NSArray *tileKeys;
} | {
"domain": "codereview.stackexchange",
"id": 7731,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, objective-c, ios, cocoa-touch",
"url": null
} |
rosdep, ros-fuerte, rosinstall
ROS dependency, stack
Simply add <depend stack="OtherStack"> in your stack.xml file
System dependency
Add <rosdep name="OtherLibrary"> in your manifest.xml file
ROS Q&A that may help further:
http://answers.ros.org/question/9430/how-to-use-external-libraries-in-ros-code/
http://answers.ros.org/question/11879/best-practice-for-rosdep-ubuntu-packages-and-others/
http://answers.ros.org/question/34199/what-is-the-correct-way-to-add-external-library/
In addition, you can look at this documentation:
rosintall: http://www.ros.org/wiki/rosinstall
rosdep: http://ros.org/wiki/rosdep, http://ros.org/doc/api/rosdep2/html/rosdep_yaml_format.html, http://ros.org/reps/rep-0125.html
ROS overlays: http://ros.org/wiki/fuerte/Installation/Overlays
Originally posted by Benoit Larochelle with karma: 867 on 2013-01-20
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 12512,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosdep, ros-fuerte, rosinstall",
"url": null
} |
mathematical-physics, soft-question, integration
Simplified Maxwell's Equations
Maxwell's equations talk about the interactions of the electric and magnetic field through differential equations. It turns out we can represent the electric and magnetic fields by introducing a single potential vector $A$ with four components: one "time" component $\phi/c$ and three space components represented by the vector $\bf{\vec{A}}$. Then the electric and magnetic fields are given by
$$
\bf{\vec{E}}=\bf{\vec{\nabla}}\phi,\quad \bf{\vec{B}}=\bf{\vec{\nabla}}\times\bf{\vec{A}}
$$
and Maxwell's equations are
$$
\frac{1}{c^2}\frac{\partial^2\phi(\bf{x},t)}{\partial t^2} - \nabla^2\phi(\bf{x},t) = \frac{\rho}{\epsilon_0}
\\
\frac{1}{c^2}\frac{\partial^2\bf{\vec{A}}(\bf{x},t)}{\partial t^2} - \nabla^2\bf{\vec{A}} (\bf{x},t) = \mu_0\bf{\vec{J}}
$$
(You can go here to learn more about Maxwell's equations, and here to learn more about the operator $\bf{\vec{\nabla}}$).
Green's Function | {
"domain": "physics.stackexchange",
"id": 9067,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mathematical-physics, soft-question, integration",
"url": null
} |
quantum-field-theory, conservation-laws, spinors, coulombs-law
$$
In the non-relativistic limit, considering the next order relativistic correction, which is not generally done in textbooks (or rather I have not seen it being done),
$$\sqrt{\left(p^\prime\cdot\sigma\right)\left(p\cdot{\sigma}\right)}+\sqrt{\left(p^\prime\cdot\bar{\sigma}\right)\left(p\cdot\bar{\sigma}\right)}\approx2\sqrt{p^\prime_0p_0}+\frac{1}{\sqrt{p^\prime_0p_0}}\left(\vec{p}^{\prime} \cdot \vec{p}+i \vec{\sigma} \cdot\left(\vec{p}^{\prime} \times \vec{p}\right)\right)$$
With this,
$$\xi^{s^{\prime}\dagger}\left(\sqrt{\left(p^\prime\cdot\sigma\right)\left(p\cdot{\sigma}\right)}+\sqrt{\left(p^\prime\cdot\bar{\sigma}\right)\left(p\cdot\bar{\sigma}\right)}\right)\xi^s=2\sqrt{p^\prime_0p_0}\delta^{s^{\prime}s}+\frac{1}{\sqrt{p^\prime_0p_0}}\left(\vec{p}^{\prime} \cdot \vec{p}\delta^{s^{\prime}s}+i \xi^{s^{\prime}\dagger}\vec{\sigma}\xi^s \cdot\left(\vec{p}^{\prime} \times \vec{p}\right)\right)$$ | {
"domain": "physics.stackexchange",
"id": 66182,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, conservation-laws, spinors, coulombs-law",
"url": null
} |
homework-and-exercises, group-theory, representation-theory, lie-algebra
$${\bf n} \otimes_A {\bf n}
\quad\cong\quad
\begin{array}{c} [~~]\cr [~~] \end{array}
\quad\cong\quad
{\bf\frac{n(n-1)}{2}},\tag{1}$$
and
$${\bf n} \otimes_A {\bf n}^{\ast}
\quad\oplus\quad
{\bf n}^{\ast} \otimes_A {\bf n}
\quad\cong\quad
{\bf n}^{\ast}\otimes {\bf n}$$
$$\quad\cong\quad
\begin{array}{c} [~~]\cr [~~]\cr \vdots\cr [~~] \end{array}
\otimes [~~]
\quad\cong\quad
\begin{array}{c} [~~]\cr [~~]\cr \vdots\cr [~~]\cr [~~] \end{array}
\quad\oplus\quad
\begin{array}{cc} [~~]&[~~]\cr [~~]\cr \vdots\cr [~~]\end{array}
\quad\cong\quad
{\bf 1} \quad\oplus\quad {\bf(n^2-1)},\tag{2}$$
etc. (The number of boxes in each term of eq. (2) is supposed to be $n$.) | {
"domain": "physics.stackexchange",
"id": 45724,
"lm_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, group-theory, representation-theory, lie-algebra",
"url": null
} |
computer-architecture, operating-systems, cpu
Title: How many registers does a computer *need*? I read about Why does a processor have 32 registers?, and others. Currently I am messing around with an OS in JavaScript, and wondering how many registers -- or more specifically, how many temporary variable slots -- you need in a computer. How many do you need? Bare minimum, what is theoretically the lower bound? Is it 2? Or is it 8? I read some CPUs had 8 at one point, why did they switch to 32 or more these days? I wonder if you can get by with only 2 registers for all computation. If so, is it very inefficient or something? These are all aspects of the main question. | {
"domain": "cs.stackexchange",
"id": 15306,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computer-architecture, operating-systems, cpu",
"url": null
} |
and to personalise content to better meet needs... Updated: Sep 23, 2014. ppt, 8 MB and in the two figures correspond and are equal to... 180°C = 180° - 70°b = 110° we now know two angles in any triangle equals degrees. For your answers below. ) is the length of all angles in triangles + f = 180°f = -. To Common Core aligned worksheets every month and finding missing angles in the triangles below answer! This stage, roughly Grades 5-8, students work on “ unknown must... Maths pupils to practise using their protractor to measure of angle H is 92° SOH CAH.! An isosceles triangle is 52° a web filter, please make sure that the triangles on a straight XY. To scale a Enter the missing angles as there are often other ways of finding sides! Unknown angle, angle b must add to these to make the sides meet at four.! Tick the correct curriculum and to personalise content to better meet the needs of our users isosceles! Shown: find the unknown angles and sides when certain information is given copy | {
"domain": "animent.hu",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9609517028006208,
"lm_q1q2_score": 0.8148560594871758,
"lm_q2_score": 0.8479677564567913,
"openwebmath_perplexity": 1096.0862469731533,
"openwebmath_score": 0.5530692338943481,
"tags": null,
"url": "http://animent.hu/szbo44cf/finding-unknown-angles-in-triangles-c43993"
} |
nuclear-physics, neutrons
Title: Thermal neutrons in fission I read this:
These so-called fast neutrons do not cause fission as efficiently as slower-moving ones so they are slowed down in most reactors by the process of moderation.
Why slowly neutrons "thermal" are more efficiently in causing the fission? Is due to their larger cross section? And why the cross section of thermal neutron is larger than the faster ones? For comparison, I plot below the (total) neutron cross section and the cross section for fission for both 235U and 238U below. These data are readily available at the Evaluated Nuclear Data File site (the linked one is at Brookhaven, look for closer sites if on a different continent). In both plots the blue line is the total cross section (any reaction from a neutron coming in, including elastic and inelastic scattering), while the green line is the cross section solely for the fission reaction.
For 235U one sees:
For 238U you get: | {
"domain": "physics.stackexchange",
"id": 67726,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nuclear-physics, neutrons",
"url": null
} |
orbital-elements, habitable-zone
Title: Orbital period of a planet orbiting Delta Pavonis in habitable zone I'm continuing my inquiry about the fictional planet I have described here: https://worldbuilding.stackexchange.com/questions/231162/length-of-seasons-on-a-planet-with-eliptical-orbit.
I'm now settled on the planet orbiting Delta Pavonis. According to data from Wikipedia and calculations, the habitable zone is from 0.78 to 1.56 AU.
My question is, what would be this planet's orbital period, keeping orbital eccentricity as high as possible while the planet stays within the habitable zone at all times? | {
"domain": "astronomy.stackexchange",
"id": 6790,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbital-elements, habitable-zone",
"url": null
} |
python, jupyter
Title: Installed module pysubgroup not found in Jupyter Notebook I'm trying to use the pysubgroup python package referenced here.
I think I properly installed it as shown below, with no errors when I installed it:
> mymacs-MacBook-Pro:dq-pattern-research mymac$ pip3 search pysubgroup
> pysubgroup (0.5.4) - pysubgroup is a Python library for the data
> analysis
> task of subgroup discovery. INSTALLED: 0.5.4 (latest) mymacs-MacBook-Pro:dq-pattern-research mymac$ pip3 install
> pysubgroup Requirement already satisfied: pysubgroup in
> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
> (0.5.4) Requirement already satisfied: pandas in
> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
> (from pysubgroup) (0.23.4) Requirement already satisfied: scipy in
> /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages
> (from pysubgroup) (1.1.0) Requirement already satisfied: numpy in | {
"domain": "datascience.stackexchange",
"id": 4222,
"lm_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, jupyter",
"url": null
} |
forces
You could roughly test this out for yourself at home, if you have a bathroom scale, with upper limit more than twice your regular weight. Put the scale on the floor in a doorframe, stand on it and push the door frame up as if it was the bar. If the scale shows anything more than twice your normal weight, your $F_{push}$ is greater than your maximum $F_{pull}$. I have to warn you that you could hurt yourself and please be sure the doorframe is actually strong enough to not cave in.
Something to keep in mind is that your pushing strength will probably vary with different heights of doorframes (so different bar heights too). | {
"domain": "physics.stackexchange",
"id": 57082,
"lm_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",
"url": null
} |
material-science, elasticity, continuum-mechanics
We are given $ \nu=-\frac{\Delta{W}/W_0}{\Delta{L}/L_0}=-\frac{\Delta{T}/T_0}{\Delta{L}/L_0}$ where $ -1 \leq \nu < 0.5$
Let $ \frac{\Delta{L}}{L_0}=\alpha > 0$ then $
\begin{cases}
\Delta{W}=\frac{W_0*\nu*\Delta{L}}{L_0}=-W_0*\nu*\alpha \\
\Delta{T}=\frac{T_0*\nu*\Delta{L}}{L_0}=-T_0*\nu*\alpha\\
\end{cases}
$
$V'=L*T*W=(L_0+\alpha L_0)*T_0*(1+\nu \alpha)*W_0*(1+\nu \alpha)=L_0*T_0*W_0*(1+\alpha)*(1+\nu \alpha)^2=V*(1+\alpha)*(1+\nu \alpha)^2$
The equation in part 3 actually reduces to: | {
"domain": "physics.stackexchange",
"id": 32041,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "material-science, elasticity, continuum-mechanics",
"url": null
} |
general-relativity, black-holes, spacetime, event-horizon, kerr-metric
Title: Kerr Black hole EH and Ergosphere embedding Goodmorning everyone. I would like to share with you a question that has been gripping me for some time, but which I have never been able to give a convincing answer. When representing the ergosphere or the external event horizon of a black hole, it is often not taken into account that the coordinates used (if space-time is Kerr, the most usual are those of Boyer-Lindquist) have no physical meaning, in the sense that they do not allow us to "see" what the real form of such spatial hypersurfaces would be if they could be "spied" from the earth.
Now, I tried to formulate the embedding, so that the line element of the metric was the Euclidean one IE $$ds ^ 2 = dx ^ 2 + dy ^ 2 + dz ^ 2;$$ the problem (which I found also in the literature) is that this process is not always possible (for example if the spin of the black hole exceeds a certain critical value). | {
"domain": "physics.stackexchange",
"id": 82848,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, black-holes, spacetime, event-horizon, kerr-metric",
"url": null
} |
to another distribution. Then, $$X$$ will follow the distribution governed by the CDF $$F_X$$, which was our desired result. Generate random numbers from the Weibull distribution. The variance of a uniform random variable is: Var(x) = (1/12)(b-a) 2. The x and y coordinates of points sampled at random from the density distribution shown in figure 5 are uniformly distributed and correlated (the degree of correlation depends on the value of t; see the next section). Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigma. run every random variable follow Gaussian distribution. In SPSS, RV is short for random variable. In our Introduction to Random Variables (please read that first!) we look at many examples of Discrete Random Variables. of nindependently generated random variables with Uniform[0;1] distribu- tions has a Beta(k;n k+ 1) distribution. A random variable having a uniform distribution is also called a uniform random variable. The | {
"domain": "aeut.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806472775277,
"lm_q1q2_score": 0.8466250968684361,
"lm_q2_score": 0.863391602943619,
"openwebmath_perplexity": 354.89415997265763,
"openwebmath_score": 0.6748271584510803,
"tags": null,
"url": "http://gqjl.aeut.pw/generate-random-variable-from-uniform-distribution.html"
} |
special-relativity
The classical Doppler effect is a change in the observed frequency due to the motion, and there is no time dilation involved. So even without time dilation you can get a change in the frequency just due to ordinary motion. This is directionally dependent and quite large. As the emitter moves towards the observer the frequency is blue shifted and as it moves away it is redshifted.
Now, on top of the large classical Doppler effect there is also the small relativistic time dilation effect. This is not directionally dependent and always produces a redshift. Regardless of what direction the emitter travels the frequency of the source itself is slowed. | {
"domain": "physics.stackexchange",
"id": 84993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity",
"url": null
} |
ros, wstool
Title: Could not find a package configuration file provided by "Qt5Widgets"
I am using indigo in ubuntu14.04.2 following this. I did like this:
$ mkdir -p ~/overlay_ws
$ cd ~/overlay_ws
$ mkdir -p ~/overlay_ws/src
$ cd ~/overlay_ws/src
$ wstool init
then added a ros package
$ wstool set ros_tutorials --git git://github.com/ros/ros_tutorials.git
$ wstool update
build it
$ source /opt/ros/groovy/setup.bash
$ cd ~/overlay_ws/
$ catkin_make
error occured:
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at ros_tutorials/turtlesim/CMakeLists.txt:6 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake | {
"domain": "robotics.stackexchange",
"id": 24850,
"lm_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, wstool",
"url": null
} |
apache-spark, scala, market-basket-analysis
I get the fowllowing error:
val model = fpg.run(transactions)
16/08/26 10:56:09 WARN fpm.FPGrowth: Input data is not cached.
16/08/26 10:56:21 ERROR executor.Executor: Exception in task 0.0 in stage 10.0 (TID 7)
org.apache.spark.SparkException: Items in a transaction must be unique but got WrappedArray(13873775, 4, 99, 9909, 102113020, 15704, 2012-03-19:00, 6.25, OZ, 4, 11.96).
at org.apache.spark.mllib.fpm.FPGrowth$$anonfun$1.apply(FPGrowth.scala:143)
at org.apache.spark.mllib.fpm.FPGrowth$$anonfun$1.apply(FPGrowth.scala:140)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:189)
at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:64)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:73) | {
"domain": "datascience.stackexchange",
"id": 1152,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "apache-spark, scala, market-basket-analysis",
"url": null
} |
automata-theory, regular-language, regular-expressions, nfa
I was unable to find any suitable references.
Note that a similar theorem holds for NFA, where for a given NFA $\mathcal{A}$ it suffices to consider NFAs of the form $\mathcal{A}_{q,q'}$ for all states $q,q'$ (here $\mathcal{A}_{q,q'}$ denotes the automaton obtained from $\mathcal{A}$ by setting its initial state to $q$ and its final state to $q'$). Clearly, there are only polynomially many of them w.r.t $|\mathcal{A}|$ and knowing the initial and final state of $\mathcal{A}$ I can decide the membership in the language. Thus NFAs are "polynomially decomposable".
Note also that regular expressions are "exponentially decomposable". Indeed, I can convert a regular expression into an NFA, decompose it as stated above, and then convert it into a regular expression again (the resulting regular expression is guaranteed to be at most exponential w.r.t the input automaton). | {
"domain": "cstheory.stackexchange",
"id": 5731,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "automata-theory, regular-language, regular-expressions, nfa",
"url": null
} |
c#, security, asp.net-mvc
Title: Checking locked users using Identity 2.0 I'm writing a theoretical MVC application to aid in learning more about ASP Identity 2. In real terms I'm new to ASP Identity as a whole but thought I'd jump in in this release as
it's the default in new projects and
everything I read about it seems to mostly suit my needs. | {
"domain": "codereview.stackexchange",
"id": 16193,
"lm_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#, security, asp.net-mvc",
"url": null
} |
zoology, physiology, cardiology, health
(source: revespcardiol.org)
Health ≠ life expectancy ≠ adaptation
Life expectancy, health and high fitness (biological sense) are three concepts that are eventually related but that are very different. While life expectancy can compare health in inter-species comparison, it makes little sense to compare health of different species. Note also, that natural selection may well favour short lifespan (as suggested by @RioSiv, you might want to have a look at life-history r/K selection theory). | {
"domain": "biology.stackexchange",
"id": 4411,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "zoology, physiology, cardiology, health",
"url": null
} |
python, beginner, python-3.x, playing-cards
Title: Command-Line Poker Showdown Further-developed followup to this question
Python beginner here.
I created a command-line program that generates poker hands (5-52 cards) and compares their strength. On my Macbook Pro, it generates and compares 1m 5-card hands in ~2m.
Here's my code:
import copy
import distutils.core
from enum import Enum
from time import time
from random import shuffle
from math import floor
#Individual Cards
class Card:
def __init__ (self,value,suit):
self.value = value
self.suit = suit
self.vname = ''
self.sname = ''
def __str__(self):
return f'{self.sname}{self.vname}{self.sname}'
def __repr__(self):
if self.value <= 10:
return f'{self.value}{self.suit[0].lower()}'
if self.value > 10:
return f'{self.vname[0]}{self.suit[0].lower()}' | {
"domain": "codereview.stackexchange",
"id": 33911,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, playing-cards",
"url": null
} |
z-transform, laplace-transform, poles-zeros
Title: Converting poles/zeros to differential/difference equation solutions Does anyone have a reference handy on how to convert poles and zeros of a system to differential/difference equations.
Here is a quick draft of math, but I am not sure if it's at all correct. First, solving the characteristic equation gives the eigen values (equal to poles). Applying rudimentary knowledge of differential equations, the solution regarding only the poles should be:
$$\text {Poles Diffrential}: p(t)= \sum_{i=1}^{n_1} c_ie^{t\times \text{p}_i} $$
$$\text {Poles Difference}:p[n]= \sum_{i=1}^{n_1} c_i\text{p}_i^n $$
Where the $p_i$ is the value of ith pole and C is some constant, possibly scaled to the inverse value of the number of poles, the index runs from 1 to $n_1$, the number of poles. I denote the solution that considers only poles/characteristic equation as $p(t)$. (To be exact, c is the input/initial value at time zero so we still have the denominator of characteristic equation as cz^0=c). | {
"domain": "dsp.stackexchange",
"id": 3993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "z-transform, laplace-transform, poles-zeros",
"url": null
} |
ros, ros-melodic, orocos
Title: Catkin adds hardcoded paths to auto-generated .cmake files
Hi all,
I notice that catkin creates hard coded paths in the auto-generated .cmake files when building catkin packages that link/include against plain .cmake files. This is noticeable with robot_state_publisher and kdl_conversions including paths to the install space of orocos_kdl header and library paths.
Is this just a function of catkin_make_isolated?
Is this by design so that you can guarantee to find this library and header for any subsequent build?
Is there anyway to turn this off, it makes my installation space non-relocatable.
Thanks,
Dan | {
"domain": "robotics.stackexchange",
"id": 35545,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, orocos",
"url": null
} |
c++, algorithm, sorting, mergesort, c++14
/*******************************************************************************
* Profiles the sorting algorithms on a random integer array. *
*******************************************************************************/
static void profile_on_random_array(const size_t sz,
const int minimum,
const int maximum,
const unsigned seed)
{
int* array1 = get_random_int_array(sz, minimum, maximum, seed);
int* array2 = new int[sz];
std::copy(array1, array1 + sz, array2);
std::cout << "--- PROFILING ON RANDOM ARRAY OF LENGTH "
<< sz
<< " ---"
<< std::endl;
profile_stable_sort(array1,
array1 + sz,
std::less<>());
profile_natural_merge_sort(array2,
array2 + sz,
std::less<>()); | {
"domain": "codereview.stackexchange",
"id": 17399,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, sorting, mergesort, c++14",
"url": null
} |
For any $$\beta\in\Bbb{R}$$, we have $$\int_{\Bbb{R}}e^{-t^2}\,dt = \int_{\Bbb{R}}e^{-(t+i\beta)^2}\,dt$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850897067342,
"lm_q1q2_score": 0.8275862458469486,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 224.14427350103955,
"openwebmath_score": 0.9968500137329102,
"tags": null,
"url": "https://math.stackexchange.com/questions/4058080/calculating-integral-actually-calculating-fourier-transform"
} |
datetime, functional-programming, scala, numbers-to-words
Title: Convert time 24hr format into time as words I'm currently writing a Scala Object that converts time 24hr format (i.e. 00:00 - 23:59) into Time As Words (i.e. Eight o'clock, Half past eight, Quarter to nine etc).
How can I refactor the current ConvertTime function (Scala Object) into a more functional version using Pattern Matching?
I wanted to originally split out the function into smaller functions but in order to determine the correct case based on the expression they need to be kept within the following order to determine the correct time as words, by eliminating previous conditions.
I found an answer to the following post Multiple of Conditions by Daniel C Sobral that uses pattern matching. I'm not sure if the following approach could be addapted for my case. Any advice will be appreciated.
Python version of word lookup: | {
"domain": "codereview.stackexchange",
"id": 26068,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "datetime, functional-programming, scala, numbers-to-words",
"url": null
} |
assembly
.loopend:
mov al, 000Ah ;; new Row
int 10h
mov al, 000Dh ;; carriage return
int 10h
add di, 2h ;; adding 2 to our di pointer ( because we are in 16bit mode)
cmp di, 7E00h ;; are we at the end of our bootloader (7c00h + 200h )?
je .hlt ;; if yes halt
jmp .printMemoryValue ;; print next memory location ( di is increased by 2 )
.hlt:
hlt ;; ende
times 510-($-$$) db 0
dw 0xAA55 ; => 0x55 0xAA (little endian byte order)
U can try code with mountable image available here
Any suggestions are welcome.
First correct some bugs.
start:
mov si, 7F00h ;; set stack pointer after our bootloader
mov ax, 0h
mov ds, ax ;; set DS to 0;
mov di, 7C00h ;; set Data pointer to memory location where is our bootloader loaded | {
"domain": "codereview.stackexchange",
"id": 29080,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "assembly",
"url": null
} |
planning
Title: Task oriented robot language? So, what I understood by the term "Task Planning" is, "to implement a task to be done by a robot by mimicking a real-world scenario".
This article is also using the term "Task" but it is saying something different.
... To enable user-friendly operation of the system operation, particularly in the phase of preparing new tasks, the original Multi-arm Robot Control (MRC) system has been developed. It incorporates a task-oriented robot language and graphical user interface ... | {
"domain": "robotics.stackexchange",
"id": 1921,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planning",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.