text stringlengths 1 1.11k | source dict |
|---|---|
modulation, quadrature
Title: What tricks can one play on a bandwidth-limited IQ modulator? I would like to create a pulsed RF signal that has a carrier frequency of 2 GHz by IQ up-conversion. The pulse should be 2-4 ns long. The carrier phase has to jump by 90° in the centre of the pulse. The problem is that my IQ modulator has only 200 MHz bandwidth. I work at an IF of 100 MHz, the maximum IF sampling rate is 1 GHz. Therefore, I see quite some distortions. Are there some tricks one can play to circumvent distortions e.g. by amplitude shaping or smoothening the phase change or is the bandwidth of the IQ modulator a hard boundary condition for such short pulses? The choice of an IF frequency of 100 MHz limits the achievable single-sided bandwidth for a real signal centered on it to be 100 MHz, so any pulse out of the modulator would be limited in rise/fall time as given by that bandwidth, without introducing other distortion effects. | {
"domain": "dsp.stackexchange",
"id": 11651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "modulation, quadrature",
"url": null
} |
climate-change
Carbon cycle feedbacks
Cloud feedback
Gas release
Ice-albedo feedback
Water vapor feedback
However, there are also a few negative feedbacks (same source):
Blackbody radiation
Carbon cycle
Lapse rate
Impacts on humans
Now the question is: what is the net budget between positive and negative feedbacks? To assess this, climatologists use some metrics, the main ones being "transient climate response" (TCR) and "equilibrium climate sensitivity" (ECS). From Knutti et al. (2017): | {
"domain": "earthscience.stackexchange",
"id": 1983,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "climate-change",
"url": null
} |
optics, visible-light, everyday-life, reflection
Starting from the ray passing through the center $C$, you can see that it will imping perpendicularly on the surface of the mirror, thus being reflected along the same ray.
The ray passing through the focus $F$ will be reflected, by definition, parallely to the optical axis.
The ray impinging parallely to the optical axis will be reflected in the direction passing through the focal point $F$.
You obtain, therefore, an image that is exactly the small light green tip in figure. The important point, that addresses your question, is that this image is not a virtual image: it is a real image, since it is placed in the plane of convergence of the rays, thus it can be inverted. On the contrary, virtual images, that are formed when the rays outgoing from an optical device always diverge, will always be erected. | {
"domain": "physics.stackexchange",
"id": 53749,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, visible-light, everyday-life, reflection",
"url": null
} |
c++, ai, sfml, connect-four
sf::Text heading("C++ Connect-4", comicSans);
heading.setCharacterSize(40);
heading.setFillColor(cyan);
heading.setOutlineColor(sf::Color::Black);
heading.setOutlineThickness(2.0);
sf::FloatRect headingRectangle = heading.getLocalBounds();
heading.setOrigin(headingRectangle.width / 2.0f,
headingRectangle.height / 2.0f);
heading.setPosition(sf::Vector2f(319.5f, 232.0f));
sf::Text prompt("Choose a Color!", comicSans);
prompt.setCharacterSize(26);
prompt.setFillColor(cyan);
prompt.setOutlineColor(sf::Color::Black);
prompt.setOutlineThickness(2.0);
sf::FloatRect promptRectangle = prompt.getLocalBounds();
prompt.setOrigin(promptRectangle.width / 2.0f,
promptRectangle.height / 2.0f);
prompt.setPosition(sf::Vector2f(319.5f, 283.0f)); | {
"domain": "codereview.stackexchange",
"id": 43479,
"lm_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++, ai, sfml, connect-four",
"url": null
} |
resource-recommendations, soft-question, education
His physics books:
Physics for Entertainment (1913)
Physics Everywhere
Mechanics for entertainment
Astronomy for entertainment
Tricks and Amusements
I want to get all the above books. Because books from author like this cannot be disappointing. But unfortunately not all of them are available. :(
I also read another amazing book How to Solve It: A New Aspect of Mathematical Method by G.Polya. This books actually teaches you how to think.
In the similar lines if you have any book suggestions (with very practical problems & case studies) for physics & Math (Please don't differentiate between math & physics here. If someone can develop interest in one of the subject they will gain interest in other.) please contribute.
Cross Post: https://math.stackexchange.com/questions/10543/books-that-develop-interest-critical-thinking-among-high-school-students I saw that some people wanted to learn physics after they saw | {
"domain": "physics.stackexchange",
"id": 21086,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-recommendations, soft-question, education",
"url": null
} |
python, performance, natural-language-processing
Title: Preprocessing text input to a machine-learning algorithm I have written the following function to preprocess some text data as input to machine learning algorithm. It lowercase, tokenises, removes stop words and lemmatizes, returning a string of space-separated tokens. However, this code runs extremely slowly. What can I do to optimise it?
import os
import re
import csv
import time
import nltk
import string
import pickle
import numpy as np
import pandas as pd
import pyparsing as pp
import matplotlib.pyplot as plt
from sklearn import preprocessing
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import sent_tokenize, word_tokenize
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer | {
"domain": "codereview.stackexchange",
"id": 30912,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, natural-language-processing",
"url": null
} |
image-processing, matlab, estimation, dct
There is a belief that their structure can be better summarized. Indeed, lossless compaction can achieve 2-3 factor ratios, and lossy compression about 8-16 with little perceivable loss.
Most of the present image compression methods (that I know of) are based on some kind of interpolation/extrapolation schemes. The rationale is to predict some samples, and to code the hopefully smaller prediction errors either on less bits (lossless), or with less precision (lossy). Those schemes can be applied either in the original space domain, or in a transformed space: either on fixed bases (Fourier, discrete cosine transforms, wavelets, etc.), on adaptive bases (PCA, NMF, KLT), learnt dictionaries, machine learning or artificial intelligence dabases. | {
"domain": "dsp.stackexchange",
"id": 8766,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, matlab, estimation, dct",
"url": null
} |
quantum-mechanics, quantum-teleportation
Title: Why can't quantum teleportation be used to transport information? Kaku Michio says in an interview that we've teleported photons, cesium atoms and beryllium atoms. Having watched a lot of Kaku as well as way too many astrophysics documentaries in general, I know he's exaggerating. From what I understand, some state of those particles were teleported.
Here's my question: what state exactly is being teleported, and why can't it be used to transfer classical information? How can we know experimentally that a teleportation occured, if the transported information can't be read classically?
Most of the news articles for the general public just throw around the word "state" without explaining the idea (or flat out tell us like Kaku that atoms were teleported), and Wikipedia uses math and terminology that's way over my head. | {
"domain": "physics.stackexchange",
"id": 14130,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-teleportation",
"url": null
} |
government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to$585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over$1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: | {
"domain": "iaex.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924785827002,
"lm_q1q2_score": 0.8261655842103213,
"lm_q2_score": 0.8499711699569787,
"openwebmath_perplexity": 736.3193313327315,
"openwebmath_score": 0.7105481624603271,
"tags": null,
"url": "http://fieu.iaex.pw/primitive-lattice-vectors.html"
} |
electrostatics, electric-fields, potential, capacitance
You can only give the potential of an object if you know what the reference potential is, and can determine the potential difference between the object and the reference.
By telling you the outer cylinder is earthed, they've given you enough information to do that. | {
"domain": "physics.stackexchange",
"id": 64744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, electric-fields, potential, capacitance",
"url": null
} |
c#, performance, animation, circular-list
public static void Main(string[] args)
{
UpdateLoop("Beautiful Lie", Direction.RightToLeft);
}
}
} Your implementation can be greatly improved by using the System.Memory package. This will give you the new Memory<char> type (and if you're using .net-core it's already part of the SDK). With that you can create views of the string without creting any garbage.
At the same time you can make it more LINQ friendly. For this you can create the Slide extension that will return the slices of each part of the string and that accepts a Func for generating the offset for slicing. This one runs infinitely.
public static IEnumerable<(Memory<char> X, Memory<char> Y)> Slide(this string text, Func<int, int> calcOffset)
{
var span = new Memory<char>(text.ToArray());
while (true)
{
var offset = calcOffset(text.Length);
var left = span.Slice(0, offset);
var right = span.Slice(offset, text.Length - offset); | {
"domain": "codereview.stackexchange",
"id": 32126,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, animation, circular-list",
"url": null
} |
material-science
And in an equally hand waving way we expect the equilibrium constant $K$ to be related to a Gibbs free energy change for the adsorption process:
$$ K = e^{-\Delta G/RT} $$
The point of all this is that what matters is the free energy change for a molecule adsorbing on a surface, and for simple molecules where we don't worry too much about changes on rotational or conformational freedom this is dominated by the enthalpy of adsorption.
Which brings us eventually to your question. If your surface is polar, i.e. it is covered in dipolar groups, then it will interact more strongly with dipolar adsorbates than with non-polar adsorbates. So the more polar the molecule the greater the enthalpy of adsorption and the more strongly it will adsorb. If the surface is non-polar then the polarity of the adsorbate will make much less difference.
In the world around us the vast majority of surface are polar, so as a rule of thumb polar molecules will adsorb more strongly than non-polar ones. | {
"domain": "physics.stackexchange",
"id": 28312,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "material-science",
"url": null
} |
thermodynamics, earth, thermal-radiation, atmospheric-science, geophysics
If you want to know more, this introductory explanation by NASA looks good.
In the picture (taken from the NASA website I linked above): satellite map showing the distribution of thermal infrared radiation emitted by Earth in September 2008). | {
"domain": "physics.stackexchange",
"id": 40913,
"lm_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, earth, thermal-radiation, atmospheric-science, geophysics",
"url": null
} |
homework-and-exercises, lagrangian-formalism, gauge-theory, variational-principle, yang-mills
Title: Deriving Yang-Mills Equations On the same spirit of this unanswered question I am proposing this question which I have been trying for some time now. Here I'm working with dimension $n = 4$ (identifying $\mathbb H = \mathbb R^4$) considering the principal $SU(2)$-bundle with $\rho : SU(2) \to GL(2, \mathbb C)$ being the adjoint representation $ad_g (A) = g^{-1} A g$, for all $g \in SU(2)$ and $A \in \mathfrak {su}(2)$. Moreover, the gauge potential is written (in local coordinates) as $\mathcal A = \mathcal A_{\alpha} dx^\alpha$, $\alpha = 1,2,3,4$ and its gauge field strength (curvature) is given by $$\mathcal F = d\mathcal A + \frac{1}{2}[\mathcal A, \mathcal A] = \frac{1}{2} \mathcal F_{\alpha\beta} dx^\alpha \wedge dx^\beta$$ where (after some lengthy calculation) $$\mathcal F_{\alpha\beta} = \partial_\alpha \mathcal A_\beta - \partial_\beta\mathcal A_\alpha + [\mathcal A_\alpha, \mathcal A_\beta]\ \ , \ \ \beta= 1,2,3,4$$ | {
"domain": "physics.stackexchange",
"id": 82371,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, lagrangian-formalism, gauge-theory, variational-principle, yang-mills",
"url": null
} |
weights, gpt-3, instruct-gpt
The paper also says:
On our test set, outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3,
despite having over 100x fewer parameters.
I am not able to understand how the aligned model is a fine tune of GPT-3 using supervised learning (and other steps associated with reinforcement learning) and at the same time the aligned model has fewer parameters than the original model.
Can someone give me a hint on the subject? They say “a pretrained GPT-3” model, emphasis on “a” implying one of many, rather than “the”.
I believe they simply repeat the process with various parameters scales of the pretrained GPT-3, comparing the performance to GPT-3 175B throughout to see if there are parameter efficiency gains.
They note that even the 1.3B instructGPT version outperforms the 175B GPT-3 version. | {
"domain": "ai.stackexchange",
"id": 3684,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "weights, gpt-3, instruct-gpt",
"url": null
} |
c#, programming-challenge
x = (x >> 1) | (x >> 2);
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
x -= (x >> 1) & 0x55555555;
x = ((x >> 2) & 0x33333333) + (x & 0x33333333)
+ ((s >> 2) & 0x33333333) + (s & 0x33333333);
return (((x >> 4) & 0x0f0f0f0f) + (x & 0x0f0f0f0f)) * 0x01010101 >> 24;
} | {
"domain": "codereview.stackexchange",
"id": 37685,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, programming-challenge",
"url": null
} |
quantum-mechanics, education, quantum-interpretations
array of weird phenomena that people were trying to make sense of in the years between 1900 and 1926, while burying or downplaying the single conceptual point that was eventually found to underlie all of those phenomena. | {
"domain": "physics.stackexchange",
"id": 2890,
"lm_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, education, quantum-interpretations",
"url": null
} |
ros, namespace, ros-kinetic, multi-robot
Originally posted by TharushiDeSilva on ROS Answers with karma: 79 on 2019-03-19
Post score: 0
Original comments
Comment by gvdhoorn on 2019-03-19:
Please attach your imaged directly to your question instead of linking to your google drive. I've given you sufficient karma for that.
There are no differences between the two rqt graphs, except for the namespace.
If you look at the first graph, you can see 4 nodes
/keyop
/mobile_base
/mobile_base_nodelet_manager
/diagnostic_aggregator
and 4 topics
/mobile_base_nodelet_manager/bond
/mobile_base/commands/velocity
/mobile_base/commands/motor_power
/diagnostics | {
"domain": "robotics.stackexchange",
"id": 32674,
"lm_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, namespace, ros-kinetic, multi-robot",
"url": null
} |
we obtain $x\approx 0.51003$ and becomes negative when x is greater than this value. Thus, the ODE is valid only when y is less than the root of this equation.
Looking at the ODE again:
$$\frac{d^2 y}{dx^2}+2\left(\frac{dy}{dx}\right)^2+y=0$$
Since y' is squared, then y'' must necessarilly be negative for the LHS to have any chance of being zero.
If y'(0)>0 then the graph slopes upward and concaving downward until y reaches the zero of the radical.
If y'(0)<0 then the graphs slopes downward and concaving downward and becomes more so to balance the square of the derivative.
Attached are two particular solutions with y'(0)>0 and y'(0)<0 respectively.
#### Attached Files:
File size:
5.1 KB
Views:
63
• ###### oden.JPG
File size:
5 KB
Views:
57
Last edited: Mar 21, 2005
12. Mar 21, 2005
### Data
actually, salty, I believe the solution to the exact DE is
$$\frac{dy}{dx} = \pm \sqrt{ ce^{-4y} - \frac{y}{2} + \frac{1}{8}}$$
(note the $ce^{-4y}$ as opposed to $ce^{4y}$) | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750522044461,
"lm_q1q2_score": 0.8332409690016291,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 1437.253831405462,
"openwebmath_score": 0.8629164099693298,
"tags": null,
"url": "https://www.physicsforums.com/threads/please-help-me.67996/"
} |
electric-circuits, electric-current, electrical-resistance
In the case of the circuit with the resistor and wire then nearly all the voltage will be pushing electrons through the resistor and only a tiny bit will be pushing the electrons through the wire. If the resistance of the wire is zero then there would be no voltage pushing electrons through the wire - they would just flow on their own (as electrons flow in a superconductor).
Charge does sometimes pile up, but we call that capacitance, as I am sure you know. I mention it here because there can be 'stray' unintended capacitance (and also inductance) which people need to worry about when they use really high frequency AC circuits in the high RF or microwave region.
So it is possible that charge would build up in front of a resistor, but this would be due to stray capacitance mostly but in answer to your question.... | {
"domain": "physics.stackexchange",
"id": 17347,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, electric-current, electrical-resistance",
"url": null
} |
beginner, matrix, elm
Title: `Maybe` handling in Matrix manipulation in Elm I'd like to learn if my rewrite is worse than the original, less clear or less "idiomatic".
I've found this code that handles updating two dimensional matrixes in Elm:
type alias Matrix a = Array.Array (Array.Array a)
type alias Location = (Int, Int)
get : Location -> Matrix a -> Maybe a
get location m =
Array.get (row location) m `andThen` Array.get (col location)
set : Location -> a -> Matrix a -> Matrix a
set location value m =
update location (always value) m
update : Location -> (a -> a) -> Matrix a -> Matrix a
update location f m =
get location m
|> Maybe.map (
\current ->
Array.get (row location) m
|> Maybe.map (
\oldRow ->
Array.set (col location) (f current) oldRow
|> (\newRow -> Array.set (row location) newRow m)
)
|> Maybe.withDefault m
)
|> Maybe.withDefault m | {
"domain": "codereview.stackexchange",
"id": 19028,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, matrix, elm",
"url": null
} |
After infinite bounces the power vanishes: $$\frac{128}{2 \sqrt{2} - \sqrt{5}} = \frac{128 (2 \sqrt{2} + \sqrt{5})}{13}$$
[MathJax complains about the above align, but I don't see any problems. My network is very flaky right now, so I can't rule out a network hickup.] | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303404461439,
"lm_q1q2_score": 0.8205087870327785,
"lm_q2_score": 0.8289388125473629,
"openwebmath_perplexity": 320.7478530818545,
"openwebmath_score": 0.992348313331604,
"tags": null,
"url": "https://math.stackexchange.com/questions/742824/total-time-a-ball-bounces-for-from-a-height-of-8-feet-and-rebounds-to-a-height-5/742881"
} |
python, json
11025835: === THIS IS NOT JSON and should error
11269569: {"umbrella": 902167, "name": "e4898b9bf79831cf36811917a797ef0fcf3af636", "value": 593180, "payload": "........", "date_stamp": 58736, "time": 1014495, "id": "7ec85fe3aa3c4dd599e23111e7abf5c1"}
11027069: {"umbrella": 990975, "name": "8aa306fb59e275a7e39debb1d5113ff411df22ad", "value": 67842, "payload": "........", "date_stamp": 60161, "time": 225413, "id": "f812d487de244023a6a713e496a8427d"} | {
"domain": "codereview.stackexchange",
"id": 45106,
"lm_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, json",
"url": null
} |
for sufficiently small ${x, y}$, and the inverse operation by ${x^{-1} := -x}$ (one easily verifies that ${R_x(-x) = L_x(-x) = 0}$ for all small ${x}$).
It is tempting to reverse the BCH formula and conclude (the local form of) Lie’s third theorem, that every finite-dimensional Lie algebra is isomorphic to the Lie algebra of some local Lie group, by using (3) to define a smooth local group structure on a neighbourhood of the identity. (See this previous post for a definition of a local Lie group.) The main difficulty in doing so is in verifying that the definition (3) is well-defined (i.e. that ${R_y(x)}$ is always equal to ${L_x(y)}$) and locally associative. The well-definedness issue can be trivially disposed of by using just one of the expressions ${R_y(x)}$ or ${L_x(y)}$ as the definition of ${\ast}$ (though, as we shall see, it will be very convenient to use both of them simultaneously). However, the associativity is not obvious at all. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9933071474906947,
"lm_q1q2_score": 0.8277472746473831,
"lm_q2_score": 0.8333245932423308,
"openwebmath_perplexity": 149.96531194708652,
"openwebmath_score": 0.9581230282783508,
"tags": null,
"url": "https://terrytao.wordpress.com/2011/10/29/associativity-of-the-baker-campbell-hausdorff-formula/"
} |
stim, error-correction
For example, on thousand qubit circuits with millions of measurements, Stim can take a few seconds to produce its reference sample. But then it starts spitting out thousands of circuit samples per second. What it's doing is pretending noiseless runs always produce the reference sample, except it's perturbed by the noise in the circuit. A key thing here is that the distinction between different choices of reference sample is removed by adding a 50/50 Z error after every reset and measurement. The set of noiseless samples forms a group and you sample uniformly from that group via these 50/50 Z errors. | {
"domain": "quantumcomputing.stackexchange",
"id": 5044,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stim, error-correction",
"url": null
} |
c++, performance, primes, reinventing-the-wheel, cryptography
// Number is probably prime
return true;
}
// Function that generates the prime number
BigInt primeGeneration(BigInt prime)
{
BigInt c;
// If the number is even make it odd
if (prime % 2 == BigIntZero)
{
prime = prime + BigIntOne;
}
bool test = isPrime(prime, 40);
// If the number generated is not prime but odd add two to the number and recheck
while (test == false)
{
prime = prime + 2;
std::cout << prime << "\n";
bool test = isPrime(prime, 40);
if (test == true)
{
break;
}
}
return prime;
} | {
"domain": "codereview.stackexchange",
"id": 29608,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, primes, reinventing-the-wheel, cryptography",
"url": null
} |
homework-and-exercises, distance
$$C = 2\pi r$$
Now to calculate the distance the circle has traveled $(D)$ we have to multiply the number of cycles $(n)$ the circle has completed with the circumference of the circle, Thus we get a following formula:
$$D = Cn \rightarrow D=2n\pi r$$
Now to find out what is the distance from $B\rightarrow A`$: We know that Number of cycles $(n)$ is equal to $2.5$ and radius is equal to $r = 1 $, We plug in this parameters into the formula we derived above:
$$B\rightarrow A` = 2 \pi n =5\pi \approx 15.7 $$
We can derive $d$ from Pythagorean theorem:
$$d=\sqrt{(2r)^2+(B\rightarrow A`)^2} \rightarrow d = \sqrt{250.49} \approx 15.8$$
I do not know why your teacher multiplied the radius with the number of cycles to get the distance the circle traveled, Maybe your teacher was trying to calculate something else.
When this circle is rolled point A's trajectory looks like the following image which is called cycloid: | {
"domain": "physics.stackexchange",
"id": 33987,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, distance",
"url": null
} |
control, design, mechanism, joint
Title: What is torque bandwidth in actuated joints and how does it affect the control systems? The rest of my student team and I are in the process of redesigning an exoskeleton and building it based on an existing one. From the papers that we have been reading there are some references to low, high and zero impedance torque bandwith.
What is that? Does it have to do with the control system?
It is measured in Hz. Here is a table from one of the papers: The torque bandwidth is typically referring to the maximum frequency of motion at which the actuator can provide that torque. So your actuator can provide a peak torque of 100 Nm, as in it can hold up a weight of 100 N held at a torque arm of 1 m. If you want to swing that weight back and forth you could do it at up to 4 Hz, but no faster without damaging or overheating the actuator. However, if you reduce the weight to 2 Nm then you can swing it at 20 Hz. | {
"domain": "robotics.stackexchange",
"id": 849,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "control, design, mechanism, joint",
"url": null
} |
I have found that the column matrix of Q would be:
$
\left(
\begin{array}{c}
x + xcos^2 \theta + ysin \theta cos \theta \\
ysin \theta cos \theta + y+xsin^2 \theta
\end{array}
\right)$
But the next part asks me to show that the line joining P to Q makes an angle θ with the x-axis.
2. Hi
You have made a mistake on Q which is actually
$
\left(
\begin{array}{c}
x + xcos^2 \theta + ysin \theta cos \theta \\
xsin \theta cos \theta + y+ysin^2 \theta
\end{array}
\right)$
Then the column matrix of PQ is
$
\left(
\begin{array}{c}
xcos^2 \theta + ysin \theta cos \theta \\
xsin \theta cos \theta +ysin^2 \theta
\end{array}
\right) = (x \cos \theta + y \sin \theta) \left(
\begin{array}{c}
cos \theta \\
sin \theta
\end{array}
\right)$
3. Oh yes, sorry about that. >_<
But I am unsure how the column matrix of PQ proves that it makes an angle of θ? Please could you explain?
4. The column matrix of PQ is | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.987178783470188,
"lm_q1q2_score": 0.8047802170838803,
"lm_q2_score": 0.815232489352,
"openwebmath_perplexity": 598.7265645532776,
"openwebmath_score": 0.9043925404548645,
"tags": null,
"url": "http://mathhelpforum.com/math-topics/85271-transformations-involving-matrices.html"
} |
c++, template-meta-programming
template <>
inline constexpr auto tribonacci<1> = std::int_fast64_t{0};
template <>
inline constexpr auto tribonacci<2> = std::int_fast64_t{1};
auto main() -> int
{
std::cout << tribonacci<0> << '\n';
std::cout << tribonacci<1> << '\n';
std::cout << tribonacci<2> << '\n';
std::cout << tribonacci<3> << '\n';
std::cout << tribonacci<4> << '\n';
std::cout << tribonacci<5> << '\n';
std::cout << tribonacci<6> << '\n';
}
With this, tribonacci<6> is a std::int_fast64_t constant. There are no classes to instantiate or any other cruft. This probably the way you want to go in C++14 and beyond; certainly in C++20 and beyond.
So, no, you can’t drop the static if you’re using the design you currently have. But there are other, better, alternatives in more modern versions of C++.
Now for your actual code review….
template<uint64_t N>
struct tribonacci { | {
"domain": "codereview.stackexchange",
"id": 41408,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, template-meta-programming",
"url": null
} |
enumeration
As for the choice of RAM over TM for enumeration, the polynomial time is usually not affected by this choice, so this does not make a huge difference for complexity classes. However, such a choice is common in enumeration complexity as people are often interested in constant or linear delay, which is more robust on RAM than on TM (see for example, Wojciech Kazana thesis [4] for constant delay or the work of Étienne Grandjean for consideration on the class of linear time solvable problem).
[4] http://www.lsv.ens-cachan.fr/~kazana/PAPERS/Wojciech_Kazana_16Septembre2013_QueryEvaluationWithConstantDelay.pdf
[5] http://www.prism.uvsq.fr/~ystr/these_strozecki | {
"domain": "cstheory.stackexchange",
"id": 3933,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "enumeration",
"url": null
} |
navigation, robot-pose-ekf, transform
Original comments
Comment by lindzey on 2012-06-11:
possibly related question: http://answers.ros.org/question/36232/clear-obstacles-resulting-from-skewed-laserscan/#36256
Comment by Claudio on 2013-03-29:
I'd also worry about all the other max delays being zero. It's impossible to have an average delay of something and a max delay of zero.
But I also notice that all the state_publisher delays are negative.
Are you per chance running the EKF at a faster rate than the state_publisher?
Comment by tfoote on 2013-10-22:
The max delays being zero is an artifact of the initialization of the max at zero. Where all the values are negative.
The delay is a function of transport time, not frequency of publishing. (It's measuring the delta between the published timestamp and the current time of receipt. You probably are getting some form of network hiccup.
Half a second is a large delta and suggests that you might also have some synchronization issues between your computers. | {
"domain": "robotics.stackexchange",
"id": 9442,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, robot-pose-ekf, transform",
"url": null
} |
Question 37 Explanation:
Initial value Q0 Q1 Q2 2Q1+4Q2+Q0 clk 1 0 0 1 1 0 1 0 2 2 1 0 1 5 3 1 1 0 3 4 1 1 1 7 5 0 1 1 6 6 0 0 1 4
So ans is (B) part.
Question 38
Consider the following data path of a simple non-pilelined CPU. The registers A, B, A1, A2, MDR, the bus and the ALU are 8-bit wide. SP and MAR are 16-bit registers. The MUX is of size 8 × (2:1) and the DEMUX is of size 8 × (1:2). Each memory operation takes 2 CPU clock cycles and uses MAR (Memory Address Register) and MDR (Memory Date Register). SP can be decremented locally.
The CPU instruction “push r”, where = A or B, has the specification
M [SP]
How many CPU clock cycles are needed to execute the “push r” instruction?
A 1 B 3 C 4 D 5
Computer Organization and Architecture GATE-CS-2001
Discuss it | {
"domain": "geeksforgeeks.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.962673111584966,
"lm_q1q2_score": 0.8182443945985391,
"lm_q2_score": 0.8499711737573762,
"openwebmath_perplexity": 1730.2345813167385,
"openwebmath_score": 0.4198146164417267,
"tags": null,
"url": "http://quiz.geeksforgeeks.org/gate-cs-2001/"
} |
java, game, community-challenge, pathfinding
// Break ties by pointing toward the goal (use unit dot
// product, not just dot product, because we want to reward
// only direction, not speed.
if (comparison == 0) {
double secondComparison = GridPoint.unitDotProduct(mFromStartToGoal, velocity2) -
GridPoint.unitDotProduct(mFromStartToGoal, velocity1);
if (secondComparison < 0.0) {
comparison = -1;
} else if (secondComparison >= 0.0) {
comparison = 1;
}
}
return comparison;
}
} | {
"domain": "codereview.stackexchange",
"id": 16173,
"lm_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, community-challenge, pathfinding",
"url": null
} |
ros, pcl, ubuntu, ros-electric, pandaboard
make[2]: *** [CMakeFiles/pcl_ros_tf.dir/all] Error 2
make[3]: *** [CMakeFiles/pcl_ros_surface.dir/src/pcl_ros/surface/convex_hull.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [CMakeFiles/pcl_ros_surface.dir/src/pcl_ros/surface/moving_least_squares.o] Error 1
make[3]: Leaving directory /home/panda/ros/perception_pcl/pcl_ros/build' make[2]: *** [CMakeFiles/pcl_ros_surface.dir/all] Error 2 make[3]: *** [src/tools/CMakeFiles/convert_pcd_to_image.dir/convert_pcd_to_image.o] Error 1 make[3]: Leaving directory /home/panda/ros/perception_pcl/pcl_ros/build'
make[2]: *** [src/tools/CMakeFiles/convert_pcd_to_image.dir/all] Error 2
make[2]: Leaving directory /home/panda/ros/perception_pcl/pcl_ros/build' make[1]: *** [all] Error 2 make[1]: Leaving directory /home/panda/ros/perception_pcl/pcl_ros/build'
make: *** [all] Error 2 | {
"domain": "robotics.stackexchange",
"id": 12169,
"lm_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, pcl, ubuntu, ros-electric, pandaboard",
"url": null
} |
ros, installation, rosmake
Continue: (y)es, (n)o: y
Overwriting /home/chengxiang/sim_workspace/.rosinstall
Config changed, remember to run 'rosws update summit-xl-ros-stack' to update the
folder from svn
chengxiang@ubuntu:~$ rosws update summit-xl-ros-stack
[summit-xl-ros-stack] Installing http://summit-xl-ros-stack.googlecode.com
/svn/trunk/summit_xl_sim_fuerte (version None) to /home/chengxiang/sim_workspace
/summit-xl-ros-stack
svn: URL 'http://summit-xl-ros-stack.googlecode.com/svn/trunk
/summit_xl_sim_fuerte' doesn't exist
Exception caught during install: Error processing 'summit-xl-ros-stack' :
[summit- xl-ros-stack] Checkout of http://summit-xl-ros-stack.googlecode.com
/svn/trunk/summit_xl_sim_fuerte version None into /home/chengxiang/sim_workspace
/summit-xl-ros-stack failed. | {
"domain": "robotics.stackexchange",
"id": 11949,
"lm_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, installation, rosmake",
"url": null
} |
### In calculus, summation notation or sigma (σ) represents adding many values together. The “a ” in the above sigma notation is saying that you sum all of the values of “a”. In other words, your’re adding up a series of a values: a 1, a 2, a 3 …a x i is the index of summation. | {
"domain": "netlify.app",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226334351969,
"lm_q1q2_score": 0.8010543483400798,
"lm_q2_score": 0.8198933381139645,
"openwebmath_perplexity": 395.39551297137973,
"openwebmath_score": 0.9918047785758972,
"tags": null,
"url": "https://topbinhxqfznm.netlify.app/cordier67502kyzo/the-index-of-summation-notation-sup.html"
} |
quantum-field-theory, particle-physics, standard-model, fermions, spin-statistics
$$ |\text{2 fermions}\rangle = \int d^3 x_1 d^3 x_2\, \psi(x_1,x_2) a^\dagger(x_1)a^\dagger(x_2)|0\rangle $$
Because the wave function $\psi$ is antisymmetric, only the antisymmetric combination $a^\dagger(x_1)a^\dagger(x_2) - a^\dagger(x_2)a^\dagger(x_1)$ contributes to the state, and in fact, only this combination is nonzero. The sum – the anticommutator – vanishes. That's why the antisymmetry of $\psi$ is "automatic": if there were a non-antisymmetric part of $\psi$, it would vanish in the integral above because the product of the creation operators is antisymmetric.
The same for bosons and "commuting", without the minus sign. | {
"domain": "physics.stackexchange",
"id": 4917,
"lm_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, particle-physics, standard-model, fermions, spin-statistics",
"url": null
} |
c++, gui, qt
namespace Fonts
{
const static QFont serifFont( "Times", 10, QFont::Bold );
const static QFont sansFont( "Helvetica [Cronyx]", 12 );
} // Fonts
namespace SpinBox
{
constexpr static int minimum = -30000;
constexpr static int maximum = 30000;
constexpr static int single_step = 1;
constexpr static int default_value = 0;
} // SpinBox
} // Config
#endif // CONFIG_H
generator.h
#ifndef GENERATOR_H
#define GENERATOR_H
#include <QWidget>
#include <exception>
class QPushButton;
class QLabel;
class QSpinBox;
class QGroupBox;
class QVBoxLayout;
struct BadParameters : std::logic_error
{
using std::logic_error::logic_error;
};
class Generator : public QWidget
{
Q_OBJECT
public:
explicit Generator( QWidget* parent = nullptr );
public slots:
void showNumber();
signals: | {
"domain": "codereview.stackexchange",
"id": 34140,
"lm_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++, gui, qt",
"url": null
} |
php, optimization, object-oriented, validation, unicode
$dataLen = strlen($newData);
if ( $dataLen >= $minimum && $dataLen <= $maximum ) {
$newData = htmlentities($newData, ENT_HTML5 | ENT_QUOTES, "UTF-8");
return $newData;
} else { return false; }
}
} else if ( isset($space) && isset($minimum) && isset($maximum) ) {
if ( $minimum == 0 || $maximum < $minimum ) { return false; }
if ( $space === true ) {
$newData = html_entity_decode($data, ENT_HTML5 | ENT_QUOTES, "UTF-8");
$newData = preg_replace("/[^\p{L}\ ]/u", "", $newData);
$dataLen = strlen($newData);
if ( $dataLen >= $minimum && $dataLen <= $maximum ) {
$newData = htmlentities($newData, ENT_HTML5 | ENT_QUOTES, "UTF-8");
return $newData;
} else { return false; } | {
"domain": "codereview.stackexchange",
"id": 11807,
"lm_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, optimization, object-oriented, validation, unicode",
"url": null
} |
astronomy, big-bang
Title: What's the evidence supporting 1 singular Big Bang?
Possible Duplicate:
What has been proved about the big bang, and what has not? | {
"domain": "physics.stackexchange",
"id": 4116,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy, big-bang",
"url": null
} |
rust
fn range_to_bash_literal(range: RangeInclusive<i64>) -> String {
if range.start() == range.end() {
range.start().to_string()
} else {
format!("{{{}..{}}}", range.start(), range.end())
}
}
lib.rs
use std::ops::RangeInclusive;
/// Generate ranges from integer sequences
///
/// # Examples
///
/// ```
/// use std::ops::RangeInclusive;
/// use ranges::Ranges;
///
/// let sequence: Vec<i64> = vec![1, 2, 3, 6, 7, 9, 9, 9, 11, 20, 21, 22, 24, 23, 22];
/// let target: Vec<RangeInclusive<i64>> = vec![1..=3, 6..=7, 9..=9, 9..=9, 9..=9, 11..=11, 20..=22, 24..=22];
/// let ranges: Vec<RangeInclusive<i64>> = Ranges::from(sequence.into_iter()).collect();
///
/// assert_eq!(ranges, target);
/// ```
#[derive(Debug)]
pub struct Ranges<T>
where
T: Iterator<Item = i64>,
{
numbers: T,
start: Option<i64>,
}
#[derive(Eq, PartialEq)]
enum Order {
Descending,
Ascending,
} | {
"domain": "codereview.stackexchange",
"id": 44704,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rust",
"url": null
} |
ros, python, ros-melodic, tf2, transform
Title: tf2_ros.Buffer.transform() in Python (Tutorial is lacking?)
Situation
I have the following rough TF(2) setup (simpified):
odom -> base_link -> tool_link
where
odom is generated by the diff drive controller from here.
base_link is the "root" of my mobile base (ie it moves around)
tool_link is the tf frame of a tool into which I want to transform coordinates
Now I would like to transform sensor measurements that I receive as PoseStamped messages in the odom frame into the tool_link frame.
What I tried
I followed the Python tutorials until here (writing a tf2 listener in Python). The solution seems to be at the bottom of the page. However, the MessageFilter approach mentioned there only contains an example for C++.
Searching rosanswers brought up this - where the guy just implemented his own filter in python. The answer is also pretty old so Id hope that there is something more recent? | {
"domain": "robotics.stackexchange",
"id": 35977,
"lm_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, python, ros-melodic, tf2, transform",
"url": null
} |
rviz
Following are my questions:
How to delete skeleton points after each callback?
Is there any better way to visualize skeleton in RVIZ?
The if-elif is too long to read. Is there any better way to assign points to Marker keeping the real-time visualisation in mind?
I am using ROS Indigo in Ubuntu 14.04 LTS PC.
Originally posted by ravijoshi on ROS Answers with karma: 1744 on 2017-10-30
Post score: 0
I think this is a perfectly fine way of visualizing a skeleton in RVIZ. I would recommend adding them all into one MarkerArray message, I found it provides a much better refresh than sending individual markers.
As for simplifying your if statements, I think you could use an array to map the numbers to different objects for a slight speedup, but I find your code perfectly readable, you just have a lot of different body parts.
Originally posted by john.j.oneill with karma: 136 on 2017-10-30
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 29225,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rviz",
"url": null
} |
3. If $n$ and $m$ are both even, then either replace all the sines with cosines or vice versa, using $\sin^2 x = 1 - \cos^2x$ or $\cos^2x = 1-\sin^2 x$, and expand. This will leave integrals of the form $$\int \sin^n x\,dx\qquad\text{or}\quad \int \cos^m x\,dx$$ with $n$ and $m$ even positive and even. In that situation, one can use the reduction formulas, which can be obtained by using integration by parts: \begin{align*} \int \sin^n x\,dx &= - \frac{1}{n}\sin^{n-1} x\cos x + \frac{n-1}{n}\int \sin^{n-2}x\,dx,\\ \int \cos^m x\,dx &= \frac{1}{m}\cos^{m-1} x\sin x + \frac{n-1}{n}\int \cos^{n-2}x\,dx. \end{align*} By repeated application of these formulas, one eventually ends up with an integral of the form $\int \,dx$ which can be solved directly. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105342148367,
"lm_q1q2_score": 0.8027119092455175,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 328.01934848602536,
"openwebmath_score": 0.9916679263114929,
"tags": null,
"url": "http://math.stackexchange.com/questions/29980/evaluating-int-p-sin-x-cos-x-textdx/29989"
} |
beginner, kotlin
// neighbor relations
for (gridY in 0 until roomCountY) {
for (gridX in 0 until roomCountX) {
val room = roomGrid[gridX][gridY]
if (gridY > 0)
roomGrid[gridX][gridY - 1]?.let { room?.setNeighbor(Room.SOUTH, it) }
if (gridY < roomCountY - 1)
roomGrid[gridX][gridY + 1]?.let { room?.setNeighbor(Room.NORTH, it) }
if (gridX > 0)
roomGrid[gridX - 1][gridY]?.let { room?.setNeighbor(Room.WEST, it) }
if (gridX < roomCountX - 1)
roomGrid[gridX + 1][gridY]?.let { room?.setNeighbor(Room.EAST, it) }
}
}
}
Even though it works I don't like the look of these:
roomGrid[gridX][gridY + 1]?.let { room?.setNeighbor(Room.NORTH, it) } | {
"domain": "codereview.stackexchange",
"id": 35852,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, kotlin",
"url": null
} |
• Your basis is not exactly correct: $$\pmatrix{x_1 \\ x_2 \\ x_3 \\ x_4} = \pmatrix{x_2-\frac 12x_3+\frac 32x_4 \\ x_2 \\ x_3 \\ x_4} =\ \ ?$$ – user137731 Jul 19 '16 at 20:55
• $x_2 \begin{bmatrix}1\\1\\0\\0\end{bmatrix}, x_3 \begin{bmatrix}-1/2\\1\\0\\0\end{bmatrix}, x_4 \begin{bmatrix}3/2\\0\\1\\0\end{bmatrix}$ – Shammy Jul 19 '16 at 20:58
• Now your first is correct, but the second and third vectors are still wrong. – user137731 Jul 19 '16 at 20:58 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357622402971,
"lm_q1q2_score": 0.8093804093710469,
"lm_q2_score": 0.826711791935942,
"openwebmath_perplexity": 342.7688927228169,
"openwebmath_score": 0.8611876368522644,
"tags": null,
"url": "https://math.stackexchange.com/questions/1864739/find-a-basis-of-nullspacea"
} |
This one fulfills your requirements: $$f(x)=\frac{x^2+x^3}{1+x+x^2}.$$ We have: $$\forall x>0,\ 0<f(x)<x$$ $$f(0)=0,$$ $$f(x)-x^2=-\frac{x^4}{1+x+x^2}$$ so that $f(x)$ and $x^2$ are very close for small values of $x$, and $$f(x)-x=-\frac{x}{1+x+x^2}$$ so that $f(x)$ and $x$ get closer and closer as $x\to+\infty$.
It's also cheap to compute with 2 additions, 2 multiplications and 1 division if you proceed thus:
• Compute $x^2$ (1 mult) and $x+x^2$ (1 addition); set $a=x+x^2$.
• Compute $x\times a$ (1 mult); set $b=x\times a$.
• Compute $1+a$ (1 addition); set $c=1+a$.
• Compute $b/c$ (1 division): that's $f(x)$.
-
the plot looks good. Thank you – bolov Jun 28 '14 at 16:21
You could use a common hyperbola $y = \sqrt{a^2 + x^2} - a$.
Example with $a = 10$: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9697854103128328,
"lm_q1q2_score": 0.8336893612759397,
"lm_q2_score": 0.8596637487122112,
"openwebmath_perplexity": 569.600100859062,
"openwebmath_score": 0.9239223003387451,
"tags": null,
"url": "http://math.stackexchange.com/questions/850493/a-simple-function-equation"
} |
regression, statistics, linear-regression, mathematics
Title: How do you calculate the number coefficients in polynomial regression? So I can't seem to find much on this by searching so I came here. Let's say I had 3 variables $x_1,x_2,x_3$ and the let's say the degree of the polynomial was $d=2$, I can define the length of a vector of variables as $l$ such that $l=3$ in this case. What I'm looking for is the length of a vector of coefficients that would be needed to create a polynomial regression on these variables.
Would I be right in saying that the length of the vectors of coefficients needed for polynomial regression would be $d\times l$? Yes - it is $d\times l$. There would be 6 $β$ coefficients for 2*3:
$β_1x_1 + β_2x_1^2 + β_3x_2 + β_4x_2^2 + β_5x_3 + β_6x_3^2$
That does not include an intercept or any interaction terms. | {
"domain": "datascience.stackexchange",
"id": 9465,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regression, statistics, linear-regression, mathematics",
"url": null
} |
inorganic-chemistry, acid-base, bond
$$\ce{HCl + H2O -> H3O+ + Cl-}$$
Why does this dissociation actually occur scientifically? What causes the $\ce{H}$ to leave its electron behind to the $\ce{Cl}$ and form the hydronium ion? Why does water ($\ce{H2O}$) take the additional $\ce{H}$ ion? What is the general concept here in dissociation? Electronegativity? Water is a polar species in which the oxygen atom in $\ce{H2O}$ has a partial negative charge and the two hydrogen atoms have partial positive charges. As you suggested, this is because oxygen is highly electronegative (i.e. it has a high affinity for electrons) and so the negative electrons tend to have a higher density around the oxygen atom than the hydrogen atoms, creating this separation of charges due to water's molecular structure. Take a look at the molecular structure of water, which can be shown below. It has an asymmetry bent geometry and therefore the charge distribution in water is also not symmetric. | {
"domain": "chemistry.stackexchange",
"id": 12220,
"lm_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, acid-base, bond",
"url": null
} |
javascript, chess
// handle diagonals down and to left
row = queenPosition.row;
column = queenPosition.column;
while (row >= 0 && column < boardSizeX) {
if (remove) {
chessBoardSquares[row][column].dominatedBy--;
} else {
chessBoardSquares[row][column].dominatedBy++;
}
row--;
column++;
}
// handle diagonals up and to right
row = queenPosition.row;
column = queenPosition.column;
while (row < boardSizeY && column >= 0) {
if (remove) {
chessBoardSquares[row][column].dominatedBy--;
} else {
chessBoardSquares[row][column].dominatedBy++;
}
row++;
column--;
}
// update the UI
updateDominatedSquares();
} | {
"domain": "codereview.stackexchange",
"id": 24815,
"lm_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, chess",
"url": null
} |
computability, turing-machines
Title: Can the encodings set of a non-trivial class of languages which contains the empty set be recursively enumerable? Let $C$ be a non-trivial set of recursively enumerable languages ($\emptyset \subsetneq C \subsetneq \mathrm{RE}$) and let $L$ be the set of encodings of Turing machines that recognize some language in $C$: $$L=\{\langle M \rangle \mid L(M) \in C \}$$
Suppose that $\langle M_{loopy}\rangle \in L$, where $M_{loopy}$ is a TM that never halts.
I wonder if it is possible that $L \in \mathrm{RE}$?
By Rice's theorem I know that $L \notin \mathrm{R}$ (the set of recursive languages), so either $L \notin \mathrm{RE}$ or $\overline{L} \notin \mathrm{RE}$. Does it have to be the first option since $M_{loopy} \in L$? No, that is not possible. There is an extended version of Rice's theorem¹ to prove an index set is not recursively enumerable. | {
"domain": "cs.stackexchange",
"id": 283,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, turing-machines",
"url": null
} |
### Increasing Plot3D speed when plotted function is Eigenvalue
This is probably a really simple fix, but I'm fairly new to Mathematica and am not sure how to do this properly. I know that trying to plot eigenvalues directly can be computationally expensive, so ...
41 views
### Character Encoding Method
I want to identify the character encoding of a text imported by Import method by example. I would like something similar to ...
308 views
### Count the sequences in an array
Is there a short and easier way to count number of sequence in a list? Let's say I have three lists: list1 = {0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0} ...
53 views
### Assigning values to variables with subscripts
I'm wondering if there is a way to assign values to variables with subscripts. I have the following Manipulate function: ...
45 views
### Graph, overlapping vertexlabels | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9381240073565739,
"lm_q1q2_score": 0.8150672490574704,
"lm_q2_score": 0.8688267677469952,
"openwebmath_perplexity": 1136.1974917009459,
"openwebmath_score": 0.801531970500946,
"tags": null,
"url": "http://mathematica.stackexchange.com/questions?page=1&sort=newest"
} |
newtonian-mechanics, friction, torque, free-body-diagram
Title: Sum of torques acting on car wheels lets say we have a car parked on a slope and its in balance. There is a torque acting on the wheels pointing down, therefore there needs to be another force which causes a torque pointing up in order to prevent the wheels from rolling. Which force does this job? Static friction on the wheels causes a torque, this torque needs to be reacted upon by something mechanical for the car to remain stationary. This something is the parking brake, or the park pawl which locks the gears when shifting into park (P position).
Static friction is necessary to balance out the component of weight that is along the ramp. Without it, the car would slide downhill, and without the torque reaction the car would roll donwhill. | {
"domain": "physics.stackexchange",
"id": 89205,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, friction, torque, free-body-diagram",
"url": null
} |
have to register or login (See top or bottom of page) before you can post a message or view images: click the appropriate link to proceed. Question is: find the moment of inertia of a 250 g thin ring with radius = 25 cm about an axis parallel to the axis of rotation and located 1. The acceleration a that the block feels is converted to angular acceleration in the pulley, where a = Rfi. Problem on Centre of gravity and Centroid, Moment of Inertia. Presentation Summary : Moments of Inertia Lesson 7. 5mm 20mm 200mm EXERCISE PROBLEMS Q. What you have shown is first moment of area, not second. In this problem, the y axis is 8” from the y centroidal axis and x axis is 6” below the base of the semicircle, this would be usually evident from the problem description. x = any axis parallel to the centroidal axis. In general, moment of inertia is just a measure of how hard it is to get something rotating. b) The wide, flat cylinder will have a higher moment of inertia than the long, thin cylinder. | {
"domain": "everwoodbiocostruzioni.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985271388745168,
"lm_q1q2_score": 0.8432456481315765,
"lm_q2_score": 0.8558511469672594,
"openwebmath_perplexity": 466.01335969356194,
"openwebmath_score": 0.6785146594047546,
"tags": null,
"url": "http://everwoodbiocostruzioni.it/ewic/moment-of-inertia-of-t-section-problems.html"
} |
c++, algorithm, recursion, template, c++20
template< std::size_t unwrap_level,
typename F,
template<class, std::size_t> class Container,
typename T,
std::size_t N>
requires ( std::ranges::input_range<Container<T, N>> &&
requires { typename recursive_array_invoke_result<
unwrap_level - 1,
F,
std::ranges::range_value_t<Container<T, N>>>::type; }) // The rest arguments are ranges
struct recursive_array_invoke_result<unwrap_level, F, Container<T, N>>
{
using type = Container<
typename recursive_array_invoke_result<
unwrap_level - 1,
F,
std::ranges::range_value_t<Container<T, N>>
>::type, N>;
}; | {
"domain": "codereview.stackexchange",
"id": 45483,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm, recursion, template, c++20",
"url": null
} |
complexity-theory, space-complexity
Title: If problem is coNL-complete, is it NL-complete We know from Immerman-Szelepcsényi theorem that $coNL=NL$. But, what about:
If problem is $coNL\text{-}complete$, is it $NL\text{-}complete$? And why? If the language $A$ is $NL$-complete then
$A \in NL$
Each problem in $NL$ is logspace reducible to $A$
Since $coNL = NL$ each problem in $coNL$ is logspace reducible to $A$ as well. Thus $A$ is $coNL$-complete. | {
"domain": "cs.stackexchange",
"id": 9601,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, space-complexity",
"url": null
} |
food-chemistry, taste, astrochemistry
The key aims of the experiment were as follows:-
(i) To determine if conditions of micro-gravity would have an impact on the range of naturally occurring terpene compounds and on the extraction
of key flavour-active compounds in oak wood by Scotch malt distillate.
(ii) To assess the impact of maturation in conditions of micro-gravity on the flavour profile of oak matured distillate.
(iii) To investigate the presence of novel compounds and flavours in model maturation systems for Scotch malt distillate, as a result of conditions
of micro-gravity.
The key findings of the above three aims would then be considered in conjunction with actual maturation conditions on Earth to investigate
techniques for developing novel flavours in Ardbeg Islay Single Malt Scotch Whisky.
In the Results and Discussion section (I do encourage interested parties to jump to the link, and there are several tables and too much information to post here), they note: | {
"domain": "chemistry.stackexchange",
"id": 4108,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "food-chemistry, taste, astrochemistry",
"url": null
} |
c++, image, template, classes, variadic
constexpr std::size_t getDimensionality() const noexcept
{
return size.size();
}
constexpr std::size_t getWidth() const noexcept
{
return size[0];
}
constexpr std::size_t getHeight() const noexcept
{
return size[1];
}
constexpr auto getSize() noexcept
{
return size;
}
std::vector<ElementT> const& getImageData() const noexcept { return image_data; } // expose the internal data | {
"domain": "codereview.stackexchange",
"id": 45280,
"lm_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++, image, template, classes, variadic",
"url": null
} |
ros2
Originally posted by jacobperron with karma: 1870 on 2020-01-17
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by justinberi on 2021-05-25:
Is anyone else experiencing an issue with this? When I ctrl-c the launch bag always dies.
The launch file:
def generate_launch_description():
return LaunchDescription([
ExecuteProcess(cmd=['ros2', 'bag', 'record', '-a'], output='screen', log_cmd=True),
])
On ctrl-c:
[ERROR] [ros2-2]: process has died [pid 40507, exit code 2, cmd 'ros2 bag record -a'].
And the tables in the sqlite database seem corrupt.
Comment by ljaniec on 2022-03-25:
@justinberi I think that better place to ask for it would be a GitHub issue there: https://github.com/ros2/rosbag2 You can prepare your MWE and error description etc. and maybe get answers directly from maintainers | {
"domain": "robotics.stackexchange",
"id": 34271,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
special-relativity, time-dilation
him. For example imagine the life time of a man is for 50,000 beats of the heart.Now with slow down of the heart beat rate it takes a longer time to complete 50,000 beats and thus the life expectancy appears to increase.But remember the most important thing here-from observer to observer and reference frame to reference frame it varies. | {
"domain": "physics.stackexchange",
"id": 25624,
"lm_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, time-dilation",
"url": null
} |
c++, c++17
template<class T, typename CallbackT>
void AddSubscription(
std::string topicName,
CallbackT &&callback);
private:
template<typename T>
std::shared_ptr<Queue<T const>> get(std::string topicName) {
auto base = queues_[topicName];
return std::dynamic_pointer_cast<Queue<T const>>(base);
}
std::vector<std::thread::id> threads_;
std::unordered_map<std::string, std::shared_ptr<QueueBase>> queues_;
};
template<typename T>
TopicStatus Broker::CreateTopic(std::string topicName) {
// check if we already have a topic with that name
if (queues_.find(topicName) == queues_.end()) {
queues_[topicName] = std::make_shared<Queue<T const>>();
return TopicStatus::TOPIC_CREATED;
}
return TopicStatus::TOPIC_EXISTS;
}; | {
"domain": "codereview.stackexchange",
"id": 43619,
"lm_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",
"url": null
} |
solubility
Title: How could you dissolve a coating of CaCO3(s) from a metal plate?
A metal plate has an unwanted coating of $\ce{CaCO3(s)}$. You must find a way to clean this metal plate without causing any scratches or abrasion. How might you dissolve the coating?
I know I should find a substance that will dissolve the coating, and then soak the plate in it. How do I determine an appropriate substance? It might take some time, but I would use vinegar.
The acid in vinegar is strong enough to dissolve the calcium carbonate, but it is not strong enough to dissolve metals (unless the metal reacts with water). | {
"domain": "chemistry.stackexchange",
"id": 12225,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solubility",
"url": null
} |
On the face of it, $\displaystyle 1+2+3+...=-\frac{1}{12}$ is obviously wrong within the context of real numbers only. But the strange thing in physics and the Zeta function and other places is that $\displaystyle -\frac{1}{12}$ just happens to work … every time. Let’s not dismiss this out of hand. It gives our students the wrong idea about mathematics, discovery, and learning.
There’s very clearly SOMETHING going on here. It’s time to explore and learn something deeper. And until then, we can revel in the awe of manipulations that logically shouldn’t work, but somehow they do.
May all of our students feel the awe of mathematical and scientific discovery. And until the connections and understanding are firmly established, I hope we all can embrace the spirit, boldness, and fearless of Euler.
## Base-x Numbers and Infinite Series | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771778588348,
"lm_q1q2_score": 0.848296573183587,
"lm_q2_score": 0.8596637541053281,
"openwebmath_perplexity": 1312.9079984145446,
"openwebmath_score": 0.7208898663520813,
"tags": null,
"url": "https://casmusings.wordpress.com/tag/calculus/"
} |
python, homework, playing-cards, statistics, battle-simulation
def cardChoice(pile):
'''During a war, checks if placeholder is present in last index (meaning the player ran out of cards before putting three down). If present, return last actual card added. If not present, pick from the last three at random.'''
if pile[-1]:
return random.choice(pile[-3:])
else:
return pile[-2]
def replaceCards(deck, pileOne, pileTwo):
'''Shuffles together both players piles and appends them to the bottom of the winners deck.'''
pileOne.extend(pileTwo)
random.shuffle(pileOne)
deck.extend(pileOne)
def playWar():
deck = buildDeck()
battleStat, warStat, doubleWarStat = 0, 0, 0
pileOne, pileTwo, deckOne, deckTwo = [], [], [], []
for i in xrange(26):
deckOne.append(deck.pop())
deckTwo.append(deck.pop())
while deckOne and deckTwo:
del pileOne[:], pileTwo[:]
pileOne.append(deckOne.pop(0))
pileTwo.append(deckTwo.pop(0)) | {
"domain": "codereview.stackexchange",
"id": 13042,
"lm_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, homework, playing-cards, statistics, battle-simulation",
"url": null
} |
rosdep, ros-kinetic
Originally posted by tfoote with karma: 58457 on 2018-06-27
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by tfoote on 2018-06-27:
Duplicate: https://github.com/ros-infrastructure/rosdep/issues/614
Comment by ejalaa12 on 2018-06-27:
Thank you, and sorry again for the double post. Is there no other way of doing so?
Comment by tfoote on 2018-06-27:
Since you're using pip I'd suggest using the pip installer. The best approach for this would be to use the full url in a pip rule. I don't think that's currently fully supported but a patch to extend the pip installer to support that would be appreciated.
Comment by ejalaa12 on 2018-06-28:
See my answer for using a pip rule. What do you mean by not fully supported ? | {
"domain": "robotics.stackexchange",
"id": 31099,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rosdep, ros-kinetic",
"url": null
} |
c++, performance, collections, skip-list
size_t Skiplist::top_level_of_new_node()
// flips a "coin" true / false . As long as the result is true the level gets increased
// the chance to reach a higher level decreases evey time by roughly half
// e.g. level 2 = 50% 3 = 25% etc.
// This is to make sure that on higher levels there are less nodes then on the lower ones
// the count of nodes on each levels should be arround half of the count of nodes on the level before
// if calculated level is bigger than the max level it gets increased
{
size_t new_node_level = 0;
do {
++new_node_level;
if (new_node_level == (top_level + 1)) { //new node can maximum grow by one lvl;
++top_level; | {
"domain": "codereview.stackexchange",
"id": 31226,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, collections, skip-list",
"url": null
} |
java, swing, pong
In addition, I've noticed some bugs in the program, but I cannot seem to find them.
The game has a short but noticeable lag spike.
The ball gets stuck in the paddle, and that causes the score to rapidly increase.
Code Review is not for debugging help on known bugs, so you're on your own for the ball getting stuck in the paddle.
Using the javax.swing.Timer will help fix your lag issue, but may not entirely remove it. To achieve smooth animation, games typically measure the time from one update to the next, and use the duration and the objects' velocities to determine how far objects should move from their locations at the last update period. | {
"domain": "codereview.stackexchange",
"id": 36939,
"lm_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, pong",
"url": null
} |
ros
Dipende: ros-fuerte-visualization-tutorials (= 0.6.3-s1348599593~precise) ma non sta per essere installato
Dipende: ros-fuerte-executive-smach-visualization (= 1.0.2-s1347140656~precise) ma non sta per essere installato
Dipende: ros-fuerte-laser-pipeline (= 1.4.4-s1347170493~precise) ma non sta per essere installato
Dipende: ros-fuerte-robot-model-tutorials (= 0.1.2-s1347123686~precise) ma non sta per essere installato
Dipende: ros-fuerte-common (= 1.8.0-s1347135482~precise) ma non sta per essere installato
Dipende: ros-fuerte-diagnostics (= 1.6.4-s1347135107~precise) ma non sta per essere installato
Dipende: ros-fuerte-navigation (= 1.8.3-s1347171894~precise) ma non sta per essere installato
E: Impossibile correggere i problemi, ci sono pacchetti danneggiati bloccati. | {
"domain": "robotics.stackexchange",
"id": 11469,
"lm_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
} |
decision-trees, theory
$$
2^M
$$
so essentially if all these values have different classes, then the number of leaves should be equal to
$$
if \ R<2^M => R \\
else \ 2^M
$$
A tree which has all possible leaves for M binary variables could at max contain 2^M combinations, think each leaf with written value of a possible combination eg: 0000,0001,0002,...,1110,1111, and these can come only once, because only 1 label can be associated with each leaf
In case a row has multiple labels, for same set of input, the max number of leaves would be equal to unique input combinations in R
A B label
0 1 0 0
1 0 0 1
2 1 1 2
3 1 1 1 | {
"domain": "datascience.stackexchange",
"id": 9742,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "decision-trees, theory",
"url": null
} |
binary-trees, random-walks
Thanks in advance! This answers the version of the question in which the goal is to show that with high probability, $\max |H_i - \frac n 3| \leq C\sqrt{n\ln m}$ for some constant $C$.
Since $|H_{i+1}-H_i| \le 1$, you can use Azuma's inequality (via Doob's martingale) to upper bound the probability of deviation from the mean, and so obtain your required bound, once we show that the expectation of $H_n$ is very close to $\frac{n}{3}$.
To this end, let $X_i$ be a random variable equal to $+1$ with probability $2/3$ and to $-1$ with probability $1/3$, and couple $H_i - H_{i-1}$ to the $X_i$: if $H_{i-1} = 0$ then $H_i = 1$, and otherwise $H_i = H_{i-1} + X_i$. Let $Y_i$ be a random variable equal to $+2$ if $H_{i-1} = 0$ and $X_i = -1$, and equal to $0$ otherwise, so that $H_i = H_{i-1} + X_i + Y_i$. In total, $H_n = \sum_{i=1}^n (X_i + Y_i)$. | {
"domain": "cs.stackexchange",
"id": 13757,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "binary-trees, random-walks",
"url": null
} |
general-relativity, black-holes, spacetime, space-travel
Could an advanced civilization orbiting a black hole position themselves within its gravity well such that they enjoy constant time with their travellers? If we assume everything takes place in the Schwarzschild metric, then the time dilation factor is obtained from the metric as
$$c^2 d\tau^2 = c^2\left(1 - \frac{r_s}{r}\right)^2dt^2 - \left( 1-\frac{r_s}{r}\right)^{-1} dr^2 -r^2 d\theta^2 - r^2\sin^2\theta d\phi^2\ ,$$
where $d\tau$ is proper time interval and $r_s$ is the Schwarzschild radius.
To answer your question we need to make some simplifications. Let's assume the "stay at home" observer is in a circular orbit around the black hole at fixed $r$. In which case for them, using $v_{\rm orb} = rd\phi/dt$ and $dr=d\theta=0$, we obtain
$$ d\tau = \left( 1 - \frac{r_s}{r} - \frac{v_{\rm orb}^2}{c^2}\right)^{1/2}dt = \left(1 - \frac{3r_s}{2r}\right)^{1/2}dt\ . $$ | {
"domain": "physics.stackexchange",
"id": 77631,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, black-holes, spacetime, space-travel",
"url": null
} |
electromagnetism
Title: Two coaxial cones have different voltages, therefore an electric field is in between them. Why does the voltage potential only depend on $\theta$ Sorry if this is a dumb question but in the material I've read, it says that $V$, or the voltage potential, only depends on $\theta$. An example of this is here in Example 6.4
As you go higher up the cone, the distance between the surface increases so shouldn't $V$ be dependent on the radius $r$?
I am no means questioning the material, I just want some kind of a visualization of how it works so I understand it better. The geometry is scale invariant - that is, sending $r\rightarrow\lambda r$ leaves the geometry unchanged. It's also $\phi$-invariant. So the potential can only depend on $\theta$. | {
"domain": "physics.stackexchange",
"id": 92075,
"lm_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",
"url": null
} |
sequence-alignment, ngs, genome, variant-calling
Title: Identifying Indels from Chromatograms I have around 100 chromatograms (.ab1 files) from Sanger sequencing a genome at loci believed to have an indel.
I'm new to interpreting this kind of data in general, but I've read a bit on the general idea—mostly in guides like this. What I'm not able to figure out from the resources I've checked is how to identify insertions and deletions in a chromatogram.
I'm most concerned with heterozygous indels, and these seem to be simpler. (And since my samples are (supposed to be) larger indels that are more rare and more likely to be het, I think.) A heterozygous indel, according to my understanding, would like something like consecutive heterozygous SNPs—overlapping peaks, maybe not with the same height, but with the same horizontal placement—until the end of the sample.
In other words, something like the top track in the open window in this image. | {
"domain": "bioinformatics.stackexchange",
"id": 1062,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sequence-alignment, ngs, genome, variant-calling",
"url": null
} |
gazebo, friction
I can create some actual contact friction, by recreating bearings and such, but that seems overly complication and prone to error.
Thanks
Originally posted by Erik Stoltenborg on Gazebo Answers with karma: 86 on 2012-11-09
Post score: 0
You are correct that we do not currently support joint friction with ODE. I've added this to the gazebo issue tracker as issue #381.
Originally posted by scpeters with karma: 2861 on 2013-01-11
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 2800,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, friction",
"url": null
} |
reinforcement-learning, markov-decision-process, policy-gradients, policy-gradient-theorem
I don't understand how the last line follows from the second to last line. That is how is the following true? $d^\pi(s) = \sum_{k=0}^{\infty}\gamma^{k}Pr(s_0 \rightarrow s, k, \pi)$
where $d^\pi$ is the stationary distribution of the MDP with fixed policy $\pi$ and $Pr(s_0 \rightarrow s, k, \pi)$ is probability of transitioning from state $s_0$ to state $s$ in exactly $k$ timesteps. This sum is not equal to the stationary distribution actually. Rigorously, it should be
$$\sum_{k=0}^\infty \gamma^k \mathrm{Pr}(s_0\rightarrow s,k,\pi)=
\left[(I_n-\gamma P_{\pi})^{-1}\right]_{s_0s}=\mathrm{Pr}_{\pi}(s|s_0)\doteq\rho_\pi(s)$$
which can be called the total discounted state transition probability. Here, $P_\pi$ is the state transition matrix. | {
"domain": "ai.stackexchange",
"id": 3463,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reinforcement-learning, markov-decision-process, policy-gradients, policy-gradient-theorem",
"url": null
} |
Note that $x=\frac{1}{1+p} \text{for some}~ p>0$
which implies $|x^k|=\frac{1}{(1+p)^k} \leq \frac{1}{kp}<\epsilon~ \forall~ k>\frac{1}{p\epsilon}$
• How did you come up with this step $\frac{1}{(1+p)^k} \leq \frac{1}{kp}$. It is not initially obvious to me. – rioneye Oct 17 '13 at 15:46
• The Bernoulli Inequalty says that $(1+p)^k\ge 1+kp$ (if $p\ge -1$). Straightforward induction proof. Or else one can use the Binomial Theorem. – André Nicolas Oct 17 '13 at 16:52 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126500692716,
"lm_q1q2_score": 0.8024399731053107,
"lm_q2_score": 0.8198933293122506,
"openwebmath_perplexity": 112.25927155472439,
"openwebmath_score": 0.9565446376800537,
"tags": null,
"url": "https://math.stackexchange.com/questions/529843/show-that-lim-limits-k-rightarrow-infty-xk-0-for-x-in-0-1"
} |
regular-expressions, parsing
Title: Fully linear time regular expression matching Is there an $O(n+m)$ algorithm to check whether a size $n$ regular expression matches a size $m$ string, assuming a fixed size alphabet if that matters?
The standard NFA algorithm is $O(nm)$ worst case. Groz et al. achieve linear time for a variety of regular expression classes, but not all. Are there any better results?
Groz, B., Maneth, S., & Staworko, S. (2012, May). Deterministic regular expressions in linear time. Groz et al. explicitly state that the best known algorithm for general regular expressions (as of 2012) is $O(nm(\log\log n)/(\log n)^{3/2}+n+m)$, due to Bille and Thorup 2009, doi:10.1007/978-3-642-02927-1_16 (preprint). | {
"domain": "cstheory.stackexchange",
"id": 3328,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-expressions, parsing",
"url": null
} |
python, datetime, curses
def __init__(self):
self.screen = curses.initscr()
curses.noecho()
curses.cbreak()
self.screen.keypad(1)
curses.start_color()
curses.use_default_colors()
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_WHITE, curses.COLOR_RED)
curses.init_pair(3, curses.COLOR_WHITE, curses.COLOR_YELLOW)
curses.curs_set(0)
def close(self):
"""Restore the screen."""
curses.nocbreak()
self.screen.keypad(0)
curses.echo()
curses.endwin()
def _create_clock_face(self):
screen_h, screen_w = self.screen.getmaxyx()
y = 0
self.panels = []
for panel_type in self.PANEL_TYPES:
self.panels.append(panel_type.create_windows(y, screen_w))
y += panel_type.height + panel_type.margin | {
"domain": "codereview.stackexchange",
"id": 15228,
"lm_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, datetime, curses",
"url": null
} |
ros, ros-control, ros-kinetic, controller-manager
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-combined-robot-hw/ros-kinetic-combined-robot-hw_0.13.3-0xenial-20190320-133622-0800_amd64.deb 404 Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-controller-manager-msgs/ros-kinetic-controller-manager-msgs_0.13.3-0xenial-20180824-100448-0800_amd64.deb 404 Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-controller-manager/ros-kinetic-controller-manager_0.13.3-0xenial-20190320-134400-0800_amd64.deb 404 Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-controller-manager-tests/ros-kinetic-controller-manager-tests_0.13.3-0xenial-20190320-153143-0800_amd64.deb 404 Not Found [IP: 64.50.236.52 80] | {
"domain": "robotics.stackexchange",
"id": 33181,
"lm_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-control, ros-kinetic, controller-manager",
"url": null
} |
modulation
But I can't find anywhere about Phase coded modulation.
Would you help me to understand what is the "phase coded modulation" and how does it work with very very simple example for referencing? Phase-coded modulation is another name for direct-sequence spread-spectrum (DS/SS) modulation. In a typical DS/SS communication scheme using binary phase modulation, a single bit is transmitted not as a sinusoidal pulse of duration $T$ and phase either $0$ or $\pi$ depending on whether the bit being transmitted is $0$ or $1$, but rather as a sequence of successive $N$ shorter sinusoidal pulses of duration $T/N$ with phases $0$ or $\pi$ as defined by a specific binary sequence (called a spreading sequence) $\mathbf b$ of length $N$ or its complement $\mathbf{\bar{b}}$ according as the data bit $d$ is $0$ or $1$. For example, with $N=7$, we would have a phase-coded transmission describable as
$$\begin{array}{ccccc} | {
"domain": "dsp.stackexchange",
"id": 5911,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "modulation",
"url": null
} |
general-relativity, visible-light, differential-geometry, reference-frames, camera
$$ \mathbf{e}_x = \frac{B^\hat{\phi}}{\kappa} \mathbf{e}_\hat{r} - \frac{B^\hat{r}}{\kappa} \mathbf{e}_\hat{\phi}, \tag{2} $$
where an arbitrary sign choice was made.
Two orthogonality constraints, one normalization constraint, and another sign choice (that determines the handedness relation between the coordinate systems) determine the three spherical components of $\mathbf{e}_z$. The equations are
\begin{align}
0 & = \mathbf{e}_y \cdot \mathbf{e}_z = B^\hat{r} e_z^\hat{r} + B^\hat{\theta} e_z^\hat{\theta} + B^\hat{\phi} e_z^\hat{\phi} \\
0 & = \mathbf{e}_x \cdot \mathbf{e}_z = \frac{B^\hat{\phi}}{\kappa} e_z^\hat{r} - \frac{B^\hat{r}}{\kappa} e_z^\hat{\phi} \\
1 & = \mathbf{e}_z \cdot \mathbf{e}_z = (e_z^\hat{r})^2 + (e_z^\hat{\theta})^2 + (e_z^\hat{\phi})^2
\end{align}
Solving this system yields
$$ \mathbf{e}_z = \frac{B^\hat{r}B^\hat{\theta}}{\kappa} \mathbf{e}_\hat{r} - \kappa \mathbf{e}_\hat{\theta} + \frac{B^\hat{\theta}B^\hat{\phi}}{\kappa} \mathbf{e}_\hat{\phi}. \tag{3} $$ | {
"domain": "physics.stackexchange",
"id": 24689,
"lm_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, visible-light, differential-geometry, reference-frames, camera",
"url": null
} |
c++, c++17, finance, c++20
displayOrderBook();
}
Now you can create a templated priceMatches() function that checks order.price against topOfBuys or topOfSells, depending on the template argument. And let matchOrders derive otherSide from orderSide, and also let it decide which book to use.
Another way to avoid all the ifs that deal with Sides is to create an array to hold the books and their associated variables:
struct Book
{
std::vector<std::deque<Order>> orders;
int top;
int bottom;
};
std::array<Books, 2> books;
Now consider that you can index books using the template parameter side, like for example:
template <Side orderSide>
void matchOrders(Order &&order)
{
static constexpr Side otherSide = (orderSide == Side::Buy) ? Side::Sell : Side::Buy;
Book& otherBook = books[static_cast<int>(otherSide)];
int& topOfOther = otherBook.top;
int& bottomOfOther = otherBook.bottom;
…
} | {
"domain": "codereview.stackexchange",
"id": 44765,
"lm_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, finance, c++20",
"url": null
} |
c, bitset
{\
assert(index < size * sizeof(type) * 8 && "Bitset index out of range");\
cim_byte_bit_index byte_bit_index = cim_get_##name##_byte_bit_index(size, index);\
bitfield[byte_bit_index.byte] |= 1 << byte_bit_index.bit;\
}
#define CIM_GENERIC_BITSET_CLEAR_BIT_DECL(name, type, size)\
void cim_##name##_bitset_clear(type* bitfield, size_t index);
#define CIM_GENERIC_BITSET_CLEAR_BIT_DEF(name, type, size)\
void cim_##name##_bitset_clear(type* bitfield, size_t index)\
{\
assert(index < size * sizeof(type) * 8 && "Bitset index out of range");\
cim_byte_bit_index byte_bit_index = cim_get_##name##_byte_bit_index(size, index);\
bitfield[byte_bit_index.byte] &= ~(1 << byte_bit_index.bit);\
}
#define CIM_GENERIC_BITSET_CHECK_BIT_DECL(name, type, size)\
bool cim_##name##_bitset_check(type* bitfield, size_t index);
#define CIM_GENERIC_BITSET_CHECK_BIT_DEF(name, type, size)\
bool cim_##name##_bitset_check(type* bitfield, size_t index)\
{\ | {
"domain": "codereview.stackexchange",
"id": 44261,
"lm_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, bitset",
"url": null
} |
Improper Integral of a Function Added Aug 1, 2010 by integralCALC in Education Enter the upper and lower limit and the function and the widget will return the improper integral of the function. As before we say that theimproper integral convergesif the limit lim a!0+ Z 1 a 1 x1=3 dx:exists. INSTRUCTOR AREA. Improper Integrals a generalization of the classical concept of the integral for the case of unbounded functions or functions defined on an infinite interval of integration. These integrals are called improper integrals. A very basic application will be to calculate the escape velocity or finding the the work done in lifting a 3 kilogram object from the surface of the earth to a distance D from the center of the earth? When value of D is not specified. Step 2: Subtract the difference between the areas under the curves. In this section, you will be studying a method of evaluating integrals that fail these requirements—either because their limits of integration are infinite, or | {
"domain": "kangalmalakli.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406026280905,
"lm_q1q2_score": 0.8097589590957879,
"lm_q2_score": 0.817574478416099,
"openwebmath_perplexity": 604.3811915113284,
"openwebmath_score": 0.9631556272506714,
"tags": null,
"url": "http://kangalmalakli.it/fjie/improper-integral.html"
} |
strings, substrings, string-matching
From the perspective of formal language design, what is the correct result of such an operation? Is it defined?
Disclosure: This question was posted at stack overflow but was closed as opinion-based. I was directed to post my question here instead. Given sequences $A = [a_1, \ldots, a_n]$ and $B = [b_1, \ldots, b_m]$, write $A + B = [a_1, \ldots, a_n, b_1, \ldots, b_m]$ for their concatenation. Given a sequence of sequences $C = [C_1, \ldots, C_n]$, write $\Sigma(C) = C_1 + \cdots + C_n$ for their concatenation.
Define a splitting of a sequence $X$ by a sequence $Y$ to be a sequence of sequences $Z = [Z_1, \ldots, Z_k]$ such that $Z_i \neq Y$ and $Z_i \neq []$ for all $i = 1, \ldots, k$, and
$$X = \Sigma [Z_1, Y, Z_2, Y, z_3, \ldots, Y, Z_k].$$
For example, $[[a], [], [b, c]]$ is a splitting of $[a, u, v, u, v, b, c]$ by $[u, v]$. | {
"domain": "cs.stackexchange",
"id": 17498,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, substrings, string-matching",
"url": null
} |
quantum-gate, matrix-representation
$$U=\begin{pmatrix}a&b\\-e^{i\phi}b^*&e^{i\phi} a^*\end{pmatrix}, |a|^2+|b|^2=1.$$
In your case, $a=\frac{i}{\sqrt{2}}$, $b=\frac{1}{\sqrt{2}}$ and $\phi=\pi$. Now, $B$ isn't one of the "popular" quantum gates like the Pauli or the Hadamard, but that doesn't mean it can't be a valid evolution operator! The Hadamard and the Pauli are generally chosen because they have some neat properties; for instance, the Pauli matrices form a basis for all $2\times 2$ Hermitian matrices. For more, read the Wikipedia pages on Hadamard matrix and Pauli matrices. Moreover, note that some gates can be easier to engineer than others; I had written an answer about this before. Also see: Why do we use the standard gate set that we do?. | {
"domain": "quantumcomputing.stackexchange",
"id": 760,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, matrix-representation",
"url": null
} |
density-matrix, photonics
but this is weird as I would expect some kind of state of the form:
$$P\rho P= \frac{1}{2}a^\dagger_V|\varnothing\rangle\langle\varnothing|a_V+\frac{1}{2}|\varnothing\rangle\langle\varnothing|$$
indicating that half of the time the state is in the zero photon state. Is the polarizer as defined correct? If the definition is correct, is the polarizer not unitary (is it measuring the state)? A polarizer is indeed not unitary: consider that many different input states could have the same output state, such as all states $\alpha|H\rangle+\beta|V\rangle\to|H\rangle$, so the transformation cannot be uniquely reversed and thus it is not unitary. | {
"domain": "quantumcomputing.stackexchange",
"id": 5433,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "density-matrix, photonics",
"url": null
} |
mobile-robot, algorithm, particle-filter, probability
As would be expected given the while loop structure, I am getting an error for accessing weight(i), where i exceeds the array dimensions.
To solve this, I was considering circularly shifting my weight array (putting the first index used as the first value in weight, so that I never exceed matrix dimensions). However, I wasn't sure if this would negatively impact the rest of the algorithm, seeing as I'm having trouble understanding the purpose of the U calculation and while loop.
Could anyone help clarify the purpose of U and the while loop, and whether or not a circular shift is an acceptable fix? I misread the text. r should be a random number between 0 and M^-1. Changing this should solve all your problems. | {
"domain": "robotics.stackexchange",
"id": 756,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mobile-robot, algorithm, particle-filter, probability",
"url": null
} |
electrochemistry
Look also for recipes for silver electroplating solutions, as it may be the key to surface quality.
A patent for cyanide-free electroplating solution recipe is:
The formula of non-cyanide silver electroplating solution consists of: Silver Nitrate 40 g/L, Sulfothiorine 230 g/L, sodium sulphite anhydrous 99.3 80 g/L, ammonium acetate 30 g/L, Potassium ethanoate 30 g/L, boric acid 20 g/L, nicotinic acid 1 g/L. The pH value of plating solution is 5-6.
Note that Sulfothiorine is the old good sodium thiosulfate pentahydrate $\ce{Na2S2O3 . 5 H2O}$.
There is many more recipes.
Another option is electrolysis-less plating by chemical silver deposition, many recipes available too. | {
"domain": "chemistry.stackexchange",
"id": 17773,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry",
"url": null
} |
energy, energy-conservation, fluid-statics
So my question is: How can a static force that does not do any work increase the fluids energy?
I understand, of course, that this is not an actual paradox, but I would like for someone to point out where my logic is flawed. An incompressible liquid is never completely incompressible, more like quasi-incompressible.
So when you apply considerable force $F$ on the piston, pressure will wise by say $\Delta p$::
$$\Delta p=\frac{F}{A},$$
where $A$ is the cross-section of the piston (and assuming constant $F$).
But the liquid will have decreased slightly in volume by $\Delta V (\approx 0)$. Although small, if measured the work $W$ done by the force will still correspond to:
$$W=\int_0^{\Delta V}p(V)dV,$$
or expressed in piston displacement $h$ and force $F$:
$$W=\int_0^hF(h)dh.$$ | {
"domain": "physics.stackexchange",
"id": 26529,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy, energy-conservation, fluid-statics",
"url": null
} |
So, we have 1+1+2+2=6 case, which means that r must be 3 (since no other number in the first column or the first row is 3). Sufficient.
Attachment:
Table2.png
Attachment:
Table1.png
Bunuel
Thanks for your nice explanation.
If the statement 2 replaced with $$s+u+w+y=6$$, can we still have the correct answer D?
_________________
“The heights by great men reached and kept were not attained in sudden flight but, they while their companions slept, they were toiling upwards in the night.”
Do you need official questions for Quant?
3700 Unique Official GMAT Quant Questions
------
SEARCH FOR ALL TAGS
GMAT Club Tests
VP
Joined: 23 Feb 2015
Posts: 1262
Re: Each of the letters in the table above represents one of the [#permalink]
### Show Tags
08 Aug 2019, 02:15
Bunuel wrote:
Each of the letters in the table above represents one of the numbers 1, 2, or 3, and each of these numbers occurs exactly once in each row and exactly once in each column. What is the value of r? | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9149009549929797,
"lm_q1q2_score": 0.8226069986812995,
"lm_q2_score": 0.8991213684847575,
"openwebmath_perplexity": 893.8551116658454,
"openwebmath_score": 0.815914511680603,
"tags": null,
"url": "https://gmatclub.com/forum/each-of-the-letters-in-the-table-above-represents-one-of-the-143777.html"
} |
# Choosing a substitution to evaluate $\int \frac{x+3}{\sqrt{x+2}}dx$
Is there any other value you can assign to the substitution variable to solve this integral?
$$\int \frac{x+3}{\sqrt{x+2}}dx$$
Substituting $u = x + 2$: $$du = dx; u +1 = x+3 ,$$ and we get this new integral that we can then split into two different ones: $$\int \frac{u + 1}{\sqrt{u}}du = \int \frac{u}{\sqrt{u}}du + \int \frac{1}{\sqrt{u}}du .$$
We can substitute again $s = \sqrt u$ and get two immediate integrals:
$$s = \sqrt{u}; \quad ds = \frac{1}{2\sqrt{u}}du; \quad 2s^2 =u .$$ Substituting back $u$ to $s$ and $x$ to $u$ we get this result, $$s^2 + \ln{\left | \sqrt{u} \right |} = u + \ln{\left | \sqrt{u} \right |} = x+2+\ln{\left | \sqrt{x+2} \right |},$$ which doesn't look quite to be right. What am I doing wrong? I'm pretty unsure about the second substitution, $2s^2 = u$. Is it correct?
let's make it easier than that!
Use this: $$x + 2 = t^2 ~~~~~~~~~~~ x+3 = t^2 + 1 ~~~~~~~ \text{d}x = 2t\ \text{d}t$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232874658904,
"lm_q1q2_score": 0.8448975569250674,
"lm_q2_score": 0.8596637541053281,
"openwebmath_perplexity": 283.0534016891102,
"openwebmath_score": 0.9637373089790344,
"tags": null,
"url": "https://math.stackexchange.com/questions/1634375/choosing-a-substitution-to-evaluate-int-fracx3-sqrtx2dx"
} |
python, performance, numpy, homework, game-of-life
def square(x, y):
turtle.penup()
turtle.setposition(x,y)
turtle.setheading(0)
turtle.pendown()
turtle.begin_fill()
for i in range(4):
turtle.forward(0.9)
turtle.left(90)
turtle.end_fill()
def draw(m):
turtle.clear()
n_board = len(m)
for i in range(n_board):
for j in range(n_board):
if m[i][j] == 1:
square(j, (n_board - i - 1))
turtle.update()
def main(n_board):
turtle.reset()
turtle.setworldcoordinates(0, 0, n_board, n_board)
turtle.hideturtle()
turtle.speed('fastest')
turtle.tracer(0, 0)
turtle.color('black')
turtle.bgcolor('white')
board=np.zeros((n_board, n_board), int)
for i in range(n_board):
for j in range(n_board):
if random() < 0.5:
board[i][j] = 1
draw(board)
for k in range(100):
update(board)
draw(board) | {
"domain": "codereview.stackexchange",
"id": 35423,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, numpy, homework, game-of-life",
"url": null
} |
reference-request, quantum-computing, application-of-theory
Of course, in actual quantum physics, quantum dynamics is Hamiltonian and not just unitary, but there are still roughly $2^n$ parameters in an arbitrary $n$-way Hamiltonian, and doing this using 2-qubit gates (which have a constant number of parameters each) will require an exponential number of gates. Furthermore, I am fairly sure that the ability to implement arbitrary $n$-way Hamiltonians would still let you construct arbitrary binary functions on $O(n)$ bits.
So the requirement you pose for quantum computers to efficiently simulate arbitrary $n$-way interactions is much too strict. What you need is that quantum computers can efficiently simulate the $n$-way interactions that actually arise in quantum physics. Quantum computers are able to efficiently simulate $k$-local Hamiltonian dynamics for constant $k$, which may be enough to simulate interactions that arise in real quantum physics. | {
"domain": "cstheory.stackexchange",
"id": 1375,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, quantum-computing, application-of-theory",
"url": null
} |
c#
public Guid? ChannelId { get; set; }
}
RecipientType.cs
public enum RecipientType
{
User,
Group
} I don't know better ways to query for principals, so below is some general comments.
if (!(usr is UserPrincipal user) || recipients.Any(m => m.Name == (user.DisplayName ?? user.Name) && m.Type == RecipientType.Group)) continue;
I think m.Type == RecipientType.Group should be m.Type == RecipientType.User
When I run your function I get an InvalidOpeartionException for this filter:
new GroupPrincipal(ctx) {DisplayName = search}
You could consider to extend the function with an argument, that allows the client to specify the context type:
public static IEnumerable<Recipient> Search(string search, ContextType contextType)
The returned Principals from new PrincipalSearcher(principal).FindAll() is of the same type as the argument Principal so you can omit this check:
if (!(grp is GroupPrincipal group)... | {
"domain": "codereview.stackexchange",
"id": 33858,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#",
"url": null
} |
javascript, react.js
for (let shape in movingScreens) {
if (movingScreens[shape].scrolls) {
for (let scroll of movingScreens[shape].scrolls) {
const from = scroll.from * this.scrollMax
const to = scroll.to * this.scrollMax
if (from <= this.scrollTop && to >= this.scrollTop) {
const styles = scroll.styles(
(this.scrollTop - from) / (to - from)
)
for (let style in styles) {
let newStyle = styles[style]
const els = scrollAnimationDefs.movingScreens[shape].els.map(
ref => {
if (ref === 'screen1IfContainer') return this.animations.screen1IfContainer.current.container.current
return this.animations[ref].current
}
)
for (const i in els) {
if (els[i]) {
els[i].style[style] = newStyle
}
}
}
}
}
}
}
} Style and code | {
"domain": "codereview.stackexchange",
"id": 34272,
"lm_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, react.js",
"url": null
} |
A simple solution would be using Coefficient
p = Sum[c[i, j] x^i Exp[I j x], {i, 0, 3}, {j, 0, 3}];
Table[a[i, j] = Coefficient[Coefficient[p, x, i], Exp[I x], j]
, {j, 0, 3}, {i, 0, 3}];
MatrixForm[%]
$\left( \begin{array}{cccc} c(0,0) & c(0,1) & c(0,2) & c(0,3) \\ c(1,0) & c(1,1) & c(1,2) & c(1,3) \\ c(2,0) & c(2,1) & c(2,2) & c(2,3) \\ c(3,0) & c(3,1) & c(3,2) & c(3,3) \\ \end{array} \right)$
General structure
The syntax is applicable for any arbitrary polynomial $\sum_{i,j} x^i y^j$
p = Sum[c[i, j] x^i y^j, {i, 0, 3}, {j, 0, 3}];
var1 = x;
var2 = y;
Table[a[i, j] = Coefficient[Coefficient[p, var1, i], var2, j]
, {j, 0, 3}, {i, 0, 3}];
p = -1/2 Exp[-x] x^3 + 1/2 Exp[-2 x] x^2 + 1/2 Exp[-x] x^2
+ 2 Exp[-2 x] x - 2 Exp[-x] x + Exp[-2 x] - 2 Exp[-x] + 1
var1 = x ;
var2 = Exp[-x] ;
Table[a[i, j] = Coefficient[Coefficient[p, var1, i], var2, j]
, {j, 0, 3}, {i, 0, 3}];
MatrixForm[%] | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9465966717067253,
"lm_q1q2_score": 0.8241044766723211,
"lm_q2_score": 0.8705972684083609,
"openwebmath_perplexity": 2864.497437389468,
"openwebmath_score": 0.28582292795181274,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/83496/extract-coefficient-matrix-a-from-expression-fx"
} |
particle-physics, earth, neutrinos, weak-interaction
Detector:
One of the detectors which is capable of detecting neutrinos today is the Super Kamiokande Neutrino Observatory. The detector is nearly a kilometer below the surface (so that particles which interact with matter get enough chance to do so). The test chamber is made up of steel and is in the shape of a cylinder. An array of super sensitive light detectors (photomultipliers) surround the sides of the test chamber. At the bottom of the test chamber, there are nearly 50,000 tons of water.
The theory behind the detector is that some of the neutrinos that pass through the water interact with matter and produce charged stray particles in the process which travel faster than the speed of light in water (speed of light in water is approximately around $0.75c$; physics works). This shows a phenomenon known as Cherenkov radiation which is similar to the sonic boom in sounds. This light is captured by the detectors and amplified to an extent which is measurable.
Conclusion: | {
"domain": "physics.stackexchange",
"id": 37810,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, earth, neutrinos, weak-interaction",
"url": null
} |
thermodynamics, electric-current
The heat production in a current carrying wire is equal to: $P = I^2 R$.
You can derive this formula as follows. First we assume that the material behaves Ohmic and therefore: $V = I \cdot R$. Further we know that $P = I \cdot V$. Substitute Ohms law into the previous equation to get the formula you are looking for.
Alternative derivation would be more formal using the Poynting vector. You imagine having a wire with a constant current through it. This will give rise to a magnetic field. (Use Ampere's law to find this field). Then also calculate the electric field from using the value of the current and the resistance of the material. (You take Ohms law to calculate the potential difference and from there the electric field). Then you calculate the Poynting vector: $S = E x B/\mu_0$. Integrate this vector field over a closed surface around the wire and you will find $P = I^2 R$. | {
"domain": "physics.stackexchange",
"id": 31565,
"lm_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, electric-current",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.