text stringlengths 1 1.11k | source dict |
|---|---|
neural-networks, backpropagation, gradient-descent, stochastic-gradient-descent, mini-batch-gradient-descent
Title: Is back-propagation applied for each data point or for a batch of data points? I am new to deep learning and trying to understand the concept of back-propagation. I have a doubt about when the back-propagation is applied. Assume that I have a training data set of 1000 images for handwritten letters,
Is back-propagation applied immediately after getting the output for each input or after getting the output for all inputs in a batch?
Is back-propagation applied $n$ times till the neural network gives a satisfactory result for a single data point before going to work on the next data point? Short answers
Is back-propagation applied immediately after getting the output for each input or after getting the output for all inputs in a batch? | {
"domain": "ai.stackexchange",
"id": 1061,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neural-networks, backpropagation, gradient-descent, stochastic-gradient-descent, mini-batch-gradient-descent",
"url": null
} |
electromagnetism, electrons
So an eletric field is different from a magnetic field as to how it affects a charged particle, however there is a relation between the two. All the quantities mentionned depend on the referential, exactly like the notion of speed: if you observe an object, you will not measure the same speed depending on whether you are in a train or fixed at some place. The thing I'll skip now are the arguments, the reasoning that led to the following relation, (wikipedia) between the eletric and magnetic field $\vec{\mathbf{E}}_1,\vec{\mathbf{B}}_1$ in a first referential, and those $\vec{\mathbf{E}}_2,\vec{\mathbf{B}}_2$ in a second: (argument in a few words: "symmetry"of the Maxwell equations)
$$ \vec{\mathbf{E}}_2 = \gamma \left( \vec{\mathbf{E}}_1 + \vec{\mathbf{v}} \wedge \vec{\mathbf{B}}_1\right ) - \left ({\gamma-1} \right ) \left( \frac{\vec{\mathbf{E}}_1 \cdot \vec{\mathbf{v}}}{\lVert\vec{\mathbf{v}}\rVert} \right) \vec{\mathbf{v}} $$ | {
"domain": "physics.stackexchange",
"id": 22492,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, electrons",
"url": null
} |
Last edited: Nov 27, 2013
4. Nov 27, 2013
### TeenieBopper
I changed the pdf so it should be technically correct now
So, because it's an absolute value function, it should be:
$$\int_{-2}^{x}\frac{-x}{4} dt + \int_{0}^{x}\frac{x}{4}dt$$? Because then I get $$F(x) = \frac{x^2}{4} - \frac{1}{2}$$ which again, isn't monotone increasing.
Ultimately, my I need to use the inversion method to generate observations from f(x), but in order to do that, I need the CDF.
5. Nov 27, 2013
### vela
Staff Emeritus
No, that's not correct. You need to look at different cases. It may help to sketch the PDF and the region of integration for the various cases.
6. Nov 27, 2013
### LCKurtz
Those $x$'s should be $t$'s, and those two integrals, separately, will be part of your work. By as vela points out, you aren't setting up the problem correctly. Consider the cases $-2<x<0$ and $0<x<2$ separately when considering the integral $\int_{-\infty}^xf(t)~dt$.
7. Nov 27, 2013
### TeenieBopper | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241982893259,
"lm_q1q2_score": 0.8098544058160252,
"lm_q2_score": 0.8354835330070839,
"openwebmath_perplexity": 438.8157624433279,
"openwebmath_score": 0.8283268213272095,
"tags": null,
"url": "https://www.physicsforums.com/threads/finding-the-cdf-from-a-pdf-with-absolute-value-function.725279/"
} |
thermal-radiation
Title: Bunsen Burners and the Sun
Why do Bunsen burners burn blue in the center? What element is being burned?
Why does the sun glow yellow, and not blue-a Bunsen burner is much cooler and yet it burns blue. Is it because the relative size, or are they two different phenomena? (i.e. black body radiation and something else?) A Bunsen Burner typically uses methane, butane, propane or another alkane and these burn blue.
The Wikipedia article on butane has a spectrum showing the $\mathrm{CH}$ radical as the primary source of blue emission:
The three main spikes are: | {
"domain": "physics.stackexchange",
"id": 7711,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermal-radiation",
"url": null
} |
experimental-chemistry, precipitation, salt
Concentrated $\ce{HCl}$ indirectly increases solubility of $\ce{BaSO4(s)}$ by decreasing concentration(more exactly activity) of sulfates by equilibrium
$$\ce{SO4^2-(aq) + H+(aq) <=>> HSO4-(aq) \tag{3}}$$
what partially shifts the precipitation equilibrium (1) to the left in favor of dissolved barium and sulfate ions.
Depending on the ratio of the precipitate and acid, the (partial) dissolving of the precipitate $\ce{BaSO4(s)}$ in concentrated HCl
$$\ce{BaSO4(s) + H+(aq) <=>[HCl] Ba^2+(aq) + HSO4-(aq) \tag{4}} $$
may or may not be noticeable.
That means if you put just a little amount of the precipitate to a large excess of the acid, it may dissolve completely or at least significantly. If, OTOH, you put large amount of precipitate to relatively small volume of acid, you may not notice at all, if e.g. 1% of it has dissolved. | {
"domain": "chemistry.stackexchange",
"id": 16444,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "experimental-chemistry, precipitation, salt",
"url": null
} |
newtonian-mechanics
so that:
$$ V'(z') = \frac 1 2 kz'^2 + \frac 1 2 \frac{(mg)^2} k$$
What?! The term is still there, albeit with a different sign. This is the internal energy in the compressed spring.
Operating the spring about a new equilibrium point because of the addition of external field does not change the force about the equilibrium position, but it does change the internal energy of the system at the equilibrium position.
Regarding the fact that the effective spring constant in the two spring system is:
$$ k_{\rm eff} = k_1 + k_2 $$
You are adding the spring in parallel, which, like capacitors, add linearly. | {
"domain": "physics.stackexchange",
"id": 72417,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics",
"url": null
} |
performance, vba, excel
'Find the match
Do While src.Worksheets(1).Range(d & 1).Value <> "" And fnd = False
If mks = "" Or mgc = "" Or sm = "" Then
'Also need to pull out MGC, MKS, & SM
Select Case src.Worksheets(1).Range(d & 1).Value
Case "ItemGroupCode"
mgc = d
Case "ItemKey"
mks = d
Case "SubMeasure"
sm = d
End Select
End If
If src.Worksheets(1).Range(d & 1).Value = os.Range(c & 1).Value Then
'Match, update the dictionary
ColDict(j, 1) = d
'temp = src.Worksheets(1).Range(d & 1).Value
fnd = True
Else
d = ColNumToStr(ColStrToNum(d) + 1)
End If 'else no match, in the case a match is never found (CRM_Phone2) ColDict(j, 1) should be left blank (the default)
Loop | {
"domain": "codereview.stackexchange",
"id": 20653,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, vba, excel",
"url": null
} |
ros, robot, pr2
Title: robot (PR2) physical information
Hello
I've been working with lasers for laser avoidance, and because of the Eigen/Core bug, I skipped using a Laser projector and did the computation of tilt scan into base scan by hand. Rotation is ok, I still need to translate my data between frames (robot tilt height to robot base height, etc.). So I would know if a physical description of the robot (base width, length of joints) is available or I should define myself the distances I need (by measuring, which is the worst solution).
Of course, if you are able to answer my question on Eigen/Core, that would be the best option, imho.
Thanks,
Erwan
Originally posted by Erwan R. on ROS Answers with karma: 697 on 2014-11-28
Post score: 0
You should really be able to use TF for this, to transform points from one frame to another.
That Eigen bug looks suspiciously old. You probably aren't running into the same issue as the original author. I'll respond there. | {
"domain": "robotics.stackexchange",
"id": 20194,
"lm_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, robot, pr2",
"url": null
} |
where the lines (from the point where. The center of gravity is on the 1/3 of the triangle base length. Defuzzification is interpreting the membership degrees of the fuzzy sets into a specific decision or real value. September 2006 "Mechanics is the paradise of the mathematical sciences because by means of it one comes to the fruits of mathematics. It is also called the geometrical centre or the centre of gravity. The center of gravity location must be referenced to a 3 dimensional coordinate system. You need to be especially careful when you are doing problems involving gravity pulling something down a slope. Gravity decreases with the square of the distance. Rear-Engine Debate: Porsche Cayman R vs. Location of centre of gravity of a hemisphere: Find out the location of centre of gravity of a hemisphere of radius a. A small stability triangle leaves less room for the center of gravity to wander left or right if the frame is not perfectly level. If an object does not have a uniform | {
"domain": "rafbis.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806506825456,
"lm_q1q2_score": 0.8254779448344705,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 304.50342906770857,
"openwebmath_score": 0.5220875144004822,
"tags": null,
"url": "http://rafbis.it/azhy/center-of-gravity-formula-for-triangle.html"
} |
c++, reinventing-the-wheel
And write tests! I even recommend writing the tests before you write the code! You could make a simple test type that can detect when it hasn’t been initialized (for example, in the constructor, record its address in a static list, and if you’re trying to move-assign over an object whose address isn’t in the list, you’ve detected a bug), and use that in your vector. You could test inserts at the beginning, middle, and end of a 10 element vector, with insert sizes from 1 to 12. Test! Test! Test! Code without tests is just garbage—just throwaway crap you might have fun playing with for a while, but can’t use in serious projects. Pick a test library—I like Boost.Test, but something simpler like Catch2 is also great; you can even use Google Test if you’re masochistic, I suppose. (Actually, Catch2’s tutorial even shows some basic testing of std::vector.) I’d even argue that being able to write good tests is a more important skill than being able to just code from the hip. | {
"domain": "codereview.stackexchange",
"id": 38736,
"lm_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++, reinventing-the-wheel",
"url": null
} |
c
* as shown below:
* {8, 15, 9, 4, 8, 7, 15, 1, 6, 9, 4, 3}, here {8, 15, 9, 4} are round 2 elements
* the same process will continue among round two elements to get to round Three and so on.
* finally we will be left with the single element which is the winner and the complete
* structure looks as:
* {15, 15, 9, 8, 15, 9, 4, 8, 7, 15, 1, 6, 9, 4, 3} 15 is the winner.
CASE: odd
* This time take the example: {8, 7, 15, 1, 6, 9, 4}
* we will proceed in the same way as we do earlier, only the difference is we are left
* with 1 element in round 1 having not any pair, so this element will be moved to round
* two without any comparison and the view looks as:
* {15, 6, 9, 8, 7, 15, 1, 6, 9, 4}
* please note 8 is not put twice and is shared among round one and two for the view purpose
* and so we will move further as we did. finally complete structure looks as:
* {15, 15, 9, 15, 6, 9, 8, 7, 15, 1, 6, 9, 4} 15 is the winner.@endverbatim
* @param tour tournament to be printed. | {
"domain": "codereview.stackexchange",
"id": 36648,
"lm_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, excel, pandas, statistics, data-visualization
# create pie charts, xlsx and save locally
with pd.ExcelWriter("foo.xlsx",
engine="xlsxwriter",
options={"strings_to_urls": False}) as writer:
workbook = writer.book
worksheet = workbook.add_worksheet("Summary Charts")
worksheet.hide_gridlines(2) | {
"domain": "codereview.stackexchange",
"id": 36287,
"lm_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, excel, pandas, statistics, data-visualization",
"url": null
} |
c#, mysql, database
Why do you always open a transaction? Why is your connection string hard-coded?
This code:
doesn't follow capitalization standards,
doesn't use a using statement to encapsulate classes that implement IDisposable (which should also be used when dealing with MySqlCommand and MySqlDataReader etc.),
has bad variable names like readerSql, usernameMySql,... | {
"domain": "codereview.stackexchange",
"id": 18142,
"lm_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#, mysql, database",
"url": null
} |
pressure, air
I doubt this proposal will help you very much, what with requiring some fairly specialised equipment!
Please also consider using a variable inline regulator on your superdupersoaker; 200 bar is rather a lot for something that will presumably be aimed at a human being. A first-cut calculation with Bernoulli's equation suggests the water would exit at around 200 m/s! | {
"domain": "physics.stackexchange",
"id": 70595,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pressure, air",
"url": null
} |
c#, wpf
So this line:
bool alreadyExists = lstMainData.Any(x => x.intNO == item.NO);
will become:
var alreadyExists = lstMainData.Any(x => x.intNO == item.NO);
MainData:
public class MainData
{
public int No { get; set; }
public string OrderNumber { get; set; }
public string TypeNumber { get; set; }
public int Color { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public string Status { get; set; }
public DateTime? StatusChanged { get; set; }
public MainData (int no, string orderNumber, string typeNumber, int color, int width, int height, string status, DateTime? statusChanged)
{
No = no;
OrderNumber = orderNumber;
TypeNumber = typeNumber;
Color = color;
Width = width;
Height = height;
Status = status;
StatusChanged = statusChanged;
}
} | {
"domain": "codereview.stackexchange",
"id": 11060,
"lm_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#, wpf",
"url": null
} |
python, python-3.x
if hashed == hashed_passwordinput:
print("Access Granted")
else:
print("Wrong password!!")
except FileNotFoundError:
print("Username not found!!1!")
Security
This code will read any .txt file that is accessible to the process. If the user can upload a file /tmp/uploads/myhash.txt, then they can give "/tmp/uploads/myhash" as a "user name", type in the required text that hashes to the given result, and be granted access.
You should sanitize the userinput to ensure it only contains valid username characters. | {
"domain": "codereview.stackexchange",
"id": 42591,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x",
"url": null
} |
javascript, jquery, validation
using the revealing module pattern
calling a function to check the status of whether the dialog is visible
encapsulating the variable as a property of an object (potentially with the es6 class syntax - possibly with private class fields) | {
"domain": "codereview.stackexchange",
"id": 43597,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery, validation",
"url": null
} |
ros, ros-kinetic
Original comments
Comment by 404RobotNotFound on 2022-02-01:
@Delbina Did you end up solving your issue or are you still having problems?
Comment by Delbina on 2022-02-01:
I have put false the angular velocity from the wheel odometer. it seems not bad. i have accepted the answer, and if there was any other issue, I will ask here.
thanks a lot
Edit
@Delbina Something I should have noticed the first time, your kalman filter accepts the angular Z value from both the odometry ( from the diff drive controller, not the one produced by the kalman filter ) and the imu. I would check the message from both of those while running and make sure that they generally agree. If they are different, then I would choose the one you think is more correct.
It is probably best to view them with rqt_plot, where you can just add the angular z values to the plot and it will plot them side-by-side for you. | {
"domain": "robotics.stackexchange",
"id": 37399,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-kinetic",
"url": null
} |
sql, vb.net, ms-access
The Year column stores years (Say, 2016), Month stores months (1-12), and period stores the period of the month/year - eg; November 2016 = 11/16, so period = 1116.
In the table, it stores from 2016, to 2030, so 14 years worth.
In my code I currently have the following Try statement on my main forms Load event. The aim of this code is that on the 1st January each year, the table updates and sets the Year column to 15 years in advance where year = current year -1, and then creates the periods.
It currently uses one update for each record - Is there a way I can reduce the code here to less queries, but still get the desired effect?
For instance, 01/01/2017 will set all Year values to 2031 WHERE Year = 2016, and then (this is the part I struggled with), set the periods to correspond with the month and year of that record?
Try
Dim current As String = Convert.ToString(Date.Today)
Dim year As String = Convert.ToString(Date.Today.AddYears(-1).Year) | {
"domain": "codereview.stackexchange",
"id": 22725,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "sql, vb.net, ms-access",
"url": null
} |
Here’s a concrete construction.
Let $L_k$ be the line with equation $y=kx+k^2$. $L_k$ and $L_m$ intersect at
$$p(k,m)=\langle-(k+m),-km\rangle\;.$$
Clearly $p(k,m)=p(r,s)$ iff $k+m=r+s$ and $km=rs$. However, on the line $x+y=a$ we have $xy=x(a-x)$, which as a function of $x$ is at most $2$-to-$1$, and clearly $p(k,m)=p(m,k)$, so either $r=k$ and $s=m$, or $r=m$ and $s=k$. Thus, $p(k,m)\ne p(r,s)$ whenever $\{k,m\}\ne\{r,s\}$.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211597623863,
"lm_q1q2_score": 0.814447030601553,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 161.89254605455557,
"openwebmath_score": 0.8671532869338989,
"tags": null,
"url": "http://math.stackexchange.com/questions/270937/how-can-you-construct-as-many-intersections-as-possible-with-n-lines"
} |
standard-model, higgs, large-hadron-collider
The point is that there are both lower and upper bounds on the mass of the Higgs boson. The LHC should be able to cover pretty much the entire range that has not yet been searched, so if it doesn't find the Higgs, we can be fairly confident that something is wrong with the Standard Model. | {
"domain": "physics.stackexchange",
"id": 260,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "standard-model, higgs, large-hadron-collider",
"url": null
} |
# Intersection Line for Two Planes
1. Oct 17, 2015
### kieth89
1. The problem statement, all variables and given/known data
Find an equation of the line where the planes Q and R intersect.
$Q: -2x + 3y - z = 1; R: x + y + z = 0$
2. Relevant equations
Equation of a Plane: $ax + by + cz = d,$where $\vec{n} = <a, b, c>$
Equation of a Line in $R^{3}$: $\vec{r}(t)=<x_{0}, y_{0}, z_{0}> + t<x,y,z>$
3. The attempt at a solution
First I find a point common to both planes, this will be $P_{0}$.
Set $y = 0$ and add the plane equations:
$-2x + 0y - z - 1 = 0$
$1x + 0y + z - 0 = 0$
Resulting in: $-x - 1 = 0$ so $x = -1 , z = 1$ and $P_{0} = (-1, 0, 1)$.
Now I find the direction vector for our line. This will just be the cross product of the normal vectors from the two plane equations:
$<-2, 3, -1> X <1, 1, 1> = <4, 1, -5>$
Now I just plug the obtained info into the equation for a line:
$\vec{r}(t) = <-1, 0, 1> + t<4, 1, -5> -> \vec{r}(t) = <-1 + 4t, t, 1 - 5t>$ | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429599907709,
"lm_q1q2_score": 0.815131149737114,
"lm_q2_score": 0.82893881677331,
"openwebmath_perplexity": 563.7644594261318,
"openwebmath_score": 0.6543372869491577,
"tags": null,
"url": "https://www.physicsforums.com/threads/intersection-line-for-two-planes.838296/"
} |
It is currently 19 Nov 2017, 05:52
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# Concept doubt from number property
Author Message
TAGS:
### Hide Tags
Manager
Joined: 29 Jul 2012
Posts: 185
Kudos [?]: 118 [1], given: 23
GMAT Date: 11-18-2012
Concept doubt from number property [#permalink]
### Show Tags | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.8311430457670241,
"lm_q2_score": 0.8311430457670241,
"openwebmath_perplexity": 1873.9175549630347,
"openwebmath_score": 0.47573745250701904,
"tags": null,
"url": "https://gmatclub.com/forum/concept-doubt-from-number-property-144325.html?oldest=1"
} |
classical-mechanics, thermodynamics, angular-momentum, rotational-dynamics
$(1,0,0) - (\sin(27),0,\cos(27)) = (0.55,0,-.89)$
which is a vector of length 1.05 and so the angular momentum of the asteroid has to be 1.05 times the angular momentum of the earth.
Make the approximation that the earth is a sphere of constant density. Then its angular momentum is given by $0.4 M_e\omega\;R_e^2$ where $M_e,R_e$ are the mass and radius of the earth and $\omega$ is its angular rate of rotation. We have
$M_e = 6\times 10^{24}\;kg\;\;\;R_e = 6.4\times 10^6\;m,\;\;\;\omega = 2\pi/(24\;hours) = 2\pi/ (86400\;sec)$.
I'm using sloppy approximations here; the earth is not constant density, I'm not using the sidereal day, etc. This gives $7\times 10^{33}\;kg\;m^2/s$ as the approximate angular momentum contributed by the asteroid. | {
"domain": "physics.stackexchange",
"id": 395,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, thermodynamics, angular-momentum, rotational-dynamics",
"url": null
} |
ads-cft, holographic-principle
Mathematics is not a deductive science—that's a cliché. When you try to prove a theorem, you don't just list the hypotheses, and then start to reason. What you do is trial and error, experimentation, guesswork. You want to find out what the facts are, and what you do is in that respect similar to what a laboratory technician does.
Provisional results derived from the AdS/CFT correspondence may also inspire productive physical experiments in the same way that any theory does. Remember that even the illustrious Standard Model of Particle Physics hasn't been rigorously defined yet (non-perturbatively, not even on a lattice as far as I know$^{\dagger\dagger}$), but it has still been immensely fruitful. | {
"domain": "physics.stackexchange",
"id": 61413,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ads-cft, holographic-principle",
"url": null
} |
# Difference between revisions of "2018 AMC 8 Problems/Problem 11"
## Problem 11
Abby, Bridget, and four of their classmates will be seated in two rows of three for a group picture, as shown. $\begin{eqnarray*} \text{X}&\quad\text{X}\quad&\text{X} \\ \text{X}&\quad\text{X}\quad&\text{X} \end{eqnarray*}$ If the seating positions are assigned randomly, what is the probability that Abby and Bridget are adjacent to each other in the same row or the same column?
$\textbf{(A) } \frac{1}{3} \qquad \textbf{(B) } \frac{2}{5} \qquad \textbf{(C) } \frac{7}{15} \qquad \textbf{(D) } \frac{1}{2} \qquad \textbf{(E) } \frac{2}{3}$
## Solution 1
There are a total of $6!$ ways to arrange the kids.
Abby and Bridget can sit in 3 ways if they are adjacent in the same column: $\begin{eqnarray*} \text{A}&\quad\text{X}\quad&\text{X} \\ \text{B}&\quad\text{X}\quad&\text{X} \end{eqnarray*}$
$\begin{eqnarray*} \text{X}&\quad\text{A}\quad&\text{X} \\ \text{X}&\quad\text{B}\quad&\text{X} \end{eqnarray*}$ | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787853562028,
"lm_q1q2_score": 0.8000875913965341,
"lm_q2_score": 0.8104789155369047,
"openwebmath_perplexity": 360.97153128759436,
"openwebmath_score": 0.5382468700408936,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2018_AMC_8_Problems/Problem_11&diff=135833&oldid=110581"
} |
electromagnetism, thermodynamics, energy, experimental-physics, electrons
The shape of the cathode does not matter. The material does. Key to solving this problem is knowing the work function of the material - that is the minimum energy that an electron needs to escape the metal. When you know that, you can compute the distribution - it is simply the distribution of energy of electrons inside the material (which follows a Boltzmann distribution) minus the work function (energy lost to pull away from the metal). This results in a "truncated" Boltzmann distribution - the shape is given by the distribution / energy that the electrons have inside the metal, but then you shift the entire curve to the left (by the work function).
You may be familiar with the Richardson equation which describes the total thermionic current (he received the Nobel Prize in Physics for this work in 1928) - but that describes total current, not velocity distribution:
$$J = A_G T^2 e^{-W/kT}$$ | {
"domain": "physics.stackexchange",
"id": 16372,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, thermodynamics, energy, experimental-physics, electrons",
"url": null
} |
digital-communications, impulse-response, inverse
Title: How to get the inverse of Filter based on channel Given a signal $X$, and a channel $h$, and the received signal $Y = Filter(h,1,X);$
What's the inverse of filter, it means if I know $h$, how can I get back $X$ ? It's not possible to recover the original signal $X$ based on $h$ perfectly !!
$Filter$ or $conv$ are usually performed in time domain, so it's similar "But not exactly" to $y = conv(X,h)$ , So in that case after you know $h$ or in other words after you estimate $h$ , you need to use any equalizer like $ZF$ or $MMSE$ to get back $X$. Of course, equalization will be performed in frequency domain, since that equation you mentioned above is equivalent to $Y = X . H$ and you go into frequency domain using $fft$. | {
"domain": "dsp.stackexchange",
"id": 7836,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "digital-communications, impulse-response, inverse",
"url": null
} |
c#, beginner, mvc, controller
var tbs = db.tb_Student.FirstOrDefault(s => s.ID == StudentID);
We're going to start with this block as it made me the least happy when I saw it.
There are four glaring issues here:
You search db.tb_Student twice, guaranteed.
You use .Count() to check if it exists.
You wrap a significant amount of work in a try/catch block, that doesn't need to be.
You treat sfh really weirdly.
Obviously we want to cut down on the work we do, always. I'm going to assume that tb_Student is a class. In this case, we can immediately reduce a lot of the work we do right off the bat.
var tbs = db.tb_Student.FirstOrDefault(s => s.ID == StudentID);
We're going to put this before our if statement, since C# and EF behave in a very predictable way. If there is no tb_Student record matching the ID, tbs will be null. We're going to modify our if to account for that.
if (tbs == null)
{
// Do stuff
} | {
"domain": "codereview.stackexchange",
"id": 23396,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, mvc, controller",
"url": null
} |
algorithms, algorithm-analysis
When looking for the "best" (fewest number of substitutions) solution, is it possible to efficiently find this solution, or do you have to compute every possible solution set with the maximum wins and then calculate which one has the minimum substitutions? The usual rule here is to ask one question per post. I'll explain how to formalize this problem and suggest an efficient algorithm for solving the problem. Here is a formalization of the problem:
Given: arrays $A[1..n]$, $B[1..n]$
Goal: find a permutation of $A$, call it $A'$, that maximizes the number of indices $i$ such that $A'[i] > B[i]$.
This can be viewed as an instance of bipartite matching, a problem which has efficient algorithms. In particular, draw a bipartite graph with an edge from vertex $i$ to vertex $j$ if $A[i] > B[j]$. Now the maximum matching in this graph corresponds to a permutation of $A$ that yields the maximum number of wins. Thus you can use standard algorithms for bipartite matching, e.g., Hopcroft-Karp. | {
"domain": "cs.stackexchange",
"id": 11307,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, algorithm-analysis",
"url": null
} |
(...) However, it seems that for any fixed circle, the probability that a random one is linked with it is bounded away from $0$, so there may be a clever coupling argument to use E-R random graphs. My guess is that the answer to all 3 questions is positive, except possibly Q3 when $S$ is lower-dimensional (in fact, a segment is my best bet to provide a negative example to Q3). – Benoît Kloeckner Apr 27 '13 at 18:46
@Benoît: Yes, I noticed that random graph results seem not to suffice, at least not directly. Excellent point about lower-dimensional $S$! I was implicitly assuming vol$(S) > 0$. – Joseph O'Rourke Apr 27 '13 at 18:56 | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877717925421,
"lm_q1q2_score": 0.8024790313732346,
"lm_q2_score": 0.8267117962054049,
"openwebmath_perplexity": 326.95661433114503,
"openwebmath_score": 0.8795554041862488,
"tags": null,
"url": "http://mathoverflow.net/questions/128940/random-rings-linked-into-one-component"
} |
primes, windows, assembly, nasm
; memory from rsp+0 .. rsp+31 has potentially been stepped on by printf
; leave RSP where it is, ready for another call
;;; scanf into that 8-byte block of stack space above the shadow space, or into our *own* shadow space
lea rdx, [rsp+32] ; stack addresses are normally 64-bit, can't get away with edx
lea rcx, [scan_fmt]
mov dword [rdx], 0 ; instead of error check, set n = 0 in case of I/O error
call scanf
;cmp eax, 1 ; success = exactly 1 conversion
;jnz .scanf_fail ; TODO: error check
mov r8d, [rsp+32] ; r8d: 32-bit unsigned number to be checked
cmp r8d, 3
jbe .prime ; 2 is prime, and let's consider 0 and 1 prime as well.
; catch 3 here so the loop can avoid the 3%3 == 0 corner case
test r8b, 1 ; all *other* even numbers (LSB=0) are non-prime
jz .notprime | {
"domain": "codereview.stackexchange",
"id": 32159,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "primes, windows, assembly, nasm",
"url": null
} |
c#, .net, linq, generics, .net-core
HtmlConverter noteConverter = new HtmlConverter(mainDocumentPart);
var nameByBusinessElement = new Dictionary<string, List<ProjectObject<Element>>>();
string elementName;
foreach (var element in businessDictionary)
{
elementName = element.TargetObject.Name;
if (!nameByBusinessElement.ContainsKey(elementName))
nameByBusinessElement.Add(elementName, new List<ProjectObject<Element>>());
nameByBusinessElement[elementName].Add(element);
}
List<OpenXmlElement> notes = new List<OpenXmlElement>();
int noteIndex = 1; | {
"domain": "codereview.stackexchange",
"id": 38462,
"lm_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#, .net, linq, generics, .net-core",
"url": null
} |
gravitational-waves, polarization
A circularly polarised gravitational wave would be observed coming from a binary system (e.g. a pair of black holes), where the system geometry has the orbital plane in the plane of the sky. i.e. a "face-on" orbit. An edge-on binary would produce linearly polarised GWs.
Since gravitational waves are sensitive to the difference in arm lengths between two perpendicular arms, they do have sensitivity to polarisation, though it is to some extent degenerate with respect to the position of the source with respect to the detector. A network of detectors can in principle determine both the direction and orbital plane inclination of the binary system - which in turn determines the degree of linear vs circular polarisation. However I'm not sure that the handedness (determined by whether the components are $\pm \pi/2$ out of phase) has been determined. | {
"domain": "physics.stackexchange",
"id": 84896,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gravitational-waves, polarization",
"url": null
} |
python, algorithm, reinventing-the-wheel, heap
V2:
def __siftdown(self, index): #v2
current_value = self.__array[index]
left_child_index, left_child_value = self.__get_left_child(index)
right_child_index, right_child_value = self.__get_right_child(index)
# the following works because if the right_child_index is not None, then the left_child
# is also not None => property of a complete binary tree, else left will be returned.
best_child_index, best_child_value = (left_child_index, left_child_value)
if right_child_index is not None and self.comparer(right_child_value, left_child_value):
best_child_index, best_child_value = (right_child_index, right_child_value)
if best_child_index is not None and self.comparer(best_child_value, current_value):
self.__array[index], self.__array[best_child_index] =\
best_child_value, current_value
self.__siftdown(best_child_index)
return | {
"domain": "codereview.stackexchange",
"id": 32736,
"lm_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, reinventing-the-wheel, heap",
"url": null
} |
python, beginner, game, pygame, snake-game
def draw(self):
"""Set what to render and blit on the pygame screen."""
self.set_rend()
self.screen.blit(self.rend, self.rect)
def set_rend(self):
"""Set what to render (font, colors, sizes)"""
font = pygame.font.Font(resource_path("resources/fonts/freesansbold.ttf"),
int((var.BOARD_SIZE * var.BLOCK_SIZE) * self.scale))
self.rend = font.render(self.text, True, self.get_color(),
self.get_background())
def get_color(self):
"""Get color to render for text and menu (hovered or not).
Return
----------
color: tuple of 3 * int
The color that will be rendered for the text block.
"""
color = pygame.Color(42, 42, 42)
if self.type == "menu":
if self.hovered:
pass
else:
color = pygame.Color(152, 152, 152)
return color | {
"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
} |
performance, vba, excel
The program is taking about 20s to sort/match & output the final data into a spreadsheet, but I need it to be faster then that. Currently the whole process takes about 40s to generate the report for 10k lines of test data, but i have to generate the report for 1 million lines in about a minute.
Sub SortHierarchyList() | {
"domain": "codereview.stackexchange",
"id": 43026,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, vba, excel",
"url": null
} |
measurement, communication-standard
Title: What are the features/aspects/characteristics of any signal? When Signal Processing experts measure signals, what are the features they measure in minimum (true to all signals)?
Time (discrete/continuous)
Amplitude/magnitude/value (discrete/continuous)
Frequency (discrete/contnious)
Is this list correct and anyway is there anything else that Signal Processing experts measure for any given signal? When I consider "measure", I think of what test equipment would report about waveforms I am evaluating. For this purpose, the list in unbounded. Further for each of these there is no common denominator (no common set of low level "signals") that is used, as it is based on the sensor, which could be voltage, pressure, temperature, etc. I don't think we can bound the types of sensors that could possibly exist.
EVM
Insertion Loss
Return Loss
Current
Voltage
Frequency
Bit Error Rate
Allan Deviation
Standard Deviation
Power
Phase Noise
... | {
"domain": "dsp.stackexchange",
"id": 11006,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "measurement, communication-standard",
"url": null
} |
This means the inner double integral (over $x$ and $y$) can be rewritten: $$\int_{-\sqrt{1-z^2}}^{\sqrt{1-z^2}} \left( \int_{-\sqrt{1-y^2-z^2}}^{\sqrt{1-y^2-z^2}} \sqrt{x^2+y^2+z^2}\, dx\right)dy = \int_{-\sqrt{1-z^2}}^{\sqrt{1-z^2}} g(y,z)\, dy. \tag2$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137879323497,
"lm_q1q2_score": 0.8266843906876348,
"lm_q2_score": 0.8418256452674008,
"openwebmath_perplexity": 121.2599693296942,
"openwebmath_score": 0.9693625569343567,
"tags": null,
"url": "https://math.stackexchange.com/questions/1910249/triple-integral-in-a-sphere"
} |
heat-transfer, renewable-energy, energy-storage
Title: Does a fully mechanical heat pump make sense? Is it reasonable to operate a fully mechanical heat pump? For example, using a linear back-and-forth motion from a vortex bladeless turbine to operate a mechanical compressor to heat (or cool off) a sizeable container of water? Virtually every possible way of doing this is already out there.
For bolt-ons, you can find propshaft pto chain drives and belt drives, hydraulic and mechanical engine pto systems, and front of block bolt-ons that are fan belt driven or bolted to the propshaft head.
Stand alone systems are available from suitecase sized to boxcar sized.
https://www.yanmar.com/global/energy/ghp/
We expect that you do some research before you ask here. Any google search will give you many examples. There are millions of these out there used where shaft power is readily available (like on ships) or where electricity is scarce or sketchy.
Some references for further research. | {
"domain": "engineering.stackexchange",
"id": 4647,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "heat-transfer, renewable-energy, energy-storage",
"url": null
} |
measurements
My book has messed all these terms up and I'm having a headache trying to grasp my head around what all these numbers and terms MEAN. Any help will be appreciated :) Well, 0.004 is the relative uncertainty corresponding to those measurement results - note that $0.1/22.4\approx 0.004$. From a terminology perspective, I would agree that this is a question of precision. I'd need a direct quote from a source using the word "accuracy" in order to speak more on how appropriate the term is to the situation. | {
"domain": "physics.stackexchange",
"id": 77076,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "measurements",
"url": null
} |
deep-learning, keras, ann
Title: MLP sequential fitting I am fitting a Keras model, using SGD
Input dataset X_train has 55000 entries.
Can anyone explain the yellow highlighted values?
For me, when each epoch is done, this should correspond to 55000/55000.
model = keras.models.Sequential()
model.add(keras.layers.Flatten(input_shape=[28,28]))
model.add(keras.layers.Dense(300, activation="relu"))
model.add(keras.layers.Dense(100, activation="relu"))
model.add(keras.layers.Dense(10, activation="softmax"))
model.compile(loss="sparse_categorical_crossentropy", optimizer="sgd",metrics=["accuracy"]) | {
"domain": "datascience.stackexchange",
"id": 9076,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, keras, ann",
"url": null
} |
oversampling
Title: Is my model classification overfitting? Is this possible to be just a bad draw on the 20% or is it overfitting? I'd appreciate some tips on what's going on. A few comments:
You don't mention number of classes or distribution. Unless the classes are balanced, you should use precision/recall/f1-score instead of accuracy (if your majority class is 75%, accuracy can be 75% just by always predicting this class).
It's also unclear what your validation set is used for?
When your feature is represented as bag of words, it's not one feature anymore, it's as many as the vocabulary size. This is important because if it's very large you're very likely to have overfitting. Btw this is certainly why you improve performance when you remove some words.
Generally you should remove all the rare words, which are useless for the model and often cause overfitting.
A difference of 78% on the validation set down to 75% on the test set is not necessarily worrying, but that depends on other factors. | {
"domain": "datascience.stackexchange",
"id": 10811,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "oversampling",
"url": null
} |
do carry a few subtleties not present in the Cartesian system, because the direction of the axes depends on position. Polar coordinates describe a point P as the intersection of a circle and a ray from the center of that circle. Polar Necessities This activity recaps many concepts taught in your trigonometry class. Jeff Hanson 30,327 views. This is shown in the following diagram. Exact state equations for the MP filter are derived without imposing any restrictions on own-ship motion; thus, prediction accuracy inherent in the traditional Cartesian. Thcse coordinate transformations are particularly complex if range rate (5) and range acceleration (S) are used. 2 - Calculus with Parametric Curves - Exercises 11. (d) Convert the point ( 2;5) to polar coordinate form, express rexactly, and approximate to the nearest 0:1. Get the analytical solution of elastic pendulum with the parameters in the table. 7 Two-Dimensional Polar Coordinates • Although Newton’s 2nd law takes a simple form in | {
"domain": "metrokaralis.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.990140142659816,
"lm_q1q2_score": 0.8251081316348945,
"lm_q2_score": 0.8333245932423308,
"openwebmath_perplexity": 406.21296170265595,
"openwebmath_score": 0.9168432354927063,
"tags": null,
"url": "http://dyyx.metrokaralis.it/equation-of-motion-in-polar-coordinates.html"
} |
python, performance, object-oriented, image
Whether this deserves a separate function or can be inlined is your choice. If you need to type this a lot, or if the method of grayscaling can change in the future, it will be easier to put it in a separate method.. You could also move the colorspace to the arguments to make this more versatile and also accept HSV or Luv encoded images.
def sobel_xy(gray, sobel_kernel=3, absolute=True):
sobel_x = cv2.Sobel(gray, cv2.CV_64F, 1, 0, ksize=sobel_kernel)
sobel_y = cv2.Sobel(gray, cv2.CV_64F, 0, 1, ksize=sobel_kernel)
if absolute:
sobel_x, sobel_y = np.absolute(sobel_x), np.absolute(sobel_y)
return sobel_x, sobel_y
This calculation is done in all methods, so refactoring it is simple and effective
def gradient_magnitude(gray, sobel_kernel=3):
return np.hypot(*sobel_xy(gray, sobel_kernel))
def gradient_direction(gray, sobel_kernel=3):
return np.arctan2(*sobel_xy(gray, sobel_kernel)) | {
"domain": "codereview.stackexchange",
"id": 30245,
"lm_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, object-oriented, image",
"url": null
} |
ros
Originally posted by ahendrix with karma: 47576 on 2016-02-18
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 23808,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
quantum-mechanics, quantum-eraser
This explains to me why we have to bother with the C and D detectors at all: otherwise we could just turn them off, so that 'particle-like' photons are detected at A and B, and 'wave-like' are left undetected at all.
But now the question: is the impossibility of creating a crystal which would provide entangled photon pairs in a statistically significant amounts (say, 75% of all produced pairs) a technical limitation or a fundamental law? As I see it now, creating such a crystal would allow us to break the no-communication theorem in DCQE, and since the no-communication theorem is strictly rooted in the current QM theory, then existence of such a crystal would require us to revisit the QM theory — not some interpretation, but the very equations it is based on, like Schrodinger's equation? If so, then by the means of QM theory we could derive even some theoretical maximum efficiency rate for SPDC process taking place in a BBO crystal or other type of entangle-splitter? | {
"domain": "physics.stackexchange",
"id": 83611,
"lm_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-eraser",
"url": null
} |
gazebo, simulation, ros2
Originally posted by Serafadam on ROS Answers with karma: 170 on 2021-06-29
Post score: 1
Firstly, I'd try with the baseline TB3 in our little demo world with your launch files / scripts. This way we can tell what issues are in the navigation configuration and which may be caused by your specific environment model or robot models.
Secondly, there may be a serious issue if you see any AMCL particle clouds. AMCL is the localization engine but you've explicitly said you want to be doing SLAM, so you should not expect to see anything from AMCL because it shouldn't even be running. | {
"domain": "robotics.stackexchange",
"id": 36603,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, simulation, ros2",
"url": null
} |
performance, array, vba, modules
Function SheetExists(sheetName As String, Optional targetBook As Workbook) As Boolean
Dim targetSheet As Worksheet
If targetBook Is Nothing Then Set targetBook = ActiveWorkbook
On Error Resume Next
Set targetSheet = targetBook.Sheets(sheetName)
On Error GoTo 0
SheetExists = Not targetSheet Is Nothing
End Function
Sub CreateSheet(ByVal targetBook As Workbook, ByVal sheetName As String)
With targetBook
.Sheets.Add(After:=.Sheets(.Sheets.Count)).Name = sheetName
End With
End Sub
You could also use a sheet's CodeName property - View Properties window (F4) and the (Name) field (the one at the top) can be used as the worksheet name. This way you can avoid Sheets("mySheet") and instead just use mySheet. But, that would be creating a need to set the CodeName of the sheet after you create it, so I don't know how useful it would really be. | {
"domain": "codereview.stackexchange",
"id": 29485,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, array, vba, modules",
"url": null
} |
python, performance, programming-challenge, complexity
Suggested solution
I'd rewrite the code altogether. Instead of posting the solution here, I have posted it as a Code Review question.
Observe, in particular, that the main() function is only five lines long, and gives an overview of the strategy:
def main(fileinput):
rules = read_rules(fileinput)
if rules['not']: # Ruleset without "not" rules must be self-consistent
rules = subst_rule_words(rules, rhyme_map(rules))
rules = subst_rule_words(rules, union_map(rules))
print('wait what?' if any(x == y for x, y in rules['not']) else 'yes')
Also note that the functions are reusable and composable. If I take out the line with rhyme_map(), then all support for rhyming equivalence is dropped. If I take out the line with union_map(), then the code will only detect self-inconsistencies within each independent statement. | {
"domain": "codereview.stackexchange",
"id": 24553,
"lm_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, programming-challenge, complexity",
"url": null
} |
frequency-spectrum, sampling, frequency, lowpass-filter, frequency-domain
N = 1000 # sample count
P = 100 # period
D = 50 # width of pulse
sig = np.arange(N) % P < D
from matplotlib import pyplot as plt
plt.plot(sig)
plt.title('Square wave')
which looks like
This has the following spectrum.
Let's assume that this square wave is sampled at 240Hz so that 100 samples is one period. This makes the frequency of the square wave is 2.4Hz.
Let's design a filter that has the start of the stop band at 50Hz.
# Design a filter with a stop band start at 50Hz.
from scipy import signal
Nlpf = 6
Wn = 30
b, a = signal.butter(Nlpf, Wn, btype='low', analog=False, output='ba', fs=240)
w, H_lpf = signal.freqz(b, a, fs=240*2*np.pi)
plt.plot(w/2/np.pi, 20 * np.log10(abs(H_lpf)))
plt.plot([50,50], [-350,10])
plt.ylim([-100,10])
plt.title('Butterworth Low Pass Filter')
If we filter the square wave with this filter we get the following signal and associated spectrum.
sig_lpf = signal.lfilter(b,a,sig)
plt.plot(sig_lpf)
plt.title('Square wave, low pass filtered') | {
"domain": "dsp.stackexchange",
"id": 11196,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "frequency-spectrum, sampling, frequency, lowpass-filter, frequency-domain",
"url": null
} |
Yes, that's what I meant. But I am not convinced of the equivalence. Can you explain a bit further with the proof.
4. ## Re: Perfect square s, odd number of factors
Suppose that the number of factors of n is odd. We need to show that n is a perfect square. Suppose the contrary; then by the statement in post #1, n has an even number of factors, a contradiction.
In general, if you showed A implies B and (not A) implies (not B), then you showed that A and B are equivalent, so either one implies the other. Also, (not A) and (not B) are equivalent in this case.
5. ## Re: Perfect square s, odd number of factors
No, I meant if it's just given that, "If a number is a perfect square, it will have an odd number of factors (e.g., 4 has factors 1, 2, 4)"
Now how would you prove the converse?
6. ## Re: Perfect square s, odd number of factors
So, I understand that the part in post #1 after "whereas" is not given. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9895109075027804,
"lm_q1q2_score": 0.837069270757869,
"lm_q2_score": 0.845942439250491,
"openwebmath_perplexity": 327.39429161237865,
"openwebmath_score": 0.891546368598938,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/200434-perfect-square-s-odd-number-factors.html"
} |
quantum-mechanics, radiation, history, radioactivity, determinism
Title: Why were the fathers of quantum mechanics so sure radioactive decay was indeterministic? The classic example of an indeterministic system is a radioactive isotope, e.g. the one that kills Schrödinger's cat.
I get there are arguments against hidden variables in quantum mechanics, but how could they be so sure, back in the twenties, that the strong nuclear forces involved in radioactivity were not governed by hidden variables rather than true randomness?
Einstein was very unhappy about the indeterminism of quantum mechanics regarding even well understood effects like Young's slit experiments, but it seems kind of ideological and brash on behalf of Heisenberg & Co to extend the indeterminism over to phenomena they hadn't even begun to understand, like alpha decay.
Is there a reason for this early self-assuredness in postulating indeterminsm? Schrödinger came up with the cat in 1935, which was relatively late in the development of quantum mechanics. | {
"domain": "physics.stackexchange",
"id": 8666,
"lm_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, radiation, history, radioactivity, determinism",
"url": null
} |
solid-state-physics, continuum-mechanics, stress-strain, solid-mechanics
First, some simplification: The index $I$ refers to a particular model in the paper, so let's strip that along with the label $e$ for elastic (we'll consider only elastic deformation) and multiply by $J$ to give
$$JT_{i}=2\mu\ln(\lambda_{i})^\prime+\kappa\ln J.$$
We seek the origin of this equation.
The equation generalizes Hooke's law (applicable for small strains of isotropic elastic materials), or $$\boldsymbol{\sigma}=2\mu\boldsymbol{\varepsilon}+\Lambda \mathrm{tr}(\boldsymbol{\varepsilon})\boldsymbol{I},$$ where $\boldsymbol{\sigma}$ is the stress tensor, $\mu$ and $\Lambda$ are the Lamé parameters, $\boldsymbol{\varepsilon}$ is the infinitesimal strain tensor, and $\boldsymbol{I}$ is the identity matrix. (We could write this in index form as $\sigma_i=2\mu \varepsilon_i+\Lambda \mathrm{tr}(\boldsymbol{\varepsilon}).$)
The generalization aims to address finite strains of isotropic elastic materials, or hyperelasticity, using the so-called Hencky or logarithmic measure of strain. | {
"domain": "physics.stackexchange",
"id": 91827,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solid-state-physics, continuum-mechanics, stress-strain, solid-mechanics",
"url": null
} |
kotlin
Title: Rock-Paper-Scissor-Lizard-Spock in Kotlin I have made a simple Kotlin application called Rock-Paper-Scissor-Lizard-Spock. The application takes in user input and check if belongs to given set of array. If it belongs then it compares user input and random value from array to generate result. Else it prints error and asks for user input again. My code is working fine. Is it possible to simplify my code?
fun getUserChoice(userChoice: Array<String>): String {
var isValidChoice = false
var userValue = ""
while (!isValidChoice) {
// Ask the user for their choice
println("Please enter one of the following:")
for ((index, item) in userChoice.withIndex()) {
println("${index + 1} . $item")
}
val userInput = readLine().toString()
println("You have chosen $userInput") | {
"domain": "codereview.stackexchange",
"id": 40904,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kotlin",
"url": null
} |
beginner, haskell, primes, factors
which is equivalent to:
null [y | y <- [3,5..roof], y `divides` x]
which would more usually be written:
not $ any (`divides` x) [1,3..roof]
allowing you to drop the definition of shorterThan entirely and use:
isPrime :: (Integral a) => a -> Bool
isPrime x
| x == 2 = True
| even x = False
| otherwise = not $ any (`divides` x) [3,5..roof]
where roof = floor $ sqrt (fromIntegral x :: Double)
The other problem is that factors is doing extra work here -- it's using isPrime to check if x is prime using an algorithm that handles even numbers specially for efficiency, but then it turns around and does trial division by all numbers [2..] for composites. Instead, you could replace isPrime with a function to find the first prime factor of x, like so:
firstPrime :: (Integral a) => a -> a
firstPrime x
| even x = 2
| otherwise = head [y | y <- [3,5..roof]++[x], y `divides` x]
where roof = floor $ sqrt (fromIntegral x :: Double) | {
"domain": "codereview.stackexchange",
"id": 34730,
"lm_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, haskell, primes, factors",
"url": null
} |
complexity-theory, parameterized-complexity
Now the quantifiers incur existential nondeterminism with $n$ possibilites each, for a total of $n^k$. The disjunctive part of the DNF brings another existential $n$. The resulting $n^{k+1}$ is as well as $n^k$ under parameterized reductions. Then comes a conjunctive clause for universal nontederminism with $k$ possibilities. Then comes a negated relational atom: For all tuples in the relation ($n$ (universal) possibilities, because the relation is part of the input) there is some position ($r$ existential possibilities) at which the tuple differs from the values chosen for the quantifiers. Again, think of independent set, where $r=2$. The universal part totals to $k\cdot n$, which is as well as $n$ under reductions. | {
"domain": "cs.stackexchange",
"id": 11321,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "complexity-theory, parameterized-complexity",
"url": null
} |
c#, .net, rabbitmq
It is already done inside the From method
Since the RabbitBaseOptions is defined as abstract that's why you don't need to define the From as generic, simple just
public static IRabbitConnectionFactory From(RabbitBaseOptions options)
UPDATE #1
Btw isn't the Dispose pattern supposed to be like that since the class is basically sealed
You are right, I've missed that part this class is marked as sealed.
By you're not getting the advantages of record you mean the properties of the positional records i.e. removing the annoying nullability suggestions/warnings and the fact that it is IEquatable by default?
Yes, you are not taking advantage any of the above (based on the shared code fragment). If you don't need these extras then don't use it.
A record is just a class with some extra features.
A record struct will generate a struct with some extra features. | {
"domain": "codereview.stackexchange",
"id": 43998,
"lm_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#, .net, rabbitmq",
"url": null
} |
c++, c++11, linux, socket, tcp
Error messages should be sent to the user by a piece of code that understands the context under which the code is being used. If this code is being used as a server nobody will ever see this message. If this code is being used as a windows application nobody will ever see this message.
Throw an exception if this is unrecoverable (with the message). Some higher level piece of code will get the message and put it in the appropriate place (log file std::cerr etc).
Not all write errors are unrecoverable
if(sentBytes == -1) {
cerr << "Error sending IDs: " << errno << " " << strerror(errno) << endl;
return 1;
} | {
"domain": "codereview.stackexchange",
"id": 26095,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, linux, socket, tcp",
"url": null
} |
magnetic-fields, electric-circuits
Title: Magnetic field of a solenoid vs magnetic circuit The magnetic field in the middle of a solenoid is :
$$B = \frac{\mu_0 N I}{L}$$
where L is the length of the solenoid
The magnetic field in the air gap of a magnetic circuit with constant cross section like this one | {
"domain": "physics.stackexchange",
"id": 30567,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, electric-circuits",
"url": null
} |
# to find number of divisor of $p^m$ times $q^n$ when $p$ and $q$ are primes
Am taking a intro discrete math course..it covers some number theory content Euclidean algorithm,modular arithmetic, Euler's phi function, that's all
How can I solve a question like this: If $p$ and $q$ are distinct primes, find the number of distinct divisors of $p^mq^n$.
what I did is plugin some prime number and observed that the number of divisor is $(m+1)(n+1)$
Is there a formal way to solve this based on the contents I mentioned?
Thanks for help!
-
Hint: How must a divisor of $p^m q^n$ look like? How many choices does this leave you? – Fredrik Meyer Dec 19 '11 at 21:01
You want to produce a (positive) divisor of $p^mq^n$. By the Unique Factorization Theorem, aka the Fundamental Theorem of Arithmetic, this will be a number $d$ of the shape $p^aq^b$, where $0 \le a\le m$ and $0 \le b \le n$.
Imagine that we have a box that contains $m$ $p$'s, and next to it a box that contains $n$ $q$'s. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.957277806109987,
"lm_q1q2_score": 0.826505629574379,
"lm_q2_score": 0.8633916134888613,
"openwebmath_perplexity": 467.68541140021216,
"openwebmath_score": 0.8850323557853699,
"tags": null,
"url": "http://math.stackexchange.com/questions/92810/to-find-number-of-divisor-of-pm-times-qn-when-p-and-q-are-primes/92838"
} |
• Yes. The issue is with the way the factors are expressed, as opposed to $(x -\alpha_i)$. Any possibility you can unfold the reasoning a bit more? – Antoni Parellada May 30 '15 at 21:52
• Okay, one possibility is to put $y=1/x$, and then you have a rational function $\frac{1}{y^n}(a_0 y^n + a_1 y^{n-1}+ \dotsb + a_n)$, on which the normal factor theorem then works after multiplying by $y^n$, but the roots are then $y=1/\alpha_i$, obviously, so you have factors of the form $(y-1/-\alpha_i)$ You can then re-substitute and push the $x^n$ into the factors $(1/x-1/a_i)$ to get the form specified. – Chappers May 30 '15 at 22:00
We assume that we are working in the complex numbers, or the reals, or the rationals.
Let $P(x)$ be the first polynomial, and let $Q(x)$ be the second. Each has degree $n$, and they have the same roots, counting multiplicity.
Let $D(x)=P(x)-Q(x)$. Then $D(x)$ has degree $\le n$. Note that $D(x)$ has at least $n+1$ roots, since the constant term of $D(x)$ is $0$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765552017674,
"lm_q1q2_score": 0.8229195930643315,
"lm_q2_score": 0.8397339596505965,
"openwebmath_perplexity": 360.04231675201123,
"openwebmath_score": 0.8116136789321899,
"tags": null,
"url": "https://math.stackexchange.com/questions/1305809/proof-of-different-polynomial-decompositions-into-linear-factors"
} |
electric-current, induction, inductance, electromagnetic-induction
In the case of an inductor in an AC circuit, we see that when current is at its most positive (flowing in to the "+" terminal) voltage is just passing through 0. Then current starts dropping, but is still positive as voltage goes negative (because $L\frac{\rm{d}i(t)}{\rm{d}t}=v(t)$). In this part of the cycle the power is negative (because $i>0$ and $v<0$), so the device is delivering energy to the rest of the circuit. In the next part of the cycle, $i<0$ and $v<0$ (but increasing), so power is positive --- the rest of the circuit is delivering power to the inductor, and it is storing the received energy in its magnetic field. In the next quarter-cycle, $i<0$ and $v>0$, so the power is negative; now the inductor is returning energy to the circuit again. Finally, in the fourth quarter cycle, $i>0$ and $v>0$, so power absorbed by the inductor is positive, it is converting electric energy to magnetic energy again. | {
"domain": "physics.stackexchange",
"id": 36273,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-current, induction, inductance, electromagnetic-induction",
"url": null
} |
Exercise (PageIndex{1})
Find the local linear approximation to (f(x)=sqrt[3]{x}) at (x=8). Use it to approximate (frac[3]{8.1}) to five decimal places.
Hint
(L(x)=f(a)+f'(a)(x−a))
(L(x)=2+frac{1}{1}2(x−8);) 2.00833
Example (PageIndex{2}): Linear Approximation of (sinx)
Find the linear approximation of (f(x)=sinx) at (x=frac{π}{3}) and use it to approximate (sin(62°).)
Solution
First we note that since (frac{π}{3}) rad is equivalent to (60°), using the linear approximation at (x=π/3) seems reasonable. The linear approximation is given by
(L(x)=f(frac{π}{3})+f'(frac{π}{3})(x−frac{π}{3}).)
We see that
(f(x)=sinx⇒f(frac{π}{3})=sin(frac{π}{3})=frac{sqrt{3}}{2})
(f'(x)=cosx⇒f'(frac{π}{3})=cos(frac{π}{3})=frac{1}{2})
Therefore, the linear approximation of (f) at (x=π/3) is given by Figure.
(L(x)=frac{sqrt{3}}{2}+frac{1}{2}(x−frac{π}{3})) | {
"domain": "mathematicstip.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9940889309686339,
"lm_q1q2_score": 0.8195884685845809,
"lm_q2_score": 0.8244619199068831,
"openwebmath_perplexity": 841.8415920642374,
"openwebmath_score": 0.9168570637702942,
"tags": null,
"url": "https://au.mathematicstip.com/4080-46-linear-approximations-and-differentials-mathemati.html"
} |
By the way, I am not studying this as new student in Calculus. This is just something that bothers me even though I have passed Calculus class. My two questions here are:
1. What is the theory behind equating both one-sided derivatives here? Are we arguing this way: at any $$x<1$$, the derivative is $$-1$$, and at any $$x>1$$, the derivative is $$2ax + b$$. Limiting to $$1$$, they have to be equal, hence $$-1=2a+b$$. However, aren't we limiting $$f'(x)$$ (for $$x\neq 1$$) here? Is one-sided limit of $$f'(x)$$ the definition of one-sided derivative?
2. Still related, I thought one-sided derivative comes from the definition $$\frac{f(x)-f(1)}{x-1}\rightarrow \text{(some number)}$$ as $$x\rightarrow 1^-$$ (for left side, and similarly for right side) instead? If it is the case, then I tried to calculate by definition and wanted to equate the result, but it does not look easy at all, and I could not obtain $$-1=2a+b$$.
Thanks a lot for clearing my misunderstanding. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9648551566309689,
"lm_q1q2_score": 0.8294510061172631,
"lm_q2_score": 0.8596637541053281,
"openwebmath_perplexity": 158.91348354922042,
"openwebmath_score": 0.9443186521530151,
"tags": null,
"url": "https://math.stackexchange.com/questions/3808489/values-such-that-piecewise-function-is-differentiable-everywhere"
} |
# Math Help - Two questions regarding sin cos and tan relations.
1. ## Two questions regarding sin cos and tan relations.
Hi, this is a bit embarrassing but I'm a bit rusty with this stuff.
My first question:
a) If sin(a°) = 0.951, then what is tan a equal to?
The answer is 3.076 according to the book, however i'm not sure how this conclusion is reached? If someone could explain that'd be nice.
Question 2:
If 0°<a<90° and cos a<0.5, then which of the following is correct?
A. a<30° B. a>30° C. a<60°
D. a<45° E. a>60°
Once again, no idea on how to go about this and need clearing up. Do any of these questions relate to :
tan(x) = sin(x) / cos(x)
or
sin²(x) + cos²(x) = 1
Thanks.
2. Originally Posted by 99.95
Hi, this is a bit embarrassing but I'm a bit rusty with this stuff.
My first question:
a) If sin(a°) = 0.951, then what is tan a equal to?
The answer is 3.076 according to the book, however i'm not sure how this conclusion is reached? If someone could explain that'd be nice. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363746096915,
"lm_q1q2_score": 0.8279242657005869,
"lm_q2_score": 0.83973396967765,
"openwebmath_perplexity": 581.9669254393498,
"openwebmath_score": 0.8124234080314636,
"tags": null,
"url": "http://mathhelpforum.com/trigonometry/151151-two-questions-regarding-sin-cos-tan-relations.html"
} |
ros, rosbridge-suite, actionlib-tutorials, osx, call-service
Original comments
Comment by Philipp Schillinger on 2015-11-23:
I would really like to help you better, but at least I can tell that the JS code is correct as your exact setup runs for me and prints the expected messages. Only difference is that I am running Ubuntu, but I have no idea how this is related to the problem.
Comment by Fry on 2015-11-23:
Thanks Phillip. This is a big help. Do your environment variables and /etc/hosts also look
the same as mine?
Comment by Philipp Schillinger on 2015-11-24:
Oh, there is "(More)" button... ;) Yes, they look similar. I agree that it really sounds related to this brew thing. But since I don't have access to OSX, I don't have any experience with it, sorry!
Comment by William on 2015-11-24:
I can reproduce what you're talking about. At first I though it was because your JS didn't wait to perform its actions until ROS was connected, but even after wrapping your logic in ros.on('connection', ...); it still is flakey. | {
"domain": "robotics.stackexchange",
"id": 23056,
"lm_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, rosbridge-suite, actionlib-tutorials, osx, call-service",
"url": null
} |
2) Add the even numbers from 40 to 70, inclusive.
3) Add the odd numbers from 40 to 70, inclusive.
========================
As a general solution to all these kind of problems learn the AP series.
google on Arithemic Progression series. It is kind of difficult to write the formula here but all these calculations are tooooooo simple using this series.
Current Student
Joined: 03 Aug 2006
Posts: 112
Location: Next to Google
Schools: Haas School of Business
Re: Quick tips for adding numbers x to y [#permalink]
### Show Tags
12 Jun 2009, 14:34
6
KUDOS
3
This post was
BOOKMARKED
If you don't mind remembering a formula or two then yes you can.
The examples that you have given can be grouped under Arithmetic Progressions...or a finite sequence of evenly spaced numbers.
There are two formulas:
$$1. S = \frac{n}{2} [2a + (n-1)d]$$ | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9462003595741247,
"lm_q1q2_score": 0.8533976684395886,
"lm_q2_score": 0.90192067652954,
"openwebmath_perplexity": 5282.883415507041,
"openwebmath_score": 0.3081875443458557,
"tags": null,
"url": "https://gmatclub.com/forum/quick-tips-for-adding-numbers-x-to-y-79541.html"
} |
i.e. and third central moments. We’re going to calculate the skewness and kurtosis of the data that represents the Frisbee Throwing Distance in Metres variable (see above). Karl Pearson defined coefficient of Skewness as: Since in some cases, Mode doesn’texist, so using empirical relation, We can write, (it ranges b/w -3 to +3) e Sk SD 3 Median Mean Sk SD n 32 But it does not make sense to use Pearson’s first coefficient of skewness for data set(a) as its number 2 appears only twice in the data set, but it can be used to make for data set(b) as it has a more repetitive mode. This is based on the distribution of a combined measure of skewness and kurtosis. Solution: Solve yours by using the formula. Covariance and Pearson's correlation coefficient are also regarded as moment statistics. ( γ 2 ) is the average of the symmetry, or more variables us give one 'plug-in formula here... Refers to a normal distribution would have a kurtosis of three or to estimate how it might vary calculate | {
"domain": "abrasivosmolina.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668712109662,
"lm_q1q2_score": 0.8021769995112599,
"lm_q2_score": 0.8175744850834648,
"openwebmath_perplexity": 746.7789554414717,
"openwebmath_score": 0.8419783711433411,
"tags": null,
"url": "https://abrasivosmolina.com/blue-marble-djraqd/0aa3a8-coefficient-of-skewness-and-kurtosis-formula"
} |
mathematics
Title: What kind of mathematics is common in quantum computing? From what I have seen so far, there is a lot of linear algebra. Curious what other kinds of maths are used in QC & the specific fields in which they are most predominately invoked.
Calculus (e.g. $\int |\psi(x)|^2dx = 1$ )
Differential Equations (e.g. Schroedinger equation)
Complex analysis
Statistics/Probability theory
Stochastics (especially in studying open quantum systems)
Information theory
Topology (e.g. topological quantum computing)
Group theory (e.g. in stabilizer codes)
Representation theory (e.g. in stabilizer codes)
Graph theory (e.g. graph state quantum computing)
Functional analysis (e.g. Quantum states are unit vectors... with respect to which norm?)
Algebraic geometry (e.g. for factoring numbers using quantum annealing)
Discrete optimization (e.g. for factoring numbers using quantum annealing and also.)
Optimal control theory (here's a review on quantum optimal control theory) | {
"domain": "quantumcomputing.stackexchange",
"id": 285,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mathematics",
"url": null
} |
meteorology, atmosphere, atmosphere-modelling, wrf
Title: Why does computation cost increase 24 times when the spatial resolution doubles? In a Chinese book, I read about the relationship between the numerical model spatial resolution and the computation cost.
It states: when the spatial resolution of model is finer, the result will be preciser. But to achieve a fine grid resolution, the computation cost will increase. For example, when the grid resolution in a 3-D model framework halves (e.g. from 10 km to 5 km), the computation cost will increase by a factor 24.
Why is this? How can I determine the increase of computation costs when the spatial grid resolution changes?
Update
The model here is a 3-d numerical model for weather forcasting like WRF, MM5, etc.
Update 2
Here is an schematic representation of the impact of model resolution
on the calculation of chemical oxidants I can't answer why there's a 24x increase, according to the textbook - but it may well be the case for a specific model. In general, | {
"domain": "earthscience.stackexchange",
"id": 772,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, atmosphere, atmosphere-modelling, wrf",
"url": null
} |
______________________________________________________________________________
Sorgenfrey Line
The Sorgenfrey line is regular and Lindelof. Hence it is paracompact. Since the Sorgenfrey line is not metrizable, by the above discussion it cannot be a Moore space. The Sorgenfrey plane is also not a Moore space. Note that being a Moore space is a hereditary property. So if the Sorgenfrey plane is a Moore space, then every subspace of the Sorgenfrey plane (including the Sorgenfrey line) is a Moore space.
The following theorem is another way to show that the Sorgenfrey line is not a Moore space.
Bing’s Metrization Theorem
A topological space is metrizable if and only if it is a collectionwise normal Moore space. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787868650146,
"lm_q1q2_score": 0.8047802154199303,
"lm_q2_score": 0.8152324848629215,
"openwebmath_perplexity": 107.99715693191011,
"openwebmath_score": 0.9666374921798706,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/the-sorgenfrey-line/"
} |
and higher kHz—the cutoff frequency a! Resistor and capacitor in parallel with the load instead version of Internet Explorer ( flat... Be built that approximate to the designed cut-off frequency point and attenuates the input, part the... Coefficients operating on an unbounded signal α of 1.414 characterizes a 2-pole (. ( n log ( n ) ) operations are required compared to O ( n2 ) the... On Facebook to get Analog Dialogue delivered directly to your inbox knowing the frequency... Furthermore, the center frequency is applied, the frequency ratio, f/f0, can be for! Between single- and two-pole low-pass and high-pass filters transition occurs is called the cutoff '' frequency transmitters low-pass. Shift in relation to filter topology interest, delivered monthly or quarterly to your inbox evaluates Equation from... Show this variability browser to the designed cut-off frequency point and attenuates the input switches direction that has a shift. Ideal low-pass filter with a load, and the | {
"domain": "atlutc.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241974031598,
"lm_q1q2_score": 0.8351098316658607,
"lm_q2_score": 0.8615382076534742,
"openwebmath_perplexity": 2066.4973012906685,
"openwebmath_score": 0.6919606924057007,
"tags": null,
"url": "https://atlutc.org/4r3kr/d1a4b7-center-frequency-low-pass-filter"
} |
c#, interview-questions, interval
private static void CheckHourIntersections(
TimePeriod firstSlot, TimePeriod secondSlot, List<TimePeriod> result)
{
if (/*edge case: overlap ..*/)
{
result.Add(new TimePeriod(secondSlot.Start, firstSlot.End));
return;
}
if (/*edge case: contains ..*/)
{
result.Add(new TimePeriod(firstSlot.Start, firstSlot.End));
return;
}
if (/*edge case: contained by ..*/)
{
result.Add(new TimePeriod(firstSlot.Start, secondSlot.End));
return;
}
}
simplified:
private static void CheckHourIntersections(
TimePeriod source, TimePeriod target, List<TimePeriod> result)
{
// check all the different interval intersections
var start = source.Start >= target.Start ? source.Start : target.Start;
var end = source.End <= target.End ? source.End : target.End;
if (end >= start)
{
result.Add(new TimePeriod(start, end));
}
} | {
"domain": "codereview.stackexchange",
"id": 35253,
"lm_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#, interview-questions, interval",
"url": null
} |
It is clear from the graph of secant that we cannot find one single continuous piece of its graph which covers its entire range of $$(-\infty, -1] \cup [1, \infty)$$ and restricts the domain of the function so that it is one-to-one. The same is true for cosecant. Thus in order to define the arcsecant and arccosecant functions, we must settle for a piecewise approach wherein we choose one piece to cover the top of the range, namely $$[1, \infty)$$, and another piece to cover the bottom, namely $$(-\infty, -1]$$. There are two generally accepted ways make these choices which restrict the domains of these functions so that they are one-to-one. One approach simplifies the Trigonometry associated with the inverse functions, but complicates the Calculus; the other makes the Calculus easier, but the Trigonometry less so. We present both points of view.
### Inverses of Secant and Cosecant: Trigonometry Friendly Approach | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743613981444,
"lm_q1q2_score": 0.8320708649228901,
"lm_q2_score": 0.8397339736884711,
"openwebmath_perplexity": 223.2995994725184,
"openwebmath_score": 0.9589127898216248,
"tags": null,
"url": "https://math.libretexts.org/TextMaps/Precalculus_TextMaps/Map%3A_Precalculus_(Stitz-Zeager)/10%3A_Foundations_of_Trigonometry/10.6%3A_The_Inverse_Trigonometric_Functions"
} |
neuroscience, neurotransmitter
Title: Are there any neurotransmitters that trigger all neurons? I'm reading into the basics of the nervous system, and am intrigued by neurotransmitters. I understand that certain neurotransmitters can trigger more than one neuron type, and may be used as inhibitors or regulators (antagonists). Conversely, are there any types of agonists that trigger excitation in all neurons, regardless of type? If so, what functions do these play? There is no such promiscuous neurotransmitter. There is always some difference between central and peripheral nervous system w.r.t neurotransmitter usage.
Glutamate is one neurotransmitter which acts as an excitatory agonist in most neurons (but still.. not ALL neurons) | {
"domain": "biology.stackexchange",
"id": 936,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, neurotransmitter",
"url": null
} |
cc.complexity-theory, approximation-algorithms, approximation-hardness
Title: Existence of $opt^c$-approximation of Dominating Set with $c < 1$? Consider the Dominating Set problem in general graphs, and let $n$ be the number of vertices in a graph. A greedy approximation algorithm gives an approximation guarantee of factor $1 + \log n$, i.e. it's possible to find in polynomial-time a solution $S$ such that $|S| \leq (1 + \log n) opt$, where $opt$ is the size of a minimum dominating set. There are bounds showing that we cannot improve the dependency on $\log n$ much http://www.cs.duke.edu/courses/spring07/cps296.2/papers/p634-feige.pdf. | {
"domain": "cstheory.stackexchange",
"id": 759,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, approximation-algorithms, approximation-hardness",
"url": null
} |
c#, .net, unit-testing, email
} DataLayer.ListCustomers() should not be static for the usual reasons, not it's a mock used for testing purposes but you want to, ideally, switch between implementations without changing your model code. The same is true for DataLayer.ListOrders(). You can use a base abstract class or an interface. Also those methods shouldn't contain List, the data structure you use to accomodate them is an implementation detail which may (and should) change (you will see this when you will add a true ORM to your application). Class itself has a little bit weird name. Probably Customer, Order and DataLayer should be sealed.
In SendWelcomeEmail() (note that name is singular because you're sending a single e-mail) you're not customizing the template. The same is true for SendComeBackEmail() where you use it as parameter for String.Format() but you do not provide any...usable argument. You're also mixing welcome/come back content there... | {
"domain": "codereview.stackexchange",
"id": 26994,
"lm_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#, .net, unit-testing, email",
"url": null
} |
php
My background task which runs some of the above process
$memory_start = (memory_get_peak_usage(true)/1024/1024).' MiB';
//$this->log->debug('securityExemptionApprove');
$response = [];
if(($job['args'] == 3) && (is_numeric($job['arg1']))) {
$exemption_id = (int) $job['arg1'];
$ids = (empty($job['arg2'])) ? [] : explode(',',$job['arg2']);
$username = $job['arg3'];
$exemptionPolicies = new ExemptionPolicies();
$ts_start = strtoupper ( date ( 'd-M-y h.i.s' ) ) . substr ( ( string ) microtime (), 1, 8 );
ini_set('memory_limit', '2048M');
$result = $exemptionPolicies->updateCommsMatrixAnalysisByPolicy($exemption_id, $ids, $username);
$ts_end = strtoupper ( date ( 'd-M-y h.i.s' ) ) . substr ( ( string ) microtime (), 1, 8 );
$response ['metadata'] ['analysis_start'] = $ts_start;
$response ['metadata'] ['analysis_end'] = $ts_end; | {
"domain": "codereview.stackexchange",
"id": 36453,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php",
"url": null
} |
c#, homework, winforms, minesweeper
this.button6.TabIndex = 5;
this.button6.Tag = "speelveld";
this.button6.UseVisualStyleBackColor = true;
this.button6.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PlayFieldButton_MouseDown);
//
// button7
//
this.button7.Enabled = false;
this.button7.Location = new System.Drawing.Point(73, 90);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(50, 50);
this.button7.TabIndex = 6;
this.button7.Tag = "speelveld";
this.button7.UseVisualStyleBackColor = true;
this.button7.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PlayFieldButton_MouseDown);
//
// button8
//
this.button8.Enabled = false;
this.button8.Location = new System.Drawing.Point(129, 90);
this.button8.Name = "button8"; | {
"domain": "codereview.stackexchange",
"id": 33817,
"lm_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#, homework, winforms, minesweeper",
"url": null
} |
performance, hashcode, pascal
If I remove the hashing element and just do the disk reading, it reads at about 4Gb per minute, so I am fairly sure my loop structure is actually fairly quick. So I'm almost certain the bottleneck is the hashing aspect and this has been discussed at the Lazarus forum, here where it has been suggested that maybe the library needs to be improved a little for better speed. One poster suggested I re-write the three functions in assembly but I am not that good.
There is a related post HERE regarding SHA256, where the gentlemen concerned experienced similar issues, though with a different language. His implementation was very similar to mine - Init, Update, Final. One suggestion was to use a buffer of 16Mb in that post. I have tried 4Kb, 8Kb, 64Kb, 256Kb, 512Kb and 1Mb. I haven't gone to 16Mb or anywhere near that - might that prove to be worthwhile? I read that once you go above about 1Mb programs usually go backward?
Is there an obvious way to improve speed? | {
"domain": "codereview.stackexchange",
"id": 8376,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, hashcode, pascal",
"url": null
} |
classical-mechanics, rotational-dynamics, rigid-body-dynamics, angular-velocity, constrained-dynamics
Title: Equivalent Characterizations of Rigid Bodies & Angular Velocity Interpretation In rotational kinematics, there seem to be two common characterizations of a rigid body:
A rigid body is any collection of particles with position vectors $\textbf x_1,\textbf x_2,...$ such that the distance $|\textbf x_i-\textbf x_j|$ between any pair of particles $i,j\space $ is conserved, i.e. $\frac{d}{dt}|\textbf x_i-\textbf x_j|=0\iff(\textbf x_i-\textbf x_j)\cdot(\dot{\textbf x}_i-\dot{\textbf x}_j)=0$
A rigid body is any collection of particles whose configuration space $\mathcal C$ is isomorphic to $\text{SO}(3)$ (assuming the rigid body's center of mass is fixed in some reference frame).
My questions are: | {
"domain": "physics.stackexchange",
"id": 99067,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, rotational-dynamics, rigid-body-dynamics, angular-velocity, constrained-dynamics",
"url": null
} |
mobile-robot, kalman-filter, ekf, estimation
The "black art" of the EKF is the choice of process noise. In the linear case, Kalman proved that the KF will converge regardless of the noise (we understand how to propogate Gaussian distributions through linear systems), but the same isn't true for the nonlinear extension. There are many papers written on the subject of estimating process noise for nonlinear models. This still an area of active research. My advice is just to play with the process noise until you achieve acceptable performance. | {
"domain": "robotics.stackexchange",
"id": 1925,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mobile-robot, kalman-filter, ekf, estimation",
"url": null
} |
gazebo, navigation, simulation, turtlebot, pgm
Title: Can turtlebot_simulator be loaded with a PGM map?
Hello,
I have a Turtlebot 2 on ROS Hydro, and I am working on an algorithm for smart autonomous navigation through a known map. I have a map of the building I wanted to test in PGM form, obtained from running Gmapping. In real life, I would take this map, boot up my 'bot, load AMCL for localization within my PGM map, and then start my navigation algorithm.
I'd like to also be able to do this in the simulation world, i.e., start the simulator, load my map into Gazebo, start AMCL with the same map, and start my algorithm and watch the simulated robot drive around.
Currently I cannot find any way to load the PGM into Gazebo or convert it into a .world file. Is this something that's already available or would I need to write a custom program to create a world file where each black pixel is an obstacle?
Thanks in advance!
Originally posted by BlitherPants on ROS Answers with karma: 504 on 2014-11-17
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 20069,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, navigation, simulation, turtlebot, pgm",
"url": null
} |
# When does a limit not exist.
## Main Question or Discussion Point
I cant remember exactly.
I'm thinking its when its not continuous or differentiable.
but is there more exact definitions/am i wrong/anything really.
Last edited by a moderator:
A limit doesn't exist if the function is not continuous at that point.
The way to find out if a limit of a certain function exists or not is to approach the limit from the left and the right side.
For example: Take the limit of the function f(x) as x approachs 0. If you approach 0 from the left and it equals -inf and when you approach 0 from the right and it equals inf then the limit of f(x) as x approachs 0 doesn't exist.
In this case it doesn't exist because it is infinite discontinous. (Not sure if thats the right term to use. Please correct me if I'm wrong.) | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754479181589,
"lm_q1q2_score": 0.8247000545750377,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 179.15966532811873,
"openwebmath_score": 0.8596698641777039,
"tags": null,
"url": "https://www.physicsforums.com/threads/when-does-a-limit-not-exist.489849/"
} |
filters, filter-design, lowpass-filter
Analog Butterworth filters are referred to as "maximally flat" because all the derivatives (up to the 2nth) of the filter gain function as a function of frequency are 0 at $\omega=0$ (see wikipedia). Note that this definition is given in the context of a low-pass Butterworth filter. | {
"domain": "dsp.stackexchange",
"id": 1809,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, filter-design, lowpass-filter",
"url": null
} |
fourier-transform, convolution
OLD answer:
I think I can show that the trivial case
$$s_2(t)=e^{j\alpha}s_1(t),\qquad\alpha\in\mathbb{R}\tag{1}$$
is the only case for which $|s_1(t)|=|s_2(t)|$ and $|S_1(f)|=|S_2(f)|$ holds.
From the requirement $|s_1(t)|=|s_2(t)|$ it follows that
$$s_2(t)=e^{j\phi(t)}s_1(t)\tag{2}$$
with a real-valued function $\phi(t)$. From the requirement $|S_1(f)|=|S_2(f)|$ it follows that $s_2(t)$ can be obtained from $s_1(t)$ by all-pass filtering:
$$s_2(t)=\int_{-\infty}^{\infty}s_1(\tau)h_{AP}(t-\tau)d\tau\tag{3}$$
with $H_{AP}(f)=\mathcal{F}\{h_{AP}(t)\}$ satisfying $|H_{AP}(f)|=1$.
Since the multiplication in $(2)$ is memoryless, Equations $(2)$ and $(3)$ can only give the same result if $h_{AP}(t)=e^{j\alpha}\delta(t)$, i.e., for a trivial all-pass which just scales the input by a complex constant with magnitude equal to $1$. Consequently, the function $\phi(t)$ in $(2)$ must be constant (and equal to $\alpha$). This means that $(2)$ and $(3)$ are reduced to Eq. $(1)$. | {
"domain": "dsp.stackexchange",
"id": 8135,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, convolution",
"url": null
} |
cc.complexity-theory, graph-theory, complexity-classes
Title: graphs where vertex coloring is in P but independent set is NP complete Is there an example of a class of graphs for which the vertex coloring problem is in P but the independent set is problem is NP complete? A perhaps more general statement (with an easy proof) is that the following problem is already NP-complete:
Input: A graph G, a 3-coloring of G, an integer k.
Question: Does G have an independent set of size k? | {
"domain": "cstheory.stackexchange",
"id": 1954,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, graph-theory, complexity-classes",
"url": null
} |
c#, interview-questions, binary-search
index = FindShiftedArray(numberToFind, shiftedArray, 0, array.Length - 1);
}
private int FindShiftedArray(int numberToFind, int[] shiftedArray, int indexMin, int indexMax)
{
//we find the pivot and from there do a binary search
int pivot = FindPivot(shiftedArray, 0, shiftedArray.Length - 1);
//the pivot acts like the first slicing of the arrays
if (shiftedArray[pivot] == numberToFind)
return pivot;
if (shiftedArray[0] <= numberToFind)
{
return FindIndexRecursive(numberToFind,shiftedArray, 0, pivot - 1 );
}
else
{
return FindIndexRecursive(numberToFind,shiftedArray, pivot + 1, shiftedArray.Length - 1 );
}
}
private int FindPivot(int[] array, int indexMin, int indexMax)
{ | {
"domain": "codereview.stackexchange",
"id": 10938,
"lm_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#, interview-questions, binary-search",
"url": null
} |
– In this section we will work a quick example illustrating how Laplace transforms can be used to solve a system of two linear differential equations. 0. Solved Problems. You appear to be on a device with a "narrow" screen width (. Once we have the eigenvalues for a matrix we also show how to find the corresponding eigenvalues for the matrix. The next topic of discussion is then how to solve systems of differential equations. Derivatives like dx/dt are written as Dx and the operator D is treated like a multiplying constant. We will use 2x2 systems and matrices to model: predator-prey populations in an ecosystem, A system of linear differential equations is a set of linear equations relating a group of functions to their derivatives. Systems of Differential Equations – In this section we will look at some of the basics of systems of differential equations. CREATE AN ACCOUNT Create Tests & Flashcards. These cookies will be stored in your browser only with your consent. We will look at | {
"domain": "levonline.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9875683498785867,
"lm_q1q2_score": 0.8097007066515071,
"lm_q2_score": 0.8198933337131076,
"openwebmath_perplexity": 242.9284758202915,
"openwebmath_score": 0.5556364059448242,
"tags": null,
"url": "http://midnattssolsrallyt.com.php54.levonline.com/k7ueskrz/553e18-system-of-differential-equations"
} |
metric-tensor
the summand is just a product of real numbers, and products of real numbers can be arranged however you please: $abc=cab=bca=cba=\cdots$.
You'll see this kind of phrasing in books just before they introduce the Einstein summation convention! "whose components vary contravariantly" is replaced with a superscript and "whose components vary covariantly" is replaced with a subscript and the sums are dropped, so you can write the whole thing more quickly. But you're always talking about sums and your components are actual numbers.
In matrix multiplication $AB\neq BA$ can occur. This equation has no indices. It is still the case that $\sum_j A_{ij}B_{jk}=\sum_j B_{jk}A_{ij}$, because these are just real numbers.
You really should take a second look at the definition of the Einstein tensor notation. There's absolutely no magic to it (excluding covariance/contravariance!) | {
"domain": "physics.stackexchange",
"id": 20310,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "metric-tensor",
"url": null
} |
ros, urdf, robot-model, solidworks, stl
started empty world
roslaunch gazebo_worlds empty_world.launch
then spawned the model
rosrun gazebo spawn_model -urdf -file test.urdf -model test_stl_mesh -z 1
Originally posted by hsu with karma: 5780 on 2011-04-29
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 5451,
"lm_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, urdf, robot-model, solidworks, stl",
"url": null
} |
visible-light, biophysics, wavelength, vision, perception
The phenomenon of neural adaption is happenning. In the presence of a skewed and lingering stimulus, the brain "recalibrates" its notion of "normal", so that the lack of skew if the stimulus is removed is perceived as a shift away from normal. This effect can be demonstrated in many ways: if you walk into a room with a strong smell, you'll notice it seems to disappear after a while, or at least become not so mingy. There's the fun experiment to show to children where you stand in a doorway with arms straight down, lift your arms so that they stay straight but stay in the transverse plane until your hands contact the doorframe. Now thrust in this position with your hands against the frame for about a minute, then relax and walk away from the doorway. Your arms will naturally lift even though you don't feel as though you're moving them: your neurally readapted proprioception has calibrated itself to believe that a force/torque needs to be imparted to the arms to keep them steady, when | {
"domain": "physics.stackexchange",
"id": 31260,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "visible-light, biophysics, wavelength, vision, perception",
"url": null
} |
### Differentiate Incomplete Elliptic Integrals of Third Kind
Differentiate these expressions involving the complete elliptic integral of the third kind:
```syms n m diff(ellipticPi(n, m), n) diff(ellipticPi(n, m), m)```
```ans = ellipticK(m)/(2*n*(n - 1)) + ellipticE(m)/(2*(m - n)*(n - 1)) -... (ellipticPi(n, m)*(- n^2 + m))/(2*n*(m - n)*(n - 1)) ans = - ellipticPi(n, m)/(2*(m - n)) - ellipticE(m)/(2*(m - n)*(m - 1))```
Here, `ellipticK` and `ellipticE` represent the complete elliptic integrals of the first and second kinds.
### Compute Integrals for Matrix Input
Call `ellipticPi` for the scalar and the matrix. When one input argument is a matrix, `ellipticPi` expands the scalar argument to a matrix of the same size with all its elements equal to the scalar.
`ellipticPi(sym(0), sym([1/3 1; 1/2 0]))`
```ans = [ ellipticK(1/3), Inf] [ ellipticK(1/2), pi/2]```
Here, `ellipticK` represents the complete elliptic integral of the first kind.
## Input Arguments
collapse all | {
"domain": "mathworks.cn",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717448632123,
"lm_q1q2_score": 0.8305213976795829,
"lm_q2_score": 0.8418256472515684,
"openwebmath_perplexity": 1022.2554370892086,
"openwebmath_score": 0.9621492028236389,
"tags": null,
"url": "https://ww2.mathworks.cn/help/symbolic/sym.ellipticpi.html"
} |
resource-recommendations, education, quantum-chromodynamics
Landau and Lifshitz, Quantum Mechanics, 3rd Edition, Section 141.
You will also find discussions in old particle physics books such as
Gasiorowicz, "Elementary Particle Physics"
Two general first principles overviews covering the non-relativistic case and it's proposed extension to the relativistic case are
Froissart, "Mandelstam Theory and Regge Poles: An Introduction for Experimentalists"
Frautschi, "Regge Poles and S-Matrix Theory"
One of the unfortunately few books to introduce Regge Theory and the Veneziano amplitude (beginning of string theory) from first principles is
Muirhead, Notes on Elementary Particles
This set of notes
Hiscox, "Analysis of Regge poles in non-relativistic
quantum mechanics", link
is a good introduction and contains many more references which are less elementary. A modern perspective is summarized by the article linked in the comments. | {
"domain": "physics.stackexchange",
"id": 85032,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "resource-recommendations, education, quantum-chromodynamics",
"url": null
} |
quantum-mechanics, wavefunction, schroedinger-equation, spacetime-dimensions
Title: Do energy levels ever appear at the peak of a cosine potential in higher dimensions? I simulated a hyperspherically symmetric wavefunction for the case of $V=-\cos(r)$, in which $h=1$, and $m=1$ and the number of spatial dimensions is $4$.
I charted the integral of the square of the absolute value of the wavefunction multiplied by $r^3$
I find that in both charts the integral looks the same even though I used different initial values for the initial value for the derivative of the wavefunction in each. Also the integral appears to be converging on a finite value.
Also the wavefunctions look the same no matter what initial value I choose for the derivative of the wavefunction
This indicates that the simulation is surprisingly resilient to having different initial values
Also this is what the square of the absolute value of the wavefunction multiplied by $r^3$ looks like
Also this is the energy and potential | {
"domain": "physics.stackexchange",
"id": 71505,
"lm_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, schroedinger-equation, spacetime-dimensions",
"url": null
} |
c++, multithreading, thread-safety, stack, atomic
int main() {
std::vector<std::thread> threads{};
Stack<int>* s = new Stack<int>();
int n = 10;
Runner<int> r(n, s);
for(int i = 0; i < 3; ++i) {
threads.push_back(std::move(std::thread(r)));
}
for(int i = 0; i < 3; ++i) {
threads[i].join();
}
Stack<int>* top = r.get_stack();
Node<int>* head = top->peek();
while(head) {
std::cout << head->val << ", ";
head = head->next;
}
size_t size = top->length();
return 0;
} Naming
My immediate reaction is that without a pop (or something equivalent) it's not really a stack. Especially given the item below about exposing the implementation details, from a client's viewpoint it's really a linked list that supports only a couple of operations: adding nodes to the beginning, getting the length, and (by knowing the implementation) traversing the list.
Exposing Internal Details | {
"domain": "codereview.stackexchange",
"id": 40555,
"lm_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++, multithreading, thread-safety, stack, atomic",
"url": null
} |
javascript, promise
Title: Access resolve function outside of a JavaScript Promise I have an object that needs to have a single point of initialization, and other callers need to wait until the initialization is complete before continuing.
I have done this with jQuery, and it feels like I'm working with the design, but the same approach with a native JavaScript Promise seems like it is going against the grain.
I need to replace use of jQuery promise with a native JS Promise.
Is this initialization pattern OK, or is there a better approach?
On the surface it seems that an event pub/sub pattern would be a better fit, but I can't guarantee that the init() will be called before the ready() is called, which would result in missed events.
jQuery
function Foo() {
var dfd= $.Deferred();
this.ready = function () {
return dfd.promise();
}
this.init = function(){
setTimeout(function(){
dfd.resolve();
}, 2000);
}
};
var foo = new Foo(); | {
"domain": "codereview.stackexchange",
"id": 15869,
"lm_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, promise",
"url": null
} |
c#, game
Title: RPG Currency System I just spent the last few days constructing the currency system for my game, and was wondering if you guys had any suggestions on how—if at all—I could improve it. Before I show the code, let me explain the system as it currently stands. It works a lot like World of Warcraft, in that Copper is automatically converted to Silver when you gain 100 of it. Silver is then converted into Gold, and Gold into Platinum. For those of you who have played Everquest, this system would seem even more familiar.
I have already made a few optimizations to the root structure of it all, like how I keep all denominators of currency within a single long. Using this long I can do computations to "fake" the other denominations. Essentially, everything is internally kept as Copper.
I have also implied a maximum base denominator value of "999999999". Using this somewhat arbitrary number allows me to cap the total currency out at 999 Platinum, 99 Gold, 99 Silver, and 99 Copper. | {
"domain": "codereview.stackexchange",
"id": 19034,
"lm_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#, game",
"url": null
} |
similar for others.
in hence if $$X,Y(i.i.d)\sim N(0,\sigma^2)$$ so $$X=\sigma r \cos(\theta)$$ and $$Y=\sigma r \sin(\theta)$$.
in hence
$$U=\sigma^2 r^2$$ and $$V=\frac{\sigma r\cos(\theta)}{r\sigma}=\frac{r\cos(\theta)}{r}=\cos(\theta) \sim f$$ and $$r$$ is independent from any function of $$\theta$$ like $$\sin(\theta)$$.
another example $$\frac{2XY}{\sqrt(X^2+Y^2)}=\frac{2r^2 \sigma^2\cos(\theta) \sin(\theta)}{r\sigma}=2r \cos(\theta) \sin(\theta) =r \sigma \sin(2\theta) \sim \sigma r \sin(\theta) \sim N(0,\sigma^2)$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9740426382811476,
"lm_q1q2_score": 0.8259567581611964,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 376.77507809312215,
"openwebmath_score": 0.994449257850647,
"tags": null,
"url": "https://stats.stackexchange.com/questions/47616/transforming-two-normal-random-variables"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.