text stringlengths 1 1.11k | source dict |
|---|---|
c++, c
With that, push becomes something like this:
void push(T data) {
node *newNode = new node(data, head);
++count;
head = newNode;
}
[Edit2: Note that, as recommended by @LokiAstari, I've also moved the ++count to after allocating the new node. This way if the attempted allocation fails (and new throws an exception), count will not be incremented, so it retains the correct values. If and only if the allocation succeeds, it's incremented to reflect the new node having been added to the list. ]
[Edit: and node would look roughly like this:
struct node {
T data;
node *next;
node(T data, node *next = NULL) : data(data), next(next) {}
} head;
] | {
"domain": "codereview.stackexchange",
"id": 809,
"lm_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",
"url": null
} |
java, android
For the second snippet, I would use a ternary conditional to emphasize the goal of assigning stack a value no matter what.
HttpStack stack = (Build.VERSION.SDK_INT >= 9) ? new HurlStack() :
new HttpClientStack(AndroidHttpClient.newInstance(userAgent)); | {
"domain": "codereview.stackexchange",
"id": 5575,
"lm_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, android",
"url": null
} |
The other area is \begin{align} A_2 &= \int_{\log_b \frac12}^\infty a \exp(x \ln b)dx \\ &= a \left(\left. \frac{\exp(x \ln b)}{ \ln b} \right|_{\log_b \frac12}^\infty\right) \\ &= a \left(\left. \frac{b^x}{ \ln b} \right|_{\log_b \frac12}\right)^\infty \\ &= a \left( \lim_{c \to \infty} \frac{b^c}{ \ln b} - \frac{b^{{\log_b \frac12}}}{ \ln b} \right) \\ &= a \left( 0 - \frac{b^{{\log_b \frac12}}}{ \ln b} \right) \\ &= a \left(\frac{-\frac12}{ \ln b} \right) \end{align} which is the same as $$A_1$$. So your exponential functions do indeed have this unusual property.
It's pretty cool that you happened to notice this -- that's how discoveries get made. It's too bad that it's not as special as it might have first appeared. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9688561703644735,
"lm_q1q2_score": 0.8073716821002346,
"lm_q2_score": 0.8333246015211008,
"openwebmath_perplexity": 679.7373137841795,
"openwebmath_score": 0.9999145269393921,
"tags": null,
"url": "https://math.stackexchange.com/questions/3251729/function-fx-such-that-integral-area-is-divided-in-half-at-the-same-point-k-whe"
} |
nanopore, minion, barcode
Flongle - 200 Mb
MinION - 5 Gb
PromethION - 50 Gb
For Flongle, this has been fine for us to do sequencing and assembly of 12 plasmids on one flow cell using the rapid barcoding kit, and the improved accuracy from the Kit14 + R10.4.1 combination makes reliable assembly easier (especially where homopolymers are involved). I expect it will work similarly well for amplicon sequencing.
Error rates are pretty similar across platforms, because it's the pore that matters, not the package. Here's a comparison plot of mapped accuracy vs predicted accuracy (from the basecaller) that I did recently on a TrackIt 1kb Plus DNA ladder, with bead cleanup using LFB, run on a PromethION flow cell with the V14 ligation kit (sequenced on a P2 Solo), then called using the new bacterial model. The reads represented in this plot have been filtered to only keep (at most) the longest 2000 matches for each target. The run produced 1,128,671 reads (1.95 Gb) over 1.5 hours: | {
"domain": "bioinformatics.stackexchange",
"id": 2584,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nanopore, minion, barcode",
"url": null
} |
general-relativity, faster-than-light, warp-drives
However, there is a chronology protection conjecture (conjecture, not the verified theory) by S. Hawking. In short, it says there is always some mechanism preventing you from traveling in time. The conjecture seems reasonable as time traveling would lead to many paradoxes. Concerning, the "preventing" mechanism, in case of Alcubirre drive, it could be the negative energy requirement.
If you want to learn more about the time travelling, warp drive and worm holes and similar stuff, I would recommend book Time Travel and Warp Drives: A Scientific Guide to Shortcuts through Time and Space. The book firstly discuss special and general relativity and then show if warp-drives and time traveling could exist from current state-of-the-art scientific point of view. It is writen in more or less plain language although some equations are not avoided. | {
"domain": "physics.stackexchange",
"id": 76868,
"lm_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, faster-than-light, warp-drives",
"url": null
} |
quantum-mechanics, wavefunction, hilbert-space, harmonic-oscillator, normalization
Title: Normalising the Quantum Harmonic Oscillator I have been working on the quantum harmonic oscillator with ladder operators and I am running into issues with normalising the excited states. There doesn't seem to be a true convention for the ladder operators; I have chosen to use: $A_{\pm}=\frac{1}{\sqrt{2m}}\left(\hat{p}\pm im\omega x\right)$ as it seems simplest to me.
I correctly arrive at wavefunctions proportional to what I want by raising the ground state, but I am having difficulty normalising them. I have tried the normal $\int_{-\infty}^\infty|\psi_n(x)|^2dx = 1$ method, but the answer I get from the second excited state seems to differ from the answer everyone else uses by a sign: I get
$$\psi_2 = \left(\frac{m\omega}{4\pi \hbar}\right)^{1/4}\left(1-\frac{2m\omega x^2}{\hbar}\right)\exp\left(-\frac{m \omega x^2}{2\hbar}\right),$$
when all the answers I see are
$$\psi_2 = \left(\frac{m\omega}{4\pi \hbar}\right)^{1/4}\left(\frac{2m\omega x^2}{\hbar} - | {
"domain": "physics.stackexchange",
"id": 40083,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, wavefunction, hilbert-space, harmonic-oscillator, normalization",
"url": null
} |
electrons, nuclear-physics, quarks, neutrons, protons
In quantum mechanics, particles can appear and disappear or change into other particles. With the neutron, one of the down quarks can decay change into an up quark by emitting a W boson, turning into a proton. The W boson quickly decays into an electron and an electron antineutrino. The new up quark didn't exist until the down quark turned into it. The W boson is what is called a virtual particle. It doesn't exist in the classical sense, it's just kind of there in the ambiguous region of spacetime where the decay occurs. The electron and antineutrino didn't exist until the decay.
Here is a Feynman diagram of the process, from here: | {
"domain": "physics.stackexchange",
"id": 41998,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrons, nuclear-physics, quarks, neutrons, protons",
"url": null
} |
electrons, solid-state-physics, semiconductor-physics, electronic-band-theory
In a semiconductor the mobility of electrons (referring to ‘conduction electrons’ or ‘free-electrons’) is greater than that of a holes (indirectly referring to ‘valence electrons’) because of different band structure and scattering mechanisms of these two carrier types.
Conduction electrons (free-electrons) travel in the conduction band and valence electrons (holes) travel in the valence band. In an applied electric field, valence electrons cannot move as freely as the free electrons because their movement is restricted. The mobility of a particle in a semiconductor is larger if its effective mass is smaller and the time between scattering events is larger.
Holes are created by the elevation of electrons from innermost shells to higher shells or shells with higher energy levels. Since holes are subjected to the stronger atomic force pulled by the nucleus than the electrons residing in the higher shells or farther shells, holes have a lower mobility. | {
"domain": "physics.stackexchange",
"id": 64604,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrons, solid-state-physics, semiconductor-physics, electronic-band-theory",
"url": null
} |
pumps
Title: Can a fully submerged submersible pump become air locked? At a place I'm staying, there is a borewell whose design and construction I ignore and I have no means to figure out (total depth, cap etc.)
The entire house runs on a limited electrical supply from solar panels, therefore, the setup is NOT designed to run automatically (no floatswitch). Thus, every week or two, the pump is manually turned on in order to fill a couple of elevated tanks.
The pump's inbuilt check-valve is not working properly.
The pump is 1 metre long.
The pump's outlet port is 2 metres below the water level.
The pump's outlet port is 9 metres from ground level, connected to a PVC pipe. | {
"domain": "engineering.stackexchange",
"id": 5234,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pumps",
"url": null
} |
word-embeddings, similarity
$v_1=(1,1,0,0), v_2=(5,5,0,0), v_3=(1,1,0,1)$
Which might well be the outputs of a CountVectorizer for 3 words with a dictionary of size 4.
Some good references:
an intuitive explanation and a detailed comparison with code
both measures suffers the curse of dimensionality, discussion on statsexchange
again, on the equivalence of euclidean and cosine similarity | {
"domain": "datascience.stackexchange",
"id": 10681,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "word-embeddings, similarity",
"url": null
} |
black-holes
Title: Relay information from near a black hole I realize this must a very fundamental issue and perhaps already answered but I couldn’t find a double.
Let A be an object near the event horizon - as seen by us - of a black hole, and B an object near the black hole (BH) but somewhat further out. I speculate now that B sees the BH with its own event horizon, closer to the BH than the one we see.
I assume therefore that B could see A after its passage through our event horizon. Would not B be able to gain information about A while in this zone (between our event horizon and that of B), and subsequently relay that information to us? I find this kind of thing basically impossible to reason about without looking at a Penrose diagram. Here's the Penrose diagram of a black hole. | {
"domain": "physics.stackexchange",
"id": 56215,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-holes",
"url": null
} |
python, statistics, data-science-model, data-analysis
Title: How to use historic data (granularity at day level) for ML modeling? There is a scenario where I have to use historic data which is at the day level for the past 5 years.Actually it is water flow data, what quantity of water was flown on that particular day. I have to use this feature along with a few other features like material, coating, etc,. for EDA and prediction. I tried averaging it out but not useful.
Data is like this flow1,flow2, and flow3 (including other features not shown here) for each day on that particular route id. This continues for 5 years for many routes. | {
"domain": "datascience.stackexchange",
"id": 8039,
"lm_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, statistics, data-science-model, data-analysis",
"url": null
} |
Show Tags
30 Jul 2018, 00:22
00:00
Difficulty:
5% (low)
Question Stats:
86% (01:10) correct 14% (01:21) wrong based on 243 sessions
HideShow timer Statistics
Point X lies on side BC of rectangle ABCD, which has length 12 and width 8. What is the area of triangular region AXD ?
A. 96
B. 48
C. 32
D. 24
E. 20
NEW question from GMAT® Quantitative Review 2019
(PS09983)
_________________
Math Expert
Joined: 02 Aug 2009
Posts: 7106
Re: Point X lies on side BC of rectangle ABCD, which has length 12 and wid [#permalink]
Show Tags
30 Jul 2018, 00:44
Bunuel wrote:
Point X lies on side BC of rectangle ABCD, which has length 12 and width 8. What is the area of triangular region AXD ?
A. 96
B. 48
C. 32
D. 24
E. 20
NEW question from GMAT® Quantitative Review 2019
(PS09983)
irrespective what is length or breadth ans will be same..
if BC is 8, height is 12 and area = $$\frac{1}{2}*8*12=48$$
If BC is 12, height is 8 and area = $$\frac{1}{2}*8*12=48$$
B
Attachments | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9532750387190131,
"lm_q1q2_score": 0.8083464995313708,
"lm_q2_score": 0.8479677602988602,
"openwebmath_perplexity": 3457.667464685267,
"openwebmath_score": 0.5617712736129761,
"tags": null,
"url": "https://gmatclub.com/forum/point-x-lies-on-side-bc-of-rectangle-abcd-which-has-length-12-and-wid-271979.html"
} |
ros, inverse-kinematics, ros-melodic
Originally posted by mellow54 on ROS Answers with karma: 3 on 2018-10-23
Post score: 0
In typical setups the joint states of a robot are published on a joint_states topic with messages of type sensor_msgs/JointState.
Those would allow you to be notified of the current pose (in joint space) of a robot, simulated or not.
Originally posted by gvdhoorn with karma: 86574 on 2018-10-23
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by mellow54 on 2018-10-23:
Thanks! This is what I wanted | {
"domain": "robotics.stackexchange",
"id": 31952,
"lm_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, inverse-kinematics, ros-melodic",
"url": null
} |
inorganic-chemistry, gas-laws
Basically, the more particles you have in a given region with a certain fixed speed (i.e. a fixed temperature), the more frequently they collide - not only with each other, but with the walls of the container. This means that putting more particles in the (same size) container (at the same temperature) increases the outward pressure on the container walls. In fact, the rate of collisions (and thus the pressure) is directly proportional to the number of particles (doubling the number of particles at a fixed temperature doubles the rate of collisions).
But we want to hold the pressure constant! If we can't change the temperature, one way to reduce the pressure is to increase the volume (e.g. let the container expand like a balloon.) As the volume grows, each particle has to travel farther before it can collide with the walls of the container, meaning that the rate of collisions and thus the pressure on the walls gets less and less. | {
"domain": "chemistry.stackexchange",
"id": 4190,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, gas-laws",
"url": null
} |
organic-chemistry, biochemistry, molecules
According to the shape theory, molecules which have similar but not identical functional groups should smell similarly, unless the protein receptors in our nose that sense odors have very exquisite shape sensitivity, enough to perceive the very slight difference in the shape of thiol vs. an alcohol in a large otherwise identical molecule. | {
"domain": "chemistry.stackexchange",
"id": 3133,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, biochemistry, molecules",
"url": null
} |
np-complete, reductions
0 &\text{otherwise}
\end{cases}
$$
and
$$
b_i = 1- (\text{ the number of complemented variables in } C_i ).
$$
Now if I use this procedure on the satisfiable formula
$(x_1 \vee x_2 ) \wedge (x_1 \vee x_3 ) \wedge (x_2 \vee x_3 )$, I get
$$
A =\left( \begin{array}{ccc}
1 & 1 & 0 \\
1 & 0 & 1 \\
0 & 1 & 1 \end{array} \right), \text{ and }
b = \left( \begin{array}{c}
1 \\
1 \\
1 \end{array} \right),
$$
which has no 0/1 solution. So my question is:
Have I made a very silly mistake, or is Karp's original reduction faulty? I believe there's a typo in Karp's definition of the problem. If we replace $Ax=b$ with $Ax \geq b$, the reduction goes through as is. The easiest way I can think of to show the hardness of your problem (the one as written in Karp's paper), is via 1-in-3 SAT or via hypergraph perfect matching. | {
"domain": "cs.stackexchange",
"id": 2256,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "np-complete, reductions",
"url": null
} |
The other three product‐sum identities can be verified by adding or subtracting other sum and difference identities. Again, this right triangle calculator works when you fill in 2 fields in the triangle angles, or the triangle sides. 2 Sum, Difference and Double-Angle Identities (continue…) Double Angle Identities sin2 2sin cos 2 2 2 1 2sin 2cos 1 cos2 cos sin 1 tan2 2tan tan2 Example 1: If 3 1 sin A and A is in Quadrant 3, evaluate tan. Trigonometric Functions, Identities and Ratios. If tan( ) = 3 4. Lesson #5Double Angle Identities. Unit 7: Trigonometric Identities and Equations Monday, May 11th: Introduction and Using Basic Trigonometric Identities: Day 1 (Section 5. Using the first and second derivatives of a function, we can identify the nature of stationary points for that function. Choose one topic from the chapter to explain with detail: Trigonometric Identities, Verifying Trigonometric Identities, Sum and Difference of Angles Identities, Double-Angle and Half-Angle | {
"domain": "vievimilano.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126432392879,
"lm_q1q2_score": 0.8001704744653122,
"lm_q2_score": 0.8175744739711884,
"openwebmath_perplexity": 1472.491066257035,
"openwebmath_score": 0.7444936037063599,
"tags": null,
"url": "http://ugme.vievimilano.it/verifying-double-angle-identities-worksheet.html"
} |
object-oriented, design-patterns, mvc, actionscript-3
super.deactivate();
}
/**
* Attempts to update the clip, and lets you know if it was successful or not.
* @return
*/
protected function updateClip():Boolean {
// Stash the value for convenience
_value = _model.getLiveFieldValue(_modelProperty);
if (clip){
if (_value) {
movieClip.gotoAndStop(LABEL_ON);
} else {
movieClip.gotoAndStop(LABEL_OFF);
}
return true;
}
return false;
}
protected function onClick(event:MouseEvent):void {
_model.updateLiveField(_modelProperty, ! _value);
}
}
Parent View implementation
public class HowThisWorksBox extends ContentAssetView {
private var _kioskModel:KioskModel;
public function HowThisWorksBox(clip:*, disabled:Boolean = false) {
super(clip, ["heading", "body"], disabled);
} | {
"domain": "codereview.stackexchange",
"id": 15193,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, design-patterns, mvc, actionscript-3",
"url": null
} |
php, object-oriented, mvc, json
}
}
class join_group_model extends model {
public function join_group() {
Global $db;
$pass = 0;
if(array_key_exists('password', $this->input) && strlen($this->input['password'])>20) {
$pass = $db->pass_check('group', $this->input['group_id'],$this->input['password'] );
}
else {
$pass = $db->pass_check('group', $this->input['group_id'],'NULL' );
} | {
"domain": "codereview.stackexchange",
"id": 2249,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, object-oriented, mvc, json",
"url": null
} |
c++, number-guessing-game
And we can use a similar loop to the player's game:
for (int tries = 0; ; ++tries) {
Now, something that applies throughout. What happens if you don't enter a number when asked? The >> operator will return false, but we never check it, and never fix up the stream. We definitely need some error handling, and to avoid writing the same code many times, we'll want it as a function:
int readInteger(const char *prompt)
{
std::cout << prompt << std::flush;
int n;
if (std::cin >> n)
return n;
// else, clean up and ask again
std::cin.clear();
return readInteger(prompt);
}
I don't think you the "Play again (y/n)" question. Given that choice 3 from the menu is "exit", then asking whether to play again is redundant. You could go the other way, and remove the exit option instead.
My version
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <string> | {
"domain": "codereview.stackexchange",
"id": 24409,
"lm_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++, number-guessing-game",
"url": null
} |
java, game, programming-challenge
// checks if two banks have the same set of elements
public boolean compare(Bank bank) {
if (bank.elements.size() != elements.size())
return false;
for (Element element : elements)
if (!bank.has(element))
return false;
return true;
}
// checks if this bank contains the element
public boolean has(Element element) {
for (Element elt : elements)
if (elt == element)
return true;
return false;
}
public String getName() {
return name;
}
public int numberOfElements() {
return elements.size();
}
public Vector<Element> getElements() {
return elements;
}
public boolean isDestination() {
return isDestination;
} | {
"domain": "codereview.stackexchange",
"id": 18249,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game, programming-challenge",
"url": null
} |
non included angle. How to use CPCTC (corresponding parts of congruent triangles are congruent), why AAA and SSA does not work as congruence shortcuts how to use the Hypotenuse Leg Rule for right triangles, examples with step by step solutions LA Congruence Theorem: If a leg and one of the acute angles of a right triangle are congruent to the corresponding leg and acute angle of another right triangle, then the two triangles are congruent. Triangle congruence is one of the most common geometrical concepts in High school studies. B. Postulate: SAS (Side Angle Side) If two sides and the included angle of one triangle are congruent to two sides and the included angle of another triangle, then the triangles are congruent. Postulate: If there exists a correspondence between the vertices of two triangles such that three sides of one triangle are congruent to the corresponding sides of the other triangle, the two triangles are congruent. more interesting facts . Play this game to review | {
"domain": "vivekanandagospel.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.944176852582231,
"lm_q1q2_score": 0.8062446519515895,
"lm_q2_score": 0.8539127492339909,
"openwebmath_perplexity": 1466.5194629044622,
"openwebmath_score": 0.5834722518920898,
"tags": null,
"url": "http://vivekanandagospel.org/end-me-pyvsxy/page.php?75800c=saa-congruence-postulate"
} |
python, sudoku, set
Title: Sudoku Puzzle Solver I have written a program to solve Sudoku puzzles as a (fun?) way to learn Python. It solves puzzles as a human would, using reasoning algorithms rather than brute force/backtracking, as I thought it would a more interesting challenge that way.
I really looking for any feedback on how to reduce indentation, lines of code, or increase efficiency. I'm sure the functions that I've repeated for columns/rows/subgrids can be merged into one, but I just can't think of an elegant way. Any general feedback would be more than welcome too, please lay into the code as much as possible. I'm a 2nd year computing (CS but lite) student if that makes any difference but probably not.
I appreciate this involves domain specific knowledge i.e. how to solve Sudoku puzzles. I created all the algorithms using only the following resource and all of the techniques contained in the program are described here for anyone interested.
import itertools | {
"domain": "codereview.stackexchange",
"id": 14662,
"lm_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, sudoku, set",
"url": null
} |
special-relativity, spacetime, metric-tensor, coordinate-systems, inertial-frames
cosh(\lambda) & sinh(\lambda)\\
sinh(\lambda) & cosh(\lambda)\\
\end{bmatrix}
\begin{bmatrix}
x\\
ct\\
\end{bmatrix}
\quad
and
\quad
\begin{bmatrix}
cosh(\epsilon) & sinh(\epsilon)\\
sinh(\epsilon) & cosh(\epsilon)\\
\end{bmatrix}
\begin{bmatrix}
x\\
y\\
\end{bmatrix}
$$
The reason you have heard that boosts are somehow rotations is that old time physicists made boosts look like familiar rotations by using imaginary angles and making t imaginary.
$$
\begin{bmatrix}
x'\\
ict'\\
\end{bmatrix}
=
\begin{bmatrix}
cos(i\lambda) & -sin(i\lambda)\\
sin(i\lambda) & cos(i\lambda)\\
\end{bmatrix}
\begin{bmatrix}
x\\
ict\\
\end{bmatrix}
$$
$$
\begin{bmatrix}
x'\\
ict'\\
\end{bmatrix}
=
\begin{bmatrix}
cosh(\lambda) & -i\ sinh(\lambda)\\
i\ sinh(\lambda) & cosh(\lambda)\\
\end{bmatrix}
\begin{bmatrix}
x\\
ict\\
\end{bmatrix}
$$
$$
\begin{bmatrix}
x'\\
ct'\\
\end{bmatrix}
=
\begin{bmatrix}
cosh(\lambda) & sinh(\lambda)\\
sinh(\lambda) & cosh(\lambda)\\
\end{bmatrix}
\begin{bmatrix}
x\\ | {
"domain": "physics.stackexchange",
"id": 66365,
"lm_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, spacetime, metric-tensor, coordinate-systems, inertial-frames",
"url": null
} |
data-structures, runtime-analysis, sorting, quicksort
Why is the worst case when $n_1 \in \{0,n-1\}$? This is because the function $n^2$ is convex, that is, the maximum of $x^2+(n-x)^2$ over $x \in [0,n]$ is attained at one of the endpoints. In more complicated situations, we could trying showing this directly, by inductively showing that $T(n+2)-T(n+1) \geq T(n+1)-T(n)$, which should imply (I think) that the maximum of $T(n_1)+T(n_2)$ is attained at one of the endpoints. | {
"domain": "cs.stackexchange",
"id": 18233,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "data-structures, runtime-analysis, sorting, quicksort",
"url": null
} |
thermodynamics, statistical-mechanics, electromagnetic-radiation, visible-light, thermal-radiation
If you are asking what microscopic processes give rise to the blackbody radiation, then there are many examples/duplicates of that question on Physics SE. The most general answer that can be given is that they are the microscopic inverse processes of whatever causes the blackbody to absorb all radiation incident upon it. Thus, as an example, the photosphere of the Sun is opaque across all visible wavelengths because visible photons can photodissociate electrons from H$^{-}$ ions that are present. The inverse process - photons emitted when electrons combine with hydrogen atoms - provides the blackbody continuum radiation. | {
"domain": "physics.stackexchange",
"id": 96833,
"lm_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, electromagnetic-radiation, visible-light, thermal-radiation",
"url": null
} |
is invertible. State propagation or message passing in a graph, with an identity function update following each neighborhood aggregation step. Domain of f = P; Range of f = P; Graph type: A straight line passing through the origin. We call this graph a parabola. Identity function is a function which gives the same value as inputted.Examplef: X → Yf(x) = xIs an identity functionWe discuss more about graph of f(x) = xin this postFind identity function offogandgoff: X → Y& g: Y → Xgofgof= g(f(x))gof : X → XWe … According to the equation for the function, the slope of the line is This tells us that for each vertical decrease in the “rise” of units, the “run” increases by 3 units in the horizontal direction. Learn All Concepts of Chapter 2 Class 11 Relations and Function - FREE. De nition 68. It generates values based on predefined seed (Initial value) and step (increment) value. And because f … Evaluate the function at an input value of zero to find the y-intercept. Functions & Graphs by | {
"domain": "co.za",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9728307700397331,
"lm_q1q2_score": 0.8169190423991048,
"lm_q2_score": 0.8397339676722393,
"openwebmath_perplexity": 469.59647136286156,
"openwebmath_score": 0.701640784740448,
"tags": null,
"url": "https://bupo.co.za/avocado-and-kxm/e79957-identity-function-examples-with-graphs"
} |
electromagnetism, maxwell-equations, beyond-the-standard-model, magnetic-monopoles, grand-unification
charge quantization leads to the ability to define configurations which are magnetic monopoles. So far there is no guarantee that there are finite energy objects which correspond to these fields. To figure out if they are finite energy we need to know what goes on all the way down to the origin inside our region. | {
"domain": "physics.stackexchange",
"id": 13655,
"lm_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, maxwell-equations, beyond-the-standard-model, magnetic-monopoles, grand-unification",
"url": null
} |
In [493]:
import os
filename = 'stockholm_temp.txt'
if os.path.exists(filename):
# look at the first 3 lines
with open(filename,'r') as f:
# alternative look at the first head lines
data = np.loadtxt(filename) # alternative we can use genfromtxt command
else:
1.756000000000000000e+03 1.000000000000000000e+00 1.000000000000000000e+00 -8.699999999999999289e+00
1.756000000000000000e+03 1.000000000000000000e+00 2.000000000000000000e+00 -9.199999999999999289e+00
1.756000000000000000e+03 1.000000000000000000e+00 3.000000000000000000e+00 -8.599999999999999645e+00 | {
"domain": "ipython.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9532750440288019,
"lm_q1q2_score": 0.8140137118507862,
"lm_q2_score": 0.8539127473751341,
"openwebmath_perplexity": 3499.299033742754,
"openwebmath_score": 0.29960694909095764,
"tags": null,
"url": "https://nbviewer.ipython.org/github/mar-one/ACM-Python-Tutorials-KAUST-2014/blob/master/Special_topics/special_topics_part2.ipynb"
} |
ros, shutdown, nodelets, nodelet
at /usr/include/boost/checked_delete.hpp:34
#20 boost::detail::sp_counted_impl_p<nodelet::Nodelet>::dispose (
this=0x8076980)
at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#21 0x0804e3d8 in boost::detail::sp_counted_base::release (this=0x8074180,
__in_chrg=<value optimised out>)
at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
#22 ~shared_count (this=0x8074180, __in_chrg=<value optimised out>)
at /usr/include/boost/smart_ptr/detail/shared_count.hpp:217
#23 0xb7b1f820 in std::_Rb_tree<std::string, std::pair<std::string const, boost::shared_ptr<nodelet::Nodelet> >, std::_Select1st<std::pair<std::string const, boost::shared_ptr<nodelet::Nodelet> > >, std::less<std::string>, std::allocator<std::pair<std::string const, boost::shared_ptr<nodelet::Nodelet> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, boost::shared_ptr<nodelet::Nodelet> > >*) () | {
"domain": "robotics.stackexchange",
"id": 10389,
"lm_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, shutdown, nodelets, nodelet",
"url": null
} |
civil-engineering, fluid-mechanics, sensors, pumps, water-resources
I thank all of you for your ideas and your analysis. If anyone is interesting in seeing how the project unfolds, keep an eye on waterunderground.net. It's pretty empty at the moment, but should have more content in a month or so.
Backstory
I am designing an open-sourced well & water-usage monitoring system for people in Northern California. The goal is to be able to measure water flow from well-to-tank, tank-to-house, and tank-to-irrigation, plus monitor the water depth in the tank and the well. Our current target parts cost is under \$200 for a system including CPU, 3 flow sensors, and 2 pressure sensors, although we think we may be able to get it closer to \$100 after a few design iterations.
We appear to have the flow sensor portion solved now that we finally have a supplier of Female G1 => U.S. 1" slip adapters to integrate cheap Hall effect sensors into a standard U.S. piping environment. The depth measurement solution is not so straightforward. | {
"domain": "engineering.stackexchange",
"id": 3265,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "civil-engineering, fluid-mechanics, sensors, pumps, water-resources",
"url": null
} |
thermodynamics
Title: Why do we ignore external pressure on the piston in PV work? For an expanding gas in a container, pushing a piston, the net energy change of the gas should be the work done by the gas on the piston (-ve) plus the work done by the environment on the piston (+ve). But in textbooks, only the work done by the gas on the piston is considered while talking about the gas's change in energy. Why? Consider your gas only. Its pression gives work to the piston, yet the gas doesn't interact with the environment. So you don't have to take the work done by the environment on the piston into acount. | {
"domain": "physics.stackexchange",
"id": 36123,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics",
"url": null
} |
ros, visp-auto-tracker, 3d-visualization
Originally posted by Rwl on ROS Answers with karma: 1 on 2017-04-03
Post score: 0
First try to think about the sensor you are using, are u using a camera? a kinect? a LIDAR.
From your question I assume you are using a camera. In this case, you can either approach the problem by using a marker detection algorithm (visp_auto_tracker is a marker detection and not the only one) or a shape detection algorithm (i.e. find_object_2d). I would recommend using a marker detection since it should me more robust, the robustness of the shape detection is highly dependent on features of what u need to detect ...
if you want to switch to 3D shape detection, of course in case of using 3D sensors like kinect, tilting LIDAR, velodyne, etc, you can use pcl library and the tools that you find there, having something that works in realtime might be tricky though
Originally posted by mohsen1989m with karma: 397 on 2017-04-04
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 27506,
"lm_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, visp-auto-tracker, 3d-visualization",
"url": null
} |
For b) you can also proceed by contraposition : if $$(x_n)$$ converges, then all subsequences converge.
For c), as $$(x_n)$$ is bounded, we can extract $$(x_{\varphi(n)})$$ that converges. Let's call $$\ell$$ its limit. As $$(x_n)$$ does not converge to $$\ell$$, there exists an $$\varepsilon$$ such that for all $$N\in \mathbb{N}$$, there exists a $$n \geqslant N$$ such that $$|x_n - \ell| > \varepsilon$$. So we can extract another subsequence that does not converge to $$\ell$$. This subsequence being bounded too, we can extract from it a another subsequence that converges to $$\ell ' \neq \ell$$. So we found two subsequences that converge to different limits.
For d), you proof is fine. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.948154531885212,
"lm_q1q2_score": 0.8203661284014251,
"lm_q2_score": 0.8652240756264639,
"openwebmath_perplexity": 226.09933860484375,
"openwebmath_score": 0.9509405493736267,
"tags": null,
"url": "https://math.stackexchange.com/questions/3959746/basic-facts-about-subsequences-of-a-sequence-x-n"
} |
# Find maximum and minimum values of an equation on an elipse
I need some help with this. I've been struggling through this last chapter of my Calc III class, and I'm not sure how to do this (although, it doesn't seem like it should be difficult to do)
$$\text{Find the maximum and minimum values of }f(x, y) = 4x + y\text{ on the ellipse } x^{2} + 49y^{2} = 1 \\ \text{Maximum = _____}\\ \text{Minimum = _____}$$
I know that I can find the critical point by taking partial derivatives so $$\frac{\partial{f}}{\partial{x}} = 4 \\ \frac{\partial{f}}{\partial{y}} = 1$$ Which gives us the critical point $(4,1)$.
Here's where I get stuck, I know that we can then determine max/min from the equation $D = f_{xx} * f_{yy} - f_{xy}^2$ and based on the value of $D$, we know whether it is a max, a min, or a "saddle" point. It doesn't seem to apply in this situation, because I have an ellipse that I have to use as a constraint.
What do I do next?
UPDATE: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534327754852,
"lm_q1q2_score": 0.832240871113662,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 194.95550644646235,
"openwebmath_score": 0.7101365327835083,
"tags": null,
"url": "https://math.stackexchange.com/questions/1364373/find-maximum-and-minimum-values-of-an-equation-on-an-elipse"
} |
magnetic-fields, radiation, earth, solar-wind
The Earth's magnetic field also helps protect our atmosphere from ionizing erosion. By that I mean that once an atom is ionized and exposed to the bulk flow of the solar wind, it will experience a conductive electric field ($\mathbf{E} = -\mathbf{V} \times \mathbf{B}$) and react like a pick-up ion. The force on the particle from such an electric field can easily exceed the gravitational force, thus freeing the particle from the atmosphere. Without the Earth's magnetic field, the ionized part of the upper atmosphere, called the ionosphere, would increase due to the addition of the solar wind's ionization effects. Currently, only charged particles with energies >10-100 MeV, neutral neutrons, or high energy photons (e.g., UV, X-rays, and/or $\gamma$-rays) are able to reach our atmosphere and contribute to the overall ionization. | {
"domain": "physics.stackexchange",
"id": 24309,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, radiation, earth, solar-wind",
"url": null
} |
python, python-2.x
parser.add_argument('--nosend', action='store_true', help='Do NOT send the mails. Used for testing.')
parser.add_argument('--notest', action='store_true', help='Do NOT test for comment bug on startup.')
params = vars(parser.parse_args(sys.argv[1:])) | {
"domain": "codereview.stackexchange",
"id": 16597,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x",
"url": null
} |
cosmic-microwave-background
On scales large compared to the Hubble radius at last scattering, only gravity
is important but on smaller scales the acoustic physics of the primordial plasma and
photon diffusion dominate.
So there is a different behavior of the regions of the universe as it is expanding and it is reviewed in the paper. | {
"domain": "physics.stackexchange",
"id": 13441,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmic-microwave-background",
"url": null
} |
performance, c, comparative-review, bitwise
Here's our updated function:
unsigned int Log2_ViaBSR(unsigned int value)
{
unsigned long result;
_BitScanReverse(&result, static_cast<unsigned long>(value));
return result;
} | {
"domain": "codereview.stackexchange",
"id": 23637,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, c, comparative-review, bitwise",
"url": null
} |
Hint: Write $f(n) = \sum_{i=1}^n (2i-1)^2$. You can start by hypothesizing that the sum of squares is a cubic $f(n) = an^3 + bn^2 + cn + d$ (as a sort of discrete analogy with the integration formula $\int x^2\, dx = x^3/3 + C$). Then $(2n+1)^2 = f(n+1) - f(n) = a (3n^2 + 3n + 1) + b(2n + 1) + c$, which gets you the constants $a, b, c$, and you can find $d$ from $f(1) = 1$. Verifying this formula is an easy proof by induction.
\begin{align} \sum_{i=1}^n (2i-1)^2 &=\sum_{i=1}^n \binom {2i-1}2+\binom {2i}2&&\text(*)\\ &=\sum_{r=0}^{2n}\binom r2\color{lightgrey}{=\sum_{r=2}^{2n}\binom r2}\\ &=\color{red}{\binom {2n+1}3}&& \text(**)\\ &\color{lightgrey}{=\frac {(2n+1)(2n)(2n-1)}6}\\ &\color{lightgrey}{=\frac 13 n(2n-1)(2n+1)}\\ &\color{lightgrey}{=\frac 13 n(4n^2-1)} \end{align}
*Note that $\;\;\;R^2=\binom R2+\binom {R+1}2$.
**Using the Hockey-stick identity | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290880402378,
"lm_q1q2_score": 0.8420036417101167,
"lm_q2_score": 0.8670357546485407,
"openwebmath_perplexity": 352.5231149614947,
"openwebmath_score": 0.9094042778015137,
"tags": null,
"url": "https://math.stackexchange.com/questions/2230785/find-a-formula-for-sum-i-1n-2i-12-1232-2n-12"
} |
• Can you take a look at my answer? – dxdydz Dec 6 '19 at 21:46
• @dxdydz I think more justification is needed for the step $a^mb^n=1\iff m=0\text{ and }n=0$, specifically for the implication from left to right. – Andreas Blass Dec 6 '19 at 23:39
• isn't that clear and obvious? How should I prove it then? – dxdydz Dec 7 '19 at 3:19
• @dxdydz If it's clear and obvious, then say why it's obvious. As far as I can see, you need to show (for the left-to-right implication) that, unless $m=n=0$, the relations $a^4\equiv b^4\equiv aba^{-1}b^{-1}\equiv e$ used in defining $G$ don't imply $a^mb^n=e$. – Andreas Blass Dec 7 '19 at 15:22
Thanks everyone for the comments. After reading all the comments to my question, I came up with the following: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475810629193,
"lm_q1q2_score": 0.8229267826185798,
"lm_q2_score": 0.8723473713594992,
"openwebmath_perplexity": 242.1492238260001,
"openwebmath_score": 0.8694217801094055,
"tags": null,
"url": "https://math.stackexchange.com/questions/3462085/what-familiar-group-is-g-isomorphic-to"
} |
dna, nucleic-acids
Title: Size of deoxyribonucleotide What is the diameter of each type of deoxyribonucleotide (if the types are significantly different in diameter, if they are fairly similar one value would suffice)? I.e., if a hole was to be created through which only a single deoxyribonucleotide could pass at a time, how small would it have to be? DNA is about 20 angstroms wide, so each of the two strand is about 10 angstroms wide. That width is the average between a larger purine unit and smaller pyrimidine unit, so let's round up to 12 or 13 angstroms for the larger unit. | {
"domain": "biology.stackexchange",
"id": 7333,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dna, nucleic-acids",
"url": null
} |
telescope, raw-data
Title: Where can I find Arecibo's data archive? Does anyone know where I can find Arecibo's historical data? After much searching, I can find neither hide nor hair of it. It doesn't help that the search results are completely dominated by the news of the relatively recent collapse of the telescope and I didn't come up with anything through their Science Portal. Arecibo recently opened the Arecibo Observatory Data Archive, which allows folks to obtain data organized by project. About 1800 proposals are listed, although not all of those have data available because not all of the observatory's data has been transferred to its new home at the Texas Advanced Computing Center. There's also an 18 month period during which each group has exclusive access to its Arecibo data. | {
"domain": "astronomy.stackexchange",
"id": 5591,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "telescope, raw-data",
"url": null
} |
mass, volume
Title: How can I conduct an experiment on the buring power of a 2 inch cubic block of wood? I'm trying to help my son put together a science project and the hypothesis that we've come up with is this:
If you take cubes of wood of the same volume (say 2 inches cubed) and start them burning with the same amount of heat over a 1 liter of water, that those woods with a higher density of mass will produce a greater increase in the temperature of the water.
But what I am struggling with is can I determine the MASS first or density? Or can I only determine the volume by water displacement or something?
Basically is there a way to determine the mass/density in some type of units before I burn each piece of wood? cut your wood samples into accurate cubes. Measuring the cubes then lets you calculate their volume. Then weigh each cube. Now you can calculate their density. | {
"domain": "physics.stackexchange",
"id": 44932,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mass, volume",
"url": null
} |
thermodynamics, energy, potential-energy
Title: Energy change when heating a substance When a substance is heated but not changing its phase, is the potential energy between the particles constituting the substance also increasing, or is it only the random kinetic energy of particles that increases? The potential energy between the particles constituting the substance basically depends on the average distance between particles and the nature of the interaction (ionic, dipole-dipole, etc.). For many systems, this variation is orders of magnitude smaller than the increase of the kinetic energy of particles for many systems.
However, indeed, thermal dilatation might change the average distance between particles. Temperature increase might favor disorientation of electric dipoles, contributing to the increase of the potential energy of the arrangement. In this sense, you are right. | {
"domain": "physics.stackexchange",
"id": 76278,
"lm_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, energy, potential-energy",
"url": null
} |
java, optimization, datetime, formatting
}
else if (days == 31 && firstDay == 5)
{
System.out.print("\t\t\t\t");
while (ctr <= days)
{
System.out.print(ctr);
System.out.print(" ");
ctr++;
if (ctr == 4 || ctr == 11 || ctr == 18 || ctr == 25)
{
System.out.println();
}
}
}
else if (days == 31 && firstDay == 6)
{
System.out.print("\t\t\t\t\t");
while (ctr <= days)
{
System.out.print(ctr);
System.out.print(" ");
ctr++;
if (ctr == 3 || ctr == 10 || ctr == 17 || ctr == 24 || ctr == 31)
{
System.out.println();
}
}
}
else if (days == 31 && firstDay == 7)
{
System.out.print("\t\t\t\t\t\t");
while (ctr <= days) | {
"domain": "codereview.stackexchange",
"id": 5321,
"lm_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, optimization, datetime, formatting",
"url": null
} |
c, graphics, c99
Notice also that I've dropped the u from your uint, which means I can also get rid of your typedef — several lines of code saved, with no loss of performance or expressiveness. (And on top of all that: if somebody does accidentally pass width = -1 to this function, they'll get a nice assertion failure instead of a segfault.) The built-in types are nice; use them, wherever possible.
Similarly, for the "concentric boxes" pattern, what you're doing is coloring each pixel according to its distance from the edge of the grid. Pixels at distance 1 get red; pixels at distance 2 get yellow; pixels at distance 3 get red again; and so on, all the way to the middle.
static inline int min2(int a, int b) { return a < b ? a : b; }
static inline int min4(int a, int b, int c, int d)
{
return min2(a, min2(b, min2(c, d)));
} | {
"domain": "codereview.stackexchange",
"id": 14654,
"lm_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, graphics, c99",
"url": null
} |
ros, rosinstall, roswtf
Title: roswtf says rosinstall missing
I started to go through the ROS tutorials and I reached roswtf. Now it says that it cant find the rosinstall python module, but it is installed. Not sure if I ever going to need rosinstall, but right now this warning just bothers me. Is it possible to know why roswtf says there is a problem? Or can I suppress the warning?
I'm running Ubuntu 12.04 with ROS Hydro.
viki@ubuntu:~/catkin_ws/devel$ roswtf
Loaded plugin tf.tfwtf
No package or stack in context
================================================================================
Static checks summary:
Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault
WARNING You are missing core ROS Python modules: rosinstall --
================================================================================
ROS Master does not appear to be running.
Online graph checks will not be run.
ROS_MASTER_URI is [htp://localhost:11311] | {
"domain": "robotics.stackexchange",
"id": 17555,
"lm_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, rosinstall, roswtf",
"url": null
} |
electricity, electrons
so, yes single electrons exist. Also in cathode ray tubes, like the old TV screens, there are streams of electrons in vacuum hitting the screen so that images are created for us to see.
In an electric current do electrons move from one atom to another or do they actually flow through the conductor like they show in the animations?
It depends on the material which carries the current. In the example of the TV screen, the current is in vacuum and composed of a stream of electrons.
In metals the outer electrons of the metal molecules are shared by the whole lattice, (the wire) and they move within a wire for a small average distance, repulsing the next electrons but the current appears with the velocity of light, because it is a collective effect. | {
"domain": "physics.stackexchange",
"id": 56123,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electricity, electrons",
"url": null
} |
Kind regards
Thomas
01-10-2014, 05:28 PM
Post: #3
Carlos CM (Mexico) Junior Member Posts: 35 Joined: Dec 2013
RE: HP 11C real root finder [Newton Method]
Best regards
Best Regards
01-12-2014, 08:31 AM
Post: #4
Namir Senior Member Posts: 688 Joined: Dec 2013
RE: HP 11C real root finder [Newton Method]
Here is a version that requires coding f(x) only since it approximate f'(x) as:
f'(x) = (f(x+h) - f(x))/h
Where h = 0.001*(ABS(X)+1)
The new version uses registers R1 through R4.
Code:
LBL 0 RCL 1 ABS 1 + EEX 3 CHS * STO 3 # calculate and store increment h RCL 1 GSB 1 STO 4 # calculate and store f(x) RCL 1 RCL 3 + GSB 1 # calculate f(x+h) RCL 4 - 1/X RCL 4 * RCL 3 * # calculate diff = h *f(x)/(f(x+h) - f(x)) STO- 1 ABS RCL 2 X<=Y? GTO 0 RCL 1 RTN
01-12-2014, 01:26 PM
Post: #5
Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: HP 11C real root finder [Newton Method]
(01-12-2014 08:31 AM)Namir Wrote: ...h = 0.001*(ABS(X)+1) | {
"domain": "hpmuseum.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471620993537,
"lm_q1q2_score": 0.8616405575001446,
"lm_q2_score": 0.8757870029950159,
"openwebmath_perplexity": 5919.442975938707,
"openwebmath_score": 0.4317140281200409,
"tags": null,
"url": "https://www.hpmuseum.org/forum/thread-383.html"
} |
• Your solutions contain declaration of the function unlike some other. Pure expressions are quite shorter. ;) – Dr Y Wit Oct 23 '18 at 10:13
• I was trying to port tsh's answer, but did not manage to get it short enough. Version 1. l.zipWithIndex.foldLeft(1>0){case(r,v,i)=>r&l.zip(l.tail).slice(i+1,l.length).forall(x=>l(i)>x._1|l(i)<x._2)}. Version 2. (for(i<-l.indices)yield l.zip(l.tail).slice(i+1,l.length).forall(x =>l(i)>x._1|l(i)<x._2)).forall(x=>x). Any ideas how to make these shorter? – Dr Y Wit Oct 23 '18 at 10:26
• Algorithm in plain English: for each element do a check with all the pairs of elements going next to each other. – Dr Y Wit Oct 23 '18 at 10:29 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759674419192,
"lm_q1q2_score": 0.8064655545473448,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 3474.962121090979,
"openwebmath_score": 0.30547282099723816,
"tags": null,
"url": "https://codegolf.stackexchange.com/questions/174293/is-this-a-bst-pre-order-traversal"
} |
c#, authorization
[Test]
public void TestCanDo()
{
Assert.IsTrue(_rbac.Can.User(_users["owner"]).Do("Delete").Result);
Assert.IsTrue(_rbac.Can.User(_users["owner"]).Do("transfer").Result);
Assert.IsTrue(_rbac.Can.User(_users["owner"]).Do("comment").Result);
Assert.IsTrue(_rbac.Can.User(_users["owner"]).Do("Create").Result);
Assert.IsFalse(_rbac.Can.User(_users["owner"]).Do("Maintnance").Result);
Assert.IsTrue(_rbac.Can.User(_users["member"]).Do("Create").Result);
Assert.IsTrue(_rbac.Can.User(_users["member"]).Do("read").Result);
Assert.IsTrue(_rbac.Can.User(_users["user"]).Do("read").Result);
Assert.IsFalse(_rbac.Can.User(_users["user"]).Do("Delete").Result);
Assert.IsFalse(_rbac.Can.User(_users["user"]).Do("transfer").Result);
Assert.IsTrue(_rbac.Can.User(_users["Bob"]).Do("Maintnance").Result); | {
"domain": "codereview.stackexchange",
"id": 18007,
"lm_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#, authorization",
"url": null
} |
python, game, numpy
# of efficiency.
self.table[i, :j + 1] = np.concatenate((np.zeros(1), self.table[i, :j]))
num_eliminated_elements += 1
else:
j -= 1
# Iterate over the i-th row again to sum up consecutive equal entries.
j = self.n - 1
while j > num_eliminated_elements:
if self.table[i, j] == self.table[i, j - 1]:
self.table[i, j - 1] = 2 * self.table[i, j - 1]
self.table[i, :j + 1] = np.concatenate((np.zeros(1), self.table[i, :j]))
num_eliminated_elements += 1
else:
j -= 1 | {
"domain": "codereview.stackexchange",
"id": 45309,
"lm_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, game, numpy",
"url": null
} |
ros, topic
I run rostopic list to get
/clock
/goal
/ik_solution_display
/initialpose
/joint_states
/ompl_planning/sync_planning_scene/cancel
/ompl_planning/sync_planning_scene/feedback
/ompl_planning/sync_planning_scene/goal
/ompl_planning/sync_planning_scene/result
/ompl_planning/sync_planning_scene/status
/planning_scene_markers
/planning_scene_markers_array
/planning_scene_validity_server/sync_planning_scene/cancel
/planning_scene_validity_server/sync_planning_scene/feedback
/planning_scene_validity_server/sync_planning_scene/goal
/planning_scene_validity_server/sync_planning_scene/result
/planning_scene_validity_server/sync_planning_scene/status
/planning_scene_visualizer_markers
/planning_scene_visualizer_markers_array
/planning_scene_warehouse_viewer_controls/feedback
/planning_scene_warehouse_viewer_controls/update
/planning_scene_warehouse_viewer_controls/update_full
/rosout
/rosout_agg | {
"domain": "robotics.stackexchange",
"id": 8780,
"lm_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, topic",
"url": null
} |
in the last equation, the error between this approximation and the exact answer will be of order $$\Delta v^2$$. This is actually great, since if we decrease $$\Delta v$$ the error will go down quadratically. If you repeat your calculation for multiple values of $$\Delta v$$ you would find that | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.951142221377825,
"lm_q1q2_score": 0.8026642568522565,
"lm_q2_score": 0.8438950966654774,
"openwebmath_perplexity": 151.90830107007545,
"openwebmath_score": 0.9066318273544312,
"tags": null,
"url": "https://physics.stackexchange.com/questions/514582/why-does-my-answer-vary"
} |
special-relativity, metric-tensor, tensor-calculus, notation
=\text{det}(g^{-1}) \sqrt{|\text{det }g|} \tilde{\epsilon}_{ijk} = \frac{\text{sgn}(g)}{\sqrt{|g|}}\tilde{\epsilon}_{ijk}$$
At this point we have
$$\epsilon^{ijk} = \frac{\text{sgn}(g)}{\sqrt{|\text{det }g|}}\tilde{\epsilon}_{ijk}$$
This is where people make a convention choice. Carroll (and many others that I have seen), for example, makes the chioce that $\tilde{\epsilon}^{ijk} = \tilde{\epsilon}_{ijk}$ so that we get
$$\epsilon^{ijk} = \frac{\text{sgn}(g)}{\sqrt{|\text{det }g|}}\tilde{\epsilon}^{ijk}$$
Pope takes the convention that $\tilde{\epsilon}^{ijk} = \text{sgn}(g)\tilde{\epsilon}_{ijk}$ so that
$$\epsilon^{ijk} = \frac{1}{\sqrt{|\text{det }g|}}\tilde{\epsilon}^{ijk}$$ | {
"domain": "physics.stackexchange",
"id": 53188,
"lm_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, metric-tensor, tensor-calculus, notation",
"url": null
} |
for the Sharpe ratio is provided below: Sharpe = RP − Rf σp S h a r p e = R P − R f σ p. 0% and +18%. Now, you want to find its rate of return. Standard deviation = √ (3,850/9) = √427. Under the assumption of normality of returns, an active risk of x per cent would mean that approximately 2/3 of the portfolio's active returns (one standard deviation from the mean) can be expected to fall between +x and -x per cent of the mean excess return and about 95% of the portfolio's active returns (two standard deviations from the. Let's look at a sample portfolio with five stocks in it. 1: Portfolio Risk and Return Let us apply this analysis to the data of the bond and stock funds as presented in Table 8. Standard deviation can be used as a measure of the average daily deviation of share price from the annual mean, or the year-to-year variation in total return. First we need to calculate the standard deviation of each security in the portfolio. use daily values of the Standard and Poor's (S&P) | {
"domain": "leplec.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357542883923,
"lm_q1q2_score": 0.8049525470371031,
"lm_q2_score": 0.822189121808099,
"openwebmath_perplexity": 882.7628329495639,
"openwebmath_score": 0.7142139673233032,
"tags": null,
"url": "http://leplec.de/standard-deviation-of-portfolio-return-formula.html"
} |
image-processing, discrete-signals, interpolation
def cubic(mu,y0,y1,y2,y3):
a = -1.0
result = y0 * kernel(mu + 1, a)
result += y1 * kernel(mu, a)
result += y2 * kernel(mu - 1, a)
result += y3 * kernel(mu - 2, a)
return result
However, it's much less computationally efficient to do it that way. As a bridge from the direct kernel approach to the more streamlined one above, consider that with a little bit of algebraic manipulation, the first implementation can be put in the following form:
def cubic(mu,y0,y1,y2,y3):
mu2 = mu*mu
mu3 = mu*mu2
c0 = -mu3 + 2*mu2 - mu
c1 = mu3 - 2*mu2 + 1
c2 = -mu3 + mu2 + mu
c3 = mu3 - mu2
return c0*y0 + c1*y1 + c2*y2 + c3*y3 | {
"domain": "dsp.stackexchange",
"id": 380,
"lm_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, discrete-signals, interpolation",
"url": null
} |
ros, imu, filter, kalman, data
Originally posted by tonybaltovski with karma: 2549 on 2014-10-11
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by alainh on 2014-10-11:
You're absolutely right. I forgot to switch branches. Thank you! To continue the discussion, however, is this the only raw data IMU solution?
Comment by tonybaltovski on 2014-10-11:
robot_localization uses the IMU data in an EKF.
Comment by alainh on 2014-10-24:
Follow up: While I got most of the package dependencies to build, it trips up on the boost library from tf with errors. I made a separate question found here: http://answers.ros.org/question/194856/error-with-boost-while-building-tf-package-in-catkin-ws/ | {
"domain": "robotics.stackexchange",
"id": 19710,
"lm_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, imu, filter, kalman, data",
"url": null
} |
2.1 The rectangular coordinate systems and graphs (Page 5/21)
Page 5 / 21
Using the midpoint formula
When the endpoints of a line segment are known, we can find the point midway between them. This point is known as the midpoint and the formula is known as the midpoint formula . Given the endpoints of a line segment, $\text{\hspace{0.17em}}\left({x}_{1},{y}_{1}\right)\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\left({x}_{2},{y}_{2}\right),$ the midpoint formula states how to find the coordinates of the midpoint $\text{\hspace{0.17em}}M.$
$M=\left(\frac{{x}_{1}+{x}_{2}}{2},\frac{{y}_{1}+{y}_{2}}{2}\right)$
A graphical view of a midpoint is shown in [link] . Notice that the line segments on either side of the midpoint are congruent.
Finding the midpoint of the line segment
Find the midpoint of the line segment with the endpoints $\text{\hspace{0.17em}}\left(7,-2\right)\text{\hspace{0.17em}}$ and $\text{\hspace{0.17em}}\left(9,5\right).$ | {
"domain": "jobilize.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787857334058,
"lm_q1q2_score": 0.8070921742675449,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 734.2786237978017,
"openwebmath_score": 0.7790675759315491,
"tags": null,
"url": "https://www.jobilize.com/trigonometry/section/section-exercises-the-rectangular-coordinate-systems-and-by-openstax?qcr=www.quizover.com"
} |
ros
Comment by Mike Scheutzow on 2021-07-05:
Your CMakeLists.txt file does not look like any I have ever seen for a ROS1 package. You really need to find one from a package that actually compiles and use it as a reference for your own project.
Comment by Fxaxo on 2021-07-06:
oh okay i will search and keep u updated when i find the solution ! thank you ! @Mike Scheutzow
Comment by Fxaxo on 2021-07-08:
i found a CMakeLists.txt wich i copied and configured for my Project do this fit more in the regular CMakeLists ?
i added the new file in the question
Comment by Mike Scheutzow on 2021-07-08:
That CMakeLists.txt still looks incomplete to me. Have you tried looking at any of the roscpp tutorials? For example, this one:
http://wiki.ros.org/roscpp_tutorials/Tutorials/WritingPublisherSubscriber | {
"domain": "robotics.stackexchange",
"id": 36626,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
$\displaystyle \text{acubic=}\left[ {\begin{array}{*{20}{c}} {{{a}_{0}}} \\ {{{a}_{1}}} \\ {{{a}_{2}}} \end{array}} \right]$
We can re-write the above:
$\displaystyle \text{vcubic}=\text{tcubic}*\text{acubic}$
Solving for alin using the left slash:
$\displaystyle \text{acubic}=\text{tcubic }\!\!\backslash\!\!\text{ vcubic}$
Once we have these, it is simply a case of inserting them into the equation at t=16:
$\displaystyle \text{v16cubic}=\left[ {\begin{array}{*{20}{c}} 1 & {16} & {16\hat{\ }2} & {16\hat{\ }3} \end{array}} \right]*\text{acubic}$
vcubic=[rocket.v(2);...
rocket.v(3);...
rocket.v(4);...
rocket.v(5);];
1,rocket.t(3),(rocket.t(3))^2,(rocket.t(3))^2;...
1,rocket.t(4),(rocket.t(4))^2,(rocket.t(4))^2;...
1,rocket.t(5),(rocket.t(5))^2,,(rocket.t(5))^2];
acubic=tcubic\vcubic;
v16cubic=[1,16,16^2]*acubic
v16cubic=392.1876
# Interpolation of a Curve
MATLAB has a function for interpolation it has the form
[newy]=interp1(oldx,oldy,newx,'method') | {
"domain": "dellwindowsreinstallationguide.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682439644956,
"lm_q1q2_score": 0.803656108184584,
"lm_q2_score": 0.8128673223709251,
"openwebmath_perplexity": 852.464980248107,
"openwebmath_score": 0.8405210971832275,
"tags": null,
"url": "https://dellwindowsreinstallationguide.com/interpolation-of-a-curve/"
} |
quantum-mechanics, hilbert-space, operators
From the algebraic perspective, it amounts to consider the algebraic states for $B^*B\neq 0$,
$$\omega_B(A):= \frac{\omega(B^*AB)}{\omega(B^*B)}\:.\quad A\in {\cal A}.$$
This result actually holds true also in standard quantum theory in Hilbert space, when assuming that the algebra of bounded observables is made of all the selfadjoint operators in ${\cal B}({\cal H})$, hence in the absence of superselection rules. (In case of superselection rules, a refinement of the idea leads to the coherent sector decomposition of the Hilbert space.)
In this case, if $\Phi$ is any unit vector (thus representing a pure state within the said hypotheses), $$\overline{{\cal B}({\cal H}) \Phi} = {\cal H}\:.$$
The GNS construction is a generalization of this idea. | {
"domain": "physics.stackexchange",
"id": 76248,
"lm_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, operators",
"url": null
} |
heat-transfer
Title: Calculating the difference in heat loss from human body in different environments I'm interested in personal cooling devices and would like to know if there's a way to make a rough estimate of rate at which you would need to extract heat from the body of an average male walking in weather of say 34 deg C and relative humidity of 90% in order to reduce body temperature to what it would be if walking in the same clothing (say slacks and a T-shirt) at say 24 deg C and RH of 75%. I don't know if there's any kind of model out there or if you have to work it all out from scratch. The implicit goal appears to be to keep the temperature of the object (the human body) constant independent of changes in the external conditions (clothing, air temperature, wind speed, humidity). The simplest model is a lumped approach.
Let's assume the body is always warmer than the surroundings. The heat extracted by the surroundings is
$$\dot{q}_{x,s} = U A \Delta T$$ | {
"domain": "engineering.stackexchange",
"id": 4396,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "heat-transfer",
"url": null
} |
## Solution 2
Note that all numbers formed from this sum are either positive, negative or zero. The number of positive numbers formed by this sum is equal to the number of negative numbers formed by this sum, because of symmetry. There is only one way to achieve a sum of zero, if all $a_i=0$. The total number of ways to pick $a_i$ from $i=0, 1, 2, 3, ... 7$ is $3^8=6561$. $\frac{6561-1}{2}=3280$ gives the number of possible negative integers. The question asks for the number of nonnegative integers, so subtracting from the total gives $6561-3280=\boxed{3281}$. (RegularHexagon)
## Solution 3
Note that the number of total possibilities (ignoring the conditions set by the problem) is $3^8=6561$. So, E is clearly unrealistic. | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9919380072800831,
"lm_q1q2_score": 0.824442374508408,
"lm_q2_score": 0.8311430436757313,
"openwebmath_perplexity": 114.13626379070489,
"openwebmath_score": 0.765343189239502,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2018_AMC_10A_Problems/Problem_18&diff=next&oldid=100830"
} |
value, between its limits, to keep the mass at rest. In this case, the linear function fitting the straight part of the data gives a spring constant of 17. Viscoelastic spring with a rigid moving mass and a viscous dashpot at the end x = 1. We express the widely used implicit Euler method as an energy minimization problem and introduce spring directions as auxiliary unknown variables. The model is formulated with. where y n is a state vector, A(t) n×m is a bounded matrix, which elements are time dependent, B n×m is a constant matrix, u m is a control vector, and g(y) n is a vector, which elements are continuous nonlinear functions, g(0) = 0. Generalization: damping, nonlinear spring, and external excitation¶. The spring is called a hardening spring if >0and a softening spring if <0. Applications Nonlinear vibration of mechanical systems. Linear and nonlinear system. Thermo-mechanical nonlinear vibration analysis of a spring-mass-beam system MH Ghayesh, S Kazemirad, MA Darabi, P Woo | {
"domain": "acpm.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9895109081214212,
"lm_q1q2_score": 0.8329956528383808,
"lm_q2_score": 0.8418256393148982,
"openwebmath_perplexity": 937.6084491184243,
"openwebmath_score": 0.5827639102935791,
"tags": null,
"url": "http://iquk.acpm.it/nonlinear-spring-mass-system.html"
} |
quantum-mechanics, visible-light, waves, electromagnetic-radiation, matter
Title: Treating matter waves as light waves? Is it valid to treat a matter wave as a light wave with wavelength equal to the de Broglie wavelength of the matter wave? Either way please can you explain why? It's not valid to treat light and matter waves alike. Why? Apart from the obvious reason that they are not the same (we can after all see light distinctly from matter), the two have different equations of motion - the (non-relativistic) "matter wave" obeys the famous Schrodinger equation, while classical light waves go around according to Maxwell's equations (or the standard wave equation).
There are many differences because of this: | {
"domain": "physics.stackexchange",
"id": 31807,
"lm_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, visible-light, waves, electromagnetic-radiation, matter",
"url": null
} |
ros, ros-kinetic, callback
if ! isinteractive()
main()
end
When I run this script and use the rostopic pub command it works perfectly, but when I integrate (joy --> teleop_twist_joy-->twist_to_vel-->Julia Node) it gives the following error:
ERROR (unhandled task failure): InexactError()
in call at ./no file:4294967295
in callback at /home/connorfuhrman/catkin_ws/src/speed_to_pwm/scripts/pwm_gen.jl:67
Honestly, I am not very experienced in ROS or Julia so any help would be appreciated!
Originally posted by cmfuhrman on ROS Answers with karma: 200 on 2018-05-21
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 30868,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic, callback",
"url": null
} |
transcription, gene-regulation
Polymerism in general, and dimerism in particular, are quite common modes of transcriptional activation and regulation. The large number of ways in which a relatively small number of transcription factors can be combined allows for the exquisite control of genes, responding to a huge variety of cellular situations. Unfortunately, it also means that mutations in key, common components can result in transformation, unrestricted growth, and the generation of tumors. | {
"domain": "biology.stackexchange",
"id": 385,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "transcription, gene-regulation",
"url": null
} |
thermodynamics, entropy, partition-function
=& -\frac{1}{kT}\langle \delta E_i\rangle + \frac{1}{kT^2}\langle E_i\rangle\delta T
\end{align}
$$
and this gives
$$\delta S = -\frac{1}{T}\langle \delta E_i\rangle+\frac{1}{T}\delta \langle E_i\rangle$$
or
$$ \delta \langle E_i\rangle - \langle \delta E_i\rangle = T\delta S$$
By the second law of thermodynamis, the right hand side should equal $\delta Q$. But on the left, I can also consider the the change in average energy by considering it just as a probabilistic average:
$$\begin{align}
\delta\langle E_i\rangle = & \delta\left(\sum_i E_i p_i\right)\\
= & \sum_i \delta E_i p_i + \sum_i E_i\delta p_i\\
= & \langle \delta E_i\rangle + \sum_i E_i\delta p_i
\end{align}$$
Putting this together gives:
$$ \delta Q = T\delta S = \sum_iE_i\delta p_i$$ | {
"domain": "physics.stackexchange",
"id": 69489,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, entropy, partition-function",
"url": null
} |
ros, cartographer
Originally posted by BrannonKing with karma: 76 on 2017-08-31
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 28093,
"lm_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, cartographer",
"url": null
} |
general-relativity, spacetime, differential-geometry, metric-tensor, topology
Thus general relativity prevents one from actively probing the
topology of spacetime. However, note that one can passively observe that topology by detecting light that originates at a past singularity.
What follows in the paper is further discussion of what restrictions, if any, there are on such passive observation. | {
"domain": "physics.stackexchange",
"id": 91285,
"lm_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, spacetime, differential-geometry, metric-tensor, topology",
"url": null
} |
graphs, dynamic-programming, weighted-graphs
I'm looking for a general direction. Does it belong to a known family of problems? If yes, how do you solve them efficiently? Dynamic programming, knapsack or some known modification of a graph traversal algorithm? Is considering it a graph problem wrong, or not particulartly helpful? Sorry for the barrage of questions. There's no need to introduce a graph; the problem can be solved by a straightforward dynamic programming algorithm. The running time will be $O(n)$, where $n$ is the number of days. | {
"domain": "cs.stackexchange",
"id": 6819,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, dynamic-programming, weighted-graphs",
"url": null
} |
javascript, jquery, classes
unenforce : function(){
$("#" + this.CONTAINER_ID + " ." + this.TARGET_STYLE_CLASS).removeClass(this.APPLY_STYLE_CLASS);
}
};
} The usefulness of creating a class is that you can have private variables.
Simply placing every thing in an object defeats that point. Instead you should define everything in the protected part of the function and simply expose an external API with the return.
http://codr.cc/s/9b31baa5/js | {
"domain": "codereview.stackexchange",
"id": 327,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, classes",
"url": null
} |
coordination-compounds, orbitals, transition-metals, crystal-field-theory
Keep in mind that the ligands do not pair with the electrons of the metal. They simply repel the orbitals electrostatically and increase their potential energy in the process.
So, now how do the complexes actually get their color then? When the orbitals split, the difference in their energies is called Crystal Field Stabilization Energy (CFSE) and is denoted by $\Delta_{\text{o}}$. When photons of light are incident on the complex, it absorbs the photons which possess the energy equal to that of the value of $\Delta _{\text{o}}$. From quantum theory of electromagnetic waves, it's known that the energy of a photon is given by:
$$U = \frac{hc}{\lambda}$$
Where $h$ is known as the Planck's Constant, with a value of $\pu{6.626×10^{-34}Js}$, and $\lambda$ is the wavelength of light. If the value of the wavelength lies in the visible light spectrum, you can find the color of the light absorbed by the complex. | {
"domain": "chemistry.stackexchange",
"id": 8295,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "coordination-compounds, orbitals, transition-metals, crystal-field-theory",
"url": null
} |
rotational-dynamics, reference-frames, inertial-frames, earth, machs-principle
These are called Foucault pendulums. They work by the Coriolis force. My easiest explanation of this starts from: the Earth is rotating counterclockwise, so that at any given second if you point East, you are actually traveling at some hundreds of meters per second in the direction you're pointing, depending on your latitude, because you have to travel the whole circumference $2\pi R$ once per day. But actually this means that if you go a little distance $x$ further away from the axis, you need to travel a little faster: $2\pi (R + x)$ per day, so you need to travel $2\pi~x/\text{day}$ faster, to appear to remain "above" where you were. And this is hard to notice at strictly human scales. It means that if you jumped straight up you might land a little west of where you started, but I doubt it's as big of an effect as the width of a hair for that short of a height for that short of a time. Now a very long Foucault pendulum moves approximately in a plane. If you are on the Equator, the | {
"domain": "physics.stackexchange",
"id": 50360,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rotational-dynamics, reference-frames, inertial-frames, earth, machs-principle",
"url": null
} |
mathematics, superposition, cq-states
generates 0 or 1 on $c_0$, both with probability 0.5. Using $n$ quantum and classical registers configured identical to those above would randomly generate a number between $0$ and $2^n-1$.
In the circuit above, the Hadamard gate ($H$) transforms the qubit from a known state $\vert 0 \rangle$ to a superposition of states described by
$$H \vert 0 \rangle = \frac{\vert 0 \rangle + \vert 1 \rangle}{\sqrt{2}}.$$
If the Hadamard gate was removed, i.e. no superposition, there would be no randomness in the output since the measurement would read $\vert 0 \rangle$ every time (apart from noise).
More complicated circuits can be built to do more interesting sampling tasks, but I'm not sure what you are looking for specifically. This talk goes into more detail on the subject.
If you are new to quantum computing, you might need to work through a good textbook on the subject (the standard text is Nielson and Chuang) before any of this will make much sense. | {
"domain": "quantumcomputing.stackexchange",
"id": 1068,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mathematics, superposition, cq-states",
"url": null
} |
electromagnetism, electrostatics, particle-physics, magnetic-fields, electricity
Magnetostatics are different. Charges (i.e. electrons) are evenly distributed inside the matter of the metal needle. If you can find a way assuming the needle material is ferromagnetic to re-orient all magnetic moments of the unpaired electrons to align to the same direction then you will magnetize the needle and it will sense the magnetic field of the Earth and needle will respond by aligning to the magnetic field of the Earth!
See below illustration of the difference between electrostatically charged matter and magnetically dipole charged matter (i.e. magnetized): | {
"domain": "physics.stackexchange",
"id": 84051,
"lm_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, electrostatics, particle-physics, magnetic-fields, electricity",
"url": null
} |
blast
For completeness, I've pasted some pseudocode from the more popular x-drop paper from 2000. Note that $X$ is a user specified parameter, with larger $X$ allowing for a larger search space but slower speed. | {
"domain": "bioinformatics.stackexchange",
"id": 1882,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "blast",
"url": null
} |
You're going to need at least two rolls in order to have a chance at more than 6 possible values. The alternative would be to remember the previous roll and use that instead of rolling a second time...but that seems like it'd make the next roll partially dependent on the previous one (which might muck around with probabilities). – cHao Aug 18 '14 at 13:52 @cHao: Yes, sometimes we want exactly one fair 1d7 value, and you're right that it's impossible to do that with only 1 roll of a 1d6 dice -- we need at least 2, sometimes more, and andre shows an excellent algorithm for that case. However, if we want several hundred independent and fair 1d7 values, it is (theoretically) possible to derive those values from (on average) log(7)/log(6) =~ 1.09 rolls of a fair 1d6 die per desired 1d7 value. However, the algorithm to do that is complex and more difficult to prove that it gives fair, independent 1d7 values. – David Cary Aug 18 '14 at 14:54 @David: It's not as complex as you might think. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676514063881,
"lm_q1q2_score": 0.8184961945828259,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 1289.6711281389273,
"openwebmath_score": 0.8984300494194031,
"tags": null,
"url": "http://math.stackexchange.com/questions/901222/simulate-repeated-rolls-of-a-7-sided-die-with-a-6-sided-die"
} |
phase, demodulation, fsk
Bad luck; with the real part of the signal you can't tell negative from positive frequencies.
Discarding the imaginary part discarded exactly that information. There's nothing you can do about that, the information is gone. Ignoring the imaginary part of a baseband signal literally ignores half of the signal content!
If your FSK was continuous-phase, you oversample sufficiently (i.e, especially not the MSK case), and the pulse shape applied before frequency-modulating is benign, and your SNR good enough, you might try to infer on whether you just saw a signal transition. You can't get the original bits that way, but you could maybe get the information of whether the last symbol is the same as the previous one. Good luck! | {
"domain": "dsp.stackexchange",
"id": 11319,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "phase, demodulation, fsk",
"url": null
} |
special-relativity, metric-tensor, inertial-frames, lorentz-symmetry
It is therefore defined by
$$O(1,3) := \left\{ \Lambda \in M(4,\mathbb R) \:|\: \Lambda \eta \Lambda^t = \eta \right\}$$
where $\eta = diag(-1,1,1,1)$ is the matrix representing the metric $g$ in (4) in every Minkowskian basis.
A Minkowskian coordinate system on $\mathbb M^4$ is a Cartesian coordinate system whose axes are a Minkowskian basis.
Lorentz transformations are transformations of coordinates between pairs of Minkowskian coordinate systems with the same origin (so that $c^k=0$ in (3)). Thus they have the form
$$x'^a = \sum_{j=1}^n {\Lambda^a}_j x^j $$
for some $\Lambda \in O(1,3)$.
If we admit different origins we obtain the so-called Poincaré transformations
$$x'^a = c^a+ \sum_{j=1}^n {\Lambda^a}_j x^j \:.$$ | {
"domain": "physics.stackexchange",
"id": 15778,
"lm_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, metric-tensor, inertial-frames, lorentz-symmetry",
"url": null
} |
deconvolution
Edit
Here is the minimal code to reconstruct undesired behaviour. The signal deconvolved using scipy.signal.deconvolve is shorter than the recorded convolved signal. I believe that, under suitable assumptions, the convolved signal contains enough information to reconstruct the original signal over the entire duration of recording. Note that | {
"domain": "dsp.stackexchange",
"id": 8915,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deconvolution",
"url": null
} |
stack, lisp, macros, racket
Title: Mutable stack in Racket I'm learning Racket and have implemented a mutable stack, which is just a bunch of wrappers around an underlying struct containing a size and buffer list (so it's not optimal, in terms of computational complexity). After consulting #racket and reading the first half of Greg Hendershott's Fear of Macros, I was able to write the syntax transformations I wanted for my implementation.
(module stack racket
(module stack-implementation racket
(struct stack (size buffer) #:mutable)
;; size :: stack -> integer
(define (size stack) (stack-size stack))
;; non-empty-stack? :: stack -> boolean
(define (non-empty-stack? stack)
(and
(stack? stack)
(positive? (stack-size stack))))
;; push! :: stack -> any (new item) -> integer (size)
(define (push! stack item)
(set-stack-buffer! stack
(append (list item) (stack-buffer stack)))
(set-stack-size! stack (+ (stack-size stack) 1)) | {
"domain": "codereview.stackexchange",
"id": 18032,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stack, lisp, macros, racket",
"url": null
} |
c++, sorting, reinventing-the-wheel, mergesort, c++20
void merge_sort(int[], size_t, size_t);
You declare two functions here, but what are their semantics? For a start, be aware that this is just a different spelling for
void print_array(int*, size_t);
void merge_sort(int*, size_t, size_t); | {
"domain": "codereview.stackexchange",
"id": 41314,
"lm_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++, sorting, reinventing-the-wheel, mergesort, c++20",
"url": null
} |
• @Justin: When someone else starts typing in the same question, the duplicate matcher will display your question title for them. Consider what title would make them most likely to click on it. "Can someone help me with a logic problem" will not do a good job of convincing them their exact question has already been asked. – Larry Wang Jul 24 '10 at 23:28
• @97832123 @Kaestur - I've edited my title; is it more helpful? =) – Justin L. Jul 24 '10 at 23:31 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540710685614,
"lm_q1q2_score": 0.8052142636310471,
"lm_q2_score": 0.822189121808099,
"openwebmath_perplexity": 1255.4208460115938,
"openwebmath_score": 0.5489892959594727,
"tags": null,
"url": "https://math.stackexchange.com/questions/639/logic-problem-identifying-poisoned-wines-out-of-a-sample-minimizing-test-subje"
} |
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551556203815,
"lm_q1q2_score": 0.8200990764621774,
"lm_q2_score": 0.8499711813581708,
"openwebmath_perplexity": 445.0842031061462,
"openwebmath_score": 0.9648494124412537,
"tags": null,
"url": "http://math.stackexchange.com/questions/262828/proof-by-contradiction-vs-prove-the-contrapositive?answertab=votes"
} |
and the central angle of a sector is 40 degrees. 1. = 44 + 2 (21) Area of a circle is given as π times the square of its radius length. First, we want to just sketch our circle and then label each part. You will learn how to find the arc length of a sector, the angle of a sector or the radius of a circle. I know the formula for arc length is rθ. Relevance. These are the conversion formulas for radians to degrees and for degrees to radians, respectively. ... Lv 7. 3 Answers. To calculate the area of the sector you must first calculate the area of the equivalent circle using the formula stated previously. We’re also interested in the perimeter of this sector. Section 4.2 – Radians, Arc Length, and the Area of a Sector 4 Sector Area Formula In a circle of radius r, the area A of a sector with central angle of radian measure T is given by . Area of a sector formula. Area (Radians) = ½r 2 θ. r, D° r, R° r, s r, A D°, s. Radius (r) Angle (D°) Angle (R°) Arc (s) Area (A) *Radius and Arc in | {
"domain": "ac.id",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.982287698703999,
"lm_q1q2_score": 0.8498989865928189,
"lm_q2_score": 0.8652240964782011,
"openwebmath_perplexity": 498.07981130006914,
"openwebmath_score": 0.9099538922309875,
"tags": null,
"url": "https://ijm.telkomuniversity.ac.id/3vpsk1b/article.php?963f9b=perimeter-of-sector-formula-radians"
} |
opencv, cv-bridge
Original comments
Comment by inflo on 2015-04-24:
some more or better info, like, what commands are you running to see an image? can you normaly see the image?etc. etc.
Comment by Anand on 2015-04-24:
Firstly thanks for your reply. Yes sure.
Initially I am using the command - roslaunch uvcCameraLaunch.launch ... this works fine and my camera gets light up.
After that i am running the command - rosrun image_view image_view image:=/camera/image_raw.. this pops up a window named /camera/image_raw
Comment by Anand on 2015-04-24:
This window /camera/image_raw has the screen which is completely green rather than seeing the display of camera.
Comment by inflo on 2015-04-24:
check with "rostopic list" after uvcCameraLaunch.launch which image topics also exist and try another with "rosrun image_viewer..."
else could you see with a simply webcam app a normal picture or also a green one ?
Comment by Anand on 2015-04-24:
Yes i am able to view properly the webcam output with webcam app. | {
"domain": "robotics.stackexchange",
"id": 21392,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "opencv, cv-bridge",
"url": null
} |
black-holes, hawking-radiation, unruh-effect
might be helpful here (and perhaps not, since I think the states considered there are "static vacua"). On the other hand, maybe this falls outside the original question, which was about the relation (or not) to Hawking radiation in this case. I'd say there's no clear relation, because the Hawking radiation is determined by the UV structure of the state at the horizon, and that static Unruh effect is determined by something else in this case. | {
"domain": "physics.stackexchange",
"id": 89312,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-holes, hawking-radiation, unruh-effect",
"url": null
} |
java, swing
}
}
/**
* Returns the integer value stored in a mapped textfield, if applicable
* @param name Textfield to search for
* @return Either the appropriate int value or 0 if no valid integer bearing field could be found
*/
public int getTextFVal(String name)
{
JTextField temp = getTextF(name);
// does it exist and is it a number
if (temp == null || !Utils.isInteger(temp.getText()))
{
return 0;
}
else
{
return Integer.parseInt(temp.getText());
}
}
/**
* Attempts to retrieve a mapped text field with the matching name and change its text value to val
*
* This function will fail silently if the field doesn't exist
*
* @param name Name of the text field to look for
* @param val Value to setText to
*/
public void setTextF(String name, String val)
{
JTextField temp = getTextF(name); | {
"domain": "codereview.stackexchange",
"id": 15483,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, swing",
"url": null
} |
then S can be written in component form as. Grapher Pro is a fast and effective equation plotter, capable of drawing any function (including complex-valued ones), solving equations and calculating expressions. | {
"domain": "prolocomontecastrilli.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147169737825,
"lm_q1q2_score": 0.8165696743575444,
"lm_q2_score": 0.8397339736884711,
"openwebmath_perplexity": 1545.129168880018,
"openwebmath_score": 0.4409862756729126,
"tags": null,
"url": "http://prolocomontecastrilli.it/axsc/3d-parametric-grapher.html"
} |
c++, c++17, fibonacci-sequence
Use an unsigned type
None of the terms of the Fibonacci sequence are negative, so I'd suggest that perhaps unsigned or even unsigned long might be more appropriate base types.
Use a template
It may make sense to turn this into a templated function to allow different types to be used as the base type. This would be one way to extend the range, such as with the GNU Multiple Precision Arithmetic Library.
Consider a different operator++ implementation
The current implementation of the operator++ is this:
iterator& operator++() {
++i_;
b_ = b_ + a_;
a_ = b_ - a_;
return *this;
}
I would suggest, especially if you decide to implement templates, that this might be more efficient:
iterator& operator++() {
++i_;
std::swap(a_, b_);
b_ += a_;
if (b_ < a_) {
throw std::overflow_error("Exceeded range of underlying type");
}
return *this;
} | {
"domain": "codereview.stackexchange",
"id": 36257,
"lm_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++17, fibonacci-sequence",
"url": null
} |
radicals, green-chemistry
We might be able to do more at the ground, where the Sun's UV is mostly filtered.
It would still be an enormous feat to merely reach the Sun's UV level.
However, there is a big reason NOT to do it at the ground: UV does not only break up methane, but also oxygen. Part of that will recombine to ozone, which is an irritant (in the medical sense, i.e. extended-time exposure will cause damage no matter what).
(I do not know whether the oxygen bonds are stronger or weaker than the methane bonds. If methane has the weaker bonds, one could use an UV wavelength below the oxygen energy. You'd still break up bonds of any atmospheric molecule that has weaker bonds than methane, such as pheromones and whatnot; it is entirely unclear what consequences that would have.) | {
"domain": "chemistry.stackexchange",
"id": 12428,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "radicals, green-chemistry",
"url": null
} |
angular-momentum, astrophysics, stars, solar-system, galaxies
If we knew what fraction of stars had close-in, potentially transiting planets, we could use the numbers of detected transiting exoplanets in the Kepler field to say whether that number was consistent with random orientations or not. Alternatively, if we had another Kepler field pointing in a different Galactic direction, but with similar sensitivity to the original Kepler field, then the relative numbers of detected transiting planets in the two fields might tell us of any non-random orientations. For example, if orbital planes were all aligned with the Galactic plane, then no transits would be seen for any star viewed out of the Galactic plane. (I think this extreme possibility can already be ruled out.) | {
"domain": "physics.stackexchange",
"id": 24643,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "angular-momentum, astrophysics, stars, solar-system, galaxies",
"url": null
} |
fourier-transform, noise
Title: Fourier transform of certain noisy function So, I have a noisy signal in time domain, $f(t) = t \eta(t)$ where $\eta(t)$ is white noise with variance $\sigma$ and mean zero, and that it has the property $\langle \eta(t)\eta(t') \rangle = \sigma^2 \delta(t-t')$ ($\langle \ldots \rangle$ denotes ensemble averaging). What I want to do is that I want to calculate the square magnitude of the spectrum in frequency domain upon ensemble averaging, $\langle |z(\omega)|^2 \rangle$. To do this, I follow Dave's answer in https://physics.stackexchange.com/questions/53739/magnitude-of-the-fourier-transform-of-white-noise. So, it will be
$$
\langle |z(\omega)|^2 \rangle = \iint e^{i\omega t} e^{-i\omega t'}t't \langle \eta(t)\eta(t') \rangle dt dt'
$$
Using the property stated above, $\langle \eta(t)\eta(t') \rangle = \sigma^2 \delta(t-t')$, I can obtain
$$
\langle |z(\omega)|^2 \rangle = \sigma^2 \int t^2 dt
$$. | {
"domain": "dsp.stackexchange",
"id": 3346,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, noise",
"url": null
} |
c#, regex, palindrome
Title: Check if string is palindrome LeetCode LeetCode 125 requires receiving a string and checking if it is a valid palindrome. I have done this and am confident with an int and a single word, but this question requires the use a of a sentence with non-alphanumeric characters. The function must ignore non-alphanumeric characters and whitespaces.
public bool isPalindrome(string s) {
s = System.Text.RegularExpressions.Regex.Replace(s, @"\W|_", "");
if (s == null || s == "" || s.Length == 1 || s == " ")
{
return true;
}
for (int i = 0, j = s.Length - 1; i <= s.Length / 2 && j >= s.Length /2;i--,j++)
{
if (Char.ToLower(s[i]) == Char.ToLower(s[j]))
{
continue;
}
return false;
}
return true;
} | {
"domain": "codereview.stackexchange",
"id": 39898,
"lm_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#, regex, palindrome",
"url": null
} |
quantum-field-theory, definition, feynman-diagrams, perturbation-theory, self-energy
With that in mind, the self-energy is then defined by rearranging/grouping the connected Feynman diagrams in such a way so that
$$
G=\frac{1}{G_0^{-1}-\Sigma}
$$
However, I can't understand why we can do this mathematically, since even a conditionally convergent summation cannot have its terms arbitrarily rearranged (Riemanns rearrangement theorem).
My guess would be that even though the motivation comes from the above, the actual rigorous logic would be to define $\Sigma(i\omega)=G_0^{-1}(i\omega)-G^{-1}(i\omega)$ and find that $\Sigma$ is smooth with respect to $\lambda$. We can then repeat the logic for $G$ and compute the first few derivatives of $\Sigma$, which just so happen to be exactly equal to the definition of $\Sigma$ by regrouping the Feynman diagrams. Is this the case? If so, now the difficulty here is actually calculating $G_0^{-1},G^{-1}$ since these are inverses of operators and not numbers.
Briefly, the full (connected) propagator | {
"domain": "physics.stackexchange",
"id": 80332,
"lm_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, definition, feynman-diagrams, perturbation-theory, self-energy",
"url": null
} |
openni, openni-kinect
I am pretty sure its the fix-mac-arch file that is missing in ps-engine and patching problem is due to the wrong path in the same file.
Did someone else face the same issue? Pls let me know if any archives are available for the same.
Thanks in advance,
Karthik
Originally posted by karthik on ROS Answers with karma: 2831 on 2011-09-27
Post score: 1
I was having the same trouble on Fedora 15.
It seems to me that the problem was introduced here, 3 days ago.
https://kforge.ros.org/openni/drivers/rev/b5dc08c27676
I actually removed the dependence, since from the description of the change, it is a patch for macs.
Originally posted by Juan Saavedra with karma: 26 on 2011-09-30
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 6794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "openni, openni-kinect",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.