text stringlengths 1 1.11k | source dict |
|---|---|
Do the same for your final velocity
Your formula for change in velocity is
$$\] $\Delta v=\left| {v_f -v_i } \right|$ \[$$
And your formula for computing average acceleration is
$$a_{avg} =\frac{\Delta v}{t}$$
7. Mar 26, 2005
Gughanath
Thanks. Problem Solved:D | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799441350252,
"lm_q1q2_score": 0.8052222786892751,
"lm_q2_score": 0.8354835391516133,
"openwebmath_perplexity": 1565.5792434454947,
"openwebmath_score": 0.46861547231674194,
"tags": null,
"url": "https://www.physicsforums.com/threads/motion-problem-help.68638/"
} |
general-relativity, special-relativity, newtonian-gravity, equivalence-principle
of the hot gas, because the high kinetic energy of the molecules contributes to the rest energy of the gas, which contributes, through Einstein’s equation, to the rest-mass of the vessel of gas." I agree with tparker that, through the appeal to the equivalence principle, the quoted text implicitly refers to general relativity, not just special relativity. In general relativity pressure contributes to gravitation. | {
"domain": "physics.stackexchange",
"id": 60762,
"lm_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, special-relativity, newtonian-gravity, equivalence-principle",
"url": null
} |
reference-request, graph-theory, graph-algorithms, computability
Title: Turing-complete computation models on graphs There are many Turing complete computation models and new ones are devised all the time. | {
"domain": "cstheory.stackexchange",
"id": 2604,
"lm_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, graph-theory, graph-algorithms, computability",
"url": null
} |
c#, parsing
//Create the necessary List implementation that we need
var explicitList = ParseAsList(val, expectedType, property);
if (expectedType.IsArray)
{
//Convert from list to array if necessary
var arrayType = expectedType.GetElementType().MakeArrayType();
var array = (Array)Activator.CreateInstance(arrayType, new object[] { explicitList.Count });
explicitList.CopyTo(array, 0);
propertyVal.SetValue(target, array);
}
else
{
propertyVal.SetValue(target, explicitList);
}
}
else
{
//Attempt to set it - will error if not compatible and all other checks are bypassed
propertyVal.SetValue(target, val);
}
}
}
return target;
} | {
"domain": "codereview.stackexchange",
"id": 16043,
"lm_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#, parsing",
"url": null
} |
fluid-dynamics, pressure, bernoulli-equation
Title: Pressure Variations in an Atomizer This question has been asked two times
Similar question 1
Similar question 2
Now my question will be different from all those questions, since I will be asking where exactly I am having trouble understanding the working of an atomizer rather than just asking explain the working of atomizer.
While deriving equation of efflux , we take the pressure of liquid to be at the atmospheric pressure i.e $P_2= P_o$
Now when I am applying this logic to an atomizer, I am getting a contradiction : | {
"domain": "physics.stackexchange",
"id": 69970,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, pressure, bernoulli-equation",
"url": null
} |
# Probability of two consecutive heads in 20 throws
What is the probability of getting two consecutive heads in 20 coin tosses?
I found that the expected number of throws to get two consecutive heads is 6, implying the probability of two heads in a row is 1/6. I realize I need to use the idea from this answer, which means having a $3 *3$ Transition Matrix, where:
$A$: We have not had 2 Heads in a row yet
$B$: We have not had 2 Heads in a row yet, but had one Head in the last trial
$C$: We have have 2 Heads in a row
Would this be the required transition matrix: $$\begin{bmatrix}5/6 & 5/6 &0\\1/6 & 0 & 0\\0 & 1/6 & 1\end{bmatrix}$$? And then calculate $M^{20}$ and the value associated with this matrix for the entry (3,1)?
Thank You
• Do you mean for A: "We have not had 2 Heads in a row yet, and the last trial was a Tail"? The way you wrote it, A includes B. – Rory Daulton Sep 12 '15 at 22:48
Three mutually exclusive states are: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105307684549,
"lm_q1q2_score": 0.8093016858639334,
"lm_q2_score": 0.828938806208442,
"openwebmath_perplexity": 638.2905862887507,
"openwebmath_score": 0.9443881511688232,
"tags": null,
"url": "https://math.stackexchange.com/questions/1432793/probability-of-two-consecutive-heads-in-20-throws"
} |
discrete-signals, digital-communications, decomposition, eigendecomposition, svd
\begin{eqnarray}X &=& U_s \Lambda_s V_s^H + U_n \Lambda_n V_n^H \\
&=& \left[ \begin{matrix} U_s & U_n\end{matrix} \right]
\left[ \begin{matrix} \Lambda_s & 0 \\ 0 & \Lambda_n\end{matrix} \right]
\left[ \begin{matrix} V_s^H \\ V_n^H\end{matrix} \right] \\
&=& U_t \Lambda_t V_t^H
\end{eqnarray}
where $U_t$, $\Lambda_t$, $V_t$ represent the total/complete SVD decomposition of $X$. | {
"domain": "dsp.stackexchange",
"id": 10425,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "discrete-signals, digital-communications, decomposition, eigendecomposition, svd",
"url": null
} |
quantum-mechanics, photons, laser, quantum-optics
Title: How does homodyne detection work in quantum optics? Homodyne detection is often cited in publications. I didn't find any good reference that explains what this is. Could you explain the principle and, if possible, the maths of it ?
Moreover, they usually also talk a lot about heralded photon, what does that mean ? Homodyne detection is the extraction of phase information about a laser by comparing it to a reference beam, referred to as a local oscillator (LO). This is accomplished by interfering the beams on a beamsplitter and subtracting the intensity of the two output ports. Intuitively this works because the phase of the LO is known, and we can therefore judge the phase of the other beam from it. | {
"domain": "physics.stackexchange",
"id": 47502,
"lm_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, photons, laser, quantum-optics",
"url": null
} |
x_2=t, for any value t", however it's usually more meaningful to choose a convenient starting value (usually for x_1), and then derive the resulting remaining value(s). An easy and fast tool to find the eigenvalues of a square matrix. Performing steps 6 to 8 with. More: Diagonal matrix Jordan decomposition Matrix exponential. The values of λ that satisfy the equation are the generalized eigenvalues. In general we can write the above matrices as: Our task is to find the eigenvalues λ, and eigenvectors v, such that: We are looking for scalar values λ (numbers, not matrices) that can replace the matrix A in the expression y = Av. Display decimals, number of significant digits: … Example: Find the eigenvalues and eigenvectors of the real symmetric (special case of Hermitian) matrix below. With lambda_1 = 5, equations (4) become: We choose a convenient value x_1 = 1, giving x_2=1. The eigenvalue equation is for the 2X2 matrix, if written as a system of homogeneous equations, will have a | {
"domain": "abroad-tostudy.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806552225684,
"lm_q1q2_score": 0.8039715402273174,
"lm_q2_score": 0.8198933315126792,
"openwebmath_perplexity": 882.8701783520148,
"openwebmath_score": 0.8298553824424744,
"tags": null,
"url": "http://abroad-tostudy.com/ajiqe/91580c-how-to-find-eigenvalues-of-a-2x2-matrix"
} |
gazebo
The bottleneck is most likely not ROS plugins. You can always profile the code using valgrind, or some other tool.
There is not an easy way to speed up simulation without changing the max_step_size. You can try a newer version of Gazebo (version 2 is over two years old).
As an alternative, you could run multiple simulations in parallel.
Originally posted by nkoenig with karma: 7676 on 2016-02-01
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 3858,
"lm_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",
"url": null
} |
The scalar value is added to each entry of `A`.
Create two arrays, `A` and `B`, and add them together.
```A = [1 0; 2 4]; B = [5 9; 2 1]; C = A + B```
```C = 2×2 6 9 4 5 ```
The elements of `A` are added to the corresponding elements of `B`.
Create a 1-by-2 row vector and 3-by-1 column vector and add them.
```a = 1:2; b = (1:3)'; a + b```
```ans = 3×2 2 3 3 4 4 5 ```
The result is a 3-by-2 matrix, where each (i,j) element in the matrix is equal to a`(j) + b(i)`: | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668717616667,
"lm_q1q2_score": 0.804452177417534,
"lm_q2_score": 0.8198933337131076,
"openwebmath_perplexity": 2314.819379059954,
"openwebmath_score": 0.786978006362915,
"tags": null,
"url": "https://nl.mathworks.com/help/matlab/ref/plus.html"
} |
ros, navigation, ros-melodic, action-client, move-base
I could not find any indicator that if the goal is reachable in the status message.
Do you have any idea how to get a notification when the goal is not reachable?
Thanks a lot!!!!
Originally posted by JanOr on ROS Answers with karma: 170 on 2019-07-25
Post score: 0
You might want to modify and compile your own version of NavfnROS.
Clone the navigation stack from github and search for
NavfnROS::getPlanFromPotential
Then look for the snippet below and modify it to publish your feedback!
if(!costmap_->worldToMap(wx, wy, mx, my)){
//publish the feedback from here!
ROS_WARN_THROTTLE(1.0, "The goal sent to the navfn planner is off the global costmap. Planning will always fail to this goal.");
return false;
}
Originally posted by ashutosh08 with karma: 28 on 2019-07-26
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 33512,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, ros-melodic, action-client, move-base",
"url": null
} |
c#, beginner, winforms
protected internal void resetCaloriesButtonClicked (object sender, EventArgs e)
{
manualCalorieEditBox.Value = (decimal)FoodRelated.TotalCaloriesPerDay;
}
protected internal void zeroOutCaloriesButtonClicked (object sender, EventArgs e)
{
manualCalorieEditBox.Value = 0;
}
protected internal void manualSubmitButtonClicked (object sender, EventArgs e)
{
FoodRelated.Calories = (float)manualCalorieEditBox.Value;
Storage.writeRegistry (GlobalVariables.RegistryAppenedValue, GlobalVariables.registryMainValue, false);
Validation.checkCurrentRadioButton (timeRadioButton, calorieRadioButton, caloriesLabel);
} | {
"domain": "codereview.stackexchange",
"id": 11136,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, winforms",
"url": null
} |
aqueous-solution, periodic-trends, electronegativity
Title: Relation Between Degree of Hydration and Electropositivity Why are salts of strongly electropositive elements less heavily hydrated in aqueous solution than the those of less electropositive elements? Shouldn't it be the other way round as the salts of electropositive elements are mostly ionic and hence strongly attracted by water molecules? The degree of hydration in solution does not directly depend on electropositivity. It depends on the ratio of charge to volume. The higher charged and the smaller a fragment is, the more water molecules hydrate it.
Note that almost every salt in solution can be considered as separated ionic pairs. For those that do not seperate, i.e. have a significantly large covalent bonding proportion, you would be looking at the solvation of the non-dissociated ion pair meaning that you can’t properly compare that hydration to simple salts’ hydration. | {
"domain": "chemistry.stackexchange",
"id": 4138,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "aqueous-solution, periodic-trends, electronegativity",
"url": null
} |
graphs, search-algorithms, network-analysis
The problem then becomes, find the shortest path in the graph between two nodes. If the nodes are not in the same connected component, there is no such path.
Output:
The shortest path between S and E, considering the positions of the X nodes, given by a sequence of coordinates.
So in the above picture, a possible route may be the following:
(0,0)->(0,1)->(0,2)->(0,3)->(1,3)->(2,3)->(3,3)->(4,3)->(4,4)
A total of eight steps.
If the Xs occur in a way that prevents any movement (i.e, Xs at (0,1),(1,1), and (1,0), it should return -1 or indicate in some other way no path is possible.)
I have received advice that the A* search algorithm (pseudocode in this link) is relevant to this problem, but I am having difficulty seeing how to apply it. You're asking how to compute the shortest path between two vertices in a graph. Solution: use an algorithm for computing shortest paths. In your case, BFS would be a good choice. There's no need for A*. | {
"domain": "cs.stackexchange",
"id": 13906,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graphs, search-algorithms, network-analysis",
"url": null
} |
object-oriented, design-patterns, typescript, classes
static createShare(name: string, ISIN: string): Share {
const dataPoints = ShareFactory.generateDataPoints(ISIN);
return new Share(name, ISIN, dataPoints);
}
static generateDataPoints(ISIN: string): DataPoint[] {
// how many years the stock exists
const years = faker.number.float({ min: MIN_YEARS, max: MAX_YEARS }); | {
"domain": "codereview.stackexchange",
"id": 45269,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "object-oriented, design-patterns, typescript, classes",
"url": null
} |
8. wayki says:
Correction: "When the diameter is"........12,742km? The observor has curved through thousands of km not less than 1 centremeter you madman.
9. Alex A says:
I can assure you the author is not mad. You, on the other hand, I am not so sure about. You take 1 number from the post, and then completely miss the point of the post (was that deliberate?) and abuse the number in the most absolutely ridiculous way possible to draw a completely wrong conclusion. Then you delude yourself into thinking that is evidence the author is mad???
Your most amusing part is that you seem to suggest that "8 inches a mile" is about correct. You should try applying your same abuse to this number, and you will again assume the author is mad. Trust me, the author is not the madman. | {
"domain": "mathscinotes.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211561049159,
"lm_q1q2_score": 0.80370293243942,
"lm_q2_score": 0.8244619306896955,
"openwebmath_perplexity": 976.3513989086459,
"openwebmath_score": 0.6087819337844849,
"tags": null,
"url": "http://mathscinotes.com/2010/11/straight-level-and-the-curvature-of-the-earth/"
} |
------------------------------------------------------------
1) When revolved about a vertical edge.
Let again vertical edges be x cm each, so the horizontal edges are (30-x) cm each.
r = (30-x), and L=x here.
So, V2 = pi[(30-x)^2](x)
V2 = pi[900 -60x +x^2](x)
V2 = pi[900x -60x^2 +x^3]
Differentiate both sides with respect to x,
dV2/dx = pi[900 -120x +3x^2]
Set that to zero,
0 = 900 -120x +3x^2
Divide both sides by 3,
x^2 -40x +300 = 0
Factor that,
(x-10)(x-30) = 0
x = 10 or 30
When x=30, the horizontal edge (30-x) becomes zero, so no good.
Therefore, x = 10 cm ------vertical edge of the rectangle.
(30-x) = 20 cm -----------horizontal edge rectangle.
Therefore, the rectangle must be 10cm by 20cm. -----answer.
(max V2 = pi(20^2)(10) = 4000pi cu.cm. also, same as max V1)
The net of the generated cylinder?
The same as in V1.
3. Thanx for that mate
4. Hello, mathsB!
I have no idea what a "net" is . . . | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.976310525254243,
"lm_q1q2_score": 0.8071274279871774,
"lm_q2_score": 0.8267117962054048,
"openwebmath_perplexity": 2513.6328683978786,
"openwebmath_score": 0.5956274271011353,
"tags": null,
"url": "http://mathhelpforum.com/math-topics/17860-optimisation-area.html"
} |
c#, tic-tac-toe
The Click event is an EventHandler delegate which has a signature taking arguments object sender and EventArgs e - the EventArgs is useless here, but the sender is the object that fired the click event - and that's your button, which means instead of referring to button1-button9, you can cast the sender to a Button and refer to that local variable now:
private void Button_Click(object sender, EventArgs e)
{
var button = (Button)sender;
button.Text = currentPlayer.ToString();
currentPlayer = currentPlayer == Player.X ? Player.Y : Player.X;
button.Enabled = false;
Check(); // notice PascalCase for method name
}
The Check method is implicitly private - try to be explicit about access modifiers, otherwise it's not clear why every other private method says private, but not that one. | {
"domain": "codereview.stackexchange",
"id": 16755,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, tic-tac-toe",
"url": null
} |
quantum-mechanics, quantum-field-theory, standard-model, gauge-theory
Title: Is the $U(1)$ in the standard model identified with quantum-mechanical phase? I think there's a tension between two claims I've read:
The standard model is Yang-Mills theory with gauge group $SU(3) \times SU(2) \times U(1)$. Here the $U(1)$ factor is data on the same level as the other two factors, and has nothing at all to do with quantum mechanics. For instance, it's present even in the classical theory.
I've heard it claimed that charge conservation corresponds via Noether's theorem to the gauge symmetry of quantum mechanics given by the fact that the overall phase of a quantum mechanical wavefunction can never be measured; only relative phases can be measured. For instance, this is how I interpret the discussion in Connection to gauge invariance section of the Wikipedia article on charge conservation. | {
"domain": "physics.stackexchange",
"id": 59324,
"lm_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-field-theory, standard-model, gauge-theory",
"url": null
} |
quantum-computer
The claim of non-observable macroscopic quantum effects because of P!=NP is based on the following argument: To prove macroscopic quantum effects, we need to compare the physical system with the simulation results of Schrodinger equation. So, if we can't simulate Schrodinger equation efficiently, then we can't prove any quantum effect. As shown in the paper: | {
"domain": "physics.stackexchange",
"id": 12931,
"lm_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-computer",
"url": null
} |
ros, ros-melodic, nodelet, nodelet-manager
Title: A nodelet is blocking another nodelet
Hi, I have a package which contains 2 nodelets and I want to run these 2 nodelets in the same manager. The problem is, I can only run 1 nodelets at a time, when I run both of them only the one which get to run first is executed, the other one give me the following output:
[ INFO] [1634708917.097720708]: Loading nodelet /driver_nodelet of type driver_nodelet/Driver to manager nodelet_manager with the following remappings: | {
"domain": "robotics.stackexchange",
"id": 37035,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, nodelet, nodelet-manager",
"url": null
} |
human-evolution
Note that the Homo Heidelbergensis image is not a picture (obviously) and much of what is being depicted was open to artistic interpretation. It is possible that some of the feature you are thinking of are not real. Have a look at the post In reconstructions, how are various shapes of facial features determined from skull only?.
You list several phenotypic traits and it would be too broad of a question if you were expecting an explanation about the evolution of each of these traits. I will just pick one classic trait; the nose. | {
"domain": "biology.stackexchange",
"id": 8394,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-evolution",
"url": null
} |
python, python-3.x, api
return result
@app.post("/newPoke/{pokemon_name}")
def create_pokemon(pokemon_name: str, pokemon: Pokemon):
if get_poke_by_name(pokemon_name):
raise HTTPException(status_code=status.HTTP_406_NOT_ACCEPTABLE,
detail="Pokemon already exists")
add_poke_to_db(pokemon.name, pokemon.primary_type, pokemon.secondary_type,
pokemon.sum_stats, pokemon.hit_points,
pokemon.attack_strength, pokemon.special_attack_strength,
pokemon.defensive_strength,
pokemon.special_defensive_strength)
raise HTTPException(status_code=status.HTTP_201_CREATED,
detail="Pokemon created successfully")
@app.put("/updatePoke/{pokemon_name}")
def update_pokemon(pokemon_name: str, pokemon: Pokemon):
if not get_poke_by_name(pokemon_name):
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND,
detail="Pokemon not found") | {
"domain": "codereview.stackexchange",
"id": 42046,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, api",
"url": null
} |
javascript, jquery, html
For the style of your code, I would recommend a few points: | {
"domain": "codereview.stackexchange",
"id": 16758,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, html",
"url": null
} |
• @OscarCunningham What a great method man! It solves all the problems of the question extremely simply: your circle will never "hit" 2 points at once, as for that to happen you would have to be along a perpendicular bisector; much less about hitting more than 2 dots simultaneously (e.g. 3 dots), as that wold only occur if your new point were on the intersection of 2 or more bisectors. You just keep growing untill you hit 1007 :). OP, this guy has fully answered your question, and only in three lines! – Just_a_fool Mar 26 '15 at 15:16
• @OscarCunningham, please add that as an answer. This type of (excellent) idea is not meant to be left buried in the comments (or at least I hope not). – rah4927 Mar 26 '15 at 15:26 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731158685837,
"lm_q1q2_score": 0.8042975458354442,
"lm_q2_score": 0.8354835432479661,
"openwebmath_perplexity": 391.2353510215926,
"openwebmath_score": 0.6628557443618774,
"tags": null,
"url": "https://math.stackexchange.com/questions/1207498/given-2015-points-show-that-it-is-possible-to-separate-them-such-that-1007"
} |
python, python-3.x, hangman
Output messages: Code repetition
You've got this in here three times:
print('-----------')
You can instead use only one of these, and place it after the if/else block, and thereby not have to repeat this three times in a row inside the if block (note that I've snipped out all other contents of the if/else block, to shorten this post slightly).
if user_input not in letters_guessed:
....
else:
....
print('-----------')
Use augmented assignment statements.
This is currently in your code in getGuessedWord:
if letter in letters_guessed:
word_guessed = word_guessed + letter
else:
word_guessed = word_guessed + '_ ' | {
"domain": "codereview.stackexchange",
"id": 22382,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, hangman",
"url": null
} |
quantum-field-theory
Title: What is the *quantum* of a field? The particles of nature are the quanta of relativistic quantum fields, from what I've understood.
But what does this mean physically?
Is the electron the quantum of an electron field? In what sense, in practice?
Is there only one electron field in the universe or is there one for each electron? To gain some insight, first consider the quantum harmonic oscillator which has the nice property that states of definite energy have energy
$$E_n = \left(n + \frac{1}{2}\right)\hbar \omega\,,\; n = 0,1,2,... $$
So, it makes sense to identify a quantum of energy as $\hbar \omega$ and then the quantum number $n$ is the number of energy quanta present.
Now, consider the classical field that obeys the wave equation. By separation of variables, we can identify the the modes of the field and find that each mode obeys a harmonic oscillator equation of motion. | {
"domain": "physics.stackexchange",
"id": 20900,
"lm_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",
"url": null
} |
c#, asp.net, event-handling, asp.net-web-api
I am not certain that you could decouple these events, my thinking is that the mail sender should not care about the maintenance of the UnsubscribedFromEmails list/collection, it should only be worried about sending emails, if it is not sending emails to that list, then it shouldn't worry about them.
In the case where you want to send an email to let the user know that they have unsubscribed, it should be a "Mail" object sent to the mail sender. the mail sender should only be worried about sending mail and nothing more. | {
"domain": "codereview.stackexchange",
"id": 31530,
"lm_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#, asp.net, event-handling, asp.net-web-api",
"url": null
} |
equilibrium, phase
A glass filled with water
A bottle of water after you poured half of the water out and recapped it.
A zip lock bag filled with water (no air).
Humid air in a zip-lock bag.
According to Wikipedia,
[...]chemical equilibrium is the state in which both reactants and products are present in concentrations which have no further tendency to change with time, so that there is no observable change in the properties of the system. Usually, this state results when the forward reaction proceeds at the same rate as the reverse reaction. The reaction rates of the forward and backward reactions are generally not zero, but equal. | {
"domain": "chemistry.stackexchange",
"id": 11542,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "equilibrium, phase",
"url": null
} |
# The definition of locally Lipschitz
I am given this definition:
A function $f:A\subset\mathbb R^n\to\mathbb R^m$ is locally Lipschitz if for each $x_0\in A$, there exist constants $M>0$ and $\delta_0 >0$ such that $||x-x_0||<\delta_0\implies||f(x)-f(x_0)||\leq M||x-x_0||$.
Source: Marsden's Elementary Classical Analysis; note that the scan below is from an old edition of the textbook; in the latest edition, the last sentence has been changed to read "This is called the local Lipschitz property."
1) Is the correct inequality $M\geq 0$ or $M>0$?
2) Does $M$ depend on $x_0$, just like $\delta_0$ does?
EDIT: After pondering further, I've revised the definition to this:
A function $f:A\subset\mathbb R^n\to\mathbb R^m$ is locally Lipschitz at $x_0\in A$ if there exist constants $\delta >0$ and $M\in \mathbb R$ such that $||x-x_0||<\delta\implies||f(x)-f(x_0)||\leq M||x-x_0||$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126525529014,
"lm_q1q2_score": 0.8024399772952095,
"lm_q2_score": 0.8198933315126792,
"openwebmath_perplexity": 154.45249274517133,
"openwebmath_score": 0.9227677583694458,
"tags": null,
"url": "https://math.stackexchange.com/questions/518323/the-definition-of-locally-lipschitz"
} |
audio, sound, stereo-signal
What is really going on? Is this phenomenon a mistake from the video uploader or could it be an intended effect? The 2 stereo channel might be out of phase (near opposites, thus cancelling each other out when mixed to mono).
The human ear-brain doesn't just sum stereo left-right to the 2 ears, but instead uses any phase differences to help determine directionality. | {
"domain": "dsp.stackexchange",
"id": 5515,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "audio, sound, stereo-signal",
"url": null
} |
ros, namespaces, ros-indigo, topics
I tried to link a screenshot that showed my rviz settings, but I don't know why I did it wrong... so I am going to describe it with more details:
"svo" is a node which publishes in the topics "/svo/points" and "/svo/keyframes".
I have 2 Markers to visualize these 2 topics in rviz, one for "/svo/points" and the other for "/svo/keyframes". Both of them, in their rviz Marker, have a dropdown field called 'Namespaces', with 2 options each.
For example, in "/svo/points" appear namespace 'pts' (for points on the map) and namespace 'trajectory' (por points that recover the camera path).
According to your reply, both ('pts' and 'trajectory') are published with same message format in "/svo/points" topic. Okey, I understand it. But when I execute rostopic echo command with this topic, the bash only displays info about points regardindg to 'trajectory' namespace.
So, my doubts are | {
"domain": "robotics.stackexchange",
"id": 33638,
"lm_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, namespaces, ros-indigo, topics",
"url": null
} |
c#, asp.net-web-api
protected override System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
AuthenticationHeaderValue authValue = request.Headers.Authorization;
if (authValue != null && !String.IsNullOrWhiteSpace(authValue.Parameter))
{
string username = null;
string password = null;
string toSplit = Encoding.UTF8.GetString(Convert.FromBase64String(authValue.Parameter));
int index;
if ((index = toSplit.IndexOf(":")) != -1)//verifies that they included at least the : between the username and password
{
username = toSplit.Substring(0, index);
password = toSplit.Substring(index + 1);
}
//makes sure that there IS some semblance of a username and password. Blanks aren't allowed.
if ( !string.IsNullOrWhiteSpace(username) && !string.IsNullOrWhiteSpace(password))
{ | {
"domain": "codereview.stackexchange",
"id": 26850,
"lm_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#, asp.net-web-api",
"url": null
} |
beginner, csv, rust
The processing is clearly laid out, in order:
I convert each element of the iterator, in turn, into an iterator of &str via String::split()
I then truncate this iterator to only take the first two elements lazily
Each element of this iterator gets parsed() and I filter any element that isn't okay, unwrapping those that are
This iterator gets collected into a Vec<f32>
From there, I filter out any element that does not have exactly 2 components, and convert those that do into a tuple2 of (f32, f32)
I then unzip this iterator of (f32, f32) into a (Vec<f32>, Vec<f32>) to fit your type signature | {
"domain": "codereview.stackexchange",
"id": 36326,
"lm_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, csv, rust",
"url": null
} |
javascript, timer
// Increment session length. If in session, and timer paused, reset clock to new length.
function incrementSessionLength(increment) {
setSessionLength(sessionLength + increment);
if (timerPaused && !onBreak) {
setClockTime(sessionLength);
}
}
/*
Update View Function
*/
var notify = (function() {
var prevBreakLength;
var prevSessionLength;
return function() {
// Just always update clock.
document.getElementById('timer').innerHTML = formatClockDisplay();
document.getElementById('title').innerHTML = onBreak ? 'Break' : 'Session';
document.getElementById('fill').style.backgroundColor = onBreak ? 'red' : 'green';
document.getElementById('fill').style.height = fillHeight();
// Update Break Length
if (prevBreakLength !== breakLength) {
document.getElementById('break-length').innerHTML = breakLength / 60;
prevBreakLength = breakLength;
} | {
"domain": "codereview.stackexchange",
"id": 16406,
"lm_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, timer",
"url": null
} |
qiskit, vqe
eval_time = time() - start_time
result = VQEResult()
result.optimal_point = opt_result.x
result.optimal_parameters = dict(zip(self.ansatz.parameters, opt_result.x))
result.optimal_value = opt_result.fun
result.cost_function_evals = opt_result.nfev
https://github.com/Qiskit/qiskit-terra/blob/dd7f9390cf076f9545fa6086de486f2c06764ea5/qiskit/algorithms/minimum_eigen_solvers/vqe.py#L546-L556 | {
"domain": "quantumcomputing.stackexchange",
"id": 4396,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "qiskit, vqe",
"url": null
} |
ros
Comment by Mark Rose on 2016-08-09:
Stupid question, probably, but have you started roscore and the stereo processing node first? (I haven't yet used dynamic reconfiguration, but it looks like rqt_configure just looks at the current node graph to determine what to show in its GUI.)
Comment by Mark Rose on 2016-08-09:
Also, you don't have to run rqt_configure, probably. Instead, set parameters in your launch file, then kill, edit, and restart to try different parameters. More of a pain, of course. | {
"domain": "robotics.stackexchange",
"id": 25310,
"lm_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
} |
kinematics, singularities
Title: Non-uniform deceleration model I encounterd a brake model for an ERTMS system (E=Europe) with the following characteristics.
A point starts a decelerating proces at $t=0$ when $v=c$ but first there is a reaction time $T$ during which the point moves with constant velocity a distance of $vT$. Then the point starts a constant deceleration with $a=p$ until velocity$=0$ and moves during $t=v/a$ an extra distance of $v^2/2a$.
So this is a simple model with uniform motion followed by uniform deceleration.
Total braking time $=T+v/p$.
Total braking distance $=vT+v^2/p$.
Now the braking model I encounted uses this equation of motion: $$dx = \frac{v + pT}{p} dv $$
with the result that the motion becomes a non-uniform deceleration:
$$a=\frac{dv}{dt} = \frac{p}{v + pT} \frac{dx}{dt} = \frac{pv}{v+pT}$$
This model has the same total braking distance as the simple model.
However in this model when $v\rightarrow0$ $a\rightarrow0$ which results in a singularity. | {
"domain": "physics.stackexchange",
"id": 83988,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, singularities",
"url": null
} |
matlab, noise, filtering
Title: How to reconstruct the signal if there were some temporary offsets I am not a signal processing expert. I have data like this:
where the red is what I have and the black is what I want to have. Any idea how to reconstruct this? The code for generating the data is here:
close all
Ndata = 1000;
X = nan(Ndata,1);
sigma = 0.5;
Y(1) = 50;
offset = 0;
for i =2:Ndata
% consumption
X(i,1) = -0.8*rand;
if rand<0.01 % supply
X(i,2) = 50;
end
if rand<0.5 % offset change
if abs(offset)==0
offset = exprnd(50)*(randi(2)*2-3);
else
offset = 0;
end
end
X(i,3) = offset ;
% noise
X(i,4) = sigma*randn;
Y(i) = Y(i-1)+sum(X(i,1:2));
Z(i) = Y(i)+sum(X(i,3:4));
end
plot(Z,'r')
hold on
plot(Y) | {
"domain": "dsp.stackexchange",
"id": 3053,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, noise, filtering",
"url": null
} |
library(emmeans)
model <- lm(y ~ intensity + treatment + intensity:treatment, data = exdat)
summary(model)
emt <- emtrends(model, ~ treatment, var = 'intensity', at = list(treatment = c('trtA', 'trtB')))
contrast(emt, 'pairwise')
In this case because there are only two treatments other than the "none" treatment, the contrast gives us the same t-ratio and p-value as we get from looking at the interaction coefficient in the model summary:
contrast estimate SE df t.ratio p.value
trtA - trtB -0.203 0.079 27 -2.567 0.0161
• Yes, I believe this yields a correct analysis. Mar 2 at 20:47
The "None" group sounds like a control group.
Thus, you would have something like the following:
Control
Treatment 1 at intensity levels $$1, 2, 3, 4, 5,\dots$$
Treatment 2 at intensity levels $$1, 2, 3, 4, 5,\dots$$
Treatment 3 at intensity levels $$1, 2, 3, 4, 5,\dots$$
$$\vdots$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475746920261,
"lm_q1q2_score": 0.8324361832853153,
"lm_q2_score": 0.8824278618165526,
"openwebmath_perplexity": 6908.528824306564,
"openwebmath_score": 0.46185579895973206,
"tags": null,
"url": "https://stats.stackexchange.com/questions/566246/ancova-with-common-zero-level"
} |
ros, ros-kinetic, ar-track-alvar, ar-kinect, transform
Thanks for anyone helping me out!
Cheers,
Simone.
Originally posted by simff on ROS Answers with karma: 98 on 2018-02-27
Post score: 1
Original comments
Comment by tuandl on 2018-02-27:
Since you already have a transform from your markers to camera_link, have you tried to apply a rotation with respect to camera_link in your marker's frame?
Comment by simff on 2018-02-27:
Hi @tuandl thanks for the comment! Not yet, I do not know the way to code it, I am new to ROS and tf, How would you to that? Can you append here a simple code snippet or code steps I have to take?
I appreciate your help!
This is a basic tf tutorial
You want to do something like
try{
listener.lookupTransform("camera_link", "ar_marker",ros::Time(0), transform);
}
Follow the tutorial to get the marker's positions.
Originally posted by tuandl with karma: 358 on 2018-02-27
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 30157,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic, ar-track-alvar, ar-kinect, transform",
"url": null
} |
causality
Although action and reaction labels are often used in the context of Newton’s 3rd law, the fact is that the mathematics does not distinguish in any way between the two. There is no physical distinction between action and reaction forces.
Instead, you should simply think of forces as coming in pairs according to the third law. The two forces are equal and opposite sides of the same interaction between two systems, but there is no action and reaction designation.
Furthermore, the two forces in a 3rd law pair must always be simultaneous. If it were not so then momentum would not be conserved as the momentum of one system would change while the momentum of the other system would not change for some brief duration. | {
"domain": "physics.stackexchange",
"id": 87879,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "causality",
"url": null
} |
python, neural-network, machine-learning-model
#IMPORT DATA
#Matrix x of features
X = df.iloc[:, 0:7].values
#Dependent variable
y = df.iloc[:, 7].values
#Encoding Independent Variable
#Need a label encoder for every categorical variable
#Converts categorical into number - set correct index of column
#Encode "UserName"
labelencoder_X_1 = LabelEncoder()
X[:, 0] = labelencoder_X_1.fit_transform(X[:, 0])
#Encode "Token"
labelencoder_X_2 = LabelEncoder()
X[:, 1] = labelencoder_X_2.fit_transform(X[:, 1])
#Encode "ChildEXE"
labelencoder_X_3 = LabelEncoder()
X[:, 3] = labelencoder_X_3.fit_transform(X[:, 3])
#Encode "ParentEXE"
labelencoder_X_4 = LabelEncoder()
X[:, 4] = labelencoder_X_4.fit_transform(X[:, 4])
#Encode "ChildFilePath"
labelencoder_X_5 = LabelEncoder()
X[:, 5] = labelencoder_X_5.fit_transform(X[:, 5])
#Encode "ParentFilePath"
labelencoder_X_6 = LabelEncoder()
X[:, 6] = labelencoder_X_6.fit_transform(X[:, 6]) | {
"domain": "datascience.stackexchange",
"id": 5529,
"lm_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, neural-network, machine-learning-model",
"url": null
} |
general-relativity, coordinate-systems, time, definition, observers
Title: What is meant by coordinate time? Isn't it time measured on a clock? If not then what does it measure? In this question-
Is proper time equal to the Invariant Interval or the time elapsed in the Rest Frame?
@Dale in the comments says-
no $dt$ is never physical time. It is always coordinate time. The equation $d\tau=dt’$ needs to be interpreted carefully. It is not a general fact, but instead it is only true along the worldline of the clock and only in the (primed) rest frame of said clock. But even then, the physical time is $d\tau$ and the coordinate time $dt’$ is designed to match it. That is what makes the primed coordinates the rest frame of the clock [...] | {
"domain": "physics.stackexchange",
"id": 74367,
"lm_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, coordinate-systems, time, definition, observers",
"url": null
} |
virology, epidemiology, sterilisation
To my knowledge most alcohol-based hand sanitizers use ethanol. In clinical settings sometimes isopropanol is also used.
Question: How exactly do alcohols, especially ethanol and isopropanol provide some disinfecting action against viruses? Are the virus particles simply dissolved? What happens? Alcohols dissolve lipid bilayers
Many viruses have an outer lipid bilayer. Ethanol lyses cells, and in the same fashion damages membrane-bound viruses by rupturing the bilayer (which is made of ethanol-soluble lipids).
Alcohols misfold the protein coats of viruses
Additionally, alcohols denature proteins, which misfold in non-aqueous conditions. Some viral surface proteins are important for adhesion and attachment, and misfolding these renders the virus inactive. The total breakdown of viruses is essentially due to the misfolding of their protein coat (the capsid).
The same goes for bacteria
With the additional effect of dehydrating cells | {
"domain": "biology.stackexchange",
"id": 10303,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "virology, epidemiology, sterilisation",
"url": null
} |
human-biology, neuroscience, pharmacology
Yes - usually through a reduced expression of receptors on the surface. Increasing the drug dosage merely increases the probability that one of the molecules will find the receptor. Chronic exposure of increasingly large doses can dramatically reduce receptor expression. In time, sans the drug, the receptor count will climb back up.
This is why a common cause of chronic drug addicts who have just gone through rehab is overdose: After months in rehab or free of a drug they immediately go back to the amount of drug they were doing before rehab - with some severe side-effects at the least, death at the worst.
Does over-stimulation of a neural pathway (through the use of a drug or other stimuli that up-regulates a given neurotransmitter) shorten the half-life of the neurotransmitters it uses? | {
"domain": "biology.stackexchange",
"id": 2525,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "human-biology, neuroscience, pharmacology",
"url": null
} |
electromagnetism, magnetic-fields, history
I'm not sure if this is the right stackexchange to ask this question but i haven't found a "gas display detection and measuring devices" stackexchange so physics seems like a somewhat reasonable place to ask.
I've found something looking like a chandelier i'm supposed to sell online on my job and i have no idea what it is used for, all i can gather is that there are three compasses that function and that can be locked in place with a small lever. the outside of the wooden box says:
"Hermann Sewerin
Vorm. Vulkan-Werk GMBH
Gaspatex(R)
Gütersloh i. Wf.
Gas-Anzeige-Spür- und Messgeräte"
Meaning gas display detection and measuring devices from a german manufacturer of such devices.
Thanks for any help, or for pointing me in the right direction to ask. that thing indicates the magnetic field strength emanating from a tube carrying a current of electricity through the hole in the center of the device. it is an antique and hasn't been used for this purpose for probably 75 years. | {
"domain": "physics.stackexchange",
"id": 97875,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, magnetic-fields, history",
"url": null
} |
ros
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
I found the above instruction from this website:
https://github.com/MST-Robotics/MST_ROS_Catkin_Packages/wiki/New-Member-Tutorials
Originally posted by urthkakao with karma: 108 on 2014-01-30
This answer was ACCEPTED on the original site
Post score: 7
Original comments
Comment by Will Chamberlain on 2016-11-06:
or
catkin_make & source devel/setup.sh
or even set up an alias for that e.g. in your ~/.bashrc
alias catkin_make_and_source='catkin_make & source devel/setup.sh' | {
"domain": "robotics.stackexchange",
"id": 16647,
"lm_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
} |
photons, entropy, boundary-conditions
I compute: $I \leqslant 4.6\times10^7 bits/eV m \cdot R \cdot E$
I chose these units because they are convenient for dealing with photons. In particular, I wish to consider a 1 m sphere containing a single 3 MHz photon, which has an energy of $1.24\times10^{-8} eV$. This gives the Bekenstein bound of $I <= 0.57 bits$.
However, we know that photon has spin angular momentum, which requires at least 1 full bit to describe. Therefore, it would seem that this space is not sufficient to contain the photon? According to Bekenstein, we need at least a 2 m sphere to hold this photon?
Possible Resolutions | {
"domain": "physics.stackexchange",
"id": 71881,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "photons, entropy, boundary-conditions",
"url": null
} |
vba, excel
Set FoundCell = srcWS.Range("A:A").Find(What:=Unique_Identifier)
If Not FoundCell Is Nothing Then
Row = FoundCell.Row
'Deposit account/loan account (post closing) (Cell B5)
If Wire_Type = "Deposit/Loan" Then
destWS.Range("A222:A243").EntireRow.Hidden = False
destWS.Range("A267:A299").EntireRow.Hidden = False
destWS.Range("A244:A266").EntireRow.Hidden = True
destWS.Range("B206") = srcWS.Cells(Row, 5) 'CIF NUmber
'destWS.Range("B507") = srcWS.Cells(Row, 6) 'Name
'destWS.Range("B508") = srcWS.Cells(Row, 7) 'Address
'destWS.Range("B509") = srcWS.Cells(Row, 8) 'City State Zip
'destWS.Range("B510") = srcWS.Cells(Row, 9) 'Telephone Number
destWS.Range("B216") = srcWS.Cells(Row, 15) 'Customer Account Number
destWS.Range("B217") = srcWS.Cells(Row, 16) 'Account Number to Fund Wire | {
"domain": "codereview.stackexchange",
"id": 37442,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
optics, lenses
\Psi(k_x,k_y)&=\frac{1}{2\pi}\int_{\mathbb{R}^2} \exp\left(-i \left(k_x u + k_y v\right)\right)\,\psi(x,y,0)\,{\rm d} u\, {\rm d} v\end{align}\tag{2}$$
Now witness that a beam $\psi(x,y,0)$ with Gaussian dependence on $x$ and $y$ becomes, under the Fresnel diffraction integral, $\psi(x,y,z)$ with Gaussian dependence on $x$ and $y$. The Fourier transform of a Gaussian is a Gaussian, a fact which does not change when we multiply by the $\exp\left(i \frac{k_z^2+k_y^2}{2\,k} z\right)$ kernel in the Fresnel diffraction integral, and of course a Gaussian is recovered by the inverse Fourier transform.
Furthermore, thin lenses can be thought of simply as phase masks, i.e. a field whose transverse variation is $\psi(x,y)$ passing through them is transformed by:
$$\psi(x,y)\to \exp\left(-i\,k\,\frac{(x-x_0)^2+(y-y_0)^2}{2\,f}\right)\psi(x,y)\tag{3}$$
So the Gaussian form is preserved by all the diffraction and lensing operations. | {
"domain": "physics.stackexchange",
"id": 11038,
"lm_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, lenses",
"url": null
} |
ros-kinetic, laserscan
Title: Explanation on sensor_msgs/LaserScan and time
Hi everyone !
I am currently working on LaserScan messages and I don't quite understand how time related attributes should be filled.
If I look at the documentation :
Header header # timestamp in the header is the acquisition time of
# the first ray in the scan.
#
# in frame frame_id, angles are measured around
# the positive Z axis (counterclockwise, if Z is up)
# with zero angle being forward along the x axis
float32 angle_min # start angle of the scan [rad]
float32 angle_max # end angle of the scan [rad]
float32 angle_increment # angular distance between measurements [rad] | {
"domain": "robotics.stackexchange",
"id": 30836,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-kinetic, laserscan",
"url": null
} |
java, swing
Useless, just drop it.
if(switch1state == false)
{
if((e.getX() >= OFFBUTTONLEFT && e.getX() <= OFFBUTTONRIGHT) && (e.getY() >= OFFBUTTONTOP && e.getY() <= OFFBUTTONDOWN))
switch1state = true;
}else
{
if((e.getX() >= ONBUTTONLEFT && e.getX() <= ONBUTTONRIGHT) && (e.getY() >= ONBUTTONTOP && e.getY() <= ONBUTTONDOWN))
switch1state = false;
}
After splitting the "if-else" into two "if"-s and a simple reordering the conditions gets clearer:
if((e.getX() >= OFFBUTTONLEFT && e.getX() <= OFFBUTTONRIGHT) && (e.getY() >= OFFBUTTONTOP && e.getY() <= OFFBUTTONDOWN))
if(switch1state == false) {
switch1state = true;
}
if((e.getX() >= ONBUTTONLEFT && e.getX() <= ONBUTTONRIGHT) && (e.getY() >= ONBUTTONTOP && e.getY() <= ONBUTTONDOWN))
if(switch1state == true) {
switch1state = false;
}
} | {
"domain": "codereview.stackexchange",
"id": 14065,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, swing",
"url": null
} |
-
definitely enough. thanks! – duxrule May 22 '13 at 11:59
+1 for the graph. What program did you make it in? – Ataraxia May 22 '13 at 12:01
ah. Unfortunately no, but I had a professor who used it for lectures, so I'm familiar with it. Is it free/open source? – Ataraxia May 22 '13 at 12:08
@ZettaSuro: Of course not. But if you get one, it'll be very helpful. :) – Babak S. May 22 '13 at 12:09
Great! Also, one thing I just realized: is the loop around the integral appropriate? This isn't a closed loop integral. – Ataraxia May 22 '13 at 12:11
Another method is to use Green's theorem:
$$\oint_C \vec{F}\cdot d\vec{r}=\iint_D|\nabla\times \vec{F}|dA$$
Where D is the area within the loop.
$$|\nabla\times \vec{F}|=y - 2x$$
Convert to cylindrical coordinates:
$$y-2x = r\sin{\theta}-2r\cos{\theta}$$
And evaluate the following double integral:
$$\int_\pi^{\frac{\pi}{2}}\int_0^3r(\sin{\theta}-2\cos{\theta})r\space dr \space d\theta$$
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399026119352,
"lm_q1q2_score": 0.8042695168573891,
"lm_q2_score": 0.82893881677331,
"openwebmath_perplexity": 576.2592867512078,
"openwebmath_score": 0.8689544796943665,
"tags": null,
"url": "http://math.stackexchange.com/questions/399135/vector-line-integral-question"
} |
The short answer is: Yes, it is true, because the contrapositive just expresses the fact that $1^2=1$.
But in controversial discussions of these issues, it is often (but not always) a good idea to try out non-mathematical examples:
"If a nuclear bomb drops on the school building, you die."
"Hey, but you die, too."
"That doesn't help you much, though, so it is still true that you die."
"Oh no, if the supermarket is not open, I cannot buy chocolate chips cookies."
"You cannot buy milk and bread, either!"
"Yes, but I prefer to concentrate on the major consequences."
"If you sign this contract, you get a free pen."
"Hey, you didn't tell me that you get all my money."
Non-mathematical examples also explain the psychology behind your teacher's and classmates' thinking. In real-life, the choice of consequences is usually a loaded message and can amount to a lie by omission. So, there is this lingering suspicion that the original statement suppresses information on 0 on purpose. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.953275045356249,
"lm_q1q2_score": 0.8529804588536851,
"lm_q2_score": 0.8947894555814343,
"openwebmath_perplexity": 353.23052291517223,
"openwebmath_score": 0.7766252756118774,
"tags": null,
"url": "https://math.stackexchange.com/questions/88565/true-or-false-x2-ne-x-implies-x-ne-1/88580"
} |
homework-and-exercises, differential-geometry, metric-tensor, vector-fields
In some sense it is obvious: $L_k \omega_{ab} = L_k (g_{ac} J^c_b) = (L_k g_{ac}) J^c_b + g_{ac} (L_k J^c_b) = 0$ since Lie derivative obeys product rule.
However, I should be able to recover it in components also. For a general rank 2 tensor field, $$(L_k T)_{ab}= k^c \nabla_c T_{ab} + T_{ac} \nabla_b k^c + T_{cb} \nabla_a k^c.$$ If I use that $\omega_{ab} = g_{ac}J^c_b$ in this general formula, I get:
$$(L_k \omega)_{ab} = k^c \nabla_c (g_{ad} J^d_b) + g_{ad} J^d_c \nabla_b k^c + g_{cd} J^d_b \nabla_a k^c$$ and I don't know how to show this is equal to zero? The claims aren't true in complete generality. For example, $R^{2n}$ is a Kähler manifold and any vector $k$ is a Killing vector. But the Lie derivatives of $J$ and $\omega$ don't vanish for a general $k$. | {
"domain": "physics.stackexchange",
"id": 30927,
"lm_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, differential-geometry, metric-tensor, vector-fields",
"url": null
} |
html, css, html5
17:44:03.545 ReferenceError: reference to undefined property f.event.triggered jquery.min.js:3:278
17:44:03.545 ReferenceError: reference to undefined property a.returnValue jquery.min.js:3:6513
17:44:03.545 Use of getPreventDefault() is deprecated. Use defaultPrevented instead. jquery.min.js:3:0
17:44:03.546 ReferenceError: reference to undefined property o[s] jquery.min.js:3:3868
17:44:03.877 ReferenceError: reference to undefined property c[0] jquery.min.js:3:28159
17:44:03.881 ReferenceError: reference to undefined property e.noCode wmd.en.js:2:14819
17:44:03.892 ReferenceError: reference to undefined property this[("s_" + e)] wmd.en.js:1:631
17:44:06.151 ReferenceError: reference to undefined property (intermediate value).value jquery.min.js:2:32273
17:44:06.999 ReferenceError: reference to undefined property d.traditional jquery.min.js:4:12761
17:44:06.999 ReferenceError: reference to undefined property f.ajaxSettings.traditional jquery.min.js:4:14154 | {
"domain": "codereview.stackexchange",
"id": 12714,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, css, html5",
"url": null
} |
javascript, html, css, animation, dom
If you use this, you can decouple your animation time, so, you can change your CSS transition time to whatever without changing your code.
PD: I'm not english speaker, so, i will be glad if someone can correct my mistakes :) | {
"domain": "codereview.stackexchange",
"id": 25018,
"lm_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, html, css, animation, dom",
"url": null
} |
quantum-mechanics, operators, wavefunction, density-operator
So I conclude that
\begin{equation}
\rho'(x,x')=\frac{x-\partial_x}{\sqrt{2}}\rho(x, x')\frac{x'+\partial_{x'}}{\sqrt{2}}
\end{equation}
My main problem is that I found a reference where it states that
\begin{equation}
\rho'(x,x')=\frac{x+\partial_x}{\sqrt{2}}\frac{x'+\partial_{x'}}{\sqrt{2}}\rho(x, x')
\end{equation}
A part from the signs which are different, I NEED the differential operators to be on the left to carry out the proof which states $W_{\hat{a}\hat{\rho}\hat{a}^\dagger}=\hat{D}W_{\hat{\rho}}$, where $\hat{D}$ is a differential operator and $W$ is the Wigner quasi-probability distribution. How can I just take a differential operator and put it to the left when the function $\rho(x,x')$ is dependent on the variable $x'$? | {
"domain": "physics.stackexchange",
"id": 67335,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, wavefunction, density-operator",
"url": null
} |
ruby, ruby-on-rails, active-record
.where(:total_cost => @cost_beginning..@cost_end)
.where("purchaseorder.VendorRef_ListID = ?", @vendor)
end The simplest refactor would be:
# this is the base query
requests = PurchaseRequest.includes(:purchase_order)
.where(:created_at => @date_start..@date_end)
.where(:total_cost => @cost_beginning..@cost_end) | {
"domain": "codereview.stackexchange",
"id": 15368,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, ruby-on-rails, active-record",
"url": null
} |
pharmacology, cardiology
action potential duration. Amiodarone also exerts an antiadrenergic
effect by non competitively inhibiting alpha- and beta-receptors (Ghuran & Camm, 2000).
Alpha blockers relax certain muscles and help small blood vessels remain open by antagonizing norepinephrine's tightening effects on the muscles in the walls of smaller arteries and veins, which improves blood flow and lowers blood pressure (Mayo Clinic). Beta blockers decrease the effects of epinephrine (adrenaline), reducing heart rate and reducing its force, thereby reducing blood pressure. Beta blockers also help blood vessels open up to improve blood flow (Mayo Clinic).
Alpha-adrenergic receptors and Beta-adrenergic receptors are G-protein coupled receptors (Wallukat, 2002). Hence, they do not form channels and your notes are incorrect. The ion currents are mediated by channels, though.
References
- Ghuran & Camm, J Clin Basic Cardiol (2000); 3: 206
- Wallukat, Herz (2002); 27(7): 683-90 | {
"domain": "biology.stackexchange",
"id": 4076,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pharmacology, cardiology",
"url": null
} |
formal-grammars, parsers
I take the view that if conflicting transitions are generated, then the construction algorithm fails and no parser is produced. That's the way the algorithms are described in Aho, Sethi & Ullman, for example (the so-called "Dragon Book"). If you take the equally valid view that a parser is always produced, but is not necessarily deterministic, then the following statements would be true for all grammars. | {
"domain": "cs.stackexchange",
"id": 4522,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-grammars, parsers",
"url": null
} |
black-holes, hawking-radiation, qft-in-curved-spacetime
In Hawking's original explanation, he mentions that one can see the process by thinking of the creation of pairs of virtual particles (which are the pairs arising from the vacuum that you mentioned), being one with positive energy, one with negative energy. The negative energy particle will at first be outside the black hole, which is classically forbidden (particles can't really have negative energy), but it can tunnel to inside the horizon, where time and space essentially switch places (the coordinate we called $t$ outside the black hole behaves as a spatial coordinate inside it, while the coordinate we called $r$ behaves as a time coordinate). Due to these switching there is no problem with the energy sign anymore and the particle can exist as a real particle inside the black hole. The other particle of the pair, which had positive energy, can exist on the outside without any problem and then escapes to infinity, originating the radiation. | {
"domain": "physics.stackexchange",
"id": 84796,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "black-holes, hawking-radiation, qft-in-curved-spacetime",
"url": null
} |
array, vba, excel
Dim ix As Long
clientIncomeDataArray = Trim2DArrayValues(clientIncomeDataArray)
'/ For each of the required columns (and only the required columns), remove "N/A"
Dim LB1 As Long, UB1 As Long
Dim LB2 As Long, UB2 As Long
AssignArrayBounds clientIncomeDataArray, LB1, UB1, LB2, UB2
Dim valueToReplace As String, replacementValue As String
valueToReplace = "N/A"
replacementValue = vbNullString
Dim key As Variant, colNum As Long, columnArray As Variant
For Each key In clientIncomeColumnNumbers.Keys()
colNum = clientIncomeColumnNumbers.item(key)
columnArray = ColumnFrom2dArray(clientIncomeDataArray, colNum)
columnArray = FindAndReplace1DArrayValues(columnArray, valueToReplace, replacementValue)
For ix = LB1 To UB1
clientIncomeDataArray(ix, colNum) = columnArray(ix)
Next ix
Next key
Dim headerRow As Variant
headerRow = RowFrom2dArray(clientIncomeDataArray, 1) | {
"domain": "codereview.stackexchange",
"id": 18114,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "array, vba, excel",
"url": null
} |
complexity-theory, np-complete, optimization, np-hard, np
Title: A certain submatrix of the correlation polytope I am kind of confused by the argument at the top of page 5 here, http://homes.cs.washington.edu/~jrl/notes/bonn-lecture-notes.pdf | {
"domain": "cs.stackexchange",
"id": 6237,
"lm_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, np-complete, optimization, np-hard, np",
"url": null
} |
So you can indeed think of these three planes as three separate copies of the complex numbers embedded in the quaternion numbers.
-
One way to view quaternions is using matrices: $$1=\begin{bmatrix} 1&0&0&0\\ 0&1&0&0\\ 0&0&1&0\\ 0&0&0&1 \end{bmatrix}$$ $$i=\begin{bmatrix} 0&1&0&0\\ -1&0&0&0\\ 0&0&0&-1\\ 0&0&1&0 \end{bmatrix}$$ $$j=\begin{bmatrix} 0&0&1&0\\ 0&0&0&1\\ -1&0&0&0\\ 0&-1&0&0 \end{bmatrix}$$ $$k=\begin{bmatrix} 0&0&0&1\\ 0&0&-1&0\\ 0&1&0&0\\ -1&0&0&0 \end{bmatrix}$$ We can view this as $4$ orthogonal vectors which span a $4$ dimensional subspace of $\mathbb{R}^{16}$.
So yes, these can be viewed as $4$ orthogonal basis vectors, $3$ of which are orthogonal to the reals, thus "imaginary". | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971129089711396,
"lm_q1q2_score": 0.8254317377879422,
"lm_q2_score": 0.8499711794579723,
"openwebmath_perplexity": 169.87404150407397,
"openwebmath_score": 0.8984550833702087,
"tags": null,
"url": "http://math.stackexchange.com/questions/1619654/are-j-and-k-on-different-imaginary-planes-than-i"
} |
quantum-field-theory, renormalization, feynman-diagrams, propagator, self-energy
Title: Why does it make sense to do Dyson Resummation with first-order 1PI-diagrams? This is somewhat related to This question.
The way I understand renormalisation (e.g of the mass) is that we consider the loop-corrections order by order in the coupling constant. If we then consider e.g. $\phi^4$ theory, the first-order 1PI-diagram is given by
$$-\frac{ig}{2}\Delta(0) $$
where $\Delta(p)$ is the Feynman Propagator. The Lecture notes I'm studying then go on to write the 2-point connected Green's function as
$$W(p_1, p_2) = (2\pi)^4 \delta(p_1+p_2) \left[ \frac{i}{p_1^2-m^2} +\frac{i}{p_1^2-m^2} \frac{\frac{g}{2} \Delta(0)}{i} \frac{i}{p_1^2-m^2} + \dots \right].$$
Then they go on to perform the Dyson Resummation and find that the mass gets shifted by
$$m^2 + \frac{g}{2}\Delta(0) := m_r^2.$$ | {
"domain": "physics.stackexchange",
"id": 96178,
"lm_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, renormalization, feynman-diagrams, propagator, self-energy",
"url": null
} |
c#, rubberduck
var getter = _declarations.Items.FirstOrDefault(item => item.Scope == TargetDeclaration.Scope &&
item.IdentifierName == TargetDeclaration.IdentifierName &&
item.DeclarationType == DeclarationType.PropertyGet);
return getter ?? TargetDeclaration;
}
This is the actual refactoring (RemoveParametersRefactoring):
private readonly IRefactoringPresenterFactory<RemoveParametersPresenter> _factory;
private RemoveParametersModel _model;
public RemoveParametersRefactoring(IRefactoringPresenterFactory<RemoveParametersPresenter> factory)
{
_factory = factory;
}
public void Refactor()
{
var presenter = _factory.Create();
if (presenter == null)
{
return;
}
_model = presenter.Show();
if (_model == null || !_model.Parameters.Any(item => item.IsRemoved))
{
return;
}
RemoveParameters();
} | {
"domain": "codereview.stackexchange",
"id": 14109,
"lm_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#, rubberduck",
"url": null
} |
quantum-mechanics, hilbert-space, quantum-entanglement, unitarity
Title: Is entanglement a non-unitary transformation? My question is motivated by the facts that measurement is a non-unitary transformation, and entanglement is necessary for measurement.
To clarify: I mean to say the transformation associated with the act of entangling two separable states. For example, in measurement, the first step is the entanglement of the apparatus' state with the state being measured. A measurement is a process that takes a quantum state $\rho$ and produces a classical probability distribution on the eigenvalues of some observable $A$. Let $A=\sum_k a_k P_k$ where $a_k$ are eigenvalues of $A$ and $P_k$ are the projectors on the respective eigenspaces. Then a measurement is a channel
$$ \rho\mapsto \mathcal E(\rho)=\sum_k P_k\rho P_k$$
If you're not used to this expression, if you take $\rho=|\psi\rangle\langle \psi|$ a pure state and if you suppose $A$ has no degenerate eigenvalues, so that $P_k=|a_k\rangle\langle a_k|$, then this reduces to | {
"domain": "physics.stackexchange",
"id": 73587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, hilbert-space, quantum-entanglement, unitarity",
"url": null
} |
html, css
/* Aside */
.social-icons {
position: fixed;
top: 50%;
right: 4rem;
transform: translateY(-50%);
z-index: 100;
}
.social-icons a {
color: var(--text-subtle);
}
.social-icons li {
margin: 2rem 0;
}
/* Showcase */
#showcase {
width: 100vw;
height: 100vh;
background: radial-gradient(#ffffff34, #ffffff17);
}
#showcase .product-img {
position: absolute;
top: 0;
left: 10rem;
z-index: 1;
overflow: hidden;
}
#showcase img {
max-width: 1600px;
}
#showcase .product-video {
position: absolute;
top: 0;
left: 10rem;
z-index: -1;
overflow: hidden;
}
#showcase .video-container {
max-width: 1600px;
}
#showcase .product-video video {
width: 100%;
}
#showcase .sub-header {
margin-bottom: 1rem;
}
/* Pricing */
#pricing {
width: 100vw;
height: 100vh;
background: radial-gradient(#ffffff34, #ffffff17);
} | {
"domain": "codereview.stackexchange",
"id": 35761,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, css",
"url": null
} |
javascript, html, ecmascript-6, google-chrome
<!-- CREATE BUTTON-->
<button id="cproject" class="mdc-button mdc-button--outlined">
<div class="mdc-button__ripple"></div>
<span class="mdc-button__label">Create</span>
</button>
<p id="error_message" style="color:red;"></p>
</div>
If you run the code snippet and click CREATE, an alert shows the JSON that will be sent to the backend.
The JSON represents a project containing: a name, a type, and a boolean "isPrivate". The project_type is a lowercase string with this format: language-[build tool]-[framework]. For example: java-gradle-springboot or simply java. Depending on the language, a project can have additional fields.
How can I reduce the duplicated code and have a more flexible solution? | {
"domain": "codereview.stackexchange",
"id": 40294,
"lm_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, html, ecmascript-6, google-chrome",
"url": null
} |
evolutionary-algorithms, neat, fitness-functions, fitness-design
But this blows up the score too much and now the food quality is not respected and they just gulp on anything slightly above 0. A human analogy can help you here (a variance).
Initialize all the agents with an initial value $x$; we will call this energyUnits. I Will talk later more about this.
Now, add some value, as an incentive, whenever the agent eats good food, to the energyUnits. You need to add a function that will keep decrementing the value of the agent's energyUnits, as humans degrade energy (calories) with time. We will call this function normalDegrade. This is the core part of the solution for your problem.
Now, for the bad (or poisonous) food you can be more creative with. You can simply subtract a given value whenever an agent eats poisonous food. Or you can extend your normalDegrade function with a very high downward slope. In this case, the energy units (value) of the agent will fall very rapidly. This will force the agent to look for good food to survive. | {
"domain": "ai.stackexchange",
"id": 455,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "evolutionary-algorithms, neat, fitness-functions, fitness-design",
"url": null
} |
The three purple functions drawn out are:
$$f(x) = \sin(x) -2$$
$$f(x) = \sin(x) + 0$$
$$f(x) = \sin(x) +2$$
It may also make more sense when you take a differential equations course, but this should be a sufficient explanation.
The indefinite integral $\int f(x)dx$ is the function $F(x)$ such that $\frac{d}{dx}F(x) = f(x)$. Problem is, there are multiple (in fact infinitely many) such functions $F(x)$. We cannot allow the expression $\int f(x)dx$ to refer to multiple functions, so to get around this we introduce the constant of integration $C$. This fixes things, because though there are infinitely many $F(x)$ such that $\frac{d}{dx}F(x) = f(x)$, if we pick any single such function $F(x)$ then all solutions to $\frac{d}{dx}G(x) = f(x)$ are of the form $G(x) = F(x) + C$ for some value of $C$, while for any value of $C$ the function $F(x)+C$ satisfies $\frac{d}{dx}(F(x)+C) = f(x)$. Hence we say $\int f(x)dx = F(x) + C$. | {
"domain": "bootmath.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806535200601,
"lm_q1q2_score": 0.8128413521761302,
"lm_q2_score": 0.8289388019824946,
"openwebmath_perplexity": 129.43322941230346,
"openwebmath_score": 0.9507293105125427,
"tags": null,
"url": "http://bootmath.com/purpose-of-adding-a-constant-after-integrating-a-function.html"
} |
ros, gazebo, gazebo-ros, gazebo-ros-control, ros-indigo
I get the error output:
[ INFO] [1430582458.651473605]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1430582458.655485962]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
spawn_model script started
[INFO] [WallTime: 1430582458.938102] [0.000000] Loading model xml from ros parameter
[INFO] [WallTime: 1430582458.941118] [0.000000] Waiting for service /gazebo/spawn_urdf_model
[ INFO] [1430582459.741922815, 0.023000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1430582459.819138448, 0.096000000]: Physics dynamic reconfigure ready.
[INFO] [WallTime: 1430582459.855947] [0.132000] Calling service /gazebo/spawn_urdf_model
[INFO] [WallTime: 1430582460.083841] [0.295000] Spawn status: SpawnModel: Successfully spawned model
[ INFO] [1430582460.118077443, 0.295000000]: Loading gazebo_ros_control plugin
[ INFO] [1430582460.118570188, 0.295000000]: Starting gazebo_ros_control plugin in namespace: /myrobot | {
"domain": "robotics.stackexchange",
"id": 21596,
"lm_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, gazebo, gazebo-ros, gazebo-ros-control, ros-indigo",
"url": null
} |
javascript, optimization, algorithm, sudoku
I haven't tested this at all, so no benchmarks to show if it actually improves performance, but theoretically it should maintain your code operations while executing faster. Figured it was worth a shot, since no one else answered. Hope it helps! | {
"domain": "codereview.stackexchange",
"id": 5492,
"lm_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, optimization, algorithm, sudoku",
"url": null
} |
pressure, definition, unit-conversion, metrology
Floating point arithmetic leads to rounding errors. Non SI units are rarely defined precisely (an exception is the inch which is exactly 25.4 mm - and thus other derived units of length).
But getting back to the "what is the value" - we should go with actual units that have defined quantity (rather than the ones that are "precise to a certain number of digits"):
The pound (according to the National Bureau of Standards is defined as:
1 pound (avoirdupois)= 0.453 592 37 kilogram defined - exact
The inch is defined as
25.4 mm exact
The bar is defined as:
1 $N / m^2$ exact
The relationship between Newton and kilogram:
g = 9.80665 $m / s^2$ defined - "exact"
Now, all you need is a calculator with infinite precision, and you can compute your number to your heart's content...
I get for 100000 psi:
100000 * 0.45359237*9.80665 / (10 * 2.54 * 2.54) =
6894.757293168361336722673445346890693781387562775125 | {
"domain": "physics.stackexchange",
"id": 17464,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pressure, definition, unit-conversion, metrology",
"url": null
} |
data-cleaning
{"gilded":0,"author_flair_text":null,"body":"Cry me a river. Most patents and\r\ncopyrights these days are theft of\r\npublic domain under the color of\r\nlaw, to an absurd degree.\r\n\r\nMickey Mouse copyright extended to\r\n100 years as a favor to everyone's\r\nfavorite political donor, Will Eisner.\r\nAmazon's one click patent.\r\n\r\nIt's probably been 20 years \r\nsince the Constitutional authority\r\nto grant patents and copyrights\r\nactually served, on the whole, to\r\n\"advance the arts and commerce\",\r\nrather than to stifle them.\r\n","score_hidden":false,"link_id":"t3_2zxa6","score":1,"author":"donh","retrieved_on":1427426409,"name":"t1_c0299bb","author_flair_css_class":null,"subreddit":"reddit.com","edited":false,"ups":1,"controversiality":0,"parent_id":"t3_2zxa6","created_utc":"1192450781","archived":true,"downs":0,"id":"c0299bb","subreddit_id":"t5_6","distinguished":null} | {
"domain": "datascience.stackexchange",
"id": 567,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "data-cleaning",
"url": null
} |
quantum-mechanics, quantum-field-theory, klein-gordon-equation, non-locality
Title: Non-Locality of Space - QFT (Srednicki's book) I was going through Mark Srednicki's book on QFT. It says in the relativistic limit the Schrodinger equation becomes something like :
$$ i\hbar\frac{\partial}{\partial t} \psi(\vec x,t) = \sqrt{-\hbar^2c^2\nabla^2+m^2c^4}\psi(\vec x,t) $$
Now he says that if I expand the square root (say binomially) it will have infinite no. of spatial derivatives acting on $\psi(x,t)$; this implies that
equation is not local in space.
What exactly does it mean to say the equation is not local in space? If you consider a standard differential operator $B$ working on functions defined in $\mathbb R^n$, like $\partial/\partial x_i$ or a polynomial of partial derivatives, and pick out a sufficiently smooth function $f$ vanishing in a neighbourhood $\Omega$, you see that also $Bf$ vanishes therein. This is the relevant notion of locality for operators. | {
"domain": "physics.stackexchange",
"id": 11707,
"lm_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-field-theory, klein-gordon-equation, non-locality",
"url": null
} |
your seat is at the position shown below in the figure. This lesson develops the concept of using trigonometry to model a real-world situation. by Cecily Curtis. The six o’clock position on the Ferris wheel is level with the loading platform. In the Ferris wheel example, it is (2 + 30) 2 which is 16. Thompson (2007) used a version of the Ferris Wheel problem to introduce the topic of trigonometric functions grounded in a real-world context and found that students' use of a Ferris wheel animation helped them explain the amplitude, period, and global behavior of sinusoidal graphs. The same governmental agency collected average monthly temperature data for Phoenix, Arizona,. 448 subscribers. ¶ The task also asks students to trace the path of a car on a ferris wheel, precisely, point by point, for a given domain. Welcome to Match Fishtank , where you can view, share, and download the curriculum we use every day at Match Charter Public School, the PreK-12 charter public school that we | {
"domain": "topvolleylamezia.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429570618729,
"lm_q1q2_score": 0.8396890860766925,
"lm_q2_score": 0.8539127473751341,
"openwebmath_perplexity": 785.071974526877,
"openwebmath_score": 0.6883447766304016,
"tags": null,
"url": "http://topvolleylamezia.it/ydit/representing-trigonometric-functions-ferris-wheel-answers.html"
} |
The approximation works better as it has a vertical asymptote at $x=-1$.
• Nice :) Though the approximation ends up being better than the derivation... – nbubis Dec 1 '14 at 11:14
• This still doesn't explain most of the agreement. Again taking $x = 1$ we have $2 (\sqrt{2} - 1) \approx 0.828 \dots$, which is maybe 15% bigger than either the LHS or the RHS, which agree to maybe within 2%. – Qiaochu Yuan Dec 1 '14 at 11:15
• Anyone who's still trying to answer the question should actually plot the functions (I did it in WolframAlpha) to see how close the agreement actually is. I think the pole is a red herring: the agreement is really not very good close to the pole. – Qiaochu Yuan Dec 1 '14 at 11:17
• I don't thank the downvoters. @QiaochuYuan: the question is not a contest to the best approximation. It is about why $\log (x+1) \approx \dfrac{x}{\sqrt{x+1}}$. – Yves Daoust Oct 31 '17 at 7:45 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924802053235,
"lm_q1q2_score": 0.8608271298503518,
"lm_q2_score": 0.885631470799559,
"openwebmath_perplexity": 289.8432629016002,
"openwebmath_score": 0.8592144846916199,
"tags": null,
"url": "https://math.stackexchange.com/questions/1046321/approximating-log-x-with-roots"
} |
electromagnetic-radiation, speed-of-light, refraction, frequency, dispersion
Title: Why are red and blue light refracted differently if they travel at the same speed in the same medium? When I look at Snell's law
$\frac{\sin\theta_2}{\sin\theta_1} = \frac{v_2}{v_1} = \frac{n_1}{n_2}$
I don't see any reference to wavelength.
If red and blue have the same speed in the same medium, why they refract differently?
What am I missing? In general, red and blue light do not travel at the same speed in a non-vacuum medium, so they have different refractive indices and are refracted by different amounts. This phenomena is known as dispersion. | {
"domain": "physics.stackexchange",
"id": 73027,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation, speed-of-light, refraction, frequency, dispersion",
"url": null
} |
gazebo, ros-kinetic, gazebo-plugin
Title: Plugin function to find pitch?
What is the function call when writing a Gazebo plugin to find out how much my model has tilted? Access angular Pose variables?
Originally posted by MRhinelander on Gazebo Answers with karma: 5 on 2018-06-25
Post score: 0
Answer found here:
http://answers.gazebosim.org/question/19796/how-to-get-the-angle-value-of-the-base-link-of-a-floating-based-robot-in-gazebo9/
Originally posted by MRhinelander with karma: 5 on 2018-06-25
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 4290,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, ros-kinetic, gazebo-plugin",
"url": null
} |
vcf, plink, gatk, vcftools
VCF files just contain sample IDs, instead of the distinct family and
within-family IDs tracked by PLINK. We offer three ways to convert
these IDs:
--double-id causes both family and within-family IDs to be set to the sample ID.
--const-fid converts sample IDs to within-family IDs while setting all family IDs to a single value (default '0').
--id-delim causes sample IDs to be parsed as <FID><delimiter><IID>; the default delimiter is '_'. If any sample ID
does not contain exactly one instance of the delimiter, an error is
normally reported; however, if you have simultaneously specified
--double-id or --const-fid, PLINK will fall back on that approach to handle zero-delimiter IDs.
If none of these three flags is present, the loader defaults to
--double-id + --id-delim.
There are caveats associated with the types of variants that Plink will pull in from the VCF files, mostly related to limitations of Plink's own file formats. But if your end-goal is Plink, then that should be fine. | {
"domain": "bioinformatics.stackexchange",
"id": 891,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vcf, plink, gatk, vcftools",
"url": null
} |
newtonian-mechanics, special-relativity, classical-mechanics, waves
Force is a vector quantity. Area is also a vector quantity. So, for stress has two options as vectors can be multiplied by two ways: dot product and cross product. A dot product gives you stress a scalar quantity. But it's not. How could a scalar quantity could account for both shear and tangential type forces? So it's not. Now, that means stress can also never be a vector as the vector is characterized by only a single direction. But stress could accommodate the two directive forces- normal (which accounts for pressure) and the shear (tangential). So stress is dyadic in nature as it contains two directions and one magnitude. It's a tensor of rank 2. This stress property is made used in electrodynamics by Maxwell in order to write down the Lorentz force acting on a charge in terms of the stress tensor alone which makes the equation neater and well explains everything. The diagonal elements of the electromagnetic stress tensor corresponds to normal forces and the off-diagonal elements | {
"domain": "physics.stackexchange",
"id": 30070,
"lm_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, special-relativity, classical-mechanics, waves",
"url": null
} |
error-correction, stim, pymatching
Stim doesn't do this. It's the decoder's job to turn the DEM into a matching graph. Stim tries to help make this easier by giving the suggested decomposition.
The key property that Stim uses when suggesting these decompositions is to notice pieces of the error occurring elsewhere. The idea is that if D1 D3 can occur on its own from one single error, and D2 D4 can occur on its own from one single error, then it must be safe to think of D1 D2 D3 D4 as being built out of those two errors: D1 D3 ^ D2 D4. You need to be able to correct them individually, so you should also be able to correct them occurring together. | {
"domain": "quantumcomputing.stackexchange",
"id": 4536,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "error-correction, stim, pymatching",
"url": null
} |
robotic-arm, dh-parameters
In the case of $x_2$, $z_2$ and $z_1$ do not have a unique common normal since they are parallel so the exact placement of the origin of frame 2 and the $x_2$ axis is not fixed - imagine a vertical line that intersects $z_2$ and $z_1$ but can move along the $z_2$ (and $z_1$) axis a bit like a trombone (that's what it makes me think of anyway). You would normally want to put the origin in such a place to produce the most zeros in the DH table which is where you have it currently.
So $x_2$ should indeed be pointing upwards to be consistent with the DH convention. | {
"domain": "robotics.stackexchange",
"id": 2114,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "robotic-arm, dh-parameters",
"url": null
} |
c++, c++14, iterator
Lastly, your specialization of std::swap is also no longer à la mode. Instead of interjecting your own code into the std namespace, you should simply provide a shino::swap(transform_iterator&, transform_iterator&) that can be found by ADL.
Your swap code itself is 100% correct and reasonable; you should just change that namespace std to namespace shino, and you'll be in business.
The expected way for users (such as STL algorithms) to swap two transform_iterators a and b is:
using std::swap; // in case no ADL swap exists
swap(a, b); // look for an ADL swap; fall back on std::swap if needed
I have no particular comment on the efficiency or subtle correctness of how your code (or my revised code) handles the forwarding of functors and such. I'd probably just try to write some tests for that (e.g. what if the functor in question is move-only?), and fix any issues they find, and then move on with my life. ;)
Here's a Wandbox of the code after these changes. | {
"domain": "codereview.stackexchange",
"id": 24386,
"lm_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++14, iterator",
"url": null
} |
c++, c++11, reinventing-the-wheel
class const_reverse_iterator : public array_iterator
{
public:
using array_iterator::array_iterator;
//INCREMENT/DECREMENT OPERATORS
const_reverse_iterator& operator++() { --array_iterator::_pos; return *this; }
const_reverse_iterator& operator--() { ++array_iterator::_pos; return *this; }
const_reverse_iterator operator++(int) { const_reverse_iterator temp(*this); operator++(); return temp; }
const_reverse_iterator operator--(int) { const_reverse_iterator temp(*this); operator--(); return temp; }
//ARITHMETIC OPERATORS
const_reverse_iterator operator+(const difference_type& off) const { return const_reverse_iterator(array_iterator::_pos - off); }
const_reverse_iterator operator-(const difference_type& off) const { return const_reverse_iterator(array_iterator::_pos + off); } | {
"domain": "codereview.stackexchange",
"id": 17183,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, reinventing-the-wheel",
"url": null
} |
IN GENERAL:
The criterion for independence is $F(x,y) = F_X(x)F_Y(y)$. Or $$f_{X,Y}(x,y)=f_X(x)\,f_Y(y)\tag 1$$
"If two variables are independent, their covariance is $0.$ But, having a covariance of $0$ does not imply the variables are independent."
This is nicely explained by Macro here, and in the Wikipedia entry for independence.
$\text {independence} \Rightarrow \text{zero cov}$, yet
$\text{zero cov}\nRightarrow \text{independence}.$
Great example: $X \sim N(0,1)$, and $Y= X^2.$ Covariance is zero (and $\mathbb E(XY)=0$, which is the criterion for orthogonality), yet they are dependent. Credit goes to this post.
IN PARTICULAR (OP problem):
These are Bernoulli rv's, $X$ and $Y$ with probability of success $\Pr(X=1)$, and $\Pr(Y=1)$.
\begin{align}\mathrm{cov}(X,Y)&=\mathrm E[XY] - \mathrm E[X]\,\mathrm E[Y]\\[2ex] &\underset{*}{=} \Pr(X=1 \cap Y=1) - \Pr(X=1)\, \Pr(Y=1)\\[2ex] &\implies \Pr(X=1 , Y=1) = \Pr (X=1)\,\Pr(Y=1). \end{align} | {
"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.8408386417374486,
"lm_q2_score": 0.867035771827307,
"openwebmath_perplexity": 485.78910135418664,
"openwebmath_score": 0.9997827410697937,
"tags": null,
"url": "https://stats.stackexchange.com/questions/258704/does-covariance-equal-to-zero-implies-independence-for-binary-random-variables"
} |
based on CBS Local and Houston Press awards the x-axis, that,. It is constant the quantities multiplying the dependent variable and its derivatives different... Is vacuously substituted '' Quadratic functions variable x does not change, its derivative is 0 without., polynomial, radical, exponential and logarithmic equations with all the steps expression. The differential equation \displaystyle y '' constant function equation x form y = -2 on variables! A horizontal line { \displaystyle ( x\mapsto c ) '=0 } able to change constants and code.... Coefficients mean that the value of f ( x 1 ) = f ( x ↦ )!: definition ; parent function ; Background Tutorials Local and Houston Press awards hand, the output value of.! Outlet trademarks are owned by the respective media outlets and are not affiliated with Tutors. The x-axis, that is, a constant function Jump to: navigation, search not to be with! Vocabulary, Terms, and other factors form y = constant, such as y = -2 they satisfy study... | {
"domain": "lakornsubs.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9597620608291781,
"lm_q1q2_score": 0.8157700890182521,
"lm_q2_score": 0.8499711775577736,
"openwebmath_perplexity": 679.0145359892776,
"openwebmath_score": 0.7542380094528198,
"tags": null,
"url": "http://lakornsubs.com/mhvk95/4795b8-constant-function-equation"
} |
c, linux
Title: C application for capturing keyboard shortcuts I'm writing an application for capturing keyboard shortcuts on Linux, but I don't have a lot of experience with C or the Linux API, so I'm wondering about problems with the code or maybe parts that could be done better.
This is the code so far. I'm planning on adding other shortcuts in the future, not just for brightness.
config.h
static const char *devname_video = "Video Bus";
static const char *devname_kb = "AT Translated Set 2 keyboard";
static const double percent_brightness = 10.0;
static const char *fname_brightness_max = "/sys/class/backlight/intel_backlight/max_brightness";
static const char *fname_brightness_now = "/sys/class/backlight/intel_backlight/brightness";
ksd.c
#define _GNU_SOURCE | {
"domain": "codereview.stackexchange",
"id": 31286,
"lm_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, linux",
"url": null
} |
python, clustering, k-means
Title: Perform k-means clustering over multiple columns and get the cluster center values? I read here how to show the number of clusters over $n$ columns.
I would like to know how to get in a table, the values of the clusters centers. Could someone help me with this? sklearn.clusters.KMeans has an attribute cluster_centers_, which stores the array of cluster centers.
You can add them to the dataframe as new columns this way:
clusters = KMeans(n_clusters = n)
predict = clusters.fit_predict(data)
centers = pd.DataFrame(clusters.cluster_centers_[predict, :])
centers.index = data.index
data = pd.concat([data, centers], axis=1) | {
"domain": "datascience.stackexchange",
"id": 11106,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, clustering, k-means",
"url": null
} |
quantum-information, noise, semiclassical, open-quantum-systems
Based on these considerations one can write down a Hamiltonian of the form
\begin{equation}
H_\text{tot} = H_\text{el} + H_\text{ph} + H_\text{I} \tag{1}
\end{equation}
where $H_\text{el}$ describes the two-level systems, $H_\text{ph}$ describes the photons, and $H_\text{I}$ describes their interaction.
The two-level system part has the form
\begin{equation}
H_\text{el} = \sum_{j=1}^N \epsilon_j \vert{j}\rangle\langle{j}\vert + \sum_{i < j}^{N} V_{ij}\left(\vert{j}\rangle\langle{i}\vert + \vert{i}\rangle\langle{j}\vert\right) \, .
\end{equation}
where the basis states $\vert j\rangle$ are defined by the electronic excitation residing on molecule (site) j and all other sites being in their electronic ground state.
The photon part has the form
\begin{equation}
H_\text{ph} = \sum_{j=1}^{N} H_{\text{ph},j} \quad
H_{\text{ph},j} = \sum_l \hbar \omega_l(a^{j\dagger}_l a^j_l + 1/2) \, .
\end{equation}
The interaction has the form
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 34076,
"lm_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-information, noise, semiclassical, open-quantum-systems",
"url": null
} |
navigation, ekf, ekf-localization-node, robot-localization
/imu
header:
seq: 26753
stamp:
secs: 1480672257
nsecs: 346966028
frame_id: imu_link
orientation:
x: 0.0027948294582
y: -0.0135141274958
z: -0.988287867583
w: 0.151975814111
orientation_covariance: [0.017453292519943295, 0.0, 0.0, 0.0, 0.017453292519943295, 0.0, 0.0, 0.0, 0.15707963267948966]
angular_velocity:
x: -0.0103946747258
y: -0.00381026370451
z: 0.306645005941
angular_velocity_covariance: [0.0004363323129985824, 0.0, 0.0, 0.0, 0.0004363323129985824, 0.0, 0.0, 0.0, 0.0004363323129985824]
linear_acceleration:
x: -0.331079125404
y: 0.683972775936
z: 10.7696285248
linear_acceleration_covariance: [0.0004, 0.0, 0.0, 0.0, 0.0004, 0.0, 0.0, 0.0, 0.0004] | {
"domain": "robotics.stackexchange",
"id": 26353,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ekf, ekf-localization-node, robot-localization",
"url": null
} |
turtlebot2, turtlebot, ros-kinetic, ubuntu, ubuntu-xenial
Title: xacro problem: kinectic 16.04 turtlebot2
Hi,
On a new install I have this message when launching "roslaunch turtlebot_bringup minimal.launch"
xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
xacro.py is deprecated; please use xacro instead
It seems to work but I'm not sure. Can someone find a solution to this problem ?
Thanks
Goupil
PS: fresh install of Ubuntu 16.04, ros-kinetic-desktop-full, kinetic, turtlebot 2
Originally posted by goupil35000 on ROS Answers with karma: 113 on 2017-02-13
Post score: 1
These are warnings, not errors.
They basically tell you that the turtlebot xacro does not adhere to the current best practices (--inorder) and that the launch file uses the 'old' xacro.py instead of the xacro script.
As they are only warnings everything should still work. | {
"domain": "robotics.stackexchange",
"id": 27003,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turtlebot2, turtlebot, ros-kinetic, ubuntu, ubuntu-xenial",
"url": null
} |
c#, integer, asp.net-mvc, cache, null
private int CreateCache(string cacheKey, Func<int> getDataCallback)
{
int intData = getDataCallback();
HttpContext.Current.Application[cacheKey] = intData;
return intData;
}
The first method only checks the existing cache and, if missing, calls the second method, which will create a new cache.
The code could be refactored to slightly shorten it, but that would be at the cost of readability.
I renamed GetOrSet to GetData for clarity's sake. The method exists to give you the data, regardless of whether it's cached or created on the fly. Pedantically, you'd need to name it Get_or_SetAndThenGet for it to be an accurate description. I prefer GetData, it sticks to the important facts and remains concise.
Nkosi is also correct in the comments that you should ideally abstract this snippet away from using HttpContext, but that's not necessary for the question at hand. | {
"domain": "codereview.stackexchange",
"id": 29646,
"lm_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#, integer, asp.net-mvc, cache, null",
"url": null
} |
python, python-3.x, object-oriented, beautifulsoup
Title: MultiLingual Online Translator So i made a program, which allows you to translate from one language to another using the command prompt.
I would like advice about the design, optimizations, and the tips and tricks to avoid repetition and writing effective code.
Code:
import requests
from bs4 import BeautifulSoup
import sys
class Translator:
# Default Options
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0'}
website = 'https://context.reverso.net/translation/'
languages = ['arabic', 'german', 'english', 'spanish', 'french', 'hebrew', 'japanese', 'dutch', 'polish', 'portuguese', 'romanian', 'russian', 'turkish']
textfile_name = 'hello.txt' | {
"domain": "codereview.stackexchange",
"id": 39358,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, object-oriented, beautifulsoup",
"url": null
} |
quantum-field-theory, special-relativity, experimental-physics, virtual-particles
The graphical representation of the matrix element within the old-fashioned perturbation theory is shown below using $e-\mu$ scattering as an example.
We have here two diagrams, each corresponding to different intermediate states (the state between the vertical red lines). In the first case, the muon emits a photon which is later absorbed by the electron. In the second case, the situation is the opposite.
When we are talking about relativistic processes, it is possible to re-interpret the old-fashioned perturbation theory in explicitly Lorentz-covariant fashion, where time is no longer dedicate quantity. After some manipulations, the matrix elements can be given in the form | {
"domain": "physics.stackexchange",
"id": 69236,
"lm_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, special-relativity, experimental-physics, virtual-particles",
"url": null
} |
c#, dependency-injection, asp.net-core, .net-core
var jsonSettings = new JsonSerializerOptions(); This could be declared as static because this is not changing from request to request
await response.Content.ReadFromJsonAsync<dynamic>: Try to avoid deserializing data into dynamic. Please create a concrete class, which could be used as the contract between your client and the service provider. dynamic can hide a lot of problems
responseJson.responses[0] is not null: This might cause OutOfRangeException if the responses is defined but empty. Please check the collection's length as well prior accessing a member directly
throw new HttpRequestException();: According to my understanding you will never reach this code. The else block is also unnecessary: | {
"domain": "codereview.stackexchange",
"id": 41730,
"lm_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#, dependency-injection, asp.net-core, .net-core",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.