text stringlengths 1 1.11k | source dict |
|---|---|
matlab, filters, signal-analysis, digital-communications, quadrature
A complex NCO will create a unique tone given by samples of $e^{j 2\pi f t}$ for any frequency from DC to the sampling rate (the sampling rate is an alias of DC, so to be accurate it would be unique from DC to one frequency spacing (given by $f_{\Delta} = f_{clk}/2^{acc}$ where $f_{clk}$ is the NCO clock rate and $acc$ is the accumulator bit size.). This would require an NCO with two outputs representing the real and imaginary components. For implementation this can be done with two real NCO's synchronized in quadrature given the relationship:
$$e^{j 2\pi f t} = \cos(2\pi f t) + j\sin(2\pi f t)$$
Implemented with "I" and "Q" where the $j$ is implied in the "Q" path. Ultimately the sinusoidal look-up-table would be shared with a simple offset in the phase accumulator of a quarter cycle (and only a quarter cycle needs to be stored to implement a full cycle with efficient up/down counting and sign change). | {
"domain": "dsp.stackexchange",
"id": 9943,
"lm_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, filters, signal-analysis, digital-communications, quadrature",
"url": null
} |
pcl, rosmake, pcl-ros
[rosmake-0] Starting >>> roscpp_traits [ make ]
[rosmake-2] Finished <<< rospy ROS_NOBUILD in package rospy
[rosmake-3] Finished <<< rosparam ROS_NOBUILD in package rosparam
[rosmake-1] Finished <<< rosmaster ROS_NOBUILD in package rosmaster
[rosmake-0] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
[rosmake-2] Starting >>> xmlrpcpp [ make ]
[rosmake-3] Starting >>> rosunit [ make ]
[rosmake-0] Starting >>> roscpp_serialization [ make ]
[rosmake-2] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp | {
"domain": "robotics.stackexchange",
"id": 10088,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl, rosmake, pcl-ros",
"url": null
} |
haskell, recursion
I might have gone overboard on trying to write code using point-free style
is it too much?
could some of it have been written better still using point-free style?
I've used view patterns where it seemed fitting but might have gone overboard there as well
is my use of view patterns readable?
Did I miss some really cool features of Haskell that could have made this code more elegant?
Unless it's really, really bad, I'm not very interested in performance
The Code
Without further ado, here's the code:
{-# Language TypeOperators, ViewPatterns, TemplateHaskell #-}
-- Contains data stuctures to represent alethic modal logic formulas
-- and functions to prove these formulas in system K and T.
module ModalLogic (
ModalFormula(..), prove, neg,
FormulaAdder,
World, emptyW, k, t
) where
import Data.Maybe
import Control.Lens
import Data.Set (Set, insert, empty, deleteFindMax, toList)
import Control.Monad ((>=>)) | {
"domain": "codereview.stackexchange",
"id": 28494,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell, recursion",
"url": null
} |
the matrix \ ( )! -- now this is important method is developed for finding the inverse of the \. Algebra I Course Tutor ; Upgrade to math Mastery sup -1, our answer would be answer., a method is developed for finding the multiplicative identity ( one ) as shown below want. Earn progress by passing quizzes and exams produces transistors, resistors, and other study tools A1: D4 minverse. When you multiply a number by its reciprocal we get x = 1 and y = 2 solution! Number one is the Syllabus of an Algebra I Course you agree to our Policy! D4 multiplicative inverse of matrix minverse ( { 1,0,0,0 ; 0,0,4,0 ; 0,1,1,0 ; 0,0,0,1 } ) Syntax so I. Get 1 of matrix C. Step 3: we deal with regular numbers, here are some multiplicative Skills! Fraction a/b is b/a its inverse results in the rest of this section we see Gauss-Jordan! Matrix with its multiplicative inverse of a matrix: 1 ( must be a very thing! Main difference between this calculator finds the modular inverse of a nonsingular matrixis | {
"domain": "gridserver.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534344029238,
"lm_q1q2_score": 0.8544506708232129,
"lm_q2_score": 0.8705972600147106,
"openwebmath_perplexity": 696.4878762898684,
"openwebmath_score": 0.757369875907898,
"tags": null,
"url": "https://s12762.gridserver.com/1gb40i0t/43d397-master-electrician-test"
} |
$u = \sin y$, so $dy = du/ \cos y$
$$I = \int \! (1-u^2)u^2 \, \mathrm{d}u$$
$$I = \int \! u^2-u^6 \, \mathrm{d}u$$
$$I = u^5/5 - u^7 / 7$$
$$I = (\sin y)^5/5 - (\sin y)^7 / 7$$
This is definitely not the good answer...
-
What do you mean by "not the good answer"? – The Chaz 2.0 Mar 15 '12 at 3:23
If I go to Wolfram Alpha, I get this answer : $1/70 sin^5(y) (5 cos(2 y)+9)+constant$ – Justin D. Mar 15 '12 at 3:26
I mean that I think I made a mistake somewhere. – Justin D. Mar 15 '12 at 3:43
Well a friend calculated an integral and obtained $\sin^2(x)$ but WA yield $1-\cos^2(x)$, so he probably made a mistake, right? – N. S. Mar 15 '12 at 3:54
@JustinDomingue In other words: Hint: $(5 \cos(2y)+9)=5 -10 \sin^2(y)+9$. – N. S. Mar 15 '12 at 3:56
show 1 more comment | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754452025766,
"lm_q1q2_score": 0.8003291991188397,
"lm_q2_score": 0.8128673155708975,
"openwebmath_perplexity": 723.4973910281711,
"openwebmath_score": 0.9171260595321655,
"tags": null,
"url": "http://math.stackexchange.com/questions/120343/calculate-the-integral-of-cos3y-sin4y-mathrmdy"
} |
python, beginner, game, pygame, snake-game
for i in range(1, substeps):
yield tuple([(start[j] + (float(i) / (substeps-1)) * (finish[j]\
- start[j])) for j in range(components)])
def pairs(seq):
a, b = tee(seq)
next(b, None)
return zip(a, b)
result = []
substeps = int(float(steps) / (len(colors) - 1))
for a, b in pairs(colors):
for c in linear_gradient(a, b, substeps):
result.append(c)
return result
def draw(self, color_list):
"""Draw the game, the snake and the food using pygame."""
self.window.fill(pygame.Color(225, 225, 225))
for part, color in zip(self.snake.body, color_list):
pygame.draw.rect(self.window, color, pygame.Rect(part[0] *\
var.BLOCK_SIZE, part[1] * var.BLOCK_SIZE, \
var.BLOCK_SIZE, var.BLOCK_SIZE)) | {
"domain": "codereview.stackexchange",
"id": 32503,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, game, pygame, snake-game",
"url": null
} |
# I A question about rolling motion of a wheel on a frictionless surface
1. Dec 4, 2017
### NoahCygnus
Let's imagine a situation where we have a wheel of mass $M$ and radius $R$ on a frictionless surface, and we apply a force $\vec{F}$ as shown in the diagram. The force will produce both linear acceleration of centre of mass $a$ and angular acceleration $\alpha$. The wheel starts to both translate and rotate, and we remove the external forcr. I know the condition for rolling is $v_{com} = R\omega$. The question is, most textbooks include a surface with friction , and I can't tell if without friction the above condition for rolling will be met or the wheel will slip. How can I know ?
Last edited: Dec 4, 2017
2. Dec 4, 2017
### BvU | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992932829918,
"lm_q1q2_score": 0.8587247050295294,
"lm_q2_score": 0.8872045996818986,
"openwebmath_perplexity": 485.3208997152512,
"openwebmath_score": 0.5970717072486877,
"tags": null,
"url": "https://www.physicsforums.com/threads/a-question-about-rolling-motion-of-a-wheel-on-a-frictionless-surface.933400/"
} |
c#, performance, excel, cyclomatic-complexity
private void CreateBuildingList(List<CBuildingAndApartment> buildingAptList)
{
buildingList = new List<CBuilding>();
string streetName = "Anza Avenue";
foreach (CBuildingAndApartment entry in buildingAptList)
{
CBuilding found = buildingList.Find(x => x.AddressStreetNumber == entry.building);
if (found != null)
{
found.AddApartmentNumber(entry.apartment);
}
else
{
CBuilding newBuilding = new CBuilding(entry.building, streetName);
newBuilding.AddApartmentNumber(entry.apartment);
buildingList.Add(newBuilding);
}
}
foreach (CBuilding building in buildingList)
{
building.SortApartMentNumbers();
} | {
"domain": "codereview.stackexchange",
"id": 42651,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, excel, cyclomatic-complexity",
"url": null
} |
python, image-processing, opencv, denoising
denoised_image = bm3d.bm3d(image_noisy, sigma_psd=30/255, stage_arg=bm3d.BM3DStages.HARD_THRESHOLDING)
There are also some examples in the library's source code download.
I installed bm3d using pip (pip install bm3d) and needed OpenBlas (sudo apt-get install libopenblas-dev). | {
"domain": "dsp.stackexchange",
"id": 9009,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, image-processing, opencv, denoising",
"url": null
} |
machine-learning, deep-learning, time-series
Make your series stationary as explained here
Understand what elements you can decompose in your series as explained here
Hope this helps | {
"domain": "datascience.stackexchange",
"id": 1230,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, deep-learning, time-series",
"url": null
} |
# Exact Differential Equation Solver | {
"domain": "iwno.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.990440601781584,
"lm_q1q2_score": 0.8165805643704677,
"lm_q2_score": 0.8244619242200082,
"openwebmath_perplexity": 551.0452697520972,
"openwebmath_score": 0.8149483799934387,
"tags": null,
"url": "http://wcgm.iwno.pw/exact-differential-equation-solver.html"
} |
vba, pointers, reflection, rubberduck, com
Also keep the ITypeLib pointers from step 4 handy as that will give us access to the less restricted ITypeInfo.
Here's all that in code:
Module VBETypeLib
Responsible for following the breadcrumbs to get to the IVBEComponent::GetStdModAccessor - along the way generating a project ITypeLib which contains all the public and private members.
'@Folder "TypeInfoInvoker"
Option Explicit
Option Private Module
Public Type VBEReferencesObj
vTable1 As LongPtr 'To _References vtable
vTable2 As LongPtr
vTable3 As LongPtr
object1 As LongPtr
object2 As LongPtr
typeLib As LongPtr
placeholder1 As LongPtr
placeholder2 As LongPtr
RefCount As LongPtr
End Type
Public Type VBETypeLibObj
vTable1 As LongPtr 'To ITypeLib vtable
vTable2 As LongPtr
vTable3 As LongPtr
Prev As LongPtr
'@Ignore KeywordsUsedAsMember: Looks nice, sorry ThunderFrame
Next As LongPtr
End Type | {
"domain": "codereview.stackexchange",
"id": 44341,
"lm_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, pointers, reflection, rubberduck, com",
"url": null
} |
astrophysics, astronomy, stars, galaxies, milky-way
Assume that the star formation rate, $\Phi(t)$ has been uniform and began approximately 12 billion years ago . This is more difficult to justify. It is quite likely that the star formation rate was a lot higher at the beginning of the Galaxy's evolution - I'll discuss this assumption at the end. The star formation rate is $\Phi(t)=C$ in units of stars per year. Assume that we are only looking at main sequence stars and that stars spend a negligible fraction of their lives off the main sequence (again, not quite right, but it will do here). Assume the main sequence lifetime is given by $10^{10} M^{-2.5}$ years, where $M$ is in solar units. Ignore white dwarfs.
The number of stars per unit mass that have been formed up to time $t$
$$ N(M) = \int^{t}_0 C n(M)\ dt = CAM^{-2.3}t $$ | {
"domain": "physics.stackexchange",
"id": 17976,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astrophysics, astronomy, stars, galaxies, milky-way",
"url": null
} |
thermodynamics, energy, thermal-radiation, blackbody
As a possibly related question, it's claimed that the greenhouse effect significantly raises the temperature of a planet -- for example, Venus's black-body temperature would be 330 K, but due to atmospheric warming, its actual surface temperature is 740 K (*). How is this possible? Isn't it Q_out = Q_in, no matter what? And however this works for Venus, can we do the same thing to warm our spacecraft? OK, I think I've got it, thanks to your comments above as well as this link, which shows how to calculate the temperature of a solar oven. (My situation is very similar to a solar oven, except that the power dumped inside the craft is electrical -- but watts are watts, right?)
So, I believe that what I need to do is: | {
"domain": "physics.stackexchange",
"id": 16324,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, energy, thermal-radiation, blackbody",
"url": null
} |
fft, ifft
% window parameters
winLen = 32; % perfect reconstruction when winLen=FFTLen
winShift = winLen/2;
FFTLen = 64;
N = ceil((T-winLen)/winShift) + 1; % number of frames
% ANALYSIS PART
ms = zeros(1,(FFTLen/2)+1,N);
mp = zeros(1,FFTLen,N);
y = [cc(1,:) zeros(1,(winLen + winShift * N) - T)]; % zeropad sequence
for n = 1:N
ibeg = 1 + (n-1) * winShift;
iend = winLen + (n-1) * winShift;
buffer = y(ibeg:iend) .* bartlett(winLen)';
buffer = fft(buffer,FFTLen);
ms(1,:,n) = log(abs(buffer(1:(end/2)+1)));
mp(1,:,n) = unwrap(angle(buffer));
end
% SYNTHESIS PART
ccinv = zeros(1,winLen + (N-1) * winShift);
for n = 1:N
ibeg = 1 + (n-1) * winShift;
iend = winLen + (n-1) * winShift;
msbuf = exp([ms(1,:,n) fliplr(ms(1,2:end-1,n))]) .* exp(1i * mp(1,:,n));
buffer = ifft(msbuf,winLen);
ccinv(1,ibeg:iend) = ccinv(1,ibeg:iend) + buffer;
end
ccinv = real(ccinv);
% PLOT RESULTS
figure(1)
index = 50:100; | {
"domain": "dsp.stackexchange",
"id": 4315,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, ifft",
"url": null
} |
geography, open-data, database
Title: Is there a freely usable map of Earth cave systems and/or density? I am considering creating some sort of model of the Earth using real world collected data. Things like worldwide height maps certainly exist, as do many maps of minerals, rainfall, etc.
Are there worldwide data available on underground cave systems?
By density, I mean the likelihood of there being a cave in a certain place, given coordinates. Hence it does not have to be exact (although this would be better), but a mathematical model or approximation would be useful if the former does not exist. You might like to check World Cave List which has a pretty extensive list of caves, their depths, and lengths.
For example:
This list has been automatically produced from our World Caves Database.
Total depth and length of all caves currently collected in the database:
Number of caves = 2424
Caves deeper than 300m = 1075
Caves longer than 3kms = 1628
Cumulated depth = 648 932 m
Cumulated length = 17 930 192 m | {
"domain": "earthscience.stackexchange",
"id": 476,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geography, open-data, database",
"url": null
} |
optics, reflection, computational-physics, refraction, geometric-optics
Title: How does light actually interact with different materials? - Physically Based Rendering (PBR) I am a computer graphics guy in the area of physically-based rendering and recently I've been searching on the net to figure out how physical is Physically Based Rendering (PBR). The nature of the question lies somewhere between pure physics and pure graphics, so I'm hoping I find someone familiar with graphics here.
For those who don't know, PBR aims to render the different materials in the same way it actually happens in real life, so it's a more physical approach. This lets us render highly realistic images than other approaches.
I want to check if my understanding is correct about how light actually interacts with different materials. | {
"domain": "physics.stackexchange",
"id": 51474,
"lm_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, reflection, computational-physics, refraction, geometric-optics",
"url": null
} |
javascript, animation
</p>
<p>
Cras ac varius odio, in sollicitudin sapien. Nunc tincidunt vulputate tortor ac euismod. Phasellus dignissim et orci sit amet malesuada. Sed suscipit lectus libero. Maecenas ac aliquam diam, sit amet feugiat nibh. Duis vehicula sem nec tincidunt viverra. Donec non dolor nulla. Curabitur iaculis justo vitae vehicula egestas. Phasellus efficitur volutpat faucibus. Morbi ligula nisl, porttitor nec lectus non, accumsan ornare augue. Nullam imperdiet nisl eu urna bibendum finibus nec vel augue. Phasellus vestibulum dui at interdum sollicitudin. Etiam ac commodo metus. Vestibulum augue metus, commodo vitae felis venenatis, aliquet feugiat mauris. Duis consequat dui enim, in posuere lorem aliquet vitae.
</p></div> | {
"domain": "codereview.stackexchange",
"id": 38305,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, animation",
"url": null
} |
general-relativity, metric-tensor, tensor-calculus, inertial-frames, qft-in-curved-spacetime
$g_{\mu\nu}(x_0) = \eta_{\mu\nu}(x_0)$
$\partial_\rho g_{\mu\nu}(x_0) = 0$
I've also been told that the Riemann curvature tensor evaluates to:
$$R^\beta_{\rho\nu\mu} = \frac{\eta^{\beta\alpha}}{2}(\partial_\nu\partial_\rho g_{\alpha\mu}(x_0) + \partial_\mu\partial_\alpha g_{\nu\rho}(x_0)-\partial_\nu\partial_\alpha g_{\mu\rho}(x_0)-\partial_\mu\partial_\rho g_{\alpha\nu}(x_0))$$
Why is it not the case that, by (2), all these derivatives of the gravitational tensor evaluate to zero so the Riemann curvature tensor is 0 overall?
Probably fundamentally not understood what one of these results actually means so any help would be amazing, thank you. The fact that a function's first derivative vanishes at a point does not mean that its second derivative vanishes at that point. Note that for $f(x)=x^2$, $f'(0)=0$ but $f''(0)=2$. | {
"domain": "physics.stackexchange",
"id": 87842,
"lm_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, metric-tensor, tensor-calculus, inertial-frames, qft-in-curved-spacetime",
"url": null
} |
java, algorithm, comparative-review, mathematics, combinatorics
Title: Comparing algorithms for computing binomial coefficients in Java I have these 3 different algorithms for computing binomial coefficients (I also had the 4th recursive one, yet I discarded it since it is super slow). The first uses the factorial formula, the second optimizes it a bit, and the last is a dynamic programming algorithm that maintains a Pascal's triangle which reduces the computation to a single addition provided that the triangle is large enough (and if it is not, it is expanded rather efficiently). The formula behind the last algorithm is
$$\binom{n}{k} = \binom{n - 1}{k} + \binom{n - 1}{k - 1}.$$
You can think of the above like that \$n\$ selects the row of the Pascal's triangle (zero-based indexing), and \$k, k - 1\$ select two consecutive entries on a row (also zero-based indexing).
See what I have:
AbstractBinomialCoefficientComputer.java:
package net.coderodde.math;
import java.math.BigInteger; | {
"domain": "codereview.stackexchange",
"id": 21351,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, algorithm, comparative-review, mathematics, combinatorics",
"url": null
} |
Hint 1: How many ways do you have to define $f(a)$ for $a\in X$ ?
Hint 2: two functions $f,g$ are different if there is $a\in X$ s.t the $f(a)\neq g(a)$
-
add comment
It is worth noting that for two sets $X$ and $Y$ (not necessarily finite), the set of all functions $X \to Y$ is denoted by $Y^X$. One benefit of this notation is that, by generalising some of the arguments you've seen in the other answers, there is a nice expression for its cardinality, namely $$|Y^X| = |Y|^{|X|}.$$ In your situation $|X| = m$ and $|Y| = n$ so you get the result you've deduced above. What is really interesting is that the relationship between the cardinalities is true even for infinite sets (provided you use cardinal arithmetic).
-
Interesting! Thanks for the info! – Daniel Oct 8 '12 at 22:27
add comment | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964198826468,
"lm_q1q2_score": 0.8147215217464893,
"lm_q2_score": 0.8267118026095991,
"openwebmath_perplexity": 324.3422888765119,
"openwebmath_score": 0.9281125068664551,
"tags": null,
"url": "http://math.stackexchange.com/questions/209361/size-of-the-set-of-functions-from-x-to-y/209362"
} |
everyday-chemistry, polymers
Note: The numbered references in the above block quote can be pulled from the linked article. The article also details efforts aimed at producing a new type of chewing gum that doesn't stick to things as much as normal/currently-manufactured ones seem to. It's a good read.
But to your main point, I've linked the MSDS for a popular product for removing gum and related compounds (it's called Goof Off), which consists almost entirely of acetone (also commonly found in nail polish remover). Given the deleterious health effects of acetone (and its high vapor pressure), it's not a good candidate for your needs.
Something non-stick and more permanent, such as a Teflon spray might be ideal for your needs. | {
"domain": "chemistry.stackexchange",
"id": 3795,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "everyday-chemistry, polymers",
"url": null
} |
Gbegiri Soup Recipe, Stain Proof Paint For Walls, Sterling National Bank Atm Withdrawal Limit, Viral Pneumonia Radiology Assistant, Fall Festivals This Weekend Near Me, Which Of These Tasks Is Typically The Lowest Priority?, Clumber Spaniel Puppies For Sale Ohio, Decatur, Ga Section 8 Houses For Rent, Wags Westies Puppies, | {
"domain": "webreus.net",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811631528337,
"lm_q1q2_score": 0.8023698402689586,
"lm_q2_score": 0.8311430457670241,
"openwebmath_perplexity": 884.0303756804661,
"openwebmath_score": 0.5943220853805542,
"tags": null,
"url": "http://3697160567.srv040065.webreus.net/nescafe-clasico-gwedtee/3e819a-angle-between-two-pair-of-straight-lines"
} |
ros2
Traceback (most recent call last):
File "/home/mrumel/fisher_agc/AGCROS/install/server/lib/server/intersection_manager", line 11, in <module>
load_entry_point('server==0.0.0', 'console_scripts', 'intersection_manager')()
File "/home/mrumel/fisher_agc/AGCROS/install/server/lib/python3.8/site-packages/server/intersection_manager.py", line 70, in main
rclpy.spin(intersection_manager)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/__init__.py", line 191, in spin
executor.spin_once()
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 711, in spin_once
raise handler.exception()
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/task.py", line 239, in __call__
self._handler.send(None)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 426, in handler
await call_coroutine(entity, arg)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 381, in _execute_service
srv.send_response(response, header) | {
"domain": "robotics.stackexchange",
"id": 36744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2",
"url": null
} |
general-relativity, reference-frames, acceleration, unruh-effect
$$T=\frac{\hbar a}{2\pi ck_B}$$
Now, let's imagine that Bob is stationary in his spaceship, and Alice is coming towards him at acceleration $a$. Would Bob see the vacuum around Alice have a finite temperature, or does the Unruh effect only occur if the observer themselves are accelerating? I would think that Bob might see space-time "warm" around Alice because she's accelerating towards him from the viewpoint of his reference frame, in the same way that Bob's surroundings are accelerating towards him when he's accelerating. Nevertheless, I am confused on this point. This is a good (and notoriously difficult) question. I'm going to follow the explanation given by Crispino, Higuchi, and Matsas in their review 0710.5373, but you should be aware there are different answers out there and also there is no (uncontroversial) experimental test of this effect. | {
"domain": "physics.stackexchange",
"id": 23269,
"lm_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, reference-frames, acceleration, unruh-effect",
"url": null
} |
by midnight 1. Multiple Choice 1. ) (This is a 10 point homework grade. Fundamental Theorem of Calculus Naive derivation – Typeset by FoilTEX – 10. The Fundamental Theorem of Calculus May 2, 2010 The fundamental theorem of calculus has two parts: Theorem (Part I). Mathematics & Statistics (Sci) : Definition and properties of Riemann integral, Fundamental Theorem of Calculus, Taylor's theorem. Definite Integrals and antiderivatives. A somewhat intuitive proof of the fundamental theorem is used. Past documents: #11 Old Practice Test 1 (1. 3 The Fundamental Theorem of Calculus 5. Students will understand the meaning of Rolle’s Theorem and the Mean Value Theorem. Simpson's Rule. Let $$f$$ be a function defined on an open interval $$I$$ containing \(c\text{. We give an example, testing the fundamental theorem of calculus: integration is antidifferentiation. Precalculus also covers sequences and series. com/subscription_center?add_user=brightstorm2. The Second Fundamental Theorem of Calculus | {
"domain": "gesuitialquirinale.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964194566753,
"lm_q1q2_score": 0.8471955498358522,
"lm_q2_score": 0.8596637523076225,
"openwebmath_perplexity": 1111.9521134672673,
"openwebmath_score": 0.7030860781669617,
"tags": null,
"url": "http://gesuitialquirinale.it/hkqo/fundamental-theorem-of-calculus-worksheet-doc.html"
} |
A#B = B#A
THAT is the definition of commutation. It's an identity or it isn't.
Whether an operation is commutative or not is really not the question, the proper question is, "Is an operation commutative on a given set of arguments?"
So the operation of arithmetic multiplication is commutative over the integers, while the operation of division is NOT commutative over the integers.
(AxB = BxA is true for all integers A and B while A/B = B/A is NOT true for all integers A and B)
"Is A x B = B x A when x is the operation of matrix multiplication and A and B are any matrices?" This is your question. The answer is no, see my original post.
Whether an operation is commutative or not is very important to know. If an operation is commutative, then you can change the order of the arguments and you'll know that the result is the same.
A very handy property, which is, unfortunately, not true for matrix multiplication (although some physicists would say fortunately!) | {
"domain": "chegg.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357579585025,
"lm_q1q2_score": 0.8416415462898709,
"lm_q2_score": 0.8596637451167997,
"openwebmath_perplexity": 370.9566664268265,
"openwebmath_score": 0.8216281533241272,
"tags": null,
"url": "http://www.chegg.com/homework-help/questions-and-answers/could-we-then-say-that-multiplication-with-square-matrices-are-commutative-q3501430"
} |
# Limit of $\left\{ \int_{0}^{1} [bx + a(1 - x) ]^{\frac1n} dx \right\}^n$ as $n \to \infty$
Evaluate the limit for $0 < a < b$, $$\lim_{n \to \infty} \left\{ \int_{0}^{1} [bx + a(1 - x) ]^{\frac1n} dx \right\}^n$$
Just to be clear, the exponent $~1/n~$ is inside the integration on the entire integrand $~a + (b-a)x,~$ and the exponent $n$ is outside on the definite integral.
I actually have been able to solve it as I happen to know a particular way of viewing the logarithm function as a limit $$\log x = \lim_{h \to 0} \frac{x^h - 1}h \quad \text{, or equivalently} \quad\log x = \lim_{n \to \infty} n(x^{\frac1n} - 1)$$
That is, my solution is a process that involves terms like $~e^{b\log b},~$ where I have to obtain $~\log b~$ first as a limit, and I can say that it is $~b^b~$ at the very last step only after another limit.
My question is this: how do I evaluate the limit more directly without this seemingly redundant path of log on the exponent? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683484150416,
"lm_q1q2_score": 0.8074106839401554,
"lm_q2_score": 0.8175744850834648,
"openwebmath_perplexity": 764.99028224484,
"openwebmath_score": 1.0000088214874268,
"tags": null,
"url": "https://math.stackexchange.com/questions/1975789/limit-of-left-int-01-bx-a1-x-frac1n-dx-right-n-as-n"
} |
Exercise 2.D
Show that the product of two Lindelof spaces is a Lindelof space whenever one of the factors is a $\sigma$-compact space.
Exercise 2.E
Prove that the product of finitely many $\sigma$-compact spaces is a $\sigma$-compact space. Give an example of a space showing that the product of countably and infinitely many $\sigma$-compact spaces does not have to be $\sigma$-compact. For example, show that $\mathbb{R}^\omega$, the product of countably many copies of the real line, is not $\sigma$-compact. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308807013051,
"lm_q1q2_score": 0.8032193009079215,
"lm_q2_score": 0.8128673201042492,
"openwebmath_perplexity": 93.63191003546632,
"openwebmath_score": 0.9769114851951599,
"tags": null,
"url": "https://dantopology.wordpress.com/2019/07/11/lindelof-exercise-2/"
} |
I found it quite interesting to have a “polynomial” defined with a rational expression.
Boundary Convergence:
As shown above, $\displaystyle \frac{1}{x+2}=\frac{1}{x}-\frac{2}{x^2}+\frac{4}{x^3}-\frac{8}{x^4}+...$ only for $|x|>2$.
At $x=2$, the series is obviously divergent, $\displaystyle \frac{1}{4} \ne \frac{1}{2}-\frac{2}{4}+\frac{4}{8}-\frac{8}{16}+...$.
For $x=-2$, I got $\displaystyle \frac{1}{0} = \frac{1}{-2}-\frac{2}{4}+\frac{4}{-8}-\frac{8}{16}+...=-\frac{1}{2}-\frac{1}{2}-\frac{1}{2}-\frac{1}{2}-...$ which is properly equivalent to $-\infty$ as $x \rightarrow -2$ as defined by the convergence domain and the graphical behavior of $\displaystyle y=\frac{1}{x+2}$ just to the left of $x=-2$. Nice. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754474655619,
"lm_q1q2_score": 0.8003291942632063,
"lm_q2_score": 0.8128673087708699,
"openwebmath_perplexity": 1036.7887491297558,
"openwebmath_score": 0.8429520726203918,
"tags": null,
"url": "https://casmusings.wordpress.com/tag/number-bases/"
} |
c#, thread-safety, concurrency
/// <summary>
/// Initialises the cache with a maximum capacity, tracking the client's message deleted event.
/// </summary>
/// <param name="client">The client that the MessageDeleted handler should be hooked up to.</param>
/// <param name="capacity">The maximum capacity of the cache. A value of CommandCacheService.UNLIMITED signifies no maximum capacity.</param>
/// <param name="log">An optional method to use for logging.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if capacity is less than 1 and is not -1 (unlimited).</exception>
public CommandCacheService(DiscordSocketClient client, int capacity = 200, Func<LogMessage, Task> log = null)
{
// Initialise the cache.
_cache = new ConcurrentDictionary<ulong, ConcurrentBag<ulong>>(); | {
"domain": "codereview.stackexchange",
"id": 26735,
"lm_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#, thread-safety, concurrency",
"url": null
} |
navigation, roslaunch, turtlebot, amcl
Original comments
Comment by bit-pirate on 2014-03-05:
Please specify, which code versions you use (ROS, Android apps etc.). There have been errors in the old versions of the make and navigate a map Android apps, but those should be fixed by now.
Comment by david.c.liebman on 2014-03-07:
OK. I have modified the question.
Comment by jihoonl on 2014-03-10:
It is failing to find transform. How are you setting up the goal pose? from remote workstation or from the robot's laptop? If you are using two computers to control the robot, check network time protocol.
http://wiki.ros.org/turtlebot/Tutorials/hydro/Workstation%20Installation
Comment by david.c.liebman on 2014-03-11:
OK. thanks for the link, I had not done that. Still, the robot does not navigate in amcl to a new location. I don't know why. | {
"domain": "robotics.stackexchange",
"id": 17173,
"lm_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, roslaunch, turtlebot, amcl",
"url": null
} |
ros, sw-urdf-exporter, solidworks
Title: I can not install sw_urdf_exporter
Hello, I'm trying to install sw_urdf_exporter a few days ago and I can not seem to get an error compiling the SW2URDF code. I do not know if my error is because I'm using visual studio (I use the visual code with compilers in C #) and the error that appears when compiling is "Could not start debugging because debug target 'c: \ programfiles \ SOLIDWORKS Corp \ SOLIDWORKS (2) \ SLDWORKS.exe is missing. Build the project and try again, or set the properties to a correct destination assembly location. "
my solidworks version is 2016, would it be something like this?
please detail me better how to install it | {
"domain": "robotics.stackexchange",
"id": 28752,
"lm_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, sw-urdf-exporter, solidworks",
"url": null
} |
newtonian-mechanics, forces, fluid-dynamics, projectile, drag
Even if we consider a quadratic drag, $bv^2$, I suppose the coefficient $b$ would depend only on the fluid and the geometry of the bodies. Again the drag would be equal.
Another way to put this question: How does the density of the sphere contribute for the resistive force? Let's say you get your object to some initial speed $v$ and then let it go so that only the drag force is acting on it (ignoring gravity for now).
Then by Newton's second law:
$$a=\frac{F_D}{m}=\frac{F_D}{\rho V}=\frac 1\rho \cdot \frac {F_D}{V}$$
Where $\rho$ is the density of the object. Since $\frac {F_D}{V}$ depends on the velocity and the geometry, then for two objects with the same geometry and same initial velocity, the object with the smaller density will have the larger acceleration due to the drag force.
We can even use your case to get the velocity as a function of time:
$$\frac{dv}{dt}=-\frac{6\pi \eta R}{\rho V}v(t)$$
$$v(t)=v_0Exp\left (-\frac{6\pi \eta R}{\rho V}t\right)$$ | {
"domain": "physics.stackexchange",
"id": 51473,
"lm_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, forces, fluid-dynamics, projectile, drag",
"url": null
} |
# Exactly 1 pair in 3 random cards from a poker deck
poker deck is 13 rank (2-Ace) and 4 suits for a total of 52 cards
Draw 3 random cards what is the chance of exactly 1 pair (same rank)?
using combination
$$\frac { \binom{4}{2} \binom{13}{1} \binom{48}{1}} {\binom{52}{3}} = 0.169411765$$
using fraction 1 - not
first card is what it is 1/1
second card there are 48/51 that don't match the first
third card there are 44/50 that don't match the first or second
1 - (48/51 x 44/50) = 0.171764706
Why are those two numbers different?
Which is correct?
Are neither correct?
I can get the second number with match fractions
first card is what is it 1/1
second card match 3/51
second card does not match but third matches one of the first two 48/51 x 6/50
3/31 + 48/51 x 6/50 = 0.171764706
To get combination to match the other numbers I need to add exactly 52 to the numerator | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137942490252,
"lm_q1q2_score": 0.8246303358149222,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 2071.9987499008585,
"openwebmath_score": 0.23254205286502838,
"tags": null,
"url": "https://stats.stackexchange.com/questions/203361/exactly-1-pair-in-3-random-cards-from-a-poker-deck/203459"
} |
image-recognition, embeddings, vector-space-models
It's still unclear for me why I need to add many unknown faces as "UNKNOWN" class and put it together with thousands of vector from each person. As far as I know, its pretty easy to check the performance by get the similarity score with only from known vectors (the vectors from each person) without the unknown one, for example let said if i put k = 3 or k = 5, i will take the minimum distance as the result and get the class of the vector (ID or label). No, creating dummy unknowns is not the best way to do it.
A better approach can be, if a new face comes in, we calculate distance between vector of the new face and all of the vectors of known faces already present with us. And to identify the correct face, the minimum distance is considered. But this minimum distance should also be below a threshold value. If the minimum distance is above the threshold value, then it is considered as an unknown face. The threshold value is set manually. | {
"domain": "datascience.stackexchange",
"id": 9603,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-recognition, embeddings, vector-space-models",
"url": null
} |
rospy
Originally posted by Chrissi on ROS Answers with karma: 1642 on 2016-07-21
Post score: 2
Found a possible solution: pydoc.locate is able to import datatypes based on string descriptors. Most of the basic datatypes in the messages are actually numpy types. Hence, t = locate("numpy."+t) solves most of the problems. string has to be shortened to str and char doesn't exist and has to be replaced by str as well but the rest matches quite well. By just removing [] like t = t.replace("[]","") in case of arrays you can find the type they are supposed to contain.
Still grateful for any other comments or possible solutions though. Just thought I'd share my findings ;)
Originally posted by Chrissi with karma: 1642 on 2016-07-28
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 25313,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rospy",
"url": null
} |
redox
Calculating the equivalent weight of nitric acid as an oxidizing agent is another story, it depends on how the redox equation is written.
From your equation nitric acid is acting as an oxidizing agent because there is no nitrate ion on the right hand side and the oxidation state of N is different on both sides:
$\ce{HNO3}$ is converting to NO. In the answer above, you already have the equation
$\ce{ NO3−}$ +3e => NO
In this case, the equivalent weight of nitric acid is 1/3 (formula weight).
As you can see equivalent weight is very much dependent on the way you write the equation. This will come with practice. | {
"domain": "chemistry.stackexchange",
"id": 11813,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "redox",
"url": null
} |
graphs, spanning-trees, weighted-graphs
Proof Sketch: Let $T_1,T_2$ be two minimal spanning trees with edge-weight multisets $W_1,W_2$. Assume $W_1 \neq W_2$ and denote their symmetric difference with $W = W_1 \mathop{\Delta} W_2$.
Choose edge $e \in T_1 \mathop{\Delta} T_2$ with $w(e) = \min W$, that is $e$ is an edge that occurs in only one of the trees and has minimum disagreeing weight. Such an edge, that is in particular $e \in T_1 \mathop{\Delta} T_2$, always exists: clearly, not all edges of weight $\min W$ can be in both trees, otherwise $\min W \notin W$. W.l.o.g. let $e \in T_1$ and assume $T_1$ has more edges of weight $\min W$ than $T_2$. | {
"domain": "cs.stackexchange",
"id": 4408,
"lm_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, spanning-trees, weighted-graphs",
"url": null
} |
but this doesn't affect the angle measurements. Look at the picture and choose the other angle that matches up with the angle in question. Which other angle is the consecutive interior angle to a angle b ? Formally, consecutive interior angles may be defined as two interior angles lying on the … 5. Posted with the aid of admin. Transversal is the line crossing the other two lines. The Consecutive Interior Angles Theorem states that the consecutive interior angles on the same side of a transversal line intersecting two parallel lines are supplementary (That is, their sum adds up to 180). Consecutive interior angles two angles which can be formed by using traces and a transversal that lie between the two traces on the same side of the transversal. In the figure, the angles 3 and 5 are consecutive interior angles. 9. Triangles can be classified according to the lengths of their sides. Question 2. How to identify angles that are consecutive interior angles? Consecutive interior angles are | {
"domain": "thinairmedia.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9715639669551474,
"lm_q1q2_score": 0.8096281515934809,
"lm_q2_score": 0.8333245973817159,
"openwebmath_perplexity": 575.6317367625481,
"openwebmath_score": 0.3145655393600464,
"tags": null,
"url": "https://thinairmedia.org/5g2oi8i/viewtopic.php?7960d4=consecutive-interior-angles-definition"
} |
java
@Override
public Collection<Modifier> getModifiers() {
Collection<Modifier> ans = super.getModifiers();
ans.addAll(getChassis().getQuirks());
return ans;
}
@Override
public String getQuirkHtmlSummary() {
StringBuilder sb = new StringBuilder();
sb.append("<html>");
sb.append("<body>");
sb.append("<p>Chassis Quirks:</p>");
for (Modifier modifier : getChassis().getQuirks()) {
modifier.describeToHtml(sb);
}
sb.append("<p>Equipment Bonuses:</p>");
for (ModifierEquipment me : items(ModifierEquipment.class)) {
for (Modifier modifier : me.getModifiers()) {
modifier.describeToHtml(sb);
}
} | {
"domain": "codereview.stackexchange",
"id": 16219,
"lm_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",
"url": null
} |
and in general ($n\ge 3$):
$$D_n=\{x\in\mathbb{R}\colon x\ge {^{n-1}}e\}$$
• Much more formal than my answer; I was so busy trying to edit mine to be correct that I missed this. – theREALyumdub Nov 15 '15 at 1:35
Actually, now that I've looked into it, the table on the page seems to suggest that the iterated logarithm values are the way you compute the bounds on the $D_n$ domains, and it switches at the tetration integer values.
## The tetration operation on the base defines the bounds of the domains $D_n$.
Let b be the base of the logarithm in question, so that $f_1(x) = \log_b(x)$
We can say
$$D_1 = \{x : x \in \mathbb{R}, x > 0\}$$ $$D_2 = \{x : x \in \mathbb{R}, x > b\}$$
And for n > 2, we apply the iterated logarithm to say that
$$D_3 = \{x : x \in \mathbb{R}, x > b^b\}$$ $$D_4 = \{x : x \in \mathbb{R}, x > (b^b)^b\}$$ $$...$$ $$D_n = \{x : x \in \mathbb{R}, x > tetra(b,n - 1)\}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534398277178,
"lm_q1q2_score": 0.8737823421135005,
"lm_q2_score": 0.8902942377652497,
"openwebmath_perplexity": 429.86676581023846,
"openwebmath_score": 0.9099500775337219,
"tags": null,
"url": "https://math.stackexchange.com/questions/1529339/domain-of-the-n-composed-logarithms-on-x"
} |
object-oriented, parsing, node.js, bioinformatics, ecmascript-6
See how many times you needed to call "chr_" +row[0]? That's how you know you deserve a variable.
var propertyName = "chr_" + row[0]
if(!myGenotypes[propertyName]) {
myGenotypes[propertyName] = {}
} else {
// If no rs_[num] exists, make one and set it to genotype
var subPropertyName = row[2]
if (!myGenotypes[propertyName][subPropertyName]) {
myGenotypes[propertyName][subPropertyName] = {
'genotype': row[3] + row[4],
'quality': row[6],
'fit': row[9]
}
}
}
Magic numbers:
Building on the last point, you call array indexes at 0, 2, 3, 4, 6, 9:
What are these points? What is at row[0] that may or may not be in myGenotypes?
You ought to move these array indexes to their own variables to declare the importance that each of these indexes holds. | {
"domain": "codereview.stackexchange",
"id": 17865,
"lm_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, parsing, node.js, bioinformatics, ecmascript-6",
"url": null
} |
c
case MODE_CAT:
cat(file, 0);
break;
case MODE_EDITOR:
editor(file);
break;
case MODE_PAGER:
pager(file);
break;
}
return 0;
} Looks good here. You've avoided some of the usual traps (e.g. passing plain char to <ctype.h> functions), so well done.
Some things I'd suggest changing: | {
"domain": "codereview.stackexchange",
"id": 41958,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c",
"url": null
} |
python, performance, physics, genetic-algorithm
class Param:
def __init__(self, min_val, max_val, value = None):
"""
Attributes and methods associated with an aeroplane parameter which is to
be optimised
Inputs:
min_val: Minimum allowed value for the paramter
max_val: Maximum allowed value for the paramter
value: If provided, the inital value of the paramter
If not provided, a random value is generated
The range between the min_val and max_val will be split into 255 "steps" to
allow the value to be encoded using 8 bits.
"""
self.min_val = min_val
self.max_val = max_val
self.step_size = (self.max_val - self.min_val) / 255
#if a value is provided, round it to an allowed value
if value:
self.step = value // self.step_size
self.val = self.step * self.step_size | {
"domain": "codereview.stackexchange",
"id": 16861,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, physics, genetic-algorithm",
"url": null
} |
javascript, random
// Update tries left
const triesUpdate = function () {
triesLeft[activePlayer] -= 1;
document.getElementById(`tries--${activePlayer}`).textContent =
triesLeft[activePlayer];
};
// Update high scores
const registerHighScore = function () {
if (playerScores[activePlayer] > highScores[activePlayer]) {
highScores[activePlayer] = playerScores[activePlayer];
document.getElementById(
`high-score--${activePlayer}`
).textContent = `High Score: ${highScores[activePlayer]}`;
}
};
// ***GAME ENGINE***
// Declare game engine variables
let interval, imageNumber;
let isSameNumber = 10; | {
"domain": "codereview.stackexchange",
"id": 40957,
"lm_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, random",
"url": null
} |
= sin (theta); polarplot (theta,rho) fig2plotly () Change the limits of the r -axis so it ranges from -1 to 1. Specify the values in radians. It is quite amazing at handling matrices, but has lots of competition with other programs such as Mathematica and Maple. The proposed Matlab script is a literal transcription of Mogi's simple equations, extended to non-isotropic medium (Poisson's ratio different from 0. About Matlab Real Magnitude And Imaginary To And Convert Phase. comLearn how to take the absolute value (magnitude) of a complex number in matlab. Older versions of Octave used gnuplot as the graphics engine, and you can still fall back on that capability. I am using the matlab version MATLAB 7. Based on this command, the angle we got is not right. And it goes like this. A circuit has a resistance of 5\ Ω in series with a reactance across an inductor of 3\ Ω. The most popular representation of a rotation tensor is based on the use of three Euler angles. histogram2Polar. Angles at | {
"domain": "limbury.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795114181106,
"lm_q1q2_score": 0.8246051312267167,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 960.1824974765693,
"openwebmath_score": 0.8298311829566956,
"tags": null,
"url": "http://limbury.de/polar-angle-matlab.html"
} |
find ( a ) the projection matrix P that projects any in... Of equations, orthogonal projection via a complicated matrix product Suppose you wish to find the work W in! Recipes: orthogonal projection via a complicated matrix product now let 's look at some examples regarding vector.... Dot products column space of matrix be a vector in R n. vector projection¶ done... ¥ '' find ( a ) the projection of vector on the ground, no vector some! Vector projection¶ a clear day and the sun is shining brightly, vector would... P that projects any vector in R n. vector projection¶ projection onto a line, orthogonal decomposition by a... Equations, orthogonal projection onto a line, orthogonal decomposition by solving a system of equations, decomposition. ( vector projection example ) to find the work W done in moving a particle from one to... Work W done in moving a particle from one point to another some of vector... Via a complicated matrix product ( b ) the projection matrix P projects... C ( a | {
"domain": "com.ua",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731158685838,
"lm_q1q2_score": 0.8311638880043787,
"lm_q2_score": 0.8633916064586998,
"openwebmath_perplexity": 540.020270122964,
"openwebmath_score": 0.7926164269447327,
"tags": null,
"url": "http://www.birga.com.ua/zsjkxx/0rtad9.php?a302ed=vector-projection-example"
} |
python, scikit-learn, feature-engineering, pipelines
Title: Creating new features as linear combination of others as part of a scikit-learn pipeline? I have a number of raw features that go into a scikit-learn model. I've already got a number of preprocessing steps (such as PolynomialFeatures) that creates additional features as part of my pipeline. However, I know that certain linear combinations of my raw features are also likely to be important in their own right. My question is whether such hand-crafted features (such as the sum of feature1 and feature2) can be created as part of scikit-learn's pipeline setup? Obviously I can create them at the Pandas dataframe level before passing them into the pipeline, but trying to figure out the cleanest way to do this in my codebase. Yes, you can create custom features as part of a scikit-learn pipeline by using a custom transformer class. A transformer is a class that implements the fit() and transform() methods, and can be used to perform any custom preprocessing or feature engineering steps | {
"domain": "datascience.stackexchange",
"id": 11378,
"lm_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, scikit-learn, feature-engineering, pipelines",
"url": null
} |
```[tspan,a] = ode45(f,[0 1/10],xt0); % Runge-Kutta 4th/5th order ODE solver figure plot3(a(:,1),a(:,2),a(:,3)) view([-30 -70])```
### Fit a Circular Path to the ODE Solution
The equations of a circular path have several parameters:
• Angle $\theta \left(1\right)$ of the path from the x-y plane
• Angle $\theta \left(2\right)$ of the plane from a tilt along the x-axis
• Radius R
• Speed V
• Shift t0 from time 0
• 3-D shift in space delta
In terms of these parameters, determine the position of the circular path for times `xdata`.
`type fitlorenzfn`
```function f = fitlorenzfn(x,xdata) theta = x(1:2); R = x(3); V = x(4); t0 = x(5); delta = x(6:8); f = zeros(length(xdata),3); f(:,3) = R*sin(theta(1))*sin(V*(xdata - t0)) + delta(3); f(:,1) = R*cos(V*(xdata - t0))*cos(theta(2)) ... - R*sin(V*(xdata - t0))*cos(theta(1))*sin(theta(2)) + delta(1); f(:,2) = R*sin(V*(xdata - t0))*cos(theta(1))*cos(theta(2)) ... - R*cos(V*(xdata - t0))*sin(theta(2)) + delta(2); ``` | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357195106374,
"lm_q1q2_score": 0.8402196415619066,
"lm_q2_score": 0.8558511469672594,
"openwebmath_perplexity": 739.5020975776401,
"openwebmath_score": 0.8620654344558716,
"tags": null,
"url": "https://in.mathworks.com/help/optim/ug/fit-differential-equation-ode.html"
} |
cosmology, lagrangian-formalism, field-theory, space-expansion
In particular:
$$\Pi^{0}=\sqrt{-g} \frac{\partial \mathscr{L}}{\partial \dot{\phi}}$$
Alternatively, you can start computing the action $S$ more explicitly and you will get
$$S = \int d^4x a^4(t) \mathscr{L}_{\text{yourLagrangian}}$$
and you can work effectively with $\mathscr{L}^{\prime} :=a^4 \mathscr{L}$ using your "flat space Euler-Lagrange equation". This is why in some textbooks on QFT in curved spacetime the Lagrangian is defined by $\mathscr{L}_{\text{curved}} := \sqrt{-g}\mathscr{L}_{\text{flat}}$. I personally prefer to work with the action right away and then vary the action. | {
"domain": "physics.stackexchange",
"id": 90586,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, lagrangian-formalism, field-theory, space-expansion",
"url": null
} |
c#, performance, object-oriented, xamarin
public int IdAtividade { get; set; } = 0;
[Column(COLUMN_NoEntidade)]
public string NoEntidade { get; set; } = "";
[Column(COLUMN_NoCliente)]
public string NoCliente { get; set; } = "";
[Column(COLUMN_NoContrato)]
public string NoContrato { get; set; } = "";
[Column(COLUMN_NoLinhaContrato)]
public string NoLinhaContrato { get; set; } = "";
[Column(COLUMN_NoProduto)]
public string NoProduto { get; set; } = "";
[Column(COLUMN_NoInvestimento)]
public string NoInvestimento { get; set; } = "";
[Column(COLUMN_SegProcesso)]
public string SegProcesso { get; set; } = ""; | {
"domain": "codereview.stackexchange",
"id": 32648,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, performance, object-oriented, xamarin",
"url": null
} |
I don't know why your text says that. Perhaps that the author is just saying that $3i$ is a square root of $-9$, without saying that it is the only square root.
More generally, every non-zero complex number $w$ has two distinct square roots. If $r$ is one such root, then $-r$ is another square root and, since $r\neq0$, $r\neq-r$. Since the equation $z^2-w=0$ can have no more than two roots, there can be no other root. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540662478147,
"lm_q1q2_score": 0.8244453629347117,
"lm_q2_score": 0.8418256393148981,
"openwebmath_perplexity": 580.2994425008359,
"openwebmath_score": 0.7127645015716553,
"tags": null,
"url": "https://math.stackexchange.com/questions/2463028/can-there-be-two-complex-roots-for-the-square-root-of-a-negative-number"
} |
Here is how it works if done on your matrix:
$$A = \begin{bmatrix} 6 & 3 & 6 \\ 5 & 5/2 & 8\\ 3 & 1 & 4 \end{bmatrix}$$
We are at step 1, so we look at the first column: the largest element is the $$6$$ in the first row, so we don't need to swap rows. Applying Gaussian elimination gives:
$$\begin{bmatrix} 6 & 3 & 6 \\ 0 & 0 & 3\\ 0 & -1/2 & 1 \end{bmatrix}$$
the we begin step 2: the largest element in the second column (and row $$\ge 2$$) is the $$-1/2$$ on row 3, so we chose it as our next pivot. Note that in general, the $$k$$-th pivot is chosen at step $$k$$ and can't be computed beforehand (which leads to some interesting challenges with sparse matrices but I digress).
The chosen pivot is not on the second row, so we need to swap row 2 and 3, and then proceed with the elimination.
$$\begin{bmatrix} 6 & 3 & 6 \\ 0 & -1/2 & 1\\ 0 & 0 & 3 \end{bmatrix}$$
In this case, it turns out that the elimination is complete, nut in general the element in position (3,2) is not zero. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9724147185726374,
"lm_q1q2_score": 0.8341063304145362,
"lm_q2_score": 0.8577681049901037,
"openwebmath_perplexity": 406.2211329714761,
"openwebmath_score": 0.9293145537376404,
"tags": null,
"url": "https://math.stackexchange.com/questions/3804623/lu-factorization-which-row-should-be-chosen-in-partial-pivoting"
} |
$H=\cup \left\{F_\alpha \times \left\{d_\alpha \right\}: \alpha<\kappa \right\}$
$K=X \times \left\{p \right\}$
The sets $H$ and $K$ are clearly disjoint. The set $K$ is clearly a closed subset of $X \times Y$. To show that $H$ is closed, let $(x,y) \in (X \times Y)-H$. Two cases to consider: $x \in F_0$ or $x \notin F_0$ where $F_0$ is the first closed set in the family $\mathcal{F}$.
The first case $x \in F_0$. Let $\beta<\kappa$ be least such that $x \notin F_\beta$. Then $y \ne d_\gamma$ for all $\gamma<\beta$ since $(x,y) \in (X \times Y)-H$. In the space $Y$, any subset of cardinality $<\kappa$ is a closed set. Let $E=Y-\left\{d_\gamma: \gamma<\beta \right\}$, which is open containing $y$. Let $O \subset X$ be open such that $x \in O$ and $O \cap F_\beta=\varnothing$. Then $(x,y) \in O \times E$ and $O \times E$ misses points of $H$. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406000885707,
"lm_q1q2_score": 0.8317066168422892,
"lm_q2_score": 0.8397339696776499,
"openwebmath_perplexity": 638.3159881490476,
"openwebmath_score": 1.000008463859558,
"tags": null,
"url": "https://dantopology.wordpress.com/category/normality-in-product/"
} |
Thus $\set {n \in \N: \map f n \in x}$ is non-empty.
Thus by the Well-Ordering Principle, $\set {n \in \N: \map f n \in x}$ has a smallest element.
But by the definition of smallest element:
$\min \set {n \in \N: \map f n \in x} \in \set {n \in \N: \map f n \in x}$
so $\map g x \in x$.
Thus $g$ is a choice function for $S$.
As this holds for every countable set of finite sets, the Axiom of Countable Choice for Finite Sets holds.
$\blacksquare$ | {
"domain": "proofwiki.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429638959674,
"lm_q1q2_score": 0.8172986742718992,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 173.27750512537406,
"openwebmath_score": 0.9861436486244202,
"tags": null,
"url": "https://proofwiki.org/wiki/Countable_Union_of_Finite_Sets_is_Countable"
} |
• I posted my answer at the same time as you, but I guess it's good to have two examples. Have an upvote! – The Count Jan 31 '17 at 2:32
• haha thanks, I'll upvote you too. – smaude Jan 31 '17 at 2:34
• fwiw I think it's clearer when written like this in a stack – MichaelChirico Jan 31 '17 at 6:13
• @MichaelChirico I can see that. I'm just a verbose person. – The Count Jan 31 '17 at 14:40
• @TheCount it's nice to see written out too, which is why I upvoted yours as well :) – MichaelChirico Jan 31 '17 at 14:51
because $x^0=e^{0log(x)}=e^0=1, x> 0$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9697854155523791,
"lm_q1q2_score": 0.8081460449761614,
"lm_q2_score": 0.8333246015211008,
"openwebmath_perplexity": 319.18654068669645,
"openwebmath_score": 0.7676352858543396,
"tags": null,
"url": "https://math.stackexchange.com/questions/2121796/why-does-any-nonzero-number-to-the-zeroth-power-1/2121811"
} |
quantum-mechanics, wavefunction, hilbert-space, notation
$$
\vert\psi\rangle = \left(\begin{array}{c}
\vdots \\
\psi(x_{i-1})\\
\psi(x_i)\\
\psi(x_{i-1})\\
\vdots
\end{array}\right)\, ,\qquad
\vert x_i\rangle = \left(\begin{array}{c}
\vdots \\
0\\
1\\
0
\\
\vdots
\end{array}\right)
\begin{array}{c}
\\
\leftarrow\hbox{position $i$}\\
\\
\end{array}\, ,\qquad
\langle x_i\vert\psi\rangle = \psi(x_i)
$$
Of course the position is really continuous, so the index $i$ is not needed but it's still convenient to this of $\psi(x)=\langle x\vert\psi\rangle$ as the value of the vector $\vert\psi\rangle$ on the basis vector $\vert x\rangle$. | {
"domain": "physics.stackexchange",
"id": 43974,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, wavefunction, hilbert-space, notation",
"url": null
} |
Usually, to find the inverse laplace transform of a function, we use the property of linearity of the laplace transform. So, if this was the laplace transform of the solution to the differential equation, then the solution in terms of t was this function. Inverse laplace transform of method of partial fraction expansion find the inverse laplace transform of. A laplace transform which is the sum of two separate terms has an inverse of the sum of the inverse transforms of each term considered separately. As an example of partial fraction expansion, consider the fraction. Pdf this paper gives a new method of decomposing certain types of rational functions that would prove fruitful in finding the inverse laplace. | {
"domain": "web.app",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513877494096,
"lm_q1q2_score": 0.8108029606498781,
"lm_q2_score": 0.8221891392358014,
"openwebmath_perplexity": 306.526279104252,
"openwebmath_score": 0.8713188767433167,
"tags": null,
"url": "https://klaslibaty.web.app/828.html"
} |
vegetation, plant
Trees need to store reserves to allow their survival during winter and for bud flush and leaf growth in the following spring.
Generally it takes 2 weeks or a month for a deciduous tree to prepare dormancy/sleep time, to gather all the nitrogen, glucose and nutritive elements from their leaves.
If the plant keeps on growing when it's leaves are adapted to massive rainfall, it may lose the green leaves rather than gather useful elements and prepare for dormancy.
i.e. from this image you can see the winter stored sugar being used to grow new leaves, for this tree the spring is in april:
There's some interesting facts about leaves here: https://en.wikipedia.org/wiki/Autumn_leaf_color#Function_of_autumn_colors | {
"domain": "earthscience.stackexchange",
"id": 2099,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vegetation, plant",
"url": null
} |
quantum-field-theory, gauge-theory, path-integral, functional-determinants
$$\mathrm{Det}\, F[\phi_\Lambda] = \mathrm{Det}\, J[\phi, \Lambda]\ \mathrm{Det}\, R[\Lambda] \tag6$$ It's an infinite-dimensional version of the identity
$$F_{AB}~=~ \sum_C J_{AC}R^{}_B\qquad \Rightarrow\qquad \det F~=~ \det J \det R \tag{A}$$
for quadratic matrices. In Weinberg, the discrete index has formally been replaced by a double index
$$A~\leftrightarrow~ (x,a),\qquad B~\leftrightarrow~ (y,b),\qquad C~\leftrightarrow ~(z,c), \tag{B}$$
which consists of a continuous spacetime variable and a discrete color-index;
and the sum has been replaced by an integral (and an implicitly written sum over a color index)
$$\sum_C ~\leftrightarrow~\sum_c\int\! d^4z.\tag{C}$$
See also e.g. my Phys.SE answer here for a similar discussion. | {
"domain": "physics.stackexchange",
"id": 38603,
"lm_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, gauge-theory, path-integral, functional-determinants",
"url": null
} |
quantum-mechanics, hamiltonian, eigenvalue, quantum-tunneling
Now since every term inside the bracket is hermitian, how can the Hamiltonian get a complex eigenvalue? The hamiltonian you're considering is not unstable, it is metastable.
If you place a particle at the bottom of the right-hand well at $+v$ it will stay there, even if it is not at the global minimum. Quantum mechanically, you get two closely spaced ground states, separated by ($h$ times) the frequency for the particule to tunnel back and forth.
An unstable system looks more like this: | {
"domain": "physics.stackexchange",
"id": 36045,
"lm_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, hamiltonian, eigenvalue, quantum-tunneling",
"url": null
} |
vba, web-scraping, vbscript
Public Const baseURLpart1 As String = "http://www.x-rates.com/average/?from="
Public Const baseURLpart2 As String = "&to="
Public Const baseURLpart3 As String = "&amount=1&year="
Public Const ARS As String = "ARS"
Public Const AUD As String = "AUD"
Public Const BRL As String = "BRL"
Public Const CNY As String = "CNY"
Public Const EUR As String = "EUR"
Public Const GBP As String = "GBP"
Public Const JPY As String = "JPY"
Public Const MXN As String = "MXN"
Public Const USD As String = "USD"
Format the sheet on workbook:
Private Sub FormatResultSheet()
'We will center the cells to give a better readability of results and format as text to keep all zeros . Ex: 1.000000
Dim TargetRange As Range
Set TargetRange = ResultSheet.Range("A:F")
TargetRange.HorizontalAlignment = xlCenter
TargetRange.NumberFormat = "@"
End Sub
Add headers:
Private Sub AddHeader() | {
"domain": "codereview.stackexchange",
"id": 21641,
"lm_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, web-scraping, vbscript",
"url": null
} |
# Gaussian Integers form an Euclidean Ring
A Ring $$R$$ is called euclidean if a map $$f:R\backslash {0} \rightarrow \mathbb{N}$$ exists with the following properties: For two elements $$a,b \in R$$ with $$b\neq 0$$ there exist $$q,r\in R$$ with:
(i) $$a=qb+r$$ and
(ii) $$r=0$$ or $$f\left(r \right).
The Gaussian Integers are a Ring $$G:= \{a+bi:a,b \in\mathbb{Z}\}$$. I want to show that $$G$$ is an euclidean Ring. Because $$G$$ is obviously an Integral domain, I would be able to show that $$G$$ is a Principal ideal domain.
My problem is with the second part (ii). I saw that such a mapping can be defined with $$a+bi \mapsto a^2 + b^2$$. Here is what I don't get: In our case the $$b$$ in (ii) is i, so I want to find a $$f$$ with $$f\left(a \right) for the Gaussian Integers right? How is $$a+bi \mapsto a^2 + b^2$$ helping here? I am sorry if the notation is a bit odd. For the Gaussian integers I get (to put them into the frame like in (i)) that $$a=q$$, $$b=i$$ and $$r=a$$ right? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777175136814,
"lm_q1q2_score": 0.813560212845775,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 99.08772681968003,
"openwebmath_score": 0.8898398876190186,
"tags": null,
"url": "https://math.stackexchange.com/questions/3062868/gaussian-integers-form-an-euclidean-ring/3063302"
} |
algorithm, c
static const char TERMINATOR = '\0';
/* skips space in @param[str] depending on the provided direction
@param[in] -- str -- the string
@param[in] -- direction -- the direction to skip space in
1 -- forward direction
0 -- back direction
@return -- pointer to first non-space character in the string if
@param[direction] and @param[str] are valid or the original
string otherwise
*/
const char *skip_space(const char *str, int direction)
{
if (direction == 1) {
while (isspace(*str)) { ++str; }
} else if (direction == 0) {
while (isspace(*str)) { --str; }
}
return str;
}
const char *ltrim_white(const char *str, size_t len)
{
char *end = (char *)&str[len - 1];
end = (char *)skip_space(end, 0);
*++end = TERMINATOR;
return skip_space(str, 1);
}
const char *trim_white(const char *str)
{
return ltrim_white(str, strlen(str));
} | {
"domain": "codereview.stackexchange",
"id": 18207,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithm, c",
"url": null
} |
beginner, rust, caesar-cipher
This is a handful, but it works exactly as your previous variant.
Encapsulate functionality in functions
Now, my main critique point is that you don't provide a single function for your cipher. It's hard to test your functionality at the moment, so we better add one and some documentation:
/// Applies [The Alphabet Cipher] given by `keyword` to `message`.
///
/// Both `message` and `keyword` must only contain lowercase alphabetic ASCII
/// characters.
///
/// # Panics
/// Panics if any non-lowercase or non-alphabetic ASCII character is encountered.
///
/// # Examples
/// The character 'a' in the keyword won't change the input:
/// ```
/// assert_eq!(alphabet_cipher("aaaaa", "hello"), "hello");
/// ```
///
/// They keyword gets cycled if its shorter than the message:
/// ```
/// assert_eq!(alphabet_cipher("a", "hello"), "hello");
/// assert_eq!(alphabet_cipher("b", "hello"), "ifmmp");
/// assert_eq!(alphabet_cipher("ab","hello"), "hflmo"); | {
"domain": "codereview.stackexchange",
"id": 30144,
"lm_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, rust, caesar-cipher",
"url": null
} |
quantum-mechanics, angular-momentum, group-theory, representation-theory
$$
\big(c^\dagger(\mathbf{x})- c^\dagger(\mathbf{y})\big)|\psi\rangle.
\tag{3}
$$
The state-vectors (2) and (3) are not proportional to each other, so they represent different physical states. This time, the experimentalist must do something different to prepare the state (3) instead of the state (2). | {
"domain": "physics.stackexchange",
"id": 53724,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, angular-momentum, group-theory, representation-theory",
"url": null
} |
transforms, gazebo-plugin, tf2
Title: Computing transforms in a Gazebo plugin
I have a plugin, from which I'd like to modify some link parameters based on the position of the link relative to another link. What's the easiest way to get this information? My normal ROS instinct is to reach for tf2, but then I'm dependent on a bunch of external stuff which I really don't want to be, including robot_state_publisher.
So far, I'm just grabbing the GetWorldCoGPose for each link and subtracting. Is there a more elegant way to do this?
Originally posted by mikepurvis on Gazebo Answers with karma: 67 on 2015-06-30
Post score: 0
Currently there is not a more elegant way. We are working on a form of tf for Gazebo, but it won't be available until gazebo7.
Originally posted by nkoenig with karma: 7676 on 2015-07-02
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by mikepurvis on 2015-07-02:
Okay, cool. So in the short term, subtracting world poses is a reasonable workaround? | {
"domain": "robotics.stackexchange",
"id": 3794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "transforms, gazebo-plugin, tf2",
"url": null
} |
inorganic-chemistry, solubility
Number of hydroxides which are soluble in excess of $\ce{NaOH}$ among the following given hydroxide?
$\ce{Al(OH)3, Zn(OH)2, Cr(OH)3, Pb(OH)2, Mn(OH)2, Fe(OH)3, Ni(OH)2, Sn(OH)2.}$
Is there any way to determine rationally which of these hydroxides will be soluble or should I rely on remembering them? There are three kind of oxides/hydroxides: basic (e.g., $\ce{NaOH}$, metal hydroxides), acidic (e.g., $\ce{CO2}$, non-metal oxides), and amphoteric (e.g., $\ce{Al(OH)3}$, Group 13 and 14 hydroxides). Amphoteric Hydroxides act either as Bronsted-Lowry bases (accepting protons) or as Lewis acids (accepting an electron pair), depending on reaction conditions. For example, $\ce{Al^3+}$ in $\ce{Al(OH)3}$ is a Lewis acid, which can accept an electron pair from either Lewis or Bronsted-Lowry base:
$$\ce{Al(OH)3 (aq) + OH- (aq) -> Al(OH)4- (aq)}$$ | {
"domain": "chemistry.stackexchange",
"id": 15277,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, solubility",
"url": null
} |
homework-and-exercises, newtonian-mechanics
But I realized that it doesn't take account for the $mgsin30$ force acting down the slope. Including that gives an answer of ≈ $6.075\,$m/s.
Any help would be appreciated! (Taking account of how simple the question is) There are four forces acting on $P$:
Friction
$0.25$ N force up the plane
Gravity
Normal force | {
"domain": "physics.stackexchange",
"id": 57979,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics",
"url": null
} |
ros-kinetic
dynamixel_controller is the name of the package that I want to import file from that and inside the folder srv there is a file named TorqueEnable.
Originally posted by ehsan_amp with karma: 33 on 2020-01-21
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 34298,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-kinetic",
"url": null
} |
generics, vb.net
Dim xList As IList(Of String) = Me.Projector.Invoke(x)
Dim yList As IList(Of String) = Me.Projector.Invoke(y)
Dim xEnum As IEnumerator(Of String) = xList.GetEnumerator
Dim yEnum As IEnumerator(Of String) = yList.GetEnumerator
Do While xEnum.MoveNext = True And yEnum.MoveNext = True
If xEnum.Current <> yEnum.Current Then Return False
Loop
Return True
End If
End Function
Public Shadows Function GetHashCode(obj As T) As Integer Implements IEqualityComparer(Of T).GetHashCode
Return Me.Projector.Invoke(obj).GetHashCode
End Function
End Class
A usage would be
Dim OtherComparer as New ProjectionEqualityComparer(Of Person)(function(p) New List(of String) From {p.Name, p.Surname} | {
"domain": "codereview.stackexchange",
"id": 35823,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "generics, vb.net",
"url": null
} |
dfa
Title: How to check if a the language represented by a DFA is finite I am studying regular languages and D FA. I have implemented D FA in Java. I have to write a function which tells if the language represented by a D FA is finite or not.
I need a method or algorithm to do so. What I have already figured out is that if the D FA has loops in it then it can possibly recognize infinite words. The language accepted by a deterministic finite automata is infinite if and only if there exists some cycle on some path from which a final state is reachable. If you minimize your automaton, then there is at most one state from where you cannot reach a final state anymore (a so called sink state). So algorithmically it is simply a check for each node if the set of final states is reachable, and if so if the resulting path has cycles in it. | {
"domain": "cstheory.stackexchange",
"id": 3636,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dfa",
"url": null
} |
lagrangian-formalism, coordinate-systems, terminology, definition, degrees-of-freedom
That is, by solving the equations of motion (and assuming they indeed have unique solutions for fully-specified initial conditions, unlike e.g. Norton's dome), the state of a mechanical system at all instants of time can in principle be specified by any of the three things above: A tuple of numbers $(q,\dot{q})$ given at an instant of time $t_0$, a tuple of numbers $(q,p)$ or a function of time $q(t)$.
That your text claims the "state" of a system is given just by a tuple of numbers $q$ means it is using "state" to mean something different, but there is no telling what exactly. The configuration $q$ at an instant of time is of course all you would need to say what one would see on a (idealized) photograph of the system at that instant, but photographs do not capture velocity - the configuration at an instant of time alone is not enough to tell how the system will evolve in time (see e.g. this question for an explicit example). | {
"domain": "physics.stackexchange",
"id": 80237,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lagrangian-formalism, coordinate-systems, terminology, definition, degrees-of-freedom",
"url": null
} |
wormholes
\end{equation}
For two points separated by $\Delta \xi$.
The metric on a planet will be some static spherically symmetric metric, of the form
\begin{equation}
ds^2 = -A(r) dt^2 + B(r)dr^2 + r^2 d\Omega^2
\end{equation}
For a radial distribution of mass, we have
\begin{equation}
B(r) = (1 - \frac{2m(r)}{r})^{-1}
\end{equation}
And, let's say,
\begin{equation}
A(r) = 1 - \frac{2m(r)}{r}
\end{equation}
to preserve continuity at the boundary ($A$ is somewhat arbitrary depending on initial conditions of the metric).
Hopefully points are not moving on the planet, so the 4-velocity of those points will be $(1,0,0,0)$, and so the radial relative acceleration will be
\begin{equation}
(\Delta a)_\parallel = -(R_{abcd} n^a V^b n^c V^d) (\Delta \xi)_\parallel = -R_{rtrt} (\Delta \xi)_\parallel = -\frac{1}{r^4} ((r-2m(r)) (2m(r) + r(-2m'(r) + rm''(r)))) (\Delta \xi)_\parallel
\end{equation} | {
"domain": "physics.stackexchange",
"id": 26585,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "wormholes",
"url": null
} |
java, multithreading
public void print() {
System.out.println(line);
}
}
}
MultiThreaded.class
public class MultiThreaded {
public static HashSet<Task> tasks = new HashSet<Task>();
public static class Task extends Thread {
public boolean running;
public void run(){
return;
}
}
public static void startTask(Task task) {
task.start();
tasks.add(task);
}
public static Task getTask(int id) {
for(Task task : tasks){
if(task.getId() == id)
return task;
}
return null;
}
public static boolean processing() {
boolean processing = false;
for(Task task: tasks){
if(task.isAlive())
processing = true;
}
return processing;
}
}
OUTPUT | {
"domain": "codereview.stackexchange",
"id": 12867,
"lm_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, multithreading",
"url": null
} |
general-relativity, differential-geometry, geodesics
Note that without using the constant curvature of the space you would end up with equation $(*)$ which doesn't give you much of a clue why you should be able to find $\xi^\alpha \zeta_\alpha$ in the sum with the curvature tensor. So your space is special and your measure of deviation is special - both are necessary ingredients for the assumption. | {
"domain": "physics.stackexchange",
"id": 17019,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, geodesics",
"url": null
} |
c++, performance, algorithm, breadth-first-search, sliding-tile-puzzle
Keep going in this iterative fashion: Find an infelicity; think of how you want the code to look instead; and then refactor until it does look that way. Rinse and repeat. | {
"domain": "codereview.stackexchange",
"id": 31555,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, algorithm, breadth-first-search, sliding-tile-puzzle",
"url": null
} |
python, algorithm
Secondly I think with this:
increment_col, decrement_row, decrement_col, increment_row = (False, False, False, True)
You reinvent your get_neighbours
2. Use enumerate
I think this was said in your last question you posted on CR too, and it is still valid. You should defenitly use enumerate when possible, see the corresponding PEP article
3. Doing this in one loop
You have: | {
"domain": "codereview.stackexchange",
"id": 28397,
"lm_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, algorithm",
"url": null
} |
proof-techniques
My question is how can one prove that there is a solution for each pin arrangement, as the manufacturer asserts? There are 12 factorial ways of arranging the pins (less by a factor of 1/120 if one considers the symmetry of the icosahedron), so using brute force to prove this might be a bit challenging. You are right, the author of the game did not provide any hint to why IcoSoKu always has a solution. The latest product page is quite cheeky: | {
"domain": "cs.stackexchange",
"id": 20340,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "proof-techniques",
"url": null
} |
machine-learning, python, neural-network
Title: How can I use a string as input in a neural network? I'm making a program that can determine if a user will like a car from different auctions based on the cars that he/she has bought in the past. Therefore, I want to use the make and model (which are represented as strings) as well as the year, mileage etc... but I'm having trouble to decide on how I'll pass them to the neural network
I've been thinking of using a vector of different makes as such:
car_make = [[10000] # Nissan
[01000] # Toyota
[00100] # Ford
[00010] # Dodge
[00001]] # Mazda | {
"domain": "datascience.stackexchange",
"id": 3560,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, python, neural-network",
"url": null
} |
So in a way, it's like the 2 norm for a vector. It's-- so the squared-- or shall I put square root? Maybe I should. It's the square root of all the little people in the matrix. So a1, n squared, plus the next a2, 1 squared, and so on. You finally get to a-m-n squared. You just treat the matrix like a long vector. And take this square root just like so. That's the Frobenius norm. And then finally, not so well known, is something that's more like L1. It's called the nuclear norm. | {
"domain": "mit.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406006529085,
"lm_q1q2_score": 0.8143294919691771,
"lm_q2_score": 0.8221891261650248,
"openwebmath_perplexity": 669.4211253784235,
"openwebmath_score": 0.7065001130104065,
"tags": null,
"url": "https://ocw.mit.edu/courses/mathematics/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/video-lectures/lecture-7-eckart-young-the-closest-rank-k-matrix-to-a/"
} |
(see, for instance, ßç [2, 3] and for further references ßç [4, 5]), This was due to the fact that the. We set up a framework to study one-dimensional heat equations de ned by fractal Laplacians associated with self-similar measures with overlaps. The IBVP for the Heat Equation. To keep things simple so that we can focus on the big picture, in this article we will solve the IBVP for the heat equation with T(0,t)=T(L,t)=0°C. solves the complete IBVP (6. We will then discuss how the heat equation, wave equation and Laplace’s equation arise in physical models. This corresponds to fixing the heat flux that enters or leaves the system. Solution of the HeatEquation by Separation of Variables The Problem Let u(x,t) denote the temperature at position x and time t in a long, thin rod of length ℓ that runs from x = 0 to x = ℓ. 2 Setting of Dirichlet and Neumann problems Some harmonic functions 1, 2, 8 p246. Solve Nonhomogeneous 1-D Heat Equation Example: In nite Bar Objective: Solve the initial | {
"domain": "aquatique-freiburg.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.978712645102011,
"lm_q1q2_score": 0.8001704781633721,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 880.9884152822596,
"openwebmath_score": 0.7227175831794739,
"tags": null,
"url": "http://wasb.aquatique-freiburg.de/ibvp-heat-equation.html"
} |
There is an interesting algorithm called contrast enhanced adaptive histogram equalization that does histogram equalization on small segments of an image (and then pastes them back together). I know ...
44 views
### Interpolation curve [on hold]
I have a complicated parametric curve which takes too long to integrate, therefore I want to sample points and interpolate to speed up calculations. The curve is: ...
278 views
### Parenthesize what I have highlighted
I want to highlight a piece of equation, click a button and have that part taken into parentheses.
30 views
### Constructing a function for expanding general $n$ products
I have the following quantum mechanically motivated product: $\langle0\vert(A_1b_1 + A_2b_2 + A_3b_3)(B_1b_1 + B_2b_2 + B_3b_3)(C_1b_1 + C_2b_2 + C_3b_3)$, where $b_i$ is an annihilation operator ...
93 views
### Piecewise and Opacity
I have the following Plot : ...
82 views
I have some data from wikipedia. ...
30 views | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9481545289551957,
"lm_q1q2_score": 0.8040044741567955,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 1799.5184279694606,
"openwebmath_score": 0.8386775255203247,
"tags": null,
"url": "http://mathematica.stackexchange.com/questions?page=1&sort=newest&pagesize=15"
} |
java, linked-list
if(start == null) {
System.out.println("\n List is empty !!");
} else {
Node temp = start; | {
"domain": "codereview.stackexchange",
"id": 34691,
"lm_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, linked-list",
"url": null
} |
java, unit-testing, fizzbuzz, junit
private static boolean isDivisibleWithoutRemainder(int dividend, int divisor) {
return (dividend%divisor == 0);
}
}
The JUnit Test:
final class Number {
private final int n;
Number (int number) {
n = number;
}
final boolean isMatchedToWord(final String word) {
return Main.getWordForNumber(n).equals(word);
}
} | {
"domain": "codereview.stackexchange",
"id": 30543,
"lm_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, unit-testing, fizzbuzz, junit",
"url": null
} |
osx
/usr/local/lib/libboost_filesystem-mt.dylib /usr/local/lib/libboost_program_options-mt.dylib /usr/local/lib/libboost_regex-mt.dylib /usr/local/lib/libboost_iostreams-mt.dylib /usr/local/lib/libboost_date_time-mt.dylib /usr/local/lib/libprotobuf.dylib -Wl,-rpath,/tmp/gazebo-YYMA8X/gazebo-1.9.6/build/test -Wl,-rpath,/usr/local/Cellar/ogre/1.7.4/lib -Wl,-rpath,/usr/local/Cellar/sdformat/2.1.0/lib | {
"domain": "robotics.stackexchange",
"id": 20083,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "osx",
"url": null
} |
general-relativity, special-relativity, differential-geometry
I would put this a little differently. This reads to me as a definition of one of the components of the metric tensor. You can think of a tensor as the collection of its components (a matrix), and people did used to think about it that way ca. 1940.
But a nicer and more modern way to think about it is that a tensor is a linear function. The metric is a linear function that takes two vectors as inputs and gives a real scalar as an output. It treats its inputs symmetrically, and it has the interpretation of measuring the interval, which can often be interpreted as a squared time or squared distance.
Does this mean that if one choose different sets of basis vectors, the metric tensor for Minkowski space will change?
This would be the 1940 way of describing it. People today would typically say that the metric stays the same, but its components are different when described in the new basis.
What are some examples of the sets of basis vectors that can describe 4D Minkowski space? | {
"domain": "physics.stackexchange",
"id": 63106,
"lm_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, differential-geometry",
"url": null
} |
game, design-patterns, objective-c
#pragma mark - Update Loop
-(void) doMovement {
//the selector is formed from a string inside the decision table dictionary
SEL methodToCallName = NSSelectorFromString([_decisionTable objectForKey:[self stringForState:self.state]]);
if (methodToCallName) {
IMP functionPointer = [self methodForSelector:methodToCallName];
void (*methodToCall)(id, SEL) = (void *)functionPointer;
methodToCall(self, methodToCallName);
}
}
-(void) doEnemyJustSpawned {
if ([self checkFloorsForJobs]) {
self.state = EnemyMovementStateNeedsMoving;
} else {
self.state = EnemyMovementStateIdle;
}
}
-(void) doEnemyIdle {
if ([self checkFloorsForJobs]) {
self.state = EnemyMovementStateNeedsMoving;
} else {
[self doIdleMovement];
}
}
-(void) doEnemyNeedsMoving {
[self calculateFloorExitPositionByFloor];
self.state = EnemyMovementStateToFloorExit;
}
-(void) doEnemyAtDestinationFloor { | {
"domain": "codereview.stackexchange",
"id": 8754,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "game, design-patterns, objective-c",
"url": null
} |
transition-metals, hybridization
$$\ldots\mathrm{
9\sigma_g^{1.88}
5\pi_u^{3.78}
2\delta_g^{3.42}
10\sigma_g^{1.92}
9\sigma_u^{0.08}
2\delta_u^{0.58}
5\pi_g^{0.22}
10\sigma_u^{0.12}
}$$
Which can be simplified as:
$$\ldots\mathrm{
(9\sigma_g)^2
(5\pi_u)^4
(2\delta_g)^4
(10\sigma_g)^2
(9\sigma_u)^0
(2\delta_u)^0
(5\pi_g)^0
(10\sigma_u)^0
}$$
$9\sigma_{\mathrm{g}}$ is not degenerate; it is $\mathrm{4d_{z^2}+4d_{z^2}}$.
$5\pi_{\mathrm{u}}$ is doubly degenerate; it is $\mathrm{4d_{xz}+4d_{xz}}$ and $\mathrm{4d_{yz}+4d_{yz}}$.
$2\delta_{\mathrm{g}}$ is doubly degenerate; it is $\mathrm{4d_{xy}+d_{xy}}$ and $\mathrm{d_{x^2-y^2}+d_{x^2-y^2}}$.
$10\sigma_{\mathrm{g}}$ is not degenerate; it is $\mathrm{5s+5s}$.
Now, let us have a look at the beautiful 4d orbitals, kindly provided by our user Philipp:
From here, you can see that no hybridization is necessary, because the $\mathrm{4d}$ and the $\mathrm{5s}$ orbitals can all form bonds within themselves. | {
"domain": "chemistry.stackexchange",
"id": 6587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "transition-metals, hybridization",
"url": null
} |
homework-and-exercises, general-relativity, differential-geometry, differentiation, calculus
Title: Volume of a two-dimensional sphere in a fixed three sphere geometry I'm just starting to read Hartle's Gravity and he gives the following equation for the volume of a 2D sphere of radius $r$ if space was a fixed 3-sphere geometry on page 20.
$$V = 4\pi a^3\left(\frac{1}{2}\sin^{-1}\left(\frac{r}{a}\right)-\frac{r}{2a}\left[1-\left(\frac{r}{a}\right)^2\right]^{1/2}\right).$$
He then claims that if we were to assume that $r/a$ were small, i.e., the radius of curvature of space $a$ were much smaller than the radius of the 2D sphere, then we would get the normal Euclidean formula for the volume of the sphere.
$$V=\frac{4}{3}\pi r^3$$ | {
"domain": "physics.stackexchange",
"id": 85321,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, general-relativity, differential-geometry, differentiation, calculus",
"url": null
} |
optimization, performance, r, vectorization
G <- unique(G)
G2 <- data.table(G, key="ID")
G2 <- G2[, list(sdw = paste0(sort(unique(unlist(strsplit(sdw, split=", ")))), collapse=", "),
sd = paste0(sort(unique(unlist(strsplit(sd, split=", ")))), collapse=", ")) , by = "ID"]
G2 <- data.table( G2, key=c("sd", "sdw"))
G2 <- unique(G2)
Bloc <- G2[-1,]
Bloc$ID <- NULL
N2 <- nrow(Bloc)
if (N1 == N2)
break
}
### Output
Bloc$sdw | {
"domain": "codereview.stackexchange",
"id": 12331,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, performance, r, vectorization",
"url": null
} |
homework-and-exercises, electrostatics, electrical-resistance, capacitance, conductors
is maybe that we need to use $$\rho=\frac{RL}{A},$$ where $L=b-a$ if we consider a coordinate system with the origin at the centre of the spheres, and $A$ increases with distance from the smaller sphere. But this then confuses me... Can anyone help constructively? This was a previous exam question on a paper I will be sitting in a few weeks time. Forget anything about a capacitor and just consider the resistance of the conducting liquid. | {
"domain": "physics.stackexchange",
"id": 30339,
"lm_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, electrostatics, electrical-resistance, capacitance, conductors",
"url": null
} |
homework-and-exercises, newtonian-mechanics, newtonian-gravity, orbital-motion, estimation
For the magnificant spear, E=400 GPa, $I = \frac{\pi}{4}r^2 = 4\cdot 10^{-8} m^4$, and we take $\ell = 1m$ since we assume it is held in the middle.
$$F_{max}\approx 240 kN$$
That seems pretty strong - you could balance 4 elephants on top of the spear, and it will be fine. But here we are talking about a LOT more force - giganewtons, not kilonewtons.
And so - regardless of how strong Obélix is, there is no material in the world strong and dense enough to withstand being accelerated to the kinds of speed needed for this feat. | {
"domain": "physics.stackexchange",
"id": 19317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, newtonian-gravity, orbital-motion, estimation",
"url": null
} |
quantum-mechanics, quantum-field-theory, renormalization, measurement-problem, decoherence
Renormalization is a procedure, when you construct (or deal with) an effective theory, disregarding some degrees of freedom only to threat them as a single object (e.g. instead of four particles only one "effective particle"). Typically you don't "loss" particles, but treat collections of then as a new one. However, the procedure is lossy - i.e. you lose some properties; in particular, from a pure state you can go to mixed ones.
However, typically you rather still hold an approximate pure state, rather than the exact one which (after neglecting some degrees of freedom) is mixed; see e.g.: | {
"domain": "physics.stackexchange",
"id": 3582,
"lm_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, renormalization, measurement-problem, decoherence",
"url": null
} |
# Clock losing time puzzle
The question goes as:
A wall clock and a Table clock are set to correct time today on 10 pm. The wall clock loses 3 minute in 1st hour, 6 minutes in the second hour and 9 minutes in the third hour and so on. The table clock loses 5 minutes in the 1st hour, 10 minutes in the second hour and 15 minutes in the third hour and so on. When will they show the same time?
My approach:
In the first hour, the difference between the two clocks would be $2$ (obtained from $5-3$) minutes.
In the second hour, it'll be four minutes and so on. This would form an arithmetic progression with $a$ = 2 and $d = 2$. I, then, formulated the problem as:
$$2 + 4 + 6+ 8 + \dots + n = 720$$
The RHS is $720$ because I assumed they'll meet after 12 hours.
With this, I got the root as $23.337$ hours, so I arrived at the answer as $10 \, \text{PM} + 23.337$ hours i.e $9:20 \, \text{PM}$.
Is this correct? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347875615794,
"lm_q1q2_score": 0.8141242269802133,
"lm_q2_score": 0.8354835411997897,
"openwebmath_perplexity": 2276.1167408934866,
"openwebmath_score": 0.8130736351013184,
"tags": null,
"url": "https://math.stackexchange.com/questions/2878715/clock-losing-time-puzzle"
} |
# How to calculate the following integral? [duplicate]
How to calculate the following integral? $\int_{- \infty}^{\infty} \mathrm{e}^{- \frac{x^2}{2}} \mathrm{d} x$
-
## marked as duplicate by Marvis, vonbrand, Micah, muzzlator, AmzotiApr 8 '13 at 17:37
The standard method here is to multiply the integral by itself, in the form $\int_{-\infty}^{\infty}e^{\frac{-y^2}{2}}dy$ and then integrate over the plane using polar coordinates. Remember to take the square root at the end. – Jared Apr 8 '13 at 17:08
Hint: Let $y=\frac{x}{\sqrt{2}}$ and make a change of variables, then use the formula $$\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt{\pi}.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.990140144405512,
"lm_q1q2_score": 0.8095133099206352,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 777.8368875856191,
"openwebmath_score": 0.9999926090240479,
"tags": null,
"url": "http://math.stackexchange.com/questions/355024/how-to-calculate-the-following-integral"
} |
human-biology, biochemistry, physiology, skin
Title: How is sebum secretion regulated? The principle of homeostasis in biology says that living organisms try to maintain some sort of equilibrium. Doing that requires the use of feedback mechanisms to regulate things like temperature, salinity, etc. Are there any feedback mechanisms the body uses to regulate the output of the skin's sebaceous glands? If so, what are they, and on what timescale do they operate? Nice question! Unfortunately, the complete list of pathways involved in regulation of sebum production and secretion rate by sebaceous glands are not understood yet (Picardo et al, 2009). However, we know that sebum production is continuous and is not regulated by neural mechanisms (Thiboutot et al, 2004). Retinoids, hormones, and growth factors are known to influence sebaceous gland growth and differentiation (Zouboulis et al, 1998). Also, androgens and growth hormones are known to promote sebaceous gland differentiation (Deplewski et al, 1999, Rosenfield et al, 1998) whereas | {
"domain": "biology.stackexchange",
"id": 7010,
"lm_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, biochemistry, physiology, skin",
"url": null
} |
Remark 2.1 . if near any point c in the domain of f(x), it is true that . When a function is differentiable it is also continuous. The first examples of functions continuous on the entire real line but having no finite derivative at any point were constructed by B. Bolzano in 1830 (published in 1930) and by K. Weierstrass in 1860 (published in 1872). Continuous and Differentiable Functions: Let {eq}f {/eq} be a function of real numbers and let a point {eq}c {/eq} be in its domain, if there is a condition that, Because when a function is differentiable we can use all the power of calculus when working with it. However, not every function that is continuous on an interval is differentiable. Your IP: 68.66.216.17 So the … In particular, a function $$f$$ is not differentiable at $$x = a$$ if the graph has a sharp corner (or cusp) at the point (a, f (a)). That is, f is not differentiable at x … Example of a function that does not have a continuous derivative: Not all continuous functions | {
"domain": "misscarrington.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759621310288,
"lm_q1q2_score": 0.8297646021024566,
"lm_q2_score": 0.8459424373085145,
"openwebmath_perplexity": 284.12264156151207,
"openwebmath_score": 0.8485810160636902,
"tags": null,
"url": "https://www.misscarrington.com/28q0pdz3/fec186-differentiable-vs-continuous-derivative"
} |
days) Pradeep Suresh on 25 Jan 2014. a). We are going to transform a complex number of rectangular form into polar form, to do that we have to find the module and the argument, also, it is better to represent the examples graphically so that it is clearer, let’s see the example, let’s start. The formulas are identical actually and so is the process. If you look at the real and imaginary parts of a complex number as coordinates in a plane, then the real part would be the x coordinate and the imaginary part the y coordinate. Then r = x 2 + y 2 , x r = cos θ and y r = sin θ . By using this website, you agree to our Cookie Policy. by M. 3. Every complex number $$z$$ can be represented as a vector in the Gaussian number plane. See also. 9-1. I also do an example of converting back and forth between the two forms. Proof of De Mar 01, 2009 · The complex number z in geometrical form is written as z = x + iy. The distance is always positive and is called the absolute value or modulus of the | {
"domain": "toromecanico.es",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357259231532,
"lm_q1q2_score": 0.8159628254882636,
"lm_q2_score": 0.8311430499496096,
"openwebmath_perplexity": 434.16522965605,
"openwebmath_score": 0.8907320499420166,
"tags": null,
"url": "https://toromecanico.es/lottery-winning-vc4t8/ozm---complex-number-to-polar-form---d0egx.html"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.