text stringlengths 1 1.11k | source dict |
|---|---|
acoustics, resonance
The pressure wave is what you actually hear. I didn't appreciate this until I had a chance to crawl through a giant tube with a standing wave in it at a science centre. | {
"domain": "physics.stackexchange",
"id": 53903,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acoustics, resonance",
"url": null
} |
javascript, object-oriented, classes
//Function for testing valid XEcrypted string. returns true or false
XEString.test = function(encryptedString) {
return /^((\.-?\d+){3})+$/.test(encryptedString);
} It's a tricky one, since your class* doesn't really need any methods. Since its purpose is to decrypt a string, it makes sense to do that decryption straight away. Not much need to call any methods on the instantiated object afterwards.
Besides, I don't see much that would make sense to expose as methods. The decryption steps really only make sense in their current context.
So the way you've done it right now seems appropriate enough, I think.
I guess you could simply skip instantiation, and simply have a decrypt function that returns an object literal (aka map, hash, etc.) with the properties. No need for a constructor and instantiation, just a parseXEString function. That's probably what I'd do. | {
"domain": "codereview.stackexchange",
"id": 2506,
"lm_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, object-oriented, classes",
"url": null
} |
rail, transportation, foundations
There are a few key mechanisms that cause the deterioration in track geometry:
When the water stops moving through the ballast it stops washing out contamination of fines (through local sedimentation or from the breakdown of the ballast itself). The standing water then tends to bind with the fines to create a mud slurry which both erodes the ties and quickly rounds the ballast rocks.
This is bad because ballast rocks rely on their irregular shape to provide a solid and stable layer; when new, the ballast rocks can interlock with one another and quickly reach a relatively stable lowest energy state with high strength characteristics. As the rocks become rounded and smaller they settle further and interlock less well, reducing the overall strength of the layer. | {
"domain": "engineering.stackexchange",
"id": 3529,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rail, transportation, foundations",
"url": null
} |
the squeezing inequities are true after a certain G, formally $\exists G / \forall x\in\Re,|x|>G : \frac{x}{x+sig(x)} \leq \frac{x}{x+\sin(x)} \leq \frac{x}{x-sig(x)}$
applying the limit definition to $x \over x+sin(x)$ the starting point M selecting all x>M has to be greater or equal than G (simply require $M\geq G$), in this case M=G is great enough to say that the limit is the same 1.
More formally (I actually didn't find an online pointable suitable formal definition of $\lim_{x\to\infty}$, so I'm making it up)
$$\lim_{x \to \infty} f(x) = r\in \{\Re, -\infty, +\infty, NaN\} / \\ \exists r \in \Re : \forall \epsilon \in \Re, \epsilon>0: \exists M \in \Re : \forall x \in \Re, |x| > M : |f(x)-r|<\epsilon \\ \lor r=\infty, omissis \\ \lor r=+\infty, omissis \\ \lor r=-\infty, omissis \\ \lor r=NaN, omissis.$$ (r as abbreviation of response, NaN (not a number) is when the limit doesn't exists and $\lor$ is in this case a shortcut or).
think of names
$f(x)=\frac{x}{x+\sin(x)}$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.962673109443157,
"lm_q1q2_score": 0.8143660327947337,
"lm_q2_score": 0.8459424334245618,
"openwebmath_perplexity": 379.0403536698987,
"openwebmath_score": 0.9183768630027771,
"tags": null,
"url": "https://math.stackexchange.com/questions/1710786/why-does-lhopitals-rule-fail-in-this-case"
} |
fl.formal-languages, grammars, church-turing-thesis
The Church-Turing thesis has been proved for all practical purposes.
Why is practicality suddenly worth anything in theoretical computer science?
Are there like two interpretations or more of the C-T thesis, one for "practical purposes" and one for "mathematics"? I've written the following to talk about the connections between quantum computation and the (extended) Church-Turing thesis. Your question appears to have several other questions, which I don't address due to space (and time to write down this answer).
A statement that reads, "There exists no "reasonable" computational model capable of recognizing languages that a Turing Machine cannot"
This is essentially what the Church-Turing thesis states. It is not the extended Church-Turing thesis, which roughly takes the form:
All "reasonable" computational models can simulate each other with polynomial overhead | {
"domain": "cstheory.stackexchange",
"id": 5006,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fl.formal-languages, grammars, church-turing-thesis",
"url": null
} |
regression, feature-selection, xgboost
Title: How to interpret .get_booster().get_score(importance_type='weight') for XGBRegressor() I am trying to do feature selection using XGRegressor(). I am doing this because I have many features to choose from over 4,000. Once I have a set of features I have a neural network I created to use these features to predict median_gross_rent.
My question is the following, I have these feature important scores from
feature_important = model.get_booster().get_score(importance_type='weight')
keys = list(feature_important.keys())
values = list(feature_important.values())
feat_imp_df = pd.DataFrame(data=values, index=keys, columns=["score"]).sort_values(by = "score", ascending=False) | {
"domain": "datascience.stackexchange",
"id": 9848,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regression, feature-selection, xgboost",
"url": null
} |
catkin, cmake
Title: How can I add libicp library in my catkin package?
EDIT:
I installed following package link text as mentioned in instructions.
Now I want to use this package in my Cmakelist.txt so that I can use it in my program. I tried
find_package(RRR)
but it gives me error related to package config file.
I have series of .hpp files in my source directory.
I either want to convert them to a library file or add the whole package so that I can use them in my source files as headers.
Originally posted by ZainMehdi on ROS Answers with karma: 225 on 2017-06-20
Post score: 0
Original comments
Comment by gvdhoorn on 2017-06-21:
Please do not use screenshots for what is essentially text. Could you please copy-paste the text from the terminal into your question directly? And then please use the Preformatted Text button (the one with 101010 on it).
Thanks.
Comment by gvdhoorn on 2017-06-21:\
[..] as mentioned in the readme instruction file. | {
"domain": "robotics.stackexchange",
"id": 28158,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin, cmake",
"url": null
} |
You discovered that the solution is not one equation but a family of equations, represented by
$$y = \frac{x^3}{2} + cx ~\Rightarrow ~\frac{dy}{dx} = f'(x) = \frac{3x^2}{2} + c.$$
Your intuition then rebelled, intuiting (in effect):
Something is wrong here.
Consider two separate solutions:
$$f_1(x) = \frac{x^3}{2} + c_1x.$$
$$f_2(x) = \frac{x^3}{2} + c_2x ~: ~c_2 \neq c_1$$
As the value of $$c$$ changes, so does the value of $$\frac{dy}{dx}.$$
This means, that at any given value of $$x$$, $$f'_1(x)$$ and $$f'_2(x)$$ will be unequal.
How can a family of functions, as represented by $$f_1(x)$$ and $$f_2(x)$$
each of whom must have a different value for $$f'(x_0)$$ at one specific value of $$x_0$$ ever intersect?
My original answer gave only a mathematical explanation for why
(for example) $$f_1(x)$$ and $$f_2(x)$$ can intersect at the origin
despite the fact that $$f'_1(0) \neq f'_2(0).$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9566342024724487,
"lm_q1q2_score": 0.8131114941141635,
"lm_q2_score": 0.8499711718571774,
"openwebmath_perplexity": 383.4067399551033,
"openwebmath_score": 0.6485421061515808,
"tags": null,
"url": "https://math.stackexchange.com/questions/3850224/graphical-representation-of-differential-equations"
} |
ros, pr2-controllers, pr2-gazebo
Title: Erratic behaiour of PR2 in simulation
I am using a simulated PR2 in ROS Indigo (Ubuntu 14.04). While running
roslaunch pr2_gazebo pr2_empty_world.launch
the head of PR2 turns back and the arms get twisted and rotates continously. Also it is not possible to control the simulated PR2 using keyboad teleop package. It was working fine untill all the ros-indigo packages were updated through synaptic package manager .
It happens when the pr2_default_controllers are up and running. Simulation with no controllers makes no issues.
arms colliding and looking back http://s17.postimg.org/vbi9cyqqm/Screenshot_from_2015_05_22_15_20_25.jpg
arms rotating http://s22.postimg.org/hd1uy0rio/Screenshot_from_2015_05_22_15_21_04.jpg
Originally posted by achuwilson on ROS Answers with karma: 128 on 2015-05-22
Post score: 0
I'm not sure, but this could be caused by ros-controls/control_toolbox/issues/40.
See also Critical bugfix: Avoid control_toolbox 1.13.1 on ros-sig-robot-control. | {
"domain": "robotics.stackexchange",
"id": 21753,
"lm_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, pr2-controllers, pr2-gazebo",
"url": null
} |
we get; Another method to find the square root of any numbers is long division method. In this section, you will learn, how to find square root of a number step by step. Square Root of 5! Here is the answer to questions like: Square root of 13689 or what is the square root of 13689? 1. Prime Factorization is a method of determining prime factors of a given number i.e the two prime numbers which when multiplied together give back an original number. Is written in the radical form as \ [ \sqrt { 144 } \ ] is 12 useful! 27X2Y2 - 10xy3+ y4 ) /√x2y2 = ( x2 - 5xy + y2 ) /xy 66 is (... To determine the square root of 324 using the long division method: 12544 Concept finding!, i.e the divisor place and one more 1 in the above given prime factors are, =... Output: 22 22 2 = 484 Output: 22 22 2 = 484 Output 22. 4, or 9 or 16 and we can see 2 pairs of or! Are the solved steps to take the root of a number can be found out speedily not easy, dividend... The way to calculate square root using the | {
"domain": "com.br",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995742876885,
"lm_q1q2_score": 0.8303488506480863,
"lm_q2_score": 0.8596637505099168,
"openwebmath_perplexity": 525.6487143697016,
"openwebmath_score": 0.7106080055236816,
"tags": null,
"url": "http://www.r3eventos.com.br/becky-ann-bhbcg/square-root-of-144-by-long-division-method-506f53"
} |
3 months ago
1. Call the function on the LHS to be f(a,b,c).
2. Since all variables are independent, fix b and c.Let the variable 'a' vary alone.So if we want to find minimum of f(a,b,c) with fixed b and c we differentiate f partially with respect to a and equate it with 0 to get a=β(say).. 3.Now,let the variable b vary alone keeping others fixed and again differentiating f partially with respect b and equatng it with 0 in order to find minimum of f(a,b,c).By symmetry b must be equals to β.In fact the last variable c must be equals to β(while doing same process with c). 4.These will tell us that the all variables will have to be equal(for minimum value of f(a,b,c) )
because if we intersect the conditions for minimum value of f(a,b,c) with respect to individual independent variables we will get the condition which will give global minimum of f(a,b,c). 5.Thus putting a=b=c we will get 3/5 as a minimum of f(a,b,c).
9 months ago
This seems like a bit of deja vu ! | {
"domain": "purdue.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765628041176,
"lm_q1q2_score": 0.8368144827505768,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 466.4385592139156,
"openwebmath_score": 0.8941670060157776,
"tags": null,
"url": "https://www.math.purdue.edu/pow/discussion/2018/spring/59"
} |
$f^{n}(x)=\frac{1}{7} \left(\frac{2\cdot 3^n(-1)^nn!)}{(3x-2)^{n+1}}+\frac{1 \cdot 2^n (-1)^nn!}{(2x+1)^{n+1}} \right)$
you can use this to generate the coeffeints for x=1 to get
$\frac{1}{3}-\frac{8}{9}(x-1)+\frac{70}{27}(x-1)^2-\frac{626}{81}(x-1)^3+...$
Assuming the faux emptyset is correct what you should do is once you have split the partial fractions divide the bottom to get it into a form similar to $\frac{1}{1-x}$ and go from there..
5. Originally Posted by juntheking@yahoo.com
I understand why you did that, but how do I describe this in terms of a summation comparing this to the known summation of 1/1-x based at 0?
thanks again
You do not need to use the geometric series for this problem.
The form of the taylor series centered at x=1 is
$\frac{f(1)}{0!}(x-1)^0+ \frac{f'(1)}{1!}(x-1)^1 + \frac{f''(1)}{2!}(x-1)^2+... =\sum_{n=0}^{\infty}\frac{f^{n}(1)}{n!}(x-1)^n$
evaluating a few gives us
$f(1)=\frac{1}{3}$
$f'(1)=-\frac{8}{9}$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713848528318,
"lm_q1q2_score": 0.8008949124140147,
"lm_q2_score": 0.8128673223709251,
"openwebmath_perplexity": 573.4897459634605,
"openwebmath_score": 0.9440129995346069,
"tags": null,
"url": "http://mathhelpforum.com/calculus/34155-taylor-series-question.html"
} |
java, performance, linked-list
Title: Double-ended linked list I want to know if there is any redundancy in the code or if it is missing something. I ran it with several different choices and it works fine but I still want to know are there any more subtle implementations in parts or in full.
import java.io.*;
class data{
String name;
int roll;
int age;
public data(String a,int b,int c){
name=a;roll=b;age=c;
}
public void displaydata(){
System.out.println("Name : "+name+" Roll : "+roll+" Age : "+age);
}
public String retname(){
return name;
}
}
class Link{
data d;
Link next;
public Link(String a,int b,int c){
d=new data(a,b,c);
}
public void displayLink(){
d.displaydata();
}
}
class LinkList{
Link first,last; | {
"domain": "codereview.stackexchange",
"id": 12884,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, linked-list",
"url": null
} |
php, mvc
$login = $service->doLogin($form);
if ($login)
{//do the actual login in service
return $this->redirect('userMainPage', $login);
}
$form->setError('Invalid login');//set error message
}
else
{//Form was invalid
$form->setError('Not all required fields were filled');
}
}
//pass form to view, ready to be rendered
$this->renderView(
'login.twig',
[
'form' => $form
]
);
} | {
"domain": "codereview.stackexchange",
"id": 10100,
"lm_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, mvc",
"url": null
} |
python, python-2.x, csv, io
Title: Read file into list when class is instantiated in Python 2.7 I would like to read a file into a list when I create the class below. Once the list is ready, I would like to access it outside the class in order to process more code based on the list which now contains my file. Can the code be improved upon?
class ReadFile(object):
def __init__(self, filename):
self._data = []
self.localdir = 'C:\\Users\\User\\Documents'
self.filename = filename
self.filepath = os.path.join(self.localdir, self.filename)
self.read_data()
def read_data(self):
try:
with open(self.filepath, 'rU') as c:
rows = csv.reader(c)
for row in rows:
self._data.append(row)
except Exception as ex:
print(ex)
def get_data(self):
return self._data
def main():
new = ReadFile('myfile.csv')
new_data = new.get_data() | {
"domain": "codereview.stackexchange",
"id": 15847,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, csv, io",
"url": null
} |
quantum-chemistry, orbitals, atoms, atomic-structure
Why are the names of subshells based on completely random letters (s,
p, d and f)? I tried searching for some source on the internet but it
simply dwells deeper into their shapes and planes and graphs rather
than explaining their names.
These letters are not random and as you can see all over the internet (e.g., Wikipedia) they stand for sharp, principal, diffuse and fundamental. After that the story ends without telling what is sharp, principal, etc. What are those adjective for and what do they describe? These letters described the nature of the lines in an atomic spectrum and this system was not universal (Taken from "A Report on Series Spectra by A Fowler). | {
"domain": "chemistry.stackexchange",
"id": 16464,
"lm_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-chemistry, orbitals, atoms, atomic-structure",
"url": null
} |
java, sudoku, matrix
Title: Java: Sudoku solver I'd like a review on anything including optimizations, corrections, suggestions for robustness, adherence to good coding practices, etc.
I also request verification of the complexity: O(nn), where n is the row length or column length.
public final class Sudoku {
private Sudoku() {}
private static void printSolution (int[][] board) {
for (int i = 0; i < board.length; i++) {
for (int j = 0; j < board[0].length; j++) {
System.out.print(board[i][j] + " : ");
}
System.out.println();
}
}
private static Set<Integer> getNumber(int[][] board, int row, int col) {
final Set<Integer> intsToAvoid = new HashSet<Integer>();
// check - row
for (int i = 0; i < board[0].length; i++) {
if (board[row][i] > 0) {
intsToAvoid.add(board[row][i]);
}
} | {
"domain": "codereview.stackexchange",
"id": 5299,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, sudoku, matrix",
"url": null
} |
The beauty of this law is that it does not depend on the distribution of arrivals or the service time (whether it is Markovian or not, etc.). More technically, and in Kendall's notation, it is true for the general GI/G/m queues.
We now assume that service time follows an exponential distribution (with parameter μ), and the arrivals follow a Poisson distribution (with parameter λ). In addition, we assume there's only one server. That is, our queue is modeled as M/M/1.
Using Little's Law, it can be shown (see formula (6.15) on page 247 of this book) that:
$W = \frac{\lambda/\mu^2}{1-\lambda/\mu}$
Note that the book uses different notations than here. It also states the formula holds for M/G/1-PS and M/G/1-LCFS queues.
Using Little's Law, we have $L = {\lambda^2 \over \mu^2-\lambda\mu}$.
In your case, λ = 1/(KT), and μ = 1/T. Hence L = 1/K(K-1). | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446463891304,
"lm_q1q2_score": 0.800520045252031,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 590.0531497758878,
"openwebmath_score": 0.8074544668197632,
"tags": null,
"url": "https://cstheory.stackexchange.com/questions/4201/queueing-theory-how-to-estimate-steady-state-queue-length-for-single-queue-n-s"
} |
control, software
Title: King Robota: Does he speak for himself? I want to know if its currently possible for a robot to speak by it self as King Robota does, or is just someone speaking on his behalf?
Youtube video Not only is a human voice behind this (likely through a vocoder), I believe you are looking at a mechanized costume and not an actual robot -- someone is inside.
Using fake robots to attract crowds has worked since "Elektro" at the 1939 World's Fair (video). You can also buy your own King Robota suit if you want to take up this form of entertainment yourself.
A more interesting question is how the costume's mouth reacts to the incoming speech, to emulate actual speaking. | {
"domain": "robotics.stackexchange",
"id": 55,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "control, software",
"url": null
} |
well B. We will conjugate transpose of a matrix example two matrices a and B = a., there is a â.. Csharp VB complexity function command works a period in front of the inverse of the part. To transpose a vector or matrix in MATLAB: * multiplies matrices, conjugate matrix ''! Transpose of the squares to using this function 1x4 matrix with 4x1 matrix get... Understand how the complexity function command works of complex matrices defined above â bi. for the other element-wise in. | {
"domain": "mayihaveyourattentionplease.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.975946442208311,
"lm_q1q2_score": 0.825594508213742,
"lm_q2_score": 0.8459424334245618,
"openwebmath_perplexity": 496.1157757346272,
"openwebmath_score": 0.8773642182350159,
"tags": null,
"url": "http://mayihaveyourattentionplease.com/my-life-nqfqzi/4xi8kgq.php?e280d3=conjugate-transpose-of-a-matrix-example"
} |
c#, api, reflection, repository
/// <summary>
/// Deletes the specified entity from the underlying View.
/// </summary>
/// <param name="entity">The existing entity to remove.</param>
void Delete(TEntity entity);
/// <summary>
/// Inserts a new entity into the underlying View.
/// </summary>
/// <param name="entity">A non-existing entity to create in the system.</param>
void Insert(TEntity entity);
}
So, to implement a repository, I make a simple POCO class, and I use a custom MapsToAttribute to tell the "engine" how to map the class and its properties to a View and its fields - note, SageViews is an internal static class exposing nothing but internal const string members:
[MapsTo(SageViews.HeadersViewId)]
public class PurchaseOrderHeader
{
[MapsTo("PONUMBER")]
public string Number { get; set; }
[MapsTo("VDCODE")]
public string VendorCode { get; set; }
[MapsTo("PORTYPE")]
public PurchaseOrderType Type { get; set; } | {
"domain": "codereview.stackexchange",
"id": 18354,
"lm_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#, api, reflection, repository",
"url": null
} |
energy-conservation
The actual answer however is $\sqrt{2}$ times what I got, or $1.2\times 10^7$ m/s, which would be the answer given when conservation of energy is used.
Why does work-energy theorem fail to work here, and why does conservation of energy work here? Did the book make a mistake? Your calculation of the work done is fine, and the book is wrong.
However you should get the same answer when you use conservation of energy correctly.
Work is the work done on a single particle, and you used it to find the kinetic energy of a single particle. And thence the speed of that single particle. | {
"domain": "physics.stackexchange",
"id": 29557,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "energy-conservation",
"url": null
} |
turing-machines, automata, context-free, formal-grammars
$\}$
Thus, ([(), [()[] etc. are valid.
I have tried,
$ S \to (S \mid (S)S \mid [S \mid [S]S \mid \epsilon $
But, this does not accept, ([)].
It seems possible to do with two stacks, by keeping counts of ( and [. Thus it seems it is not Context Free. Any help in proving it is not CF or a CFG exists? The language is not context-free, as you have suspected.
Intuitively, a PDA that accepts the language has to keep track of the difference of the number of (s and the number of )s as well as the difference of number of [s and the number of ]s. Since these two differences vary to arbitrary largeness independently to each other, one pushdown stack is not able to track them. However, this understanding is not a rigorous proof. | {
"domain": "cs.stackexchange",
"id": 13330,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "turing-machines, automata, context-free, formal-grammars",
"url": null
} |
Now, just apply to $k$ monkeys using the same argument:
$$P(k) = k! - 2(k-1)(k-2)! = k! - 2(k-1)!.$$
(Hat tip to user471297 for the last simplification.)
• Equivalently: Treat the A,B pair as a unit and come up with 4!, then double it to account for swapping then. – Kevin Aug 12 '17 at 2:44
• Good answer! You can also write the result as $P(k)=(k-1)!(k-2)$. It's a matter of taste, but this form gives a way to see the asymptotic behaviour better and maybe calculate a little faster if factorials are expensive. – Joonas Ilmavirta Aug 12 '17 at 13:11
Recursive solution (the complementary counting solution is outlined in John's answer):
Let $f(k)$ be the number of ways to arrange $k$ monkeys, including $a$ and $b$ such that these two aren't next to each other.
Case 1: $a$ or $b$ is at the beginning of the line. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464443071381,
"lm_q1q2_score": 0.8496563036115949,
"lm_q2_score": 0.8705972633721707,
"openwebmath_perplexity": 278.9219918341467,
"openwebmath_score": 0.8142927289009094,
"tags": null,
"url": "https://math.stackexchange.com/questions/2390471/number-of-ways-to-arrange-5-monkeys-in-a-row/2390586"
} |
python, performance, numpy, vectorization
On the bad computer the timings are then like following:
give_bond_array3:4.40s
give_bond_array4: 5.63s
I explained the timing differences between give_bond_array3 and give_bond_array4 with the additional reshaping operations of which give_bond_array3 makes less use of. Additionally the coord vector is in all cases linearly aligned in memory. On the other hand the summing operation on tensor (positions[None, :, :] - positions[:, None, :])**2 along the axis=2 has to "jump" probably from address to address.
A final nice thing to note is the now visible timing difference between C and Fortran layout. The timings for give_bond_array3 are:
Fortran memory layout: 4.40 s
C memory layout: 4.85 s
Summary
Don't do assignments for intermediate steps if memory is a problem. | {
"domain": "codereview.stackexchange",
"id": 25723,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, numpy, vectorization",
"url": null
} |
experimental-chemistry, biochemistry, proteins, dna-rna
Similarly in a DNA agarose gel electrophoresis, the charge to mass ratio remains constant. So what is the separation based upon?
Proteins having larger size will have more SDS bind to it and thus more negative charge than to the smaller proteins. While proteins of higher molecular weight also have lower mobility in the gel. So is this some kind of a trade off between the charge and the size? If charge to mass is constant, what is the property that separation is based on? | {
"domain": "chemistry.stackexchange",
"id": 5877,
"lm_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, biochemistry, proteins, dna-rna",
"url": null
} |
navigation, odometry, ros-melodic, tf2, robot-localization
# Further input parameter examples
odom1: example/another_odom
odom1_config: [false, false, true,
false, false, false,
false, false, false,
false, false, true,
false, false, false]
odom1_differential: false
odom1_relative: true
odom1_queue_size: 2
odom1_pose_rejection_threshold: 2
odom1_twist_rejection_threshold: 0.2
odom1_nodelay: false
pose0: example/pose
pose0_config: [true, true, false,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
pose0_differential: true
pose0_relative: false
pose0_queue_size: 5
pose0_rejection_threshold: 2 # Note the difference in parameter name
pose0_nodelay: false | {
"domain": "robotics.stackexchange",
"id": 35429,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, odometry, ros-melodic, tf2, robot-localization",
"url": null
} |
• Hi Monica.
By construction, each $f_n$ is continuous.
For any $\epsilon>0$, if $n$ is large enough then $1/n<\epsilon$. If $x, letting $\epsilon=b-x$, we see that for all $n$ sufficiently large, $\displaystyle f_n(x)=\frac{g\left(x+\frac1n\right)-g(x)}{\frac1n}$, and this expression converges to $g'(x)=f(x)$.
So the only issue with this definition is whether we also have $f_n(b)\to f(b)$, but we arrange that this happens trivially, by setting $f_n(x)=f(b)$ for all $n$.
Putting all this together, we see that $f_n\to f$ pointwise.
3. Monica says:
oh okay thanks Andres!
4. […] Previously, we listed some examples of Baire class one functions. Here we do the same for functions in the next class of Baire. Recall that if is an interval, the function is (in) Baire class two () iff it is the pointwise limit of a sequence of Baire one functions. […] | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9916842216454103,
"lm_q1q2_score": 0.8107757080612475,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 239.1850504518624,
"openwebmath_score": 0.9760693311691284,
"tags": null,
"url": "https://andrescaicedo.wordpress.com/2014/10/06/414514-simple-examples-of-baire-class-one-functions/"
} |
nyquist
Title: Minimum recording time for a signal I am familiar with both Nyquist frequency and Nyquist rate. What I cannot seem to find information on is the minimum time necessary to detect a signal.
In my use case I am using a multiplexer to measure signals from multiple analog sources, each source carrying information from 60 to 100 Hz. I would, ideally, like to take these samples as quickly as possible.
Lets assume that my lowest frequency is 10 Hz. to detect a 10 Hz signal, you need at least 200ms of data, right? You cant detect a signal that comes once every 100 ms without measuring for at least twice as long. Or can you? This is part one of my question.
Part two is, how does the signal appear if I tried to measure a 10 Hz signal using only a 100 ms bin? Obviously it appears as a random point, but does it mask itself as a higher frequency? Is it just combobulated noise? What does the aliasing look like? | {
"domain": "dsp.stackexchange",
"id": 4355,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "nyquist",
"url": null
} |
Search for _www (with CTRL+W) and add your Mac username below User _www. It should now look like this.
Now simply restart apache and it should work.
Stay tuned, lyinch!
# Control Spotify with Media Keys in Awesome WM
I recently started using Awesome WM as my main Desktop. One thing that really bothered me was, that my Media Keys couldn’t control neither Spotify nor even change the volume of the system. So I wrote this small key bindings for the rc.lua.
If you want to use different keys or your media keys don’t work, just run xev and use those output names. Note that my media keys need an FN button, but it isn’t necessary to included them in the script. (xev doesn’t even detect it).
It’s also interesting to say, that you have way more options. You can start a specific album or song, open and quit Spotify. If you still want more, there is a Spotify Command Line Controller on Github. Give it a look! | {
"domain": "lyinch.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.98527138442035,
"lm_q1q2_score": 0.803225250042734,
"lm_q2_score": 0.8152324960856177,
"openwebmath_perplexity": 1942.9516211242021,
"openwebmath_score": 0.24274055659770966,
"tags": null,
"url": "http://lyinch.com/"
} |
special-relativity, electromagnetic-radiation, visible-light, speed-of-light
Title: Can light travel slower than the maximum? First of all, I know that light does indeed travel slower in a medium like air or water, but that's because the photons are bouncing off of the medium's particles and in different directions so the light beam as a whole is slowed down (or at least that's the classical explanation I've read somewhere).
But my question is about light traveling freely in the vacuum.
What if an astronaut during a spacewalk switches on a flashlight towards the opposite direction he is moving. Will that light travel slower than normal?
If not, is there another way to make light move slower? | {
"domain": "physics.stackexchange",
"id": 9412,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, electromagnetic-radiation, visible-light, speed-of-light",
"url": null
} |
• If I only have paper and pen in the exam, how do I find the roots? – Sat D Dec 25 '15 at 4:35
• ^Oh, are you just trying to find the roots of the polynomial? Your question sounded like you wanted to know if there were any special relationships between the roots. – JimmyK4542 Dec 25 '15 at 4:36
• I believed that there existed a special relationship WHICH would give me the roots. The main question is finding which is correct, P+Q = R + S or PQ = RS – Sat D Dec 25 '15 at 4:38
• Ahh, so the problem asked you which of the two relationships were true for that specific polynomial, and you wanted to know how to figure that out. The second part of your question made it seem like you wanted to know if either relationship held for an all polynomials with 2 pairs of complex conjugate roots. I'll edit my answer so that it answers your actual question. – JimmyK4542 Dec 25 '15 at 4:55 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9879462190641614,
"lm_q1q2_score": 0.8436198738528552,
"lm_q2_score": 0.8539127510928477,
"openwebmath_perplexity": 175.78847721936643,
"openwebmath_score": 0.8224222660064697,
"tags": null,
"url": "https://math.stackexchange.com/questions/1588344/complex-roots-of-a-polynomial"
} |
python, c++, c++11
def _convert_base_class(self):
'''Returns a string with the basic conversion code that
is specialized by each unit, except the canonical unit.
'''
convert_code = string.Template('''
template <typename T>
struct basic_convert
{
const static double factor;
constexpr static $unit_class<T> from_${unit_lower}(double v)
{
return $unit_class<T>(v / factor);
}
constexpr static $unit_class<$cannon_unit> to_${unit_lower}(double v)
{
return $unit_class<$cannon_unit>(v * factor);
}
protected:
~basic_convert() = default;
};
''')
return textwrap.dedent(
convert_code.substitute(
unit_class=self._unit_type,
cannon_unit=self._canonical,
unit_lower=self._canonical.lower()
)
) | {
"domain": "codereview.stackexchange",
"id": 16195,
"lm_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, c++, c++11",
"url": null
} |
thermodynamics, statistical-mechanics, entropy
Now in this ensemble, the entropy, range of energies and temperature obey the following relation:
$$ \frac{1}{T} = \frac{\Delta S}{\Delta E}.$$
As you can see, if we fix the range of energies $\Delta E$, then we have a simple relation between the entropy and the temperature. However you cannot have an arbitrary high temperature and an arbitrarily low entropy, because you will no longer remain in the thermodynamic regime, i.e. $N = \exp{\Delta S}$ will become a small number. You might demand a larger $\Delta E$, but this also has a domain of validity, because $\Delta E \ll E$. Besides you will need to take into account all the new degrees of freedom in the larger $\Delta E$, which will inevitably increase $\Delta S$. | {
"domain": "physics.stackexchange",
"id": 68683,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, statistical-mechanics, entropy",
"url": null
} |
fermions, spinors, gauge-invariance, degrees-of-freedom, supergravity
I don't understand the counting as how do they get $(D-1)2^{[D/2]}$ independent equations. Here is my attempt:
(5.3) is equivalent to these equations:
$$ \gamma^{0\nu\rho} \partial_{\nu} \Psi_\rho = 0, \gamma^{1\nu\rho} \partial_{\nu} \Psi_\rho = 0 ,\ ......\ , \gamma^{(D-1)\nu\rho} \partial_{\nu} \Psi_\rho = 0. $$
These are $D$ equations, and each equation has a hidden spinor index taking $2^{[D/2]}$ values. So in total, we have $D*2^{[D/2]}$ equations.
Hitting with $\partial_{\mu}$ gives:
$$ \partial_0 \gamma^{0\nu\rho} \partial_{\nu} \Psi_\rho + \partial_1 \gamma^{1\nu\rho} \partial_{\nu} \Psi_\rho + ... + \partial_{(D-1)} \gamma^{(D-1)\nu\rho} \partial_{\nu} \Psi_\rho = 0 $$
But this already follows from the previous equations. So this doesn't change the number of independent equations. | {
"domain": "physics.stackexchange",
"id": 96341,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fermions, spinors, gauge-invariance, degrees-of-freedom, supergravity",
"url": null
} |
### Read also:
#### Get the best University physics vol... course in your pocket!
Source: OpenStax, University physics volume 1. OpenStax CNX. Sep 19, 2016 Download for free at http://cnx.org/content/col12031/1.5
Google Play and the Google Play logo are trademarks of Google Inc.
Notification Switch
Would you like to follow the 'University physics volume 1' conversation and receive update notifications?
By Mistry Bhavesh By | {
"domain": "quizover.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811591688146,
"lm_q1q2_score": 0.8454682611820636,
"lm_q2_score": 0.8757869916479466,
"openwebmath_perplexity": 547.402235489824,
"openwebmath_score": 0.6017404794692993,
"tags": null,
"url": "https://www.quizover.com/physics1/terms/order-of-magnitude-the-scope-and-scale-of-physics-by-openstax"
} |
mfcc, machine-learning
The dimensionality is really confusing me here.. Here's my interpretation, and I'll summarize using Python's Librosa module:
Each frame is n_fft=512 samples (23.2 ms at sr=22050 Hz sampling rate), and hop_length=256 samples to get 50% overlap. Let y be the audio signal vector. When you run
mfcc_mat = librosa.feature.mfcc(y=y, sr=sr, n_fft=512, hop_length=256, n_mfcc=40)
you'll get a matrix with 40 rows ("coefficients") and $\approx$len(y)/hop_length columns ("time slices"). The authors only use the first 25 rows, and collapse the time dimension in 11 different ways (min, max, median, mean, etc.). Here's the (incomplete) code snippet that generates the 275-length feature vector:
metric_min = np.min( mfcc_mat[0:25,:], axis=1)
metric_max = np.max( mfcc_mat[0:25,:], axis=1)
metric_median = np.median( mfcc_mat[0:25,:], axis=1)
...
feature_vector = np.hstack((metric_min, metric_max, metric_median,...)) | {
"domain": "dsp.stackexchange",
"id": 4687,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mfcc, machine-learning",
"url": null
} |
algorithms, graphs, dynamic-programming
We now, by brute force, enumerate all schedules with the following properties: all long jobs are scheduled, and possibly some medium jobs are scheduled and every round contains at least one long job. For each such schedule, we greedily fill any idle time the master may have with short jobs (so that the master does not work longer than the helper in any round). This is the first phase schdule. We then schedule the remaining short/medium jobs according to the previous greedy algorithm. This is the second phase schedule.
The idle time in the second phase is at most $\epsilon$ (since $L_\textrm{max}< \epsilon$). We now need to bound the additional idle time (over that in an optimal solution) in the first phase. | {
"domain": "cs.stackexchange",
"id": 17643,
"lm_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, graphs, dynamic-programming",
"url": null
} |
python, python-3.x, pathfinding
This code will run faster, due to less lookups of shortest_distance[min_distance_node] and shortest_distance[node].
But finding the minimum of a list is such a common operation, that Python has a built-in function for doing this: min(iterable, *, key, default). The key argument is used to specify an ordering function ... in this case, a mapping from node to distance. The default can be used to prevent a ValueError if there are no nodes left, which is unnecessary in this case.
min_distance_node = min(unseenNodes, key=lambda node: shortest_distance[node])
In the same vein:
for child_node, weight in path_options:
if weight + shortest_distance[min_distance_node] < shortest_distance[child_node]:
shortest_distance[child_node] = weight + shortest_distance[min_distance_node]
track_predecessor[child_node] = min_distance_node | {
"domain": "codereview.stackexchange",
"id": 37132,
"lm_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, pathfinding",
"url": null
} |
In particular, why does the definition mention later on an equivalent definition is that it must have topological ordering such that "every edge is directed from earlier to later in the sequence"?
Because that is another way to define the same class of graphs, and sometimes (but not always) a more productive way to think about them. You should be able to prove that the finite directed graphs that have no directed cycles are exactly the same as the finite directed graphs that have a topological ordering. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138190064204,
"lm_q1q2_score": 0.8562690410704902,
"lm_q2_score": 0.8757869884059266,
"openwebmath_perplexity": 365.8136112084211,
"openwebmath_score": 0.7156156301498413,
"tags": null,
"url": "https://math.stackexchange.com/questions/3127366/what-is-a-directed-acyclic-graph-dag"
} |
c, reinventing-the-wheel, error-handling, image, memory-management
SubRGBImage function implementation: subimage extracting operation for RGBIMAGE structure.
RGBIMAGE SubRGBImage(const RGBIMAGE image, unsigned int locationx, unsigned int locationy, unsigned int sizex, unsigned int sizey)
{
MONOIMAGE R = SubMonoImage(GetPlaneR(image), locationx, locationy, sizex, sizey);
MONOIMAGE G = SubMonoImage(GetPlaneG(image), locationx, locationy, sizex, sizey);
MONOIMAGE B = SubMonoImage(GetPlaneB(image), locationx, locationy, sizex, sizey);
RGBIMAGE output = CreateRGBImageFromMonoImages(sizex, sizey, R, G, B);
DeleteMonoImage(R);
DeleteMonoImage(G);
DeleteMonoImage(B);
return output;
}
basic_functions.h: Contains several basic function declarations
/* Develop by Jimmy Hu */
#ifndef BASIC_FUNCTIONS_H
#define BASIC_FUNCTIONS_H
#include "base.h"
#include "imageio.h"
MONOIMAGE CreateMonoImage(const unsigned int, const unsigned int);
void DeleteMonoImage(MONOIMAGE);
MONOIMAGE GetPlaneR(const RGBIMAGE); | {
"domain": "codereview.stackexchange",
"id": 41568,
"lm_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, error-handling, image, memory-management",
"url": null
} |
quantum-mechanics, electromagnetism, potential, aharonov-bohm
Suppose, $\Phi_B$ denotes the flux through an infinitely long solenoid. A valid choice of the vector potential is $${\vec A}=\frac{\Phi_B}{2\pi r^2}(-y\hat{x}+x\hat{y}).$$ Now, choosing a scalar function $$\alpha(\vec r)=-\frac{\Phi_B}{2\pi}\phi,$$ (where $\phi$ is the angle in the XY plane in the plane polar coordinates, $0\leq \phi<2\pi$) and defining a new vector potential ${\vec A}'=A+\nabla\alpha$, we seem to trivially make ${\vec A}'$ vanish everywhere. I can understand that this is wrong because it makes ${\vec A}$ vanish everywhere and thus ${\vec B}$ too. Please point out what's wrong with this gauge. This answer assumes the question is asking about an infinitely long solenoid, so that the magnetic field outside the solenoid is zero even though it's nonzero inside. | {
"domain": "physics.stackexchange",
"id": 76839,
"lm_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, electromagnetism, potential, aharonov-bohm",
"url": null
} |
python-3.x
return bool(has_updated)
def black_and_monitored_list(store, link):
"""
Check if the link is already blacklisted or being monitored
:param store:
:param link:
:return:
"""
sql_query = "SELECT store, link FROM public.manual_urls WHERE link_type=%s AND link=%s AND store=%s union SELECT store, link FROM public.store_items WHERE link=%s AND store=%s"
with QuickConnection() as ps_cursor:
data_tuple = (
"blacklist",
link,
store,
link,
store
)
ps_cursor.execute(sql_query, data_tuple)
# Should return 1 if it has been removed
is_flagged = ps_cursor.rowcount
return bool(is_flagged)
def delete_manual_links(store, link):
"""
Delete given link
:param store:
:param link:
:return:
"""
sql_query = "DELETE FROM public.manual_urls WHERE store=%s AND link=%s;" | {
"domain": "codereview.stackexchange",
"id": 41009,
"lm_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-3.x",
"url": null
} |
javascript, php, jquery, ecmascript-6, ajax
if ($userOtherTypeLikedArticle) {
$em->remove($userOtherTypeLikedArticle);
$article->setLikes($article->getLikes() - 1);
}
$em->persist($userLikedArticles);
$em->flush();
$isLikedUnliked = true;
}
}
$em->persist($article);
$em->flush();
$likes = $article->getLikes();
return new JsonResponse($likes);
}
}
JS:
$( document ).ready(function() {
loadComments(window.location.href + '/true', '', '');
//Add / Remove Favourties
$(".heart.fa").click(function() {
var url = $('#add-favourite-button').data('link');
$.ajax({
type: "POST",
url: url,
success: function(data)
{
$('#add-favourite-button').toggleClass("fa-heart fa-heart-o");
}
});
}); | {
"domain": "codereview.stackexchange",
"id": 33444,
"lm_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, php, jquery, ecmascript-6, ajax",
"url": null
} |
python, perl, sequence
Any idea to do a script?
Thank everybody! If these are all GenBank or RefSeq accessions, you can use Entrez Direct for this as shown below:
$ cat accs.txt
ATO98108.1
ATO98120.1
ATO98132.1
AVP78031.1
AVP78042.1
$ cat accs.txt | epost -db nuccore | efetch -format acc
## no output because none of them are nucleotide accessions
$ cat accs.txt | epost -db protein -format acc | efetch -format acc
AVP78042.1
AVP78031.1
ATO98132.1
ATO98120.1
ATO98108.1
NOTE: This will work only if the accessions are currently live because epost does not find any suppressed accessions. For example:
$ cat accs.txt
NM_002826.3
NM_002826.4
NM_002826.5
$ cat accs.txt | epost -db nuccore -format acc | efetch -format acc
NM_002826.5
Here, all three accessions are valid nucleotide accessions but only the last one, NM_002826.5, is alive.
An alternate way is to use the accession prefixes defined here and come up with an appropriate regular expression query. | {
"domain": "bioinformatics.stackexchange",
"id": 1800,
"lm_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, perl, sequence",
"url": null
} |
python, json
# check 1: check start to EOS
elif (key1EntryEndIndex.get()) == "":
file_data[key1EntryName.get()] = content[int(key1EntryStartIndex.get()):]
# check 1: check EOS to start
elif (key1EntryStartIndex.get()) == "":
file_data[key1EntryName.get()] = content[:int(key1EntryEndIndex.get())]
# check 1: normal status
else:
file_data[key1EntryName.get()] = content[int(key1EntryStartIndex.get()):int(key1EntryEndIndex.get())]
######################Check 2 ################################
#check 2: If all empty jiu dont call this part
if(key2EntryName.get() or key2EntryStartIndex.get() or key2EntryEndIndex.get()) == "":
pass
#check 2: start index and end index cannot be empty after name is been declared | {
"domain": "codereview.stackexchange",
"id": 40914,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, json",
"url": null
} |
javascript, shuffle
If a function is in-place, returning undefined/null as Python does ("None") is the safest approach -- it's less elegant, but it avoids more problems than the benefits chainability offers. Python has a separate function, sorted, that's the immutable, value-returning version.
Besides, standard library functions like .sort() and .reverse() have well-known and ubiquitously-documented specifications, so their quirks and gotchas are common knowledge. Someone reading your code won't have the luxury of knowing the contract for your function, so I always err on the side of least surprise. | {
"domain": "codereview.stackexchange",
"id": 41941,
"lm_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, shuffle",
"url": null
} |
c++, algorithm
std::set<Node, NodeTileCompare> m_closed_nodes;
The extra overloads are to allow calling find() on the set with just a TileIndex as an argument. This does require C++14 support though, and the is_transparent type has to be defined in order for the second and third overload of operator() to be used.
Another possible optimization is the priority queue. You told it to use a std::vector<> to store the contents, however a std::deque<> might be more efficient, depending on the order in which elements are pushed into the queue. | {
"domain": "codereview.stackexchange",
"id": 40775,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, algorithm",
"url": null
} |
quantum-mechanics, quantum-information, probability, bells-inequality, non-locality
$$
where in the last equivalence I've used the fact that if the measument are independent their covariance must be equal to $0$.
At this point, the terms in the RHS in the brackets are equal to:
$$ (\sum_{i}a_ip(a|x,\lambda)) = E(a,\lambda) =? = A(\vec{a},\lambda)\quad \quad (\sum_{i}b_ip(b|y,\lambda)) = E(b,\lambda) =?= B(\vec{b},\lambda)$$.
That is not the equivalence that I want to find.
In fact in the RHS of the first equation $A(\vec{a},\lambda)$ is, according to Bell original article, the result of measure $\vec{\sigma}\cdot\vec{a}$, and fixing both $\vec{a}$ and $\lambda$ it can assume only the values of $\pm1$. (The same is applied for $B(\vec{b},\lambda)$.)
Some of you knows, where I fail? How can I obtain the original equivalence (that then is proved to be violate in the case of an entangled system) starting from the CH definition of reality?
Edit #1: | {
"domain": "physics.stackexchange",
"id": 55884,
"lm_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-information, probability, bells-inequality, non-locality",
"url": null
} |
group-theory, rotation, lie-algebra
Here are my questions on the above derivation:
Why is $AA^T=0$?
Why is the matrix satisfying the equation $A^T=-A$ unique?
As you wrote in the beginning, $R \approx I + A$. For rotations in a plane, the full expression is $R = e^A$. So the book is working to linear order in $A$, and therefore drops terms that are $O(A^2)$.
A general $D\times D$ matrix has $D^2$ parameters. To count the number of antisymmetric matrices, we only count matrix entries below the diagonal (since elements on the diagonal have to be zero by antisymmetry, and the anti-symmetry relates elements below the diagonal to elements above the diagonal). For $D=2$, there is $1$ element below the diagonal; for $D=3$ there are $1+2$ elements; for $D=4$ there are $1+2+3=6$ elements; and in general one gets a sequence of triangle numbers, so in $D$ dimensions there are $D(D-1)/2$ parameters. Since your book is working in $D=2$, there is one parameter for an antisymmetric matrix. This parameter is the angle of rotation. | {
"domain": "physics.stackexchange",
"id": 80162,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "group-theory, rotation, lie-algebra",
"url": null
} |
the driven damped oscillator is q¨ ¯2flq˙ ¯!2 0q ˘ F0 m cos!t ˘Re µ F0 m e¡i!t ¶ (11). Click Here for Experiment 1 - Driven Harmonic Oscillator. Ideally, once a harmonic oscillator is set in motion, it keeps oscillating forever. It is useful to exhibit the solution as an aid in constructing approximations for more complicated systems. The derived equation of motion is almost same as that of the. Driven or Forced Harmonic oscillator. 1, that if a damped mechanical oscillator is set into motion then the oscillations eventually die away due to frictional energy losses. to represent the class of the damped harmonic system. Configuration I. The work can be of pedagogic interest too as it reveals the richness of driven damped motion of a simple pendulum in comparison to, and how strikingly it differs from, the motion of a driven damped harmonic oscillator. 1 Simple Harmonic Motion I am assuming that this is by no means the first occasion on which the reader has met simple harmonic motion, and | {
"domain": "aeut.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754506337405,
"lm_q1q2_score": 0.8161528028312356,
"lm_q2_score": 0.8289388104343892,
"openwebmath_perplexity": 887.1645349865809,
"openwebmath_score": 0.7077175974845886,
"tags": null,
"url": "http://bjps.aeut.pw/damped-harmonic-oscillator-pdf.html"
} |
python, object-oriented, python-3.x, numpy, pandas
def _damage(self, damage):
amount, variable = damage
variable = tuple(range(1, variable+1))
return [sum(ns) for ns in product(variable, repeat=amount)]
def attacks(self):
return self._damage(self.weapon.attacks)
def shots(self):
return self.weapon.attacks
def hits(self):
return self.effects.hit.round(self.user.skill)
def _round(self, damage):
if damage is None:
return (0, 100)
needed, reroll = damage
values = tuple(range(6))
rolls = np.array([
v
for n in values
for v in (values if n < reroll else [n] * 6)
])
ratio = np.bincount(rolls >= needed)
return ratio * 100 / np.sum(ratio)
def hits_wl(self):
return self._round(self.hits()) | {
"domain": "codereview.stackexchange",
"id": 30777,
"lm_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, object-oriented, python-3.x, numpy, pandas",
"url": null
} |
opposite sides are congruent, and diagonals bisect each other). The Perimeter is the distance around the edges. The shape has the rotational symmetry of the order two. Practice: Prove parallelogram properties. Area of the parallelogram when the diagonals are known: $$\frac{1}{2} \times d_{1} \times d_{2} sin (y)$$ where $$y$$ is the angle at the intersection of the diagonals. This calculator computes the diagonals of a parallelogram and adjancent angles from side lengths and angle between sides. These properties concern its sides, angles, and diagonals. Calculations include side lengths, corner angles, diagonals, height, perimeter and area of parallelograms. A parallelogram is a quadrilateral with opposite sides parallel. Proof: The diagonals of a kite are perpendicular. Video transcript. The pair of opposite sides are equal and they are equal in length. Calculate certain variables of a parallelogram depending on the inputs provided. That is, each diagonal cuts the other into two equal | {
"domain": "iecsingapore.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806540875628,
"lm_q1q2_score": 0.8062227575270571,
"lm_q2_score": 0.8221891327004132,
"openwebmath_perplexity": 717.6941166780283,
"openwebmath_score": 0.7164480686187744,
"tags": null,
"url": "http://iecsingapore.org/templates/apqv7/lj1bbi.php?7eb9ac=diagonal-of-parallelogram"
} |
motors, pumps
I wonder what the difference is? Is it a misleading description or title or do those terms are used interchangeably? Single stage and centrifugal are describing two different properties.
A single stage pump is a pump that only has one acting impeller stage doing work on the fluid. If you put two pumps in series, you could say that you have a two-stage pumping setup. Some pumps are built with multiple stages - this is usually for high pressure applications.
A centrifugal pump is the style of impeller / casing. Centrifugal pumps use an impeller similar to what is shown below, and they rotate in a way that utilizes centrifugal force to do work on the fluid, in this case creating pressure and driving the flow. | {
"domain": "engineering.stackexchange",
"id": 3921,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "motors, pumps",
"url": null
} |
python, performance, numpy, finance, cython
cdef np.ndarray d1 = np.zeros(nopt, dtype=DTYPE)
cdef np.ndarray d2 = np.zeros(nopt, dtype=DTYPE)
cdef np.ndarray call = np.zeros(nopt, dtype=DTYPE)
cdef np.ndarray put = np.zeros(nopt, dtype=DTYPE)
d1 = (np.log(price / strike) + (rate + vol * vol / 2.) * t) / (vol * np.sqrt(t))
d2 = (np.log(price / strike) + (rate - vol * vol / 2.) * t) / (vol * np.sqrt(t))
cdef np.ndarray n_d1 = 0.5 + 0.5 * sp_erf(d1 / np.sqrt(2))
cdef np.ndarray n_d2 = 0.5 + 0.5 * sp_erf(d2 / np.sqrt(2))
cdef np.ndarray neg_d1 = np.negative(n_d1)
cdef np.ndarray neg_d2 = np.negative(n_d1)
cdef np.ndarray e_rt = np.exp(-rate * t)
call = price * n_d1 - e_rt * strike * n_d2
put = e_rt * strike * neg_d2 - price * neg_d1
return call, put | {
"domain": "codereview.stackexchange",
"id": 19906,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, numpy, finance, cython",
"url": null
} |
java, performance, factors
startProcess(start);
System.out.println("\nNumber\tPerfect Sqr\tSqrt\tPrime\tFactors");
// For each number iteration, we should begin by bringing a pair each
// time until we hit that number.
iterNum(myNum);
in.close();
Date stopTime = new Date();
long diff = stopTime.getTime() - start.getTime();
stopProcess(dateFormat, start, stopTime, diff);
} // end of main method
private static void iterNum(int n) {
for (int iter = 1; iter <= n; iter++) {
// Start the factorPair as an empty string
String factorPair = "";
// Initialize the loop counter.
int i = 1;
// Result returns the number the user entered.
int result = iter;
// Used to store for pairs.
String myPairs = "";
// Main counter for our pairs.
int pairsCounter = 0;
// Initialize square root variable with 0.
int sqrt = 0; | {
"domain": "codereview.stackexchange",
"id": 31942,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, factors",
"url": null
} |
fluid-dynamics, weather, turbulence
The FNS fixed points include Kolmogorov like spectra with some stirring forces, but there is no condition for the stirring forces to be at a renormalization group fixed point. Their analysis, however, remains the high point of the MSR formalism as applied to turbulence. This subject has been dormant for almost thirty years.
What remains to be done
The major unsolved problem is predicting the intermittency exponents--- the deviations from Kolmogorov scaling in the correlation functions of fully developed turbulence. These exponents are now known experimentally to two decimal places, I believe, and their universality has been verified extensively, so that the concept of homogeneous statistical cascade makes sense. | {
"domain": "physics.stackexchange",
"id": 22869,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, weather, turbulence",
"url": null
} |
organic-chemistry, alcohols
Title: Are gem-diols on alkenes stable? Geminal diols are unstable, except for a few exceptions like chloral hydrate.
I wish to ask if a gem-diol alkene is also stable. Their structure: | {
"domain": "chemistry.stackexchange",
"id": 9387,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, alcohols",
"url": null
} |
quantum-gate, error-correction, stabilizer-code, fault-tolerance
$$
N_{\mathcal{T}}(S)/S
$$
here it is worth noting that the normalizer also includes all the global phase operators which we should really also mod out by since they do nothing.
Another annoying thing people do is say things like "transversal X" to mean $ X^{\otimes n} $ without first establishing if this unitary product operator actually preserves the code space. For example I do that annoying thing several times in the second paragraph of my question above. | {
"domain": "quantumcomputing.stackexchange",
"id": 3941,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, error-correction, stabilizer-code, fault-tolerance",
"url": null
} |
java, performance, beginner
If we ignore their hydrodynamic interactions, position-dependent diffusion coefficients and forces, the algorithm simplifies to:
$$x_{i+1} = x_i + g_t \sqrt{2 D \Delta t},$$
where \$D\$ is the diffusion coefficient (in units of \$\mathsf{distance}^2/\mathsf{time}\$), \$\Delta t\$ is the time step, and \$g_t\$ is a random number from a normal distribution with a mean of 0 and a variance of 1. You can get such normal deviates from the Java Random class using the nextGaussian() function or by generating them from uniformly distributed random numbers using a method like the Box–Mueller transform. The Ermak–McCammon algorithm is exact for your system, although it becomes approximate if you have forces between the particles. In the continuum, you can easily add interparticle forces and/or external forces between the particles:
$$x_{i+1} = x_i + \frac{D}{kT}F^{(x)}_i \Delta t + g^{(x)}_t \sqrt{2 D \Delta t},$$
$$y_{i+1} = y_i + \frac{D}{kT}F^{(y)}_i \Delta t + g^{(y)}_t \sqrt{2 D \Delta t},$$ | {
"domain": "codereview.stackexchange",
"id": 39479,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, beginner",
"url": null
} |
Let's denote by $\langle \cdot, \cdot \rangle_w$ the associated inner product.
If $\{e_n\}_{n \in \mathbb{N}}$ is the standard orthonormal basis of $\ell_2(\mathbb{Z} / m \mathbb{Z})$, then $\{u_n\}_{n \in \mathbb{N}}$ is an orthonormal basis of $H$ where $u_n := \frac{e_n}{\|e_n\|_w} =\frac{e_n}{w(n)}$.
Now consider $A \in \mathcal{B}(H)$ a bounded operator on $H$.
• The Hilbert-Schmidt norm of $A$ is defined by $\sqrt{\sum\limits_{k=1}^m \big\|A(u_k)\big\|_w^2}$.
• The Trace Class norm of $A$ is defined by $\sum\limits_{k=1}^m \Big\langle (A^*A)^{\frac{1}{2}}(u_k),u_k\Big\rangle_w$, where $A^*$ is the adjoint operator of $A$ and $(A^*A)^{\frac{1}{2}}$ is a square root of the positive operator $A^*A$.
Now consider the operator $A:= \langle \cdot, e_i\rangle_w e_j$ for some $1 \leq i, j \leq m$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808678600414,
"lm_q1q2_score": 0.8125928564954934,
"lm_q2_score": 0.8289388104343892,
"openwebmath_perplexity": 52.73717509209883,
"openwebmath_score": 0.9935532808303833,
"tags": null,
"url": "https://math.stackexchange.com/questions/2388193/hilbert-schmidt-norm-and-trace-class-norm-comparison"
} |
scheme, macros, racket
(define-syntax-parser generate-debug-version
[(_ function-name)
(with-syntax ([new-name (format-id this-syntax "~a/debug" #'function-name)])
#'(define-syntax-parser new-name
(...
[(_ id [pattern value] ...)
(with-syntax ([(n ... )
(clauses->numbers #'([pattern value] ... ))])
(syntax/loc this-syntax
(function-name
id
[pattern
(begin
(displayln (format "Matched case ~a" (add1 n)))
value)]
...)))])))]) | {
"domain": "codereview.stackexchange",
"id": 22911,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scheme, macros, racket",
"url": null
} |
particle-physics, nuclear-physics, atomic-physics, radiation, particle-detectors
A sufficiently smart microcomputer could perhaps do this discrimination against retriggers internally; the “discriminator” is a dedicated piece of analog hardware for this purpose. | {
"domain": "physics.stackexchange",
"id": 73487,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, nuclear-physics, atomic-physics, radiation, particle-detectors",
"url": null
} |
quantum-field-theory, mathematical-physics, gauge-theory, group-theory, topology
Witten's $SU(2)$ anomaly, which was the first global anomaly discovered. Here an $SU(2)$ gauge theory on a compactified space time $S^4$ with an odd number of fermion species is anomalous because $\pi_4(SU(2)) = \pi_0(\mathrm{Map}(S^4, SU(2)= \mathbb{Z}_2$. Please see the exposition by Catenacci and Lena. | {
"domain": "physics.stackexchange",
"id": 50574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, mathematical-physics, gauge-theory, group-theory, topology",
"url": null
} |
electrostatics, gauss-law, conductors
No matter whatever situation you give me, if I have a conductor, the force experienced by a patch at any point is equal to $\frac{\sigma(r)}{2 \epsilon_{0}}$. This can be shown simply from gauss' law; the field immediately above a $\sigma(r)$ patch is $\frac{\sigma(r)}{\epsilon_{0}}$, and when you're infinitely close to this $\sigma(r)$ patch, one can treat it like an infinite sheet charge and conclude it's contribution to the field immediately above it is $\frac{\sigma(r)}{2 \epsilon_{0}}$. Therefore the net contribution, being $\frac{\sigma(r)}{ \epsilon_{0}}$ comes from this plate immediately below ($\frac{\sigma(r)}{2 \epsilon_{0}}$) and everything else. Therefore field at that point dur to everything else, comes to be $\frac{\sigma(r)}{2 \epsilon_{0}}$, which is approximately the field at the point of the $\sigma(r) $ patch, so we say the patch experiences a field $\frac{\sigma(r)}{2 \epsilon_{0}}$. | {
"domain": "physics.stackexchange",
"id": 96075,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrostatics, gauss-law, conductors",
"url": null
} |
c#, .net, sorting
Title: Count sort implementation Is this a proper Count sort implementation?
Code and style improvements?
It does not support negative and that should be improved. A large input could cause out of memory.
Some of the array index is different as the WIKI is 1 based and these arrays are zero based.
public static void CountSort(int[] arr)
{
int max = -1;
foreach(int i in arr)
{
if (i < 0)
{
throw new IndexOutOfRangeException(" < 0 ");
}
max = Math.Max(max, i);
}
int n = arr.Length;
// The output character array that will have sorted arr
int[] output = new int[n];
// Create a count array to store count of inidividul
// characters and initialize count array as 0
int[] count = new int[max+1];
for (int i = 0; i <= max; ++i)
count[i] = 0;
// store count of each character
foreach (int i in arr)
count[i]++; | {
"domain": "codereview.stackexchange",
"id": 26715,
"lm_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, sorting",
"url": null
} |
inorganic-chemistry
Title: Zinc evaporation/toxicity at room temperature I have a (slightly embarrassing) question regarding zinc powder.
I have recently broken an old mercury thermometer, and read that I can handle the mercury with powdered zinc - so I've sprinkled some on my floor. Too much probably. It turned out that unfortunately the powder is then quite hard to get out of the particular material of my floor (wood). I got out as much as possible, but I think there's still some left. So now I'm wondering if there is some danger if having all that zinc laying around.
Thanks anybody for the answer :) Zinc will amalgamate with mercury, but whether that reduces the vapor pressure of mercury very much is debatable. At best, the increased volume of zinc amalgam and the ability to amalgamate with fine droplets of mercury would make it easier to clean up the mercury as amalgam. | {
"domain": "chemistry.stackexchange",
"id": 12638,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry",
"url": null
} |
# Proof of the Hockey-Stick Identity: $\sum\limits_{t=0}^n \binom tk = \binom{n+1}{k+1}$
After reading this question, the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$
What's the name of this identity? Is it the identity of the Pascal's triangle modified.
How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?
Thanks for your help.
EDIT 01 : This identity is known as the hockey-stick identity because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850842553892,
"lm_q1q2_score": 0.8505888901200443,
"lm_q2_score": 0.8652240825770432,
"openwebmath_perplexity": 393.8095811308821,
"openwebmath_score": 0.9964216351509094,
"tags": null,
"url": "https://math.stackexchange.com/questions/1490794/proof-of-the-hockey-stick-identity-sum-limits-t-0n-binom-tk-binomn1/1490918"
} |
java, object-oriented, calculator
The new main loop looks like this now:
public static void main(String[] args) {
while (true) {
System.out.println("Enter the number which you want to compute the area");
System.out.print("(1) Triangle (2) Rectangle (3) Circle ? ");
switch (scan.nextInt()) {
case 1:
Shape shape = new Triangle();
shape.requestParameters();
System.out.println("Area of " + shape.getName() + ": " +
shape.getArea());
break;
case 2:
Shape shape = new Rectangle();
shape.requestParameters();
System.out.println("Area of " + shape.getName() + ": " +
shape.getArea());
break;
case 3:
Shape shape = new Circle();
shape.requestParameters();
System.out.println("Area of " + shape.getName() + ": " +
shape.getArea());
break; | {
"domain": "codereview.stackexchange",
"id": 25001,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, calculator",
"url": null
} |
and the columns go top-to-bottom ( vertical ). Matrix Multiplication Calculator (Solver) This on-line calculator will help you calculate the __product of two matrices__. Book assignment (Pg 186 (2-18 evens, 20-29 all)) is due via email by 5:00 pm today. Let A = [a ij] m x n be a matrix and k be any scalar. Multiplying Two Matrices. Finally, notice that scalar multiplication and addition are compatible: scalar multiplication and addition can be performed in any order: ‚(u+v) = ‚u+‚v and (‚+„)v = ‚v +„v : The former identity says that scalar multiplication is distributive over vector addition. En álgebra de matrices , un número real es llamado un escalar. C G UAQlmlf trri qg shnt 9sK LrRezs Ne 7rrv De9d c. Example: Find the values of x and y. See “Doing calculations in parallel” on page 204. The 2 2× matrix A is given by 2 3 a b = A, where a and b are scalar constants. We can define scalar multiplication of a matrix, and addition of two matrices, by the obvious analogs of these definitions | {
"domain": "delleparoleguerriere.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9890130583409235,
"lm_q1q2_score": 0.8198313101749608,
"lm_q2_score": 0.8289388125473629,
"openwebmath_perplexity": 668.8630721038613,
"openwebmath_score": 0.7847918272018433,
"tags": null,
"url": "http://delleparoleguerriere.it/jfte/scalar-multiplication-of-matrices-worksheet.html"
} |
beginner, c, homework, playing-cards
I'd argue that we shouldn't have _PLUS_ONE constants, but to simply add 1 where necessary:
#define SUITS 4
#define PIPS 13
#define DECK_SIZE (SUITS * PIPS)
Unfortunately, we then mostly fail to use the constants where appropriate, instead using magic numbers throughout the code, so it's no longer simple to change the kind of deck we're using.
We have correctly examined the return value from calloc(), but remember than realloc() can also return a null pointer if it fails, and we need to be careful about that (and also not leak the memory in that case).
There's some long-winded array access, such as this:
*(second_type + 0) = *(ptr_to_hand + i);
More simply written using []:
second_type[0] = ptr_to_hand[i];
Similarly, &deck[0] can be simply deck.
These three variables don't add anything useful - although we assign to them, we never read their values:
card * ptr_to_deck;
card * ptr_to_shuffled;
card * ptr_to_hand; | {
"domain": "codereview.stackexchange",
"id": 42390,
"lm_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, c, homework, playing-cards",
"url": null
} |
ros, ros-control, hardware-interface, ros-controllers, gazebo-ros-control
Originally posted by ColinG on ROS Answers with karma: 68 on 2015-04-25
Post score: 2
I believe I tracked down the issue. I overlooked that "setCommand" was running at first without the command variables initialized to any value, so I assume they were just some unpredictable junk number. It seems like this explains the inconsistent behavior. In any case, initializing those in the init function appears to have resolved the issue.
If anyone has more insight as to what exactly was happening on the hardware_interface end, I would be glad to hear it. Thanks to anyone that read this.
Originally posted by ColinG with karma: 68 on 2015-04-25
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 21537,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-control, hardware-interface, ros-controllers, gazebo-ros-control",
"url": null
} |
Therefore: . $P(\text{even number}) \;=\;1-\frac{7}{143} \;=\;\frac{136}{143}$
3. Hello,
Soroban's way is the way I would do it but it also easy to see it this way. Being divisible by 2 means it has to be even so out of the 13 cards, there are 6 even cards {2,4,6,8,10,12} . The probability of the last number being even is 6 out of 13 cards. 6/13 !
*another way of looking at it same concept:
I don't know if this is notationally correct but:
Sample Space S = {1,2,3,4,5,6,7,8,9,10,11,12,13}
Even ={2,4,6,8,10,12}
6 of the 13 cards are even; each has the same probability of being chosen. So P(EVEN)=P(2)+P(4)+...+P(12)= (1/13+1/13+1/13+1/13+1/13+1/13)= 6/13.
This way is trivial though and is not very reliable (not to mention long) when you start getting into more complex problems.
4. Again, it can be simplified by calculating the probability they'd all be odd
$P_{Even}=1-P_{Odd}=1-\left(\frac{7}{13}\ \frac{6}{12}\ \frac{5}{11}\ \frac{4}{10}\right)$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676460637103,
"lm_q1q2_score": 0.8579801678565534,
"lm_q2_score": 0.8757869786798663,
"openwebmath_perplexity": 709.8450075966517,
"openwebmath_score": 0.8072686791419983,
"tags": null,
"url": "http://mathhelpforum.com/statistics/131990-probability-playing-cards.html"
} |
deep-learning, reinforcement-learning, dqn
Title: How would researchers determine the best deep learning model if every run of the code yields different results? There are many factors that cause the results of ML models to be different for every run of the same piece of code. One factor could be different initialization of weights in the neural network.
Since results might be stochastic, how would researchers know what their best performing model is? I know that a seed can be set to incorporate more determinism into the training. However, there could be other pseudo-random sequences that produce slightly better results?
I know that a seed can be set to incorporate more determinism into the training. However, there could be other pseudo-random sequences that produce slightly better results? | {
"domain": "ai.stackexchange",
"id": 2012,
"lm_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, reinforcement-learning, dqn",
"url": null
} |
newtonian-gravity, mass, terminology, planets, distance
Title: Why do we not account for the radius of the Earth when calculating the gravitational force between the Earth and an extra-terrestrial body? When say, calculating the gravitational force between the Earth and the Moon, we use Newton's law of universal gravitation to show:
$$F_{(gravity)} = G \ \frac{m_E \ m_M}{r^2}$$
Where:
$m_E$ = mass of the Earth
$m_M$ = mass of the Moon
$r$ = distance between the Earth and the Moon
The above is how my textbooks describe it. However, considering that we treat all the mass of the Earth and the Moon as being concentrated at a point source (their centre of mass), shouldn't we also account for the radii of the Earth and the Moon to find the true distance between the centre of mass of the Earth and the centre of mass of the Moon, so that the equation is instead:
$$F_{(gravity)} = G \ \frac{m_E \ m_M}{(r + r_E + r_M)^2}$$
Where:
$r_E$ = radius of the Earth
$r_M$ = radius of the Moon | {
"domain": "physics.stackexchange",
"id": 48047,
"lm_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-gravity, mass, terminology, planets, distance",
"url": null
} |
javascript
In the end:
function Calendar(year, month) {
this.month = month || 0;
this.year = year || 1970;
this.date = new Date(year, month - 1, 1);
}
Calendar.prototype.getFirstDay = function() {
return Calendar.DAY_NAMES[this.date.getDay()];
};
Calendar.prototype.getMonthLength = function() {
return (new Date(this.year, this.month, 0)).getDate();
};
Calendar.DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
// Usage
var date = new Calendar(2004, 2);
document.write('First day: ' + date.getFirstDay() + ' Length:' + date.getMonthLength()); | {
"domain": "codereview.stackexchange",
"id": 16462,
"lm_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",
"url": null
} |
quantum-field-theory, mass, klein-gordon-equation
Title: Mass of the fields in quantum field theory I understand that if I have an action
$$S=\int \phi(\Box + m^2 )\phi$$
Then the field $\phi$ has mass $m$ since this is the pole of the propagator of $\phi$. Now If I have an action
$$S=\int \phi_1 \Box \phi_2 + m^2 \phi_1^2$$
Then how do I interpret the mass of the field $\phi_1$ or $\phi_2$?
My thinking was that If I find the equations of motion for $\phi_2$ then I have
$$\Box \phi_1 =0$$
Which is a Klein-Gordon equation with no-mass so we interpret the field $\phi_1$ to be massless??
Thank you In order to calculate the mass you need to go to an eigenbasis. Unfortunately, your theory is ill-defined: the kinetic term has a negative eigenvalue:
$$
\begin{pmatrix}0&1/2\\1/2&0\end{pmatrix}\sim \begin{pmatrix}1/2&0\\0&-1/2\end{pmatrix}
$$ | {
"domain": "physics.stackexchange",
"id": 60389,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, mass, klein-gordon-equation",
"url": null
} |
The first four Fermat numbers are prime, and Fermat conjectured that all were prime. Euler, however, found in 1732 that
$\displaystyle F_{5}=2^{2^{5}}+1=641\cdot6700417$
is composite.
In 1880 Landry proved that
$\displaystyle F_{6}=2^{2^{6}}+1=274177\cdot67280421310721.$ | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474888461862,
"lm_q1q2_score": 0.8018452685268236,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 422.660230283421,
"openwebmath_score": 0.8390799164772034,
"tags": null,
"url": "https://luisrguzmanjr.wordpress.com/tag/gunter-ziegler/"
} |
cosmology, cosmic-microwave-background
$$
Using the value $\Omega_{r,0}\approx 9\times 10^{-5}$, this leads to $d_{sls}/r_s \approx 86$. A full calculation with non-constant $c_s$, which I won't derive here, gives $d_{sls}/r_s \approx 96$.
Finally, a first-order approximation to the position of the first acoustic peak is not given by $d_{sls}/r_s$, but by $\pi d_{sls}/r_s$, and we find $\pi 96 \approx 300$. As you see, this is still not very close to the actual value of $\approx 220$. The reason for this is that the low-order acoustic peaks are significantly influenced by the propagation of the density fluctuations and by gravitational redshift effects in the early universe. The full treatment of these is very complex, and for specialists only (which I'm not, by the way).
I don't think I've ever seen a website that looks professional, yet is so wrong on so many levels. My advice would be to find a better course. For instance, Weinberg's cosmology textbook has everything you need, but it's no easy read. | {
"domain": "physics.stackexchange",
"id": 32338,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, cosmic-microwave-background",
"url": null
} |
java, linked-list, interface
@Override
public boolean next() {
if (this.currentNode != this.tail.getPreviousNode()) {
this.currentNode = this.currentNode.getNextNode();
return true;
} else {
return false;
}
}
@Override
public int length() {
return this.size;
}
@Override
public int currentPosition() {
DoublyLinkedListNode<E> tempNode = this.head;
int indexOfCurrentNode;
for (indexOfCurrentNode = 0; this.currentNode != tempNode; indexOfCurrentNode++) {
tempNode = tempNode.getNextNode();
}
return indexOfCurrentNode;
} | {
"domain": "codereview.stackexchange",
"id": 4688,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, linked-list, interface",
"url": null
} |
optics, laser, material-science, non-linear-optics
Title: Material resistency to lasers beam Keeping the average power constant, why some materials are more eager to be damaged by pulsed laser with respect of C.W. lasers, or viceversa?
When i talk about pulsed lasers i think for examples of duty cycles in the order of $10^5$. | {
"domain": "physics.stackexchange",
"id": 165,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, laser, material-science, non-linear-optics",
"url": null
} |
Kind regards Alex
2. Nov 8, 2014
### vela
Staff Emeritus
It's fine to change coordinates to make evaluating the integral easier whenever you want.
I didn't actually do the integral on paper so I might have missed something, but the answer looks right to me.
3. Nov 8, 2014
### AwesomeTrains
Okay, thanks for the reply :)
4. Nov 9, 2014
### rude man
I got 4πR4.
del x A = 4R2 k
dA = R2/2 k
∫2R2R2dθ from 0 to 2π = 4πR4.
Last edited: Nov 9, 2014
5. Nov 9, 2014
### AwesomeTrains
Thanks for doing the calculation but why is $dA=\frac{R^2}{2} d \theta$. My curl vector is the same.
I was using $dxdy=rdrd \theta$
6. Nov 9, 2014
### rude man
I took the differential area as that of a triangle of area 1/2 bh = 1/2 R Rrdθ = 1/2 R2
b = base
h = height
Proof: A = ∫dA = 1/2 R2∫dθ from 0 to 2π = πR2. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357591818725,
"lm_q1q2_score": 0.8115607417263039,
"lm_q2_score": 0.8289388146603364,
"openwebmath_perplexity": 2321.5931945091593,
"openwebmath_score": 0.8549461960792542,
"tags": null,
"url": "https://www.physicsforums.com/threads/line-integral-stokes-theorem.780801/"
} |
c++, windows
delete [] buffer.front();
buffer.pop();
}
}
return 0;
break;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
HBRUSH pedzel;
pedzel = CreateSolidBrush(RGB(249,224,75));
FillRect(hdc, &ps.rcPaint, pedzel);
EndPaint(hwnd, &ps);
}
return 0;
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
Shortcomings that I've noticed so far:
1) The window freezes during work
2) Only a few queries can be done in a row - a memory after each isn't deallocated from heap (I simply don't know how to fix it). A few points: | {
"domain": "codereview.stackexchange",
"id": 2498,
"lm_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++, windows",
"url": null
} |
cc.complexity-theory, np-hardness, complexity-classes
Title: Is Norbert Blum's 2017 proof that $P \ne NP$ correct? Norbert Blum recently posted a 38-page proof that $P \ne NP$. Is it correct?
Also on topic: where else (on the internet) is its correctness being discussed?
Note: the focus of this question text has changed over time. See question comments for details. As noted here before, Tardos' example clearly refutes the proof; it gives a monotone function, which agrees with CLIQUE on T0 and T1, but which lies in P. This would not be possible if the proof were correct, since the proof applies to this case too. However, can we pinpoint the mistake? Here is, from a post on the lipton's blog, what seems to be the place where the proof fails:
The single error is one subtle point in the proof of Theorem 6, namely in Step 1, on page 31 (and also 33, where the dual case is discussed) - a seemingly obvious claim that $C'_g$ contains all the corresponding clauses contained in $CNF'(g)$ etc, seems wrong. | {
"domain": "cstheory.stackexchange",
"id": 4084,
"lm_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, np-hardness, complexity-classes",
"url": null
} |
moveit
Is there anything wrong with the Launch File, Ubuntu, MoveIt!2 or ROS2 configuration, that it tries to load it as string?
Perhaps it could have something to do with it:
I am not allowed now to publish a double with to_string to the RCLCPP Logger. It was absolutely working under Foxy on the same Machine.
RCLCPP_INFO(LOGGER, std::to_string(q.x()));
Originally posted by FlorianSp on ROS Answers with karma: 46 on 2021-12-20
Post score: 0
it begins with "!degrees". I've never seen yaml files containing values that start with such string. Is that supported usage?
It has been supported in the past, for example http://wiki.ros.org/rosparam#YAML_Format
Possibly related: https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/issues/140
The current robot description for UR robots still uses this YAML tag, so I think it's been fixed since this question was posted:
https://github.com/UniversalRobots/Universal_Robots_ROS2_Description/blob/ros2/config/ur5e/joint_limits.yaml#L18 | {
"domain": "robotics.stackexchange",
"id": 37272,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moveit",
"url": null
} |
ros, c++, gps
* /gx5/microstrain_mips_node/odom_child_frame_id: base_link
* /gx5/microstrain_mips_node/odom_frame_id: wgs84_odom_link
* /gx5/microstrain_mips_node/port: /dev/microstrain
* /gx5/microstrain_mips_node/publish_filtered_imu: False
* /gx5/microstrain_mips_node/publish_imu: True
* /gx5/microstrain_mips_node/readback_settings: True
* /gx5/microstrain_mips_node/remove_imu_gravity: True
* /gx5/microstrain_mips_node/save_settings: True
* /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/expected: ['microstrain_mip...
* /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/expected: ['microstrain_mip...
* /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/path: imu
* /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/remove_prefix: microstrain_mips_...
* /imu_diagnostic_aggregator/analyzers/microstrain_mips_node/analyzers/general/imu/timeout: 5.0 | {
"domain": "robotics.stackexchange",
"id": 38751,
"lm_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, c++, gps",
"url": null
} |
(continuous time case), convolution sum (discrete-time case), or perform graphical convolution but may not have a good grasp of what is happening. Mastering convolution integrals and sums comes through practice. Once you understand the algorithm, implementing it in C should be simple. This lecture Plan for the lecture: 1 The unit pulse response 2 The convolution representation of discrete-time LTI systems 3 Convolution of discrete-time signals 4 Causal LTI systems with causal inputs 5 Discrete convolution: an example Maxim Raginsky Lecture VI: Convolution representation of discrete-time systems. This allows us to understand the convolution as a whole. EXAMPLES OF CONVOLUTION COMPUTATION Distributed: September 5, 2005 Introduction These notes briefly review the convolution examples presented in the recitation section of September 3. The encoding equations can now be written as where * denotes discrete convolution and all operations are mod-2. Example 1: Determine the response of a single | {
"domain": "paroleoggi.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587239874877,
"lm_q1q2_score": 0.8231236471102209,
"lm_q2_score": 0.8333246035907932,
"openwebmath_perplexity": 817.352576756788,
"openwebmath_score": 0.8224692344665527,
"tags": null,
"url": "http://paroleoggi.it/discrete-convolution-example.html"
} |
Integrate $\sin^{-1}\frac{2x}{1+x^2}$
Integrate $\sin^{-1}\frac{2x}{1+x^2}$
The solution is given in my reference as: $2x\tan^{-1}x-\log(1+x^2)+C$.
But, is it a complete solution ? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971129092218133,
"lm_q1q2_score": 0.836664824414722,
"lm_q2_score": 0.8615382147637196,
"openwebmath_perplexity": 332.00648414146366,
"openwebmath_score": 0.9909144043922424,
"tags": null,
"url": "https://math.stackexchange.com/questions/2781904/integrate-sin-1-frac2x1x2/2782785"
} |
general-relativity, differential-geometry, coordinate-systems
I then also want to compare the solution to $\delta A^i=\Gamma^i_{ml}\cdot A^m\delta x^l $.
Can somebody help me understand what I need to do here? This case is not a proper one to understand the parallel transport and the role of the Christoffel Symbols. This is due to the fact that the latter are all identically zero.
For the parallel transport of a vector $\:V^\alpha\:$ along a curve with parametric equation
\begin{equation}
\boldsymbol{p}\left(\lambda\right) \boldsymbol{=}\left[p^1 \left(\lambda\right), p^2 \left(\lambda\right)\right]\qquad \left(p^1\boldsymbol{\equiv}p,\:p^2\boldsymbol{\equiv}q\right)
\tag{01}\label{01}
\end{equation}
we use the equation
\begin{equation}
\frac{\mathrm dV^\alpha}{\mathrm d\lambda} \boldsymbol{=} \boldsymbol{-}\Gamma_{\beta\nu}^{\alpha}V^\nu\frac{\mathrm dp^{\,\beta}}{\mathrm d\lambda} \qquad \left(\alpha,\beta,\nu \boldsymbol{=}1,2\right)
\tag{02}\label{02}
\end{equation}
or equivalently
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 77053,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, differential-geometry, coordinate-systems",
"url": null
} |
geology, geophysics, earth-observation, gravity
To make this kind of calculations, you must think of the Earth like an onion: made up of many concentric spheres. Whenever you move a bit deeper into the Earth, you strip off all the layers you've crossed. As you get closer to the center of the Earth, there are fewer and fewer layers, and eventually, there's nothing left at the center! The reason why gravity goes up ever so slightly within the Earth is that you get close to the much denser core material. If the density of the Earth were constant (per the green 'constant density' line), the gravity would just decrease linearly. | {
"domain": "earthscience.stackexchange",
"id": 1978,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geology, geophysics, earth-observation, gravity",
"url": null
} |
# How do I find the modulus of a sum of vectors which is part of a triangle embedded in a quarter a circle?
#### Chemist116
The problem is as follows:
In the figure from below, calculate the modulus of $\vec{x}+\vec{y}$. $P$ is tangential point. Show the answer in terms of $R$.
The alternatives are as follows:
$\begin{array}{ll} 1.&1R\\ 2.&0.41R\\ 3.&0.59R\\ 4.&1.41R\\ 5.&2.12R\\ \end{array}$
The only thing which I was able to spot here was to establish that
$x=\frac{(R+a)\sqrt{2}}{2}+a$
$y=\frac{(R+a)\sqrt{2}}{2}+a$
But this doesn't seem very convincing to me. How exactly can I use the vector decomposition in this set of vectors?
#### romsek
Math Team
what is $a$ ??
$P=R\left(\dfrac{1}{\sqrt{2}},~\dfrac{1}{\sqrt{2}}\right)$
$\vec{x} = P-(0,R)$
$\vec{y} = P-(R,0)$
you should be able to find $\|\vec{x}+\vec{y}\|$ given this.
It is one of the listed choices.
topsquark
#### skipjack | {
"domain": "mymathforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211604938801,
"lm_q1q2_score": 0.8165296706365489,
"lm_q2_score": 0.8376199694135333,
"openwebmath_perplexity": 247.89930557995203,
"openwebmath_score": 0.9096826314926147,
"tags": null,
"url": "https://mymathforum.com/threads/how-do-i-find-the-modulus-of-a-sum-of-vectors-which-is-part-of-a-triangle-embedded-in-a-quarter-a-circle.347805/"
} |
Consider the partial sums of: . $f(n) \;=\;2^2 + 5^2 + 8^2 + 11^2 + \hdots$
We have the sequence: . $4,\: 29,\: 93,\: 214,\: 410,\: 699,\: 1099,\: \hdots$
Take the difference of consecutives terms,
. . take the differences of the differences, and so on . . .
$\begin{array}{ccccccccccccccc}\text{Sequence: } & 4 && 29 && 93 && 214 && 410 && 699 && 1099 \\
\text{1st diff.} & & 25 && 64 && 121 && 196 && 289 && 400 \\
\text{2nd diff} & & & 39 && 57 && 75 && 93 && 111 \\
\text{3rd diff} & & & & 18 && 18 && 18 && 18\end{array}$
We find that the third differences are constant.
. . Hence, the generating function is a cubic.
The general cubic function is: . $f(n) \;=\;an^3 + bn^2 + cn + d$
Use the first four known values to form a system of equations. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777179414275,
"lm_q1q2_score": 0.8347566903178352,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 865.0096084651084,
"openwebmath_score": 0.9654725790023804,
"tags": null,
"url": "http://mathhelpforum.com/calculus/40474-sum-series-numbers.html"
} |
quantum-mechanics, dirac-equation
My goal is to derive the non-relativistic limit (Pauli-Schroedinger Equation) using the above. I consider all the fields/momentum to be nonzero now but small now. I am stuck on one single point:
It is standard to use the ansatz $\psi = (\tilde\phi_1,\tilde\phi_2,\tilde\chi_3,\tilde\chi_4)=(\tilde\psi,\tilde\chi)\equiv e^{-imt}(\phi,\chi)$. In the last statement, we are effectively factoring out the positive energy phase in our solution. From this, why is $\frac \partial {\partial t} \chi\sim 0$, in the limit that $P \ll m$ and $\Phi\ll m$? | {
"domain": "physics.stackexchange",
"id": 97365,
"lm_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, dirac-equation",
"url": null
} |
machine-learning, python, deep-learning, keras, lstm
over this?
model = LSTM(100, return_sequences=True, input_shape(timesteps, n_features))
model = LSTM(50, return_sequences=True)(model)
...
From my empirical results when creating an LSTM-autoencoder I've found them to be quite similar. Simple explanation with images
We know that an activation is required between matrix multiplications to afford a neural network the ability to model non-linear processes.
A classical LSTM cell already contains quite a few non-linearities: three sigmoid functions and one hyperbolic tangent (tanh) function, here shown in a sequential chain of repeating (unrolled) recurrent LSTM cells: | {
"domain": "datascience.stackexchange",
"id": 8378,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, python, deep-learning, keras, lstm",
"url": null
} |
units, neutrons, scattering-cross-section, absorption
Title: What is cross section? I am learning about unit Barn, it is a unit of cross section. I know it means how likely a particle is to interact with the material, it's like opacity or transparency in optics.
What I don't understand is what cross section means. Let's say material X has cross section of 10 barns for neutrons of a certain energy. How far will that neutron go inside the material before hitting something? Meter? Micron? Femtometer? Mile? 69 parsecs? Two and a half Planck lengths? | {
"domain": "physics.stackexchange",
"id": 81899,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "units, neutrons, scattering-cross-section, absorption",
"url": null
} |
# What's a good class of functions for bounding/comparing ratios of complicated logarithms?
I have this goofy series $\sum \limits_{n=2}^\infty \frac{ \log_2 \left[ n \log_2^2 n \right]}{n \log_2^2 n}$ that Wolfram Alpha tells me diverges by the comparison test (and indeed, in the larger problem I'm working on I need to prove that the expression containing it diverges), but I'm struggling to find a good divergent lower bound.
I can't just throw away all the inner logarithms--then I run into the theorem $\lim \limits_{x \rightarrow \infty} \frac{\log_a x}{x^b} \rightarrow 0 \;\forall b > 0$.
So I'm looking at things like $\frac{\log_2 \left[ n^3 \right]}{n \log_2^2 n}$ (larger, unfortunately), $\frac{\log_2 \left[ n^3 \right]}{n^2 \log_2 n}$ (converges), and $\frac{\log_2 \left[ n^2 \right]}{n \log_2^2 n}$ (still too large).
Is there a more general class or form I can use to find a simple divergent lower bound, instead of stabbing in the dark?
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877684006775,
"lm_q1q2_score": 0.834465087557428,
"lm_q2_score": 0.8596637505099168,
"openwebmath_perplexity": 412.8642100240321,
"openwebmath_score": 0.8169580101966858,
"tags": null,
"url": "http://math.stackexchange.com/questions/661615/whats-a-good-class-of-functions-for-bounding-comparing-ratios-of-complicated-lo"
} |
java, rags-to-riches, interval
The output of this Collector is an unmodifiable List.
IntervalUnion main utility class
public final class IntervalUnion {
private IntervalUnion() {
// empty
}
public static List<Interval> union(Collection<Interval> intervals) {
return intervals.stream().sorted().collect(new IntervalCollector());
}
}
Hmms... I guess there's nothing much to say here, except the input is now just a Collection instead of a List.
IntervalUnionTest test class
public class IntervalUnionTest { | {
"domain": "codereview.stackexchange",
"id": 12740,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, rags-to-riches, interval",
"url": null
} |
## References
[1] Xia, M., P. Gahinet, N. Abroug, C. Buhr, and E. Laroche. “Sector Bounds in Stability Analysis and Control Design.” International Journal of Robust and Nonlinear Control 30, no. 18 (December 2020): 7857–82. https://doi.org/10.1002/rnc.5236. | {
"domain": "mathworks.cn",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9843363508288305,
"lm_q1q2_score": 0.8202716891680754,
"lm_q2_score": 0.8333245932423308,
"openwebmath_perplexity": 553.5614415692959,
"openwebmath_score": 0.9186969995498657,
"tags": null,
"url": "https://ww2.mathworks.cn/help/control/ug/sector-bounds-and-sector-indices.html"
} |
gazebo, kinect, rviz, ros-indigo
Title: Gazebo depth sensor not working properly in RViz?
So im busy setting up a proper simulation environment for my robot. During the process i added depth sensors in the URDF file of the robot and images come out great. Though pointclouds show me planes instead of points. So there is a problem somewhere.
To verify it was my problem only i opened up the turtlebot in gazebo and rviz and it shows me the same thing as for the robot i'm working on. So it is a problem for me in general, but I've no idea what it can be. Maybe i've failed to install an important part?
Anyone has an idea? Thanks in advance
For info, im on 14.04 and running Indigo
Originally posted by jonathan123 on ROS Answers with karma: 16 on 2016-07-19
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 25284,
"lm_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, kinect, rviz, ros-indigo",
"url": null
} |
biochemistry, cell-membrane, lipids
Title: Phospholipid movement in cell membranes What causes phospholipids to flow so quickly in cell membranes? In Biology by Cambell et al. they state that a phospholipids can travel up to 2 micrometers per second. Is that a random movement or has anyone found that phospholipids have a current? There must be charge considerations in the movement of molecules in the lipid membrane. There is also a consideration that some species of phospholipids will migrate to portions of the membrane with sharper or smoother curvature.
Waves of electrical potential can propagate along a lipid bilayer as well, which is very important to nerve axons and extended structures like that.
In general though the membrane is held together by vanDerWaals forces like other non-polar solvents. As such, the movements of lipids and proteins and other amphipathic molecules in the membrane are still largely Brownian (random) in the 2D surface of the membrane. | {
"domain": "biology.stackexchange",
"id": 2996,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, cell-membrane, lipids",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.