text
stringlengths
1
1.11k
source
dict
I am just posting my comment as an answer. Since $f:X\to S$ is smooth of finite type, in particular it is of finite presentation. By limit theorems, after replacing $S$ by the open in an open affine covering, there exists a Cartesian diagram, $$\begin{array}{ccc} X & \xrightarrow{f} & S \\ u~\downarrow & & \downarrow~v \\ X_0 & \xrightarrow{f_0} & S_0\end{array},$$ such that $f_0$ is smooth and finite type, and such that $S_0$ is integral and Noetherian (even a finite type affine scheme over $\text{Spec}\ \mathbb{Z}$). Up to replacing $S_0$ by a finite type $S_0$-scheme through which $v$ factors, also there exists $\mathcal{E}_0$ on $X_0$ whose pullback by $u$ equals $\mathcal{E}$. Finally, up to replacing $S_0$ by the closure of the image of $v$, assume that $S_0$ is integral and that $v$ is dominant. For every $s$ in $S$ with image point $s_0$ in $S$, the fiber $X_s=\text{Spec}\ \kappa(s)\times_S X$ is the base change of the fiber $X_{s_0} = \text{Spec}\ \kappa(s_0)\times_{S_0} X_0$
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462204837636, "lm_q1q2_score": 0.8211246369451495, "lm_q2_score": 0.8311430520409023, "openwebmath_perplexity": 91.00029905104105, "openwebmath_score": 0.9519054293632507, "tags": null, "url": "https://mathoverflow.net/questions/273142/is-relative-torsion-freeness-an-open-condition" }
waves, double-slit-experiment, diffraction, wavelength Title: Why do we demand that $\lambda \ll \text{size of slit}$ I'd appreciate it if anyone could explain to me why do we demand that the wavelength will be much smaller than the distances between the slits in order to see wave diffraction when performing Young's experiment. From searching online I've understood that if $$ \lambda \gg d $$ where $d$ is the distance between two slits, then the maxima which occur every $\lambda/d$ will go out of the screen and we won't be able to see them. Is this correct? Without resorting to mathematics, the following picture should speak a thousand words: As the slit size increases with respect to the wavelength, the effect of wave diffraction becomes smaller and smaller. So to observe diffraction the wavelength should be smaller than slit size. Image credit.
{ "domain": "physics.stackexchange", "id": 65654, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, double-slit-experiment, diffraction, wavelength", "url": null }
As far as your last question, the sum of an odd function and even function is neither even nor odd. ## Proof: Sum of Odd Functions is Odd: Given two odd functions $f$ and $g$. Since they are odd functions $f(-x) = -f(x)$, and $g(-x) = -g(x)$. Hence: \begin{align*} f(-x) + g(-x) &= -f(x) - g(x) \\ &= -(f+g)(x) \\ \implies (f+g) & \text{ is odd if $f$ and $g$ are odd.} \end{align*} ## Proof: Sum of Even Functions is Even: Given two even functions $f$ and $g$, then $f(-x) = f(x)$, and $g(-x) = g(x)$. Hence: \begin{align*} f(-x) + g(-x) &= f(x) + g(x) \\ \implies (f+g) &\text{ is even if $f$ and $g$ are even.} \end{align*} ## Proof: Sum of an odd function and even function is neither odd or even. If $f$ is odd, and $g$ is even \begin{align*} f(-x) + g(-x) &= -f(x) + g(x) \\ &= -(f-g)(x) \\ \implies (f+g)&\text{ is neither odd or even if $f$ is even, $g$ is odd.} \end{align*} - Thanks, that's a cool way to prove it. –  user48226 Nov 17 '12 at 2:05
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9898303413461358, "lm_q1q2_score": 0.8311941578759413, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 173.98454838469442, "openwebmath_score": 0.9987871050834656, "tags": null, "url": "http://math.stackexchange.com/questions/238980/exponents-in-odd-and-even-functions/238987" }
• @ kelalaka I thought that I should be add 1+2+3..+n then o(n^2) but I misthinking. its size just n, it should be o(n). Thank you so much – jhdm Mar 22 at 21:54
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806538038114, "lm_q1q2_score": 0.8254779435707595, "lm_q2_score": 0.8418256472515683, "openwebmath_perplexity": 368.4858724966108, "openwebmath_score": 0.6023370623588562, "tags": null, "url": "https://crypto.stackexchange.com/questions/78343/merkle-tree-space-complexity" }
quantum-mechanics, quantum-information, wigner-transform, quasiprobability-distributions, quantum-foundations For example, in the paper "Quantum catalysis in cavity QED", the authors discuss the possibility of generating non-classical states of light using a specific mechanism. They employ two figures of merit to characterise these states: the negativity of the Wigner function and second-order coherence. While neither figures of merit is individually necessary and sufficient to define non-classicality, their combined use is particularly effective for the task at hand. Typically, the Wigner logarithmic negativity (WLN) is used instead of the standard negativity. This is defined as $$\mathsf{W} \left ( \rho \right) := \log \left( \int \! \mathrm{d} x \,\mathrm{d} p \, \left| W_\rho \left(x,p \right) \right| \right),$$ where $W_\rho$ is the Wigner function of the state $\rho$. This quantity is related to the negativity via $$\mathsf{W} = \log(N+1).$$
{ "domain": "physics.stackexchange", "id": 98092, "lm_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, wigner-transform, quasiprobability-distributions, quantum-foundations", "url": null }
python, xgboost Title: does xgb multi-class require one-hot encoding? I was trying an xgboost from python with a multiclass single-label problem and assumed the label can be an integer indicating my class (as opposed to eg one-hot) . params = {'eta': 0.1, # 'objective': 'binary:logistic', 'objective': 'multi:softmax', 'scale_pos_weight':9, 'eval_metric': 'auc', 'nthread':25, 'num_class':6} dtrain = xgb.DMatrix(df_train_x,label= df_train_y) dvalid = xgb.DMatrix(df_val_x,label= df_val_y) watchlist = [(dtrain, 'train'), (dvalid, 'valid')] model = xgb.train(params, dtrain, 500,watchlist, maximize=True, verbose_eval=50,early_stopping_rounds=20) However I hit an error (1353150 vs. 225525) label size predict size not match
{ "domain": "datascience.stackexchange", "id": 4062, "lm_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, xgboost", "url": null }
homework-and-exercises, newtonian-mechanics, energy, orbital-motion, rocket-science Am I doing something wrong? It seems impossible to release that much energy with chemical thrusters. I know ISS was sent up by a lot of rockets, it's still too crazy for me. edit: Calculations were wrong; it's not 3577 tons of TNT, but instead it should be 3.577 tons of TNT. Your calculation of $E_{tot}$ is correct. However, acc. Wikipedia:
{ "domain": "physics.stackexchange", "id": 65487, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, energy, orbital-motion, rocket-science", "url": null }
statistical-mechanics Title: Statistical physics and momentum conservation In statistical physics one usually looks at energy as a conserved quantity and e.g. in the canonical ensemble assumes a constant average energy of the ensemble. Now why don't we usually do this for other conserved quantities like momentum? Why not do a 'canonical' ensemble with momentum exchange? Is it more complicated or simply never useful? Indeed they are conserved quantities so there are canonical ensembles with linear momentum exchange and angular momentum exchange with a reservoir. In fact Gibbs used angular momentum as an example to demonstrate the canonical ensemble's use beyond simply energy (Gibbs 1902, see around eqn 98). Considering linear and angular momentum together, the canonical probability expression for state $i$ is $$ p_i = \exp( [\Omega - E_i + \vec v \cdot \vec P_i + \vec \omega \cdot \vec L_i]/kT) $$
{ "domain": "physics.stackexchange", "id": 17788, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics", "url": null }
ros, ros-jade, ros-indigo If I try to execute the command sudo apt-get install libsdformat1, it attempts to uninstall all of ros-jade which I do not want to happen. Is there a way of installing indigo without uninstalling jade? Thanks Originally posted by atoz on ROS Answers with karma: 58 on 2016-03-03 Post score: 0 Original comments Comment by BennyRe on 2016-03-04: Usually this should just simply work. Have you tried executing sudo apt-get dist-upgrade or some other apt-get dependency conflict trouble shooting steps? I was in a hurry so I ended up uninstalling jade and installing indigo. I assume it is something to do with the 2 different gazebo versions for each distro because even after I uninstalled jade, it didn't let me install indigo until I uninstalled some independent jade-gazebo packages. Originally posted by atoz with karma: 58 on 2016-03-05 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 23984, "lm_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-jade, ros-indigo", "url": null }
java private Map<String, Field> getFields(Class<?> clazz) { // Could be cached for each class if performance is important. Map<String, Field> fields = new HashMap<>(); for (Field field : clazz.getDeclaredFields()) { // Maybe add some checks, like if the field is static or not. field.setAccessible(true); fields.put(field.getName(), field); } return fields; } Untested and without exception handling, but I guess you see where this is going. Getters/Setters Like above, you can access the Getters/Setters reflectively. It is close to the same solution as above, with the difference that you don't need the set the fields accessible. However, you must be slightly more selective with what methods you expose in that case, and you need to convert the names.
{ "domain": "codereview.stackexchange", "id": 39376, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java", "url": null }
quantum-field-theory, particle-physics, standard-model, neutrinos, weak-interaction Enter sterile EW singlets (indexless) $\nu_R$ and the seesaw. Now the superheavy N will be mostly $\nu_R$ with a tiny contamination $O(m_D/M)$ component of (indexed!) $\nu_L^{~c}$, which, ipso facto, as you are surmising, does couple to the Ws. Nevertheless, this is a minuscule component of order 100GeV/$10^{15}$GeV ~ $10^{-13}$, so, negligible. The major handle on this mixing, instead is through lepton number violation involving the other, the light eigenvector of the seesaw mass matrix, not N; it will enter into the neutrinoless double β decay.
{ "domain": "physics.stackexchange", "id": 49518, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, particle-physics, standard-model, neutrinos, weak-interaction", "url": null }
c++, computational-geometry template <typename T> std::vector<Point<T>> ConvexHull2d<T>::GetHullPoints() const { return m_hullPoints; } } Here is a program to test the class. It generates random integer and double points then calculates the convex hull. main.cpp #include "ConvexHull2d.h" #include <iostream> #include <vector> #include <random> #include <ctime> double randomNumber(double mn, double mx); int randomNumber(int mn, int mx); using namespace ConvexHull; int main() { size_t const count = 100; int const minInt = -10; int const maxInt = 10; double const minDouble = -10.0; double const maxDouble = 10.0; std::srand(static_cast<unsigned int>(std::time(0))); PointIntArray intPoints; for (size_t i = 0; i < count; ++i) { int dx = randomNumber(minInt, maxInt); int dy = randomNumber(minInt, maxInt); intPoints.push_back(PointInt(dx, dy)); } ConvexHull2d<int> intHull(intPoints); PointIntArray intHullPoints = intHull.GetHullPoints();
{ "domain": "codereview.stackexchange", "id": 17369, "lm_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++, computational-geometry", "url": null }
thermodynamics, newtonian-gravity, ideal-gas, estimation, gas Title: How long does it take for gas to settle down under earth's gravity? I was discussing about ideal gas with my colleague the other day, and these questions come up in our conversation. Lets say we have 1 mole ideal gas in a perfectly insulating cube box of size $1m^3$, and just put it on the floor at room temperature. How will gravity affect the distribution of the gas? Will it ever settle down?
{ "domain": "physics.stackexchange", "id": 96031, "lm_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, newtonian-gravity, ideal-gas, estimation, gas", "url": null }
Now substitute  a2  back in for  u . $$\begin{array}{ccc} a^2=2&\qquad\text{or}\qquad&a^2=\frac34\\~\\ a=\pm\sqrt2&\qquad\text{or}\qquad&a=\pm\sqrt{\frac34}\\~\\ &&a=\pm\frac{\sqrt3}{2}\\~\\ a=\sqrt2\qquad\text{or}\qquad a=-\sqrt2&\text{or}&a=\frac{\sqrt3}{2}\qquad\text{or}\qquad a=-\frac{\sqrt3}{2} \end{array}$$ The greatest value of  a  that satisfies the equation is  $$\sqrt2$$  . Sep 9, 2018 edited by hectictar  Sep 9, 2018 edited by hectictar  Sep 9, 2018 #3 0 a=sqrt(2) 5 sqrt(4 a^2 + 1) = 4 a^2 + 7    sub sqrt(2) for a: 5 sqrt(4sqrt(2)^2 +1) = 4sqrt(2)^2 + 7 5sqrt(4*2  + 1) = 4 * 2 + 7 5 * 3  = 8 + 7 15  =  15 So, the sqrt(2) is the largest "a" that satisfies the equation. Sep 9, 2018
{ "domain": "0calc.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462211935646, "lm_q1q2_score": 0.8077196142998182, "lm_q2_score": 0.8175744761936437, "openwebmath_perplexity": 3171.6938093199706, "openwebmath_score": 0.6209320425987244, "tags": null, "url": "https://web2.0calc.com/questions/please-help_55879" }
eclipse Originally posted by alfa_80 on ROS Answers with karma: 1053 on 2011-08-04 Post score: 0 It seems that you're trying to import directories as though they were projects. You'll need to generate the .project files using the directions in step 2 Make sure you have your ros environment setup ( with the relevant ". setup" ) and issue a make eclipse-project in the package directory (i.e. it won't work in a stack directory). If you get an error it's likely that either you're trying in the wrong directory you don't have your environment set up and so cmake can't find the relevant rules supplied by ros to make the eclipse projects. Originally posted by Patrick Bouffard with karma: 2264 on 2011-08-04 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 6345, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "eclipse", "url": null }
ros-melodic, rosbag You can find the answer you're looking for in the output of rosbag info as recommended by @mgruhler : /device_0/sensor_1/Color_0/image/data 20882 msgs : sensor_msgs/Image
{ "domain": "robotics.stackexchange", "id": 33744, "lm_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-melodic, rosbag", "url": null }
computer-architecture The instruction format exposed to software is also typically denser than the final control signals used to control execution. Typically not all possible combinations of control signals will be generated by valid instructions. For example, a very simple twos-complement adder supporting addition, subtraction, and addition with carry might have two control signals — one controlling whether one operand is inverted and the carry-in value is set to one, the other controlling whether the carry-in value is used. Both signals would be asserted for subtraction, neither for regular addition, and the second signal only for addition with carry. Asserting only the first signal would produce A plus one minus B, which is not a commonly useful operation.
{ "domain": "cs.stackexchange", "id": 13822, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computer-architecture", "url": null }
astronomy, orbital-motion So instead, what I'd try is to take the first terms from the above, i.e. put $E_0 = M$ or $M/(1-\epsilon)$, and use Newton's method to iterate. That is, iterate with: $E_{n+1} = E_n - \frac{M - E +\epsilon \sin E}{-1+\epsilon\cos(E)}$. To test the method, run a bunch of random data through it, and make sure you test the fence posts (boundary conditions).
{ "domain": "physics.stackexchange", "id": 651, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, orbital-motion", "url": null }
electromagnetism, electromagnetic-induction, induction It turns out that the charge on the anode and cathode in the Crooke's tube can be reversed, and the glow of electrons in it will still be visible. Therefore a Crooke's tube will work using symmetric AC, provided again that during each half cycle, the two conditions mentioned above are met.
{ "domain": "physics.stackexchange", "id": 46418, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, electromagnetic-induction, induction", "url": null }
java, android if (photoFile != null) { takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile)); startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO); } } private File createImageFile() throws IOException { String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); String imageFileName = "JPEG_" + timeStamp + "_"; File storageDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_PICTURES); if (isExternalStorageWritable() && !storageDir.isDirectory()) { storageDir.mkdirs(); } File image = File.createTempFile(imageFileName, ".jpg", storageDir); mCurrentPhotoPath = image.getAbsolutePath(); return image; } public boolean isExternalStorageWritable() { String state = Environment.getExternalStorageState(); return Environment.MEDIA_MOUNTED.equals(state); }
{ "domain": "codereview.stackexchange", "id": 13526, "lm_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, android", "url": null }
python, console Title: Autogenerate a CLI for Python Functions Motivation When writing command-line applications in Python I frequently find myself in situations where I want to expose the functionality of some specific set of functions - independently of the rest of the application. Often this is for testing or for experimentation, but occasionally also for general use, e.g. sometimes there are auxiliary/helper/utility functions which are useful on their own. Instead of manually writing a separate CLI for each such function, I thought it would be nice to have a way to automatically generate a CLI from a given collection of functions in a Python module. Features There were a few basic features that I wanted to make sure I included:
{ "domain": "codereview.stackexchange", "id": 29967, "lm_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, console", "url": null }
c#, performance, strings, comparative-review Full version: source code So after a couple hours of tinkering around I've come to the conclusion that 'people' are wrong and string.Split has been optimized into oblivion by microsoft. Here is a gist with my code for parsing the data from Spans CharSpanExtensions.cs The idea is that it uses ReadOnlySpan to represent a string and enumerates over it exactly once. The data is only ever copied to create new (small) strings in ConsumeDateTime and ConsumeString, and that is done with a direct unsafe pointer into the data of the span. Adding a test for the span implementation to your code looked like this static List<TickMessage> GetTickMessages(ReadOnlySpan<char> data) { var ticks = new List<TickMessage>(); while (data.Length > 0) { ticks.Add(new TickMessage( data.ConsumeDateTime(out data), data.ConsumeFloat(out data), data.ConsumeInt(out data), data.ConsumeInt(out data), data.ConsumeFloat(out data),
{ "domain": "codereview.stackexchange", "id": 30682, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, strings, comparative-review", "url": null }
cpu This design surprises me a bit since it seems very slow to have to pass through ALU to load the registers. I am interested in if there is any smart rationale behind the design, and if there are real-world examples of CPUs with similar design? Was the design for example common in the early days of computers? Both questions sort of tell me the same thing: is the design any good, or is it just something more like "educational fiction".
{ "domain": "cs.stackexchange", "id": 20248, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cpu", "url": null }
planet, kepler TL;DR There are many more planets than the ones we can detect by the transit method, between 10 and 100 times more depending on the size and orbital period of the planet you are searching for.
{ "domain": "astronomy.stackexchange", "id": 3838, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "planet, kepler", "url": null }
vba, excel Title: Standard Methods in VBA Since I learnt about refactoring, I've been busy creating my own Module of Standard Methods. I feel it's about time they got a review of their own. Open to all aspects of advice but particularly interested in: Method Naming: Are they completely unambiguous about what the method does/returns? Use of Optional / Variable parameters: Always a tricky balance to define the scope of a method and its potential uses. Just after general opinions. Redundancy: Have I ended up re-inventing the wheel anywhere? Good use of Sub/Function: Is there a sub that should be a function, or vice versa? Further Refactoring: Any general improvements to the methods described / other ways to achieve the same outcomes.
{ "domain": "codereview.stackexchange", "id": 15442, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, excel", "url": null }
• @Avraham Semantically speaking, given the question, I prefer the answer $\frac{3}{4}$, because it's not mentioned whether he's allowed to give a non-binary answer. Dec 30 '14 at 9:08 • @ShreyasVinod, heropup's answer above is clearer, more complete, and encapsulates the root cause of your confusion. I just explained what had to have been intended by the question writer. You should accept his answer! Dec 30 '14 at 15:26
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9744347801373334, "lm_q1q2_score": 0.8358390765663432, "lm_q2_score": 0.8577681068080748, "openwebmath_perplexity": 338.2436346059659, "openwebmath_score": 0.9389745593070984, "tags": null, "url": "https://math.stackexchange.com/questions/1084785/a-man-who-lies-a-fourth-of-the-time-throws-a-die-and-says-it-is-a-six-what-is-t" }
gravity, hypothetical Title: Could two planetesimals orbit a dense object and share an atmosphere? Could two objects be caught into an orbit around some kind of dense object, perhaps a rogue planet. Could they share an atmosphere. So how much do you know about drag? Orbits in atmosphere are short lived - as reference see any low earth orbit satellite. They need regular boosts or else they fall in. So your objects could orbit... Briefly. But not in the way you have drawn in the diagram, and not for any length of time. Basically it's a no, in any real terms.
{ "domain": "astronomy.stackexchange", "id": 2968, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity, hypothetical", "url": null }
Published Wednesday, March 17, 2010 by César Souza in C#, Mathematics, Statistics In recent years, Kernel methods have received major attention, particularly due to the increased popularity of the Support Vector Machines. This task view on numerical mathematics lists R packages and functions that are useful for solving numerical problems in linear algebra and analysis. For certain special arguments, SphericalBesselJ automatically evaluates to exact values. Expansions for any z in exponential form. We discuss also their relation to Bessel functions and to the spher-ical Bessel functions of Morse and Schelkunoff, as well as their applications to spherical waves. Mellin Transform, Eric W. This problem was revisited in greater detail by J. Bessel polynomials, explicit formulas, modified functions, spherical Bessel functions Notes: Use the same method as for § 10. Watson which employed Bessel functions. From MathWorld --A Wolfram Web. The linear combinations of these two are usually called
{ "domain": "ajte.pw", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9873750492324249, "lm_q1q2_score": 0.8206499016036223, "lm_q2_score": 0.8311430415844384, "openwebmath_perplexity": 843.0734275604377, "openwebmath_score": 0.834372341632843, "tags": null, "url": "http://scdw.ajte.pw/mathworld-spherical-bessel-function.html" }
java, combinatorics ArrayList<Integer> mOneDrawPartialSums = new ArrayList<Integer>(); BallCombination mBallCombination = new BallsSum().new BallCombination(); int MAX_POSSIBLE_COMB = 1; for (int i = 0; i < BALLS_DRAWN; i++) { MAX_POSSIBLE_COMB *= (TOTAL_BALLS - i); } for (int i = 0; i < MAX_POSSIBLE_COMB; i++) { ++mNumberOfWays; mOneDrawPartialSums.add(mBallCombination.getSum()); mTotalSum += mBallCombination.getSum(); mBallCombination.getNewCombination(); } float mExpectationValue = mTotalSum / mNumberOfWays; System.out.println("Expectation value is " + mExpectationValue); int mStandardDeviationSum = 0; for (int i = 0; i < mOneDrawPartialSums.size(); i++) { mStandardDeviationSum += Math.pow( (mOneDrawPartialSums.get(i) - mExpectationValue), 2); }
{ "domain": "codereview.stackexchange", "id": 12958, "lm_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, combinatorics", "url": null }
newtonian-mechanics, rotational-dynamics, friction Thanks. The no slipping condition between the wheel and the ground is $v=r\omega$ where $v$ is the speed of the centre of mass of the wheel of radius $r$ and angular speed $\omega$. If the wheel is on level ground and the no slipping condition is satisfied then the frictional force between the wheel and the ground is zero. You can liken the motion of the wheel on the ground to a spinning wheel in outer space where the centre of mass of the wheel will continue moving in a straight line and the wheel will spin with a constant angular speed as there are no forces or torques acting on it. On level ground suppose that $v> r\omega$ then the forces on the wheel will be as shown in the diagram on the left. The dynamic frictional force $F$ acting left does two things to try to get to the no slip condition. It reduces the magnitude of the translational speed and applies a torque $Fr$ on the wheel about the centre of mass $C$ which tries to increase the angular speed $\omega$.
{ "domain": "physics.stackexchange", "id": 55205, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, rotational-dynamics, friction", "url": null }
rqt, osx So there seems to be some other problem related to button positioning in rqt_bag. I have opened an issue: https://github.com/ros-visualization/rqt_common_plugins/issues/68 Originally posted by William with karma: 17335 on 2013-04-04 This answer was ACCEPTED on the original site Post score: 4 Original comments Comment by Markus Achtelik on 2013-04-04: This is awesome, thanks a lot !! Will try it tomorrow morning, it's fairly late here already Comment by Markus Achtelik on 2013-04-05: The steps above helped, thanks a lot again! For rqt_bag, I get the same behaviour as shown above by William, which is already a lot nicer than before.
{ "domain": "robotics.stackexchange", "id": 13685, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rqt, osx", "url": null }
javascript, object-oriented, google-maps // center map responsively window.addEventListener('resize', function () { var center = gMap.getCenter(); gMap.triggerEvent('resize'); gMap.setCenter(center); }); addressInput.onkeydown = function (e) { if (e.keyCode === 13) { addressInput.blur(); processAddressInput(); } }; document.getElementById(SEARCH_BUTTON_ID).onclick = function () { processAddressInput(); }; function processAddressInput() { Gmap.geocode({ 'address': addressInput.value }, function (results, status) { if (status !== Gmap.geocodeStatus.OK) { if (status === Gmap.geocodeStatus.ZERO_RESULTS) { return; } throw new Error('Geocode was unsuccessful: ' + status); } if (results[0].geometry.location.equals(gMap.currentLocation)) { addressInput.value = results[0].formatted_address;
{ "domain": "codereview.stackexchange", "id": 12549, "lm_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, google-maps", "url": null }
inverse-kinematics, orientation $${R}(\vartheta, {r})={R}_{d} {R}_{e}^{T}({q})$$ This gives the $3 \times 1$ vector which is the orientation error about $X, Y, Z$ axis. For more information one can refer book I mention above. using equation $$\begin{array}{l}{\vartheta=\cos ^{-1}\left(\frac{r_{11}+r_{22}+r_{33}-1}{2}\right)} \\ {r=\frac{1}{2 \sin \vartheta}\left[\begin{array}{l}{r_{32}-r_{23}} \\ {r_{13}-r_{31}} \\ {r_{21}-r_{12}}\end{array}\right]}\end{array}$$
{ "domain": "robotics.stackexchange", "id": 1619, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inverse-kinematics, orientation", "url": null }
javascript, unit-testing, node.js, express.js return sut .ensureAuthenticated(req) .catch(function(outcome) { expect(outcome.status).to.equal(401); }); }); test("should add decoded data to req object when token is valid", function() { const decoded = { username: "dummy username" }; const jsonwebtoken = { }; jsonwebtoken.verify = function(token, secret, cb) { cb(undefined, decoded); }; const req = httpMocks.createRequest({ query: { token: "dummy token" } }); const sut = proxyquire("../../middleware", { jsonwebtoken: jsonwebtoken }); return sut .ensureAuthenticated(req) .then(function() { expect(req.user).to.equal(decoded); }); }); });
{ "domain": "codereview.stackexchange", "id": 17201, "lm_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, unit-testing, node.js, express.js", "url": null }
ros, ros-hydro, rqt, node Original comments Comment by Nap on 2014-05-04: When I run that command, I get "grep: hydro-rqt-top: No such file or directory". Perhaps that has something to do with the fact that I've installed from source? My RQT about shows: rqt rqt is a framework for graphical user interfaces. It is extensible with plugins which can be written in either Python or C++. Please see the Wiki for more information on rqt and available plugins. Utilized libraries:: Python 2.7.5+, rospkg 1.0.28, PyQt 4.10.3 (QtCore, QtDeclarative, QtGui, QtNetwork, QtOpenGL, QtScript, QtSvg, QtWebKit, QtXml, QtXmlPatterns, Qwt), Qt 4.8.4, SIP C++ bindings available. Comment by Nap on 2014-05-04:
{ "domain": "robotics.stackexchange", "id": 17762, "lm_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-hydro, rqt, node", "url": null }
python, algorithm, python-3.x, math-expression-eval def tokenize(expression): """ Yield tokens in the order that they are encountered in the expression. """ # https://docs.python.org/3/library/re.html#writing-a-tokenizer token_spec = [ ('PAREN', r'[()]'), ('OPERATOR', r'[+*/-]'), ('OPERAND', r'\d+'), ('IGNORE', r'\s+'), ('JUNK', r'\S+?\b'), ] tokenizer = re.compile('|'.join( '(?P<{kind}>{pattern})'.format(kind=kind, pattern=pattern) for kind, pattern in token_spec )) for match in tokenizer.finditer(expression): kind, value = match.lastgroup, match.group(match.lastgroup) if kind == 'JUNK': raise ValueError('Unrecognized token: {0}'.format(value)) elif kind != 'IGNORE': yield Token(kind, value)
{ "domain": "codereview.stackexchange", "id": 31546, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, algorithm, python-3.x, math-expression-eval", "url": null }
optics, electromagnetic-radiation, vision, perception Title: Why do I see discrete images when moving an object in front of a screen? I observed this while doing my homework. I have a habit of shaking my pen between my fingers vigorously while thinking something. My PC's screen is right in front of me (on my study table itself). There was a white background on the screen. Whenever I shook the pen with the screen behind it, I could see 8-10 blurred distinct images in the region instead of a continuous one which I generally see when the background is dark. Could anyone explain the reason for this? The picture you observe when you are shaking a pen in front of a computer or TV screen is a result of the averaging action of the eye.
{ "domain": "physics.stackexchange", "id": 50905, "lm_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, electromagnetic-radiation, vision, perception", "url": null }
angular-momentum, rotational-dynamics, rigid-body-dynamics $$I_{cm} = 2m ({3l\over{4}})^2$$ From which the angular velocity may be determined by the conservation of angular momentum: $$w = {L \over{ I_{cm} }} = {m v l \over{2m({3l\over{4}})^2}} = {8v \over{9l}}$$ Hence, the final kinetic energy $$KE = 0.5 * 2m ({v\over{2}})^2 + 0.5 (2m({3l\over{4}})^2) * ({8v\over{9l}})^2$$ However, this is incorrect since the final kinetic energy is greater than the initial kinetic energy. The final answer should be $v = \sqrt{8gL}$, according to the book, however my attempts have been in vain. How should I go about this problem? Suppose putty is thrown with velocity v . Then use AMC abouthinge to find angular velocity of rod just after impact . Now do the side calculation of finding the minimum velocity to be given to lowermost part of rod to complete full circle by using work energy theorem .find velocity of bottommost point with help of angular velocity found earlier and equate.
{ "domain": "physics.stackexchange", "id": 46109, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "angular-momentum, rotational-dynamics, rigid-body-dynamics", "url": null }
thermodynamics, heat, entropy, kinetic-theory-of-gases Title: What is heat bath here? At the beginning $\pu{1 mol}$ of air is compressed to $\pu{3 atm}$ at a of temperature $\pu{523 K}$. After a random process, the pressure of the air equates to $\pu{1 bar}$ at a temperature of $\pu{353 K}$. A amount of heat is transferred to a bath of $\pu{303 K}$. Where does the heat come from? From the gas? Or the bath is the gas? In voluntary / spontaneous processes, heat is passed from the reservoir of higher energy to the one of lower energy. Thus, heat from the reservoir of higher temperature transfers to the reservoir of lower temperature, until both share the same temperature. The reverse is possible only if you invest work. As an analogy, compare the situation with a pumped-stage hydroelectric plant, where energy is stored in the potential energy of the water in the upper basin.
{ "domain": "chemistry.stackexchange", "id": 16358, "lm_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, heat, entropy, kinetic-theory-of-gases", "url": null }
2) There are a total of 35 ways to make team of 3 members out of team of x members. xC3=35... $$\frac{x(x-1)(x-2)}{6}=35......x(x-2)(x-1)=5*6*7$$ x=7 Sufficient D _________________ ##### General Discussion Manager Joined: 05 Feb 2016 Posts: 169 Location: India Concentration: General Management, Marketing WE: Information Technology (Computer Software) Re: If 3 members are to be selected from a team of x members then what is  [#permalink] ### Show Tags 01 Apr 2018, 04:51 GMATinsight wrote: If 3 members are to be selected from a group of x members then what is the value of x? 1) If team of 3 members is selected from the group of x members then 30 different combinations of 3 members can be formed with 2 specific members never being together on the team 2) There are a total of 35 ways to make team of 3 members out of team of x members. Source: http://www.GMATinsight.com we have to find x.
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9334308036221031, "lm_q1q2_score": 0.8206226751760153, "lm_q2_score": 0.8791467690927438, "openwebmath_perplexity": 2553.2128401709892, "openwebmath_score": 0.2759699821472168, "tags": null, "url": "https://gmatclub.com/forum/if-3-members-are-to-be-selected-from-a-team-of-x-members-then-what-is-262420.html" }
linear-bounded-automata Title: Recognizing loops in computation on LBA In the case of LBAs (Linear Bounded Automaton), in writing a decider for the language $\qquad A = \{ \langle M,w\rangle \mid M\ \mathrm{LBA}, w \in \mathcal{L}(M) \}$ we reject the input after a specific number (number of possible different configurations) of computation steps. We say that the machine must be looping after this many steps. Why don't we just check in every step to see if there is a loop (repetition of the same configuration) and if it is the case then just reject the input? If I understand the question correctly, you are asking why are we bounding the number of configurations, rather than checking for a repeating configuration? Well, clearly these are equivalent in the sense that in both ways you will detect a repeating configuration.
{ "domain": "cs.stackexchange", "id": 1216, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "linear-bounded-automata", "url": null }
fluid-statics This hopefully addresses both areas of confusion. First, since only one unique vector quantity exists, namely, the inward force per unit area, we can just replace it with its scalar magnitude for convenience. Second, the pressure isn't the summation of pressures, it is the pressure. The net force, which is the summation of all applied forces, is zero for a infinitesimal body of neutral buoyancy floating in a fluid.
{ "domain": "physics.stackexchange", "id": 87948, "lm_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-statics", "url": null }
similarly, $c= 20\% * b$ $= (\frac{20}{100})*b$ $= 0.2*b$.......eqn(2) Let $30\%$ of $c = x$ $x = 30\% * c$ $= (\frac{30}{100})*c$ $= 0.3*c$.........eqn(3) Now substitute value of $c$ i.e, equation(2) in eqn (3) $x = 0.3 *(0.2*b)$ now substitute value of $b$ i.e, eqn (1) in above equation $x = 0.3 *(0.2 * 0.1*a)$ hence, $x= 0.6a$ :) Deepak () You have done everything right until the last step. $x = 0.3 *(0.2 * 0.1*a)$ gives $x = 0.006a$ and NOT $0.6a$ Ali Jan () Deepak is saying right, dear, 0.3*0.2*0.1 = 0.006 Ravi () I guess you need to modify the options to compare it with either $a$ or $b$. Deepak ()
{ "domain": "lofoya.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9890130554263733, "lm_q1q2_score": 0.8108852045705581, "lm_q2_score": 0.8198933271118221, "openwebmath_perplexity": 3359.1027621655344, "openwebmath_score": 0.5254805088043213, "tags": null, "url": "http://www.lofoya.com/Solved/495/if-b-equals-10-of-a-and-c-equals-20-of-b-then-which-one-of" }
python, beginner, game NOTE: All code below this point is for example purposes and untested. Your Questions! > go [north|south|east|west] There are a few ways to handle this. This is one potential way. On your Area, declare a dictionary. The keys will be the direction ("north", "south", "east", "west"). In your main loop, the condition for the go command would be if menu_input[:3] == "go ":. This uses slicing to get the first three characters of menu_input. The contained block could then be: try: global position position = position.neighbor[menu_input[3:]] desc() except KeyError: print("You cannot go in that direction!")
{ "domain": "codereview.stackexchange", "id": 21420, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, game", "url": null }
python, beginner, python-3.x, file Title: Program that reads 4 files and outputs contents of it into another file after formatting it The below Python 3 program scans 4 files a.txt, b.txt, c.txt, d.txt and then outputs the read data into a file output.txt in a formatted way. The first line of each file is guaranteed to have a header and the second line of each file will be blank. I'm required to scan those four files. Program: def main(): with open('a.txt', 'r') as file_a, open('b.txt', 'r') as file_b, open('c.txt', 'r') as file_c, open('d.txt', 'r') as file_d: lines1, lines2, lines3, lines4 = file_a.readlines(), file_b.readlines(), file_c.readlines(), file_d.readlines() lines = [lines1, lines2, lines3, lines4] number_of_spaces = 5 assert len(lines1) == len(lines2) == len(lines3) == len(lines4), "Error. Different number of lines found in the files" row, column = 0, 1 with open('output.txt', 'w') as output:
{ "domain": "codereview.stackexchange", "id": 14328, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, file", "url": null }
reductions, logic, proof-techniques, undecidability You ask about the $\Rightarrow$ direction of the proof, so you must handle arbitrary models which interpret $\sigma$, where the world can have elements which have nothing to do with strings (this relates to your second question). This is where the interpretation function comes in. We give a correspondence between all finite strings and a subset of the world of $\mathcal{M}$, which is rather natural given the nature of our signature. A string $s$ is mapped to the element $f_s(e)$, which can be a string/number/table or anything you like.
{ "domain": "cs.stackexchange", "id": 7753, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reductions, logic, proof-techniques, undecidability", "url": null }
ros, visual-odometry, yaml, viso2-ros, stere-image-proc Title: viso2_ros demo.launch Hi all, I'm trying out viso2_ros (http://www.ros.org/wiki/viso2_ros?distro=fuerte) by running the demo.launch file that was included. However, it requires a disparity_params.yaml for the stereo_image_proc node. I don't see an example of what is inside the disparity_params.yaml. I tried just putting in a camera calibration parameters. But that does not seem right. Output from the terminal: aaron@AntaresL:~/Desktop/DRC/ROS_Examples/viso2-fuerte/viso2_ros/launch$ roslaunch viso2_ros demo.launch ... logging to /home/aaron/.ros/log/6948e56a-ae8e-11e2-b858-180373ea7946/roslaunch-AntaresL-6453.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. Invalid roslaunch XML syntax: not well-formed (invalid token): line 12, column 57 What is needed in the disparity_params.yaml to make this program work? Could someone show an example?
{ "domain": "robotics.stackexchange", "id": 13960, "lm_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, visual-odometry, yaml, viso2-ros, stere-image-proc", "url": null }
The default bandwidth of the SmoothKernelDistribution function I am researching the Silverman rule of thumb for bandwidth selection. Below is a sample of my code, from which it seems that BW=63 is close to the default parameter given by Mathematica (2 images are quite similar). data4 = RandomReal[1024, {3600, 2}]; \[ScriptCapitalD]1 = SmoothKernelDistribution[data4]; \[ScriptCapitalD]2 = SmoothKernelDistribution[data4, 63]; {ContourPlot[PDF[\[ScriptCapitalD]1, {x, y}], {x, 0, 1024}, {y, 0, 1024}], ContourPlot[PDF[\[ScriptCapitalD]2, {x, y}], {x, 0, 1024}, {y, 0, 1024}]} Yet, according to articles the definition for Silverman R.O.T. should be: H1 = (4/(dim + 2))^(1/(dim + 4))*n^(-1/(dim + 4)) StandardDeviation[data4[[All, 1]]] (* -> 74.7864 *) When I did this analysis for the 1D case, the Mathematica results fit well to expectations. My question is: How does Mathematica calculate BW by default? How can I see the BW results (other than trial and error until images are alike)?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.95598134762883, "lm_q1q2_score": 0.812556595400453, "lm_q2_score": 0.849971181358171, "openwebmath_perplexity": 2498.2132692916975, "openwebmath_score": 0.33931872248649597, "tags": null, "url": "https://mathematica.stackexchange.com/questions/25423/the-default-bandwidth-of-the-smoothkerneldistribution-function/25505" }
ros, ros2, linux, g2o Title: G2O BlockSolver Initialization Crash on Unix System I have a project which possesses and uses G2O library, it runs on both platforms(win/Unix). (WINDOW PASSED / UNIX CRASHED) We can see in both platforms, these lines: g2o::SparseOptimizer optimizer; g2o::BlockSolver_6_3::LinearSolverType * linearSolver; linearSolver = new g2o::LinearSolverDense<g2o::BlockSolver_6_3::PoseMatrixType>(); Next steps, in window os we have this: g2o::BlockSolver_6_3 * solver_ptr = new g2o::BlockSolver_6_3(linearSolver); g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(solver_ptr); But Unix system can't compile those lines because it says
{ "domain": "robotics.stackexchange", "id": 31443, "lm_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, ros2, linux, g2o", "url": null }
machine-learning, natural-language-processing When you say you removed punctuation, you actually meant whitespaces as well. You tried neural networks, but not in a sequence-to-sequence fashion.
{ "domain": "cs.stackexchange", "id": 8154, "lm_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, natural-language-processing", "url": null }
ubuntu, ros-fuerte, rosmake, ubuntu-precise, libfreenect [rosmake-0] Finished <<< libfreenect [FAIL] [ 0.10 seconds ] [ rosmake ] Halting due to failure in package libfreenect. [ rosmake ] Waiting for other threads to complete. [ rosmake ] Results: [ rosmake ] Built 1 packages with 1 failures. [ rosmake ] Summary output to directory [ rosmake ] /root/.ros/rosmake/rosmake_output-20121031-140959
{ "domain": "robotics.stackexchange", "id": 11580, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ubuntu, ros-fuerte, rosmake, ubuntu-precise, libfreenect", "url": null }
classification, regression, data For the cases where there is time in the data, you can use the Discrete Sine Transform, as well as the more popular Discrete Cosine Transform, to approximate the signal in terms of a sum of sine/cosine functions oscillating at different frequencies. You should take into account, however, that discontinuities affect the DCT accuracy; from the wikipedia page for the DCT:
{ "domain": "datascience.stackexchange", "id": 8798, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classification, regression, data", "url": null }
javascript, beginner, object-oriented, tic-tac-toe, mvc The next key to this puzzle would be to update the UI based on how the current state was updated. A simple way to do this, would be to simply make it so once you're done calling executeAction() with your desired action, you send the exact same action over to a function exported on the ui side, which we'll call executeUiAction(). The UI will take this action, along with the updated state, and figure out what actually needs to be changed in the UI to bring the UI up to date with what the state looks like. I usually use a slightly more complicated variation of this pattern that's capable of handling some other issues (the details depend on the project I'm working on), but what I presented should get you pretty far, and would probably accomplish everything you need for this tic-tac-toe game. But, feel free to tweak or even change it drastically as you go along, it's just a rough-draft idea of what you can do to handle online play. Structural changes const state = { ... boardDim: 3,
{ "domain": "codereview.stackexchange", "id": 43220, "lm_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, beginner, object-oriented, tic-tac-toe, mvc", "url": null }
ros, ompl-ros-interface Original comments Comment by ryann2k1 on 2013-04-16: it is not in my ros package, but some sources mentioned that motion_planning_msgs has changed to arm_navigation_msgs. GetMotionPlan.h does exist in arm_navigation_msgs. Yet, after changing, the compilation still produces the same error. Comment by ryann2k1 on 2013-04-16: I Just figure out that arm_navigations_msgs appear twice in my ros path:/opt/ros/fuerte/stacks/arm_navigation/arm_navigation_msgs/srv_gen/cpp/include/arm_navigation_msgs$, however it doesn't recognise the directory -> fatal error: arm_navigation_msgs/GetMotionPlan.h: No such file or directory Comment by felix k on 2013-04-17: Have you replaced every occurrence of motion_planning_msgs (manifest, that other include, CMakeLists if at all...) Why do you mean twice? The package-named directory inside msg_gen or srv_gen is correct, but of course shouldn't be in your ROS_PACKAGE_PATH itself. Comment by ryann2k1 on 2013-04-17:
{ "domain": "robotics.stackexchange", "id": 13764, "lm_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, ompl-ros-interface", "url": null }
c++, performance, cache, polymorphism, c++20 /* Helper functions */ /* This set functions applies a function an element of a tuple given a runtime index */ template<typename R, int N, class T, class F> R apply_one(T& p, F& func) { static_assert(std::is_same<typename std::result_of<F(decltype(std::get<N>(p)))>::type, R>::value, "Wrong return type for polymorphic function"); return func(std::get<N>(p) ); } template<typename R, class T, class F, int... Is> R apply_func_to_tuple(T& p, int index, F& func, seq<Is...>) { using FT = R(T&, F&); /* This is the magic, a v-table is built on the spot here. */ static constexpr FT* arr[] = { &apply_one<R, Is, T, F>... }; return arr[index](p, func); } template<typename R, class T, class F> R apply_func_to_tuple(T& p, int index, F&& func) { return apply_func_to_tuple<R>(p, index, func, gen_seq<std::tuple_size<T>::value>{}); } /* Helper class to find the index of a type from a tuple type list at compile - time */ template <class T, class Tuple> struct Index;
{ "domain": "codereview.stackexchange", "id": 40710, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, cache, polymorphism, c++20", "url": null }
The p-values help determine whether the relationships that you observe in your sample also exist in the larger population. Is Google BigBird gonna be the new leader in NLP domain? This plaster can provide a smooth surface and it can handle water in the lon, Vegetables to Grow in North India in April 2020 In this article, information on vegetables that can be grown in the month of April 2020 , North India   The figure [1]  gives a simple design of the garden also. May the choice of the variables is not good. Interpretation of Results of Clustering Algorithms, Interpretation of Dynamic Binning Algorithms, Vegetable to Grow in North India in April 2020, Overcoming Barriers to Roof Top Raise Bed Gardening, Difference Between Joblessness & Unemployment, feedback of bio toilets in Indian railways, feedback of bio toilets tenders in railways, forest bathing natural building allergy thyroid weight loss. Figure 1: Vegetable to Grow in North India in April  What to grow in April 2020 : You can
{ "domain": "newsreportnakhonpathominside.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877726405083, "lm_q1q2_score": 0.8046407573006413, "lm_q2_score": 0.8289387998695209, "openwebmath_perplexity": 898.321942536921, "openwebmath_score": 0.4437622129917145, "tags": null, "url": "http://newsreportnakhonpathominside.com/overtraining-syndrome-ctkpbll/archive.php?id=ols-regression-results-explained-f40cd2" }
actionlib InterfaceE[_ZN9actionlib12ActionClientIN14move_base_msgs15MoveBaseAction_ISaIvEEEE10initClientEPN3ros22CallbackQueueInterfaceE]+0x3e8):对‘actionlib::ConnectionMonitor::goalDisconnectCallback(ros::SingleSubscriberPublisher const&)’未定义的引用 t3_sendGoals.cpp:(.text._ZN9actionlib12ActionClientIN14move_base_msgs15MoveBaseAction_ISaIvEEEE10initClientEPN3ros22CallbackQueueInterfaceE[_ZN9actionlib12ActionClientIN14move_base_msgs15MoveBaseAction_ISaIvEEEE10initClientEPN3ros22CallbackQueueInterfaceE]+0x46f):对‘actionlib::ConnectionMonitor::goalConnectCallback(ros::SingleSubscriberPublisher const&)’未定义的引用 t3_sendGoals.cpp: (.text._ZN9actionlib12ActionClientIN14move_base_msgs15MoveBaseAction_ISaIvEEEE10initClientEPN3ros22CallbackQueueInterfaceE[_ZN9actionlib12ActionClientIN14move_base_msgs15MoveBaseAction_ISaIvEEEE10initClientEPN3ros22CallbackQueueInterfaceE]+0x61d):对‘actionlib::ConnectionMonitor::cancelDisconnectCallback(ros::SingleSubscriberPublisher const&)’未定义的引用
{ "domain": "robotics.stackexchange", "id": 29308, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "actionlib", "url": null }
deep-learning, tensorflow In the image, we see that the data and model are considered artifacts. The Execution is that of the Trainer of the model. Events in this flow were the input of the data and the model output while the Context annotates the entire experiment. From here, it is easier to understand where an Attribution and Association would fit in to this scheme. EDIT To add to prior post it is best to use the following image as well from the documentation:
{ "domain": "datascience.stackexchange", "id": 9934, "lm_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, tensorflow", "url": null }
electromagnetism, special-relativity You'll notice that the electric field in the intermediate region has non-zero curl. By Faraday's Law, there is therefore also a non-zero magnetic field within this region (technically, a non-zero time derivative of a magnetic field, but the former follows easily from this statement). In contrast, the radial regions have zero curl, so they have constant magnetic field; examining reasonable boundary and initial conditions for the problem (no magnetic field at $t=0$ and at infinity), this leads to there being zero magnetic field in these regions. Taken together, these facts imply that quickly moving a charge produces a quick magnetic pulse that propagates outward.
{ "domain": "physics.stackexchange", "id": 36451, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, special-relativity", "url": null }
this could be written as •4. We also construct orthonormal bases for the Hilbert. These topics have been at the center of digital signal processing since its beginning, and new results in hardware, theory and applications continue to keep them important and exciting. Fourier Analysis of a Periodic Sawtooth (Asymmetrical Triangle) Wave. Fourier Series approximation of binding wave (theoretical general description of model) There is a tenden cy to avoid labored and tardy procedure of the creation of the cross-sections experimental. Chap 3 - Discrete-time Signals and Fourier series representation 4 | P a g e Figure 3. Now in this Fourier Series lecture video I will briefly explained Fourier Series Lecture #17 Fourier Series Examples and Solutions for F(x)= XSINX in Interval 0 to Pi|PTU. When compared with known results for wave speed, results from the method agree closely. You can use it in your daily design, your own artwork and your team project. Consider a square wave f(x) of length 1.
{ "domain": "chiesaevangelicapresbiteriana.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692264378963, "lm_q1q2_score": 0.8007645837009872, "lm_q2_score": 0.8198933293122507, "openwebmath_perplexity": 720.3926557973892, "openwebmath_score": 0.8425406813621521, "tags": null, "url": "http://yfwv.chiesaevangelicapresbiteriana.it/fourier-series-of-sawtooth-wave-pdf.html" }
ros, navigation, nav2d I've attached a picture of rviz below, and here yaml git my nav2d configuration; costmap, mapper, navigator, operator and ros.yaml. EDIT 2 I solved part of the navigation task by using almost all default parameters. I updated the parameters I'm using on github, but still having the same problem from the beginning for rviz. It stucks sometimes and other goes down here pictures there are more pictures. Now I think the map updates as it should. But because of the rviz problem I have, it doesn't update in a good way. I hope you can clarify me about what could origin this. I'm sure that grid_resolution, some threshold or the other grid parameters are the responsibles of this issue. EDIT 3 EDIT 4 I managed to improve the map accuracy and now seems that doesn't overflow as before. Below I uploaded a picture of the map I got. . EDIT5
{ "domain": "robotics.stackexchange", "id": 29076, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, nav2d", "url": null }
python, c++, c++11, iterator, reinventing-the-wheel template<typename BidirectionalIterable> inline auto reversed(ReversedObject<BidirectionalIterable>&& iter) -> BidirectionalIterable { return { std::forward<BidirectionalIterable>(iter._iter) }; }
{ "domain": "codereview.stackexchange", "id": 5024, "lm_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, iterator, reinventing-the-wheel", "url": null }
swift, serialization The time to convert the 512,000 character string is now 0.0008 seconds. This is more than 17 times faster than the original code. Test code: let s1 = (0 ... 255).map { String(format:"%02x", $0) }.joinWithSeparator("") let str = Repeat(count: 100, repeatedValue: s1).joinWithSeparator("") print(str.characters.count) // 51200 let start = NSDate() if let data = str.dataFromHexString() { let duration = NSDate().timeIntervalSinceDate(start) print(duration) } else { print("failed") } The tests were done on a MacBook, with the program compiled in Release mode.
{ "domain": "codereview.stackexchange", "id": 21075, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "swift, serialization", "url": null }
cpu-pipelines, computer-architecture Which of these is very important (as in which of these really matters in the CPU now-a-days)? If both are equally important or in case the second one is more important then Why do we not have two instruction pipeline (probably of half the length ) and then depending on the branches, just choose one of them and then again start the population from the beginning? I don't know which case is prevalent, but I would like to offer some thoughts on your proposal of double pipelines. First of all, you would need double the wire which would consume double the energy and produce double the heat while active. While not needed, on the other hand, it would be completely useless. So one could argue that it is not a good use of resources that are rare on modern processors.
{ "domain": "cs.stackexchange", "id": 664, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cpu-pipelines, computer-architecture", "url": null }
graphs Title: Find largest subset of vertices in graph so that every pair of vertices have an edge between them Let's say you have a graph like this: The largest subset of nodes so that every pair of vertices have an edge between them is $\{3, 5, 7, 12\}$. The second largest subsets are $\{4, 7, 21\}$, $\{3, 5, 7\}$, $\{3, 5, 12\}$,
{ "domain": "cs.stackexchange", "id": 11508, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graphs", "url": null }
nlp, word-embeddings, word2vec, text-classification, tfidf Title: What are the exact differences between Word Embedding and Word Vectorization? I am learning NLP. I have tried to figure out the exact difference between Word Embedding and Word Vectorization. However, seems like some articles use these words interchangeably. But I think there must be some sort of differences. In Vectorization, I came across these vectorizers: CountVectorizer, HashingVectorizer, TFIDFVectorizer Moreover, while I was trying to understand the word embedding. I found these tools. Bag of words, Word2Vec
{ "domain": "datascience.stackexchange", "id": 11150, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nlp, word-embeddings, word2vec, text-classification, tfidf", "url": null }
quantum-field-theory, mass, renormalization, scattering Itzykson C., Zuber J.-B. Quantum field theory, section 4-1-2. Peskin, Schroesder. An introduction To Quantum Field Theory, section 6.5. Itzykson C., Zuber J.-B. Quantum field theory, section 8-3-1. Schwartz M.D. Quantum Field Theory and the Standard Model, chapter 20. Srednicki M. Quantum Field Theory, chapters 26 and 27. Ticciati R. Quantum Field Theory for Mathematicians, section 19.9. Pokorski S. Gauge Field Theories, sections 5.5 and 8.7. Weinberg S. Quantum theory of fields, Vol.1. Foundations, chapter 13.
{ "domain": "physics.stackexchange", "id": 39916, "lm_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, renormalization, scattering", "url": null }
javascript, reinventing-the-wheel, ecmascript-6, callback Title: Simple replacement for Redux in ES6 The idea about this code is that it's a full replacement of Redux — in 22 lines of code. let state = null const beforeSetStateCallbacks = [] const afterSetStateCallbacks = [] export const beforeSetState = (fn) => beforeSetStateCallbacks.push(fn) export const afterSetState = (fn) => afterSetStateCallbacks.push(fn) export const setState = async (key, value) => { if (state === null) state = {} // QUESTION: Should I use Promise.all for performance reason? // Note that the order might be important though for (const fn of beforeSetStateCallbacks) await fn(key, value) state[key] = value for (const fn of afterSetStateCallbacks) await fn(key, value) } export const stateEmpty = () => { return !state } export const getState = (key) => { if (!state) return null return state[key] }
{ "domain": "codereview.stackexchange", "id": 36377, "lm_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, reinventing-the-wheel, ecmascript-6, callback", "url": null }
neural-network, convolution, graphs Title: Struggling to understand GCNNs (Graph Convolutional Neural Networks) Although I've worked with CNN's for over a year, I am struggling to understand how GCNNs work paper on their simplification. I've read several papers, and I find myself out of my depth when they talk about Chebyshev polynomials or Fourier spaces. The descriptions talk about using an adjacency matrix as input, and perhaps my primary confusion is how I can supply such a matrix to a convolutional neural network (if that is what is in fact what is done). I can't just convolve over the matrix as if it were an image because spatial similarity in the matrix (i.e. rows/cols that are near to each other) doesn't signify actual closeness between nodes in the graph. The question is therefore, how does an adjacency matrix, fit into the framework of CNNs which uses the spatial filters, and the logistic operations (non-linear regressions) in the layered stack/graph.
{ "domain": "datascience.stackexchange", "id": 5523, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neural-network, convolution, graphs", "url": null }
scala, sudoku Title: Basic (Logical Only) Sudoku Solver I'm (very) new to Scala, and decided I'd try to get a handle on some of the syntax and general language constructs. This currently doesn't implement any backtracking and will only solve things if they can be derived exactly from the values given in the initial board. That being said, I don't particularly care about adding backtracking at the moment; this was much more a project to simply deal with some of the simpler language constructs (Basic I/O and Collections usage, mainly). I'm far more interested in:
{ "domain": "codereview.stackexchange", "id": 3499, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "scala, sudoku", "url": null }
# Density of Baire’s Theorem for Complete Metric Spaces Let $\{G_n\}$ be a sequence of dense open subsets of a complete metric space $X$. Show that $\bigcap_{n \geq 1}G_n$ is nonempty. Proof: Consider some point $p_1 \in G_1$. There exist real numbers $0< r_1 <r<1$ such that $$N_1 = N_{r_1} (p_1) \subset N_r (p_1) \subset G_1.$$ Let $q$ be a limit point of $N_1$. For any $\epsilon > 0$ we can find $x \in X$ such that $x \in N_1$ and $x \in N_\epsilon (q)$. Hence $$d(p_1, q) \leq d(p_1, x) + d(x, q)<r_1 + \epsilon.$$ Since $\epsilon$ was arbitrary it follows that $$d(p_1, q) \leq r_1.$$ Thus, if $q$ is any limit point of $N_1$, $q$ is an interior point of $G_1$ (to see this, simply consider the neighbourhood of radius $0<\epsilon<r-r_1$) and so we can write $\overline{N_1} \subset G_1.$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822876992225168, "lm_q1q2_score": 0.803093353346399, "lm_q2_score": 0.8175744784160989, "openwebmath_perplexity": 95.78228018719416, "openwebmath_score": 0.9794579148292542, "tags": null, "url": "https://math.stackexchange.com/questions/2842488/density-of-baire-s-theorem-for-complete-metric-spaces" }
# Generate covariance matrix from related random variable distributions Say I have a random variable $$X\sim\mathscr{N}\left(0,\sigma^2\right)$$ and another random variable $$Y=X+\varepsilon$$, where $$\varepsilon\sim\mathscr{N}\left(0,\eta^2\right)$$ is independent of $$X$$. I can calculate $$Cov\left(X,Y\right)=Cov\left(X,X+\varepsilon\right)=Var(X)=\sigma^2$$. Is there a way to get Mathematica to generate a bivariate normal distribution automatically from the given information? Specifically, rather than working out the covariance matrix myself and then inputting to Mathematica, I would like to be able to do something like (implementing the above example): \[ScriptCapitalX] = NormalDistribution[0, \[Sigma]] \[CapitalEpsilon] = NormalDistribution[0, \[Eta]] \[ScriptCapitalY] = TransformedDistribution[X + \[CurlyEpsilon], {X \[Distributed] \[ScriptCapitalX], \[CurlyEpsilon] \[Distributed] \[CapitalEpsilon]}]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936054891428, "lm_q1q2_score": 0.8532443418800824, "lm_q2_score": 0.8670357546485408, "openwebmath_perplexity": 1891.9690943188014, "openwebmath_score": 0.4621465802192688, "tags": null, "url": "https://mathematica.stackexchange.com/questions/263451/generate-covariance-matrix-from-related-random-variable-distributions" }
c#, json, enum, asp.net-mvc So then, a Listing has many items, and upon being created it uses an extension method to save an identity for each item in the listing, defined here; public static class TypeExtensions { public static Models.Listing ToIdentities(this Models.Listing obj) { // set the identity of each item in the collection foreach (var item in obj.Items) item.Id = string.Format("list/{0}/{1}", obj.Name.ToLower().Replace(" ", "-").Replace("/", "-"), item.Name.ToLower().Replace(" ", "-").Replace("/", "-")); return obj; } }
{ "domain": "codereview.stackexchange", "id": 6509, "lm_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#, json, enum, asp.net-mvc", "url": null }
#include "logfunc.h" double getLogFunc ( int32_t ndim, double Point[] ) { // multivariate normal (MVN) distribution specifications: const double LOG_INVERSE_SQRT_TWO_PI = log(0.398942280401432); // log(1/sqrt(2*Pi)) const double MEAN[NDIM] = {0., 0., 0., 0.}; // mean vector of the MVN const double COVMAT[NDIM][NDIM] = { {1.0,0.5,0.5,0.5}, {0.5,1.0,0.5,0.5}, {0.5,0.5,1.0,0.5}, {0.5,0.5,0.5,1.0} }; // covariance matrix of the MVN const double INVCOVMAT[NDIM][NDIM] = { {+1.6, -0.4, -0.4, -0.4}, {-0.4, +1.6, -0.4, -0.4}, {-0.4, -0.4, +1.6, -0.4}, {-0.4, -0.4, -0.4, +1.6} }; // inverse covariance matrix of the MVN const double LOG_SQRT_DET_INV_COV = 0.581575404902840; // logarithm of square root of the determinant of the inverse covariance matrix // subtract mean vector from the input point int i; double NormedPoint[NDIM]; for(i = 0; i < NDIM; i++){ NormedPoint[i] = Point[i] - MEAN[i]; }
{ "domain": "cdslab.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9926541736428375, "lm_q1q2_score": 0.8376959878731101, "lm_q2_score": 0.8438950947024555, "openwebmath_perplexity": 6924.640919095357, "openwebmath_score": 0.46039295196533203, "tags": null, "url": "https://www.cdslab.org/paramonte/notes/examples/c/mvn/" }
c++, strings std::string window(str, first1, next1 - first1); Once you have that, calculating the number of zeores and ones in window is easy: auto count1 = next0 - first1; auto count0 = window.size() - count1; However, you might not even need the initial window: Avoid constructing and then partially deconstructing the window Your window consists of a number of ones followed by a number of zeroes. You are then slowly removing from the start and end until some conditions are met. However, while you are doing this, the only thing you really care about is the count of zeroes and ones, not the string window itself! You can reconstruct the final window from the counts left at the end. Let's assume we have calculated count0 and count1 like I've written above. Then: while (window.size() > 1) { Can be replaced with: while (count0 + count1 > 1) { Then you do: if (count0 > count1) window.erase(--window.end()); else if (count1 > count0) window.erase(window.begin());
{ "domain": "codereview.stackexchange", "id": 38638, "lm_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++, strings", "url": null }
machine-learning, reinforcement-learning Title: Does an RL agent need to experience a complete episode in order to learn? Suppose we have a game where there is no good measure of how "far" the target is (that we could use to nudge the agent towards the goal via the immediate returns). If the agent gets only -1 reward per time step and experiencing a full episode where it reaches the goal is extremely improbable (it's equivalent to just blind search at this point), can it still learn? If the agent gets no feedback whatsoever and has no information about the structure of the search space (just blind search, hoping to get lucky), then no, it can't learn. It has nothing to learn from. In your scenario, it has no information to enable it to improve: the feedback is always the same -- always an unending stream of -1,-1,-1,-1,-1,... unless it happens to get lucky. Without feedback, there's no basis for learning.
{ "domain": "cs.stackexchange", "id": 9444, "lm_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, reinforcement-learning", "url": null }
computation-models, hypercomputation Title: Is infinitely fast computer fundamentally impossible even theoretically? This may get slightly philosophical, but consider the following program: bool lampState = false; TimeSpan timeout = 1; while (true) { lampState = !lampState; Thread.Sleep(timeout); timeout = timeout / 2; }
{ "domain": "cs.stackexchange", "id": 19992, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computation-models, hypercomputation", "url": null }
ros, ros2, installation, build-from-source sudo apt install --no-install-recommends -y \ libasio-dev \ libtinyxml2-dev sudo apt install --no-install-recommends -y \ libcunit1-dev sudo apt-get install python-rosinstall-generator mkdir -p ~/ros2_dashing/src cd ~/ros2_dashing/ rosinstall_generator ros_core --rosdistro dashing --deps --tar > dashing-ros-core.rosinstall vcs import src < dashing-ros-core.rosinstall sudo rosdep init rosdep update rosdep install --from-paths src --ignore-src --rosdistro dashing -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers" colcon build --symlink-install --packages-skip sros2 sros2_cmake ros_core Edit: I have written a simple IPC.srv custom service. Everything worked fine on my Ubuntu 18.04 VM that also has ROS2 Dashing installed with Debian Packages. char[10] request_data --- int8 response_code
{ "domain": "robotics.stackexchange", "id": 36493, "lm_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, ros2, installation, build-from-source", "url": null }
acoustics, frequency, electronics, electrical-engineering with $p$ the pressure, $u$ the particle velocity, $r$ being the distance from the source, $\omega$ the radial frequency for which $\omega = 2 \pi f$ is true with $f$ denoting the frequency, $\rho$ the medium (air mostly) density, $Q$ the "strength" of the source (actually is the volume velocity of the radially vibrating sphere), $k$ the wavenumber for which $k = \frac{\omega}{c} = \frac{2 \pi}{\lambda}$ is true, with $c$ being the speed of sound and $\lambda$ the wavelength (distance travelled in the duration of one period $T = \frac{1}{f}$). Finally note that $j$ is the imaginary unit, also found as $i$ for which $j^{2} = -1$ (thanks to Robert Bristow-Johnson for the hint).
{ "domain": "physics.stackexchange", "id": 93871, "lm_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, frequency, electronics, electrical-engineering", "url": null }
homework-and-exercises, waves, astrophysics, definition, plasma-physics Title: What exactly is Landau Damping? I would like to understand what exactly happens when Landau damping takes place. I have seen the mathematics of it. But I am not sure If I truly understand what happens when we are talking about Landau damping. There are a few critical issues that I did not find in the other answers which are worth noting here. Landau Interactions Landau interactions are specifically tied to the term $\mathbf{k} \cdot \mathbf{v}$, where $\mathbf{k}$ is the wave vector and $\mathbf{v}$ is the particle velocity. The physical interpretation of this term is that longitudinal electric field fluctuations exchange energy/momentum with particles along the direction of the wave vector.
{ "domain": "physics.stackexchange", "id": 78105, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, waves, astrophysics, definition, plasma-physics", "url": null }
python, performance #Calculate regression co-efficient and stepsize r = np.amax(np.absolute(w)) l_over_rho = sqrt(2*log(n, 10)) * r / 2.0 # I might be wrong here rho = 1/r #Pre-compute to save some multiplications A_t_y = A.T.dot(y) Q = A_t_A + rho * np.identity(n) Q = np.linalg.inv(Q) Q_dot = Q.dot sign = np.sign maximum = np.maximum absolute = np.absolute for _ in xrange(MAX_ITER): #x minimisation step via posterier OLS x_hat = Q_dot(A_t_y + rho*(z_hat - u)) #z minimisation via soft-thresholding u = x_hat + u z_hat = sign(u) * maximum(0, absolute(u)-l_over_rho) #mulitplier update u = u - z_hat return z_hat def test(m=50, n=200): """Test the ADMM method with randomly generated matrices and vectors""" A = np.random.randn(m, n)
{ "domain": "codereview.stackexchange", "id": 16309, "lm_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", "url": null }
electromagnetic-radiation, information, radio, radio-frequency Here we see the reason for the term Amplitude Modulation (AM): the message is a modulation of the amplitude of the carrier wave. You can use trig identities or Fourier analysis to see that the spectral content of $s(t)$ is in the range $\Omega \pm \delta \omega$ where $\delta \omega$ is the highest frequency in $m(t)$. The carrier frequency $\Omega$ might be in the tens of MHz range. On the other hand, the actual message $m(t)$ would absolutely never have any frequencies above around 20 kHz because that's the upper range of human hearing. In real life, $m(t)$ doesn't use up the full 20 kHz; useful speech and music don't need our full hearing range. So now we see that the transmitted signal $s(t)$ is contained within some relatively narrow bandwidth, i.e. maybe a 10 kHz band centered at 10 MHz. Therefore, a tuned circuit with a $Q$ of around 1,000 and centered at $\Omega$ picks up $s(t)$ but mostly nothing else.$^{[a]}$
{ "domain": "physics.stackexchange", "id": 36464, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetic-radiation, information, radio, radio-frequency", "url": null }
c#, parsing, css, regex, hash-map Title: Parsing very simple CSS into selector and declarations (as as single piece) The last part of my HTML genrator requries a few styles. Because all styles are inline and the styling is for emails there won't be any fancy selectors, just by element, id or class. The most complex css might look like this: var css = @" h1 { font-family: Sans-Serif; color: green; font-weight: normal; margin-top: 1.5em; } h2 { font-family: Sans-Serif; color: green; font-weight: normal; margin-top: 1.5em; } #foo, p { font-family: Sans-Serif; color: green; } hr, .foo { border: 0; border-bottom: 1px solid #ccc; background: #ccc; }";
{ "domain": "codereview.stackexchange", "id": 26055, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, parsing, css, regex, hash-map", "url": null }
turing-machines, computability But I do not understand in the first line of the answer, in the second statement why does it say that $L(M) = L(M)^{\mathcal{R}}$, could anyone explain this for me please? For a language $L$, we define the reverse language $L^{\mathcal{R}}$ by $$ L^{\mathcal{R}} = \{ x^{\mathcal{R}} : x \in L \}. $$ In words, $L^{\mathcal{R}}$ is obtained from $L$ by reversing all words. It follows that $L = L^{\mathcal{R}}$ if and only if, for each word $x$, we have $x \in L \Leftrightarrow x^{\mathcal{R}} \in L$.
{ "domain": "cs.stackexchange", "id": 11500, "lm_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, computability", "url": null }
in the radial r- direction. 1 for Gauss's law problems. 0 cm) which has a net charge of +4. 00 cm and a charge per unit length of 30. (a) Derive the expression for the electric field inside the volume at a distance r from the axis of the cylinder in terms of the charge density p. Griffiths 4. Question 3: A very long conducting cylinder of radius 2R has a cylindrical hole of radius R along its entire length. A long, non conducting, solid cylinder of radius 4. The wheel is pivoted on a stationary axle through the axis of the cylinder and rotates about the axle at a constant angular speed. Suggestion: Use the result of Example 23. outside the cylinder & a distance. 23 - An infinitely long insulating cylinder of radius R. Consider an infinitely long solid cylinder with radius R_0 and volume charge density rho=rho_0*r(r≤R_0) where rho_0 is a constant. from the center. uniform volume mass density. Show that the electric field strengths outside and inside the rod are given, respectively, by
{ "domain": "ol3roma.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9884918526308095, "lm_q1q2_score": 0.823734579200424, "lm_q2_score": 0.8333246015211008, "openwebmath_perplexity": 429.7929339172226, "openwebmath_score": 0.8591949939727783, "tags": null, "url": "http://yzum.ol3roma.it/an-infinitely-long-solid-cylinder-of-radius-r-is.html" }
slam, navigation, rtabmap <!--By default , the database db is not started --> <arg name ="db" default ="false"/> <!--By default , debug mode is switched off --> <arg name ="debug" default ="false" /> <!-- Load the URDF , SRDF and other . yaml configuration files on the param server --> <include file ="$(find ur5_moveit_config)/launch/planning_context.launch"> <arg name ="load_robot_description" value ="true"/> </include> <!--Including Kinect Bridge camera driver--> <include file ="$(find kinect2_bridge)/launch/kinect2_bridge.launch"> <arg name ="publish_tf" value="true"/> </include> <!--static_transform_publisher (transformation description) frame_id child_frame_id period_in_ms--> <!-- Link kinect2_base_link frame to ee_link --> <node pkg ="tf" type ="static_transform_publisher" name ="kinect2_base_link_tf_broadcaster" args ="-0.09 0 0.07 0 0 0 ee_link kinect2_base_link 10"/>
{ "domain": "robotics.stackexchange", "id": 28829, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, rtabmap", "url": null }
type-theory Title: What is the formalism to prove statements about uniqueness of functions with certain signatures Suppose I want a function like f: ((A, B) -> C) -> A -> B -> C A statement I've often seen made is that f has just one implementation, namely the 'curry function', i.e. g => a => b => g(a, b) Taken at face value this doesn't seem to actually be true, I can always define f as acting differently from this in special cases, e.g. I can say it is g => a => b => g(a, b) except when A = B and then I define it as g => a => b => g(b, a). Nonetheless, it's intuitively clear enough what is meant by 'has just one implementation'. I would like to know the correct formalism in which statements like the above can be proven.
{ "domain": "cs.stackexchange", "id": 15888, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "type-theory", "url": null }
html, perl # Set color scheme according to 'color' argument open (my $colorsFile, $src . "colors.txt") or die "Could not open colors.txt: $!"; my %schemes = (); while (my $line = <$colorsFile>) { chomp $line; $schemes{$1} = $2 if ($line =~ /^(\w+):\s*(.*)/); } $colors = $schemes{$color} if (defined $schemes{$color}); close ($colorsFile); # Write HTML and Javascript to file open (my $outputFile, '>', $output) or die "Could not open $output: $!";
{ "domain": "codereview.stackexchange", "id": 8925, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "html, perl", "url": null }
ros-melodic // for points which are very close causing the height threshold to be tiny, set a minimum value if (points_distance > concentric_divider_distance_ && height_threshold < min_height_threshold_) { height_threshold = min_height_threshold_; }
{ "domain": "robotics.stackexchange", "id": 37973, "lm_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-melodic", "url": null }
sampling, algorithms, control-systems, pid Current error $e_n$ to proportional, and finally an aproximation of derivate of error to derivative part, for example: $$D_n=K_d * (e_{n}-e_{n-1})/Tsampler$$ where Ki and Kd are representative. The step where $$U_n = U_{n-1} \pm dU_n \tag 1$$ is a numerical integration - it is causing $U_n = \sum_{k = -\infty}^n dU_k$. (I'm assuming you really meant the update was from $U_{n-1}$ to $U_n$; I'm further assuming that the dependence of the sign of the summation is settable in the program you're figuring out). So what the author of that program has done is to formulate a more or less ordinary PID controller, then take the numerical derivative of every step. This has a minor pitfall, in that if your integrator gain ($T_i$) is zero, then your controller has a pole-zero cancellation (if you're unfamiliar with that term then search for it). But as long as $T_i$ is nonzero, then the end-to-end behavior of the system will look just like a PID controller.
{ "domain": "dsp.stackexchange", "id": 11547, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sampling, algorithms, control-systems, pid", "url": null }
thermodynamics I really doubt that, given all the dynamic things happening at the Earth's surface, where one downhill process drives an uphill process. Such as the huge electric potential generated in a thunderstorm when larger ice particles fall and smack into small ice particles being lifted in the updraft, resulting in lightning. I don't think of the generation of electric potentials as being particularly "spontaneous", but I also don't know if the Gibbs free energy function really applies to this case. In this example and others I can think of (such as generation of wind and water power), it is exergy that is increasing, i.e. available work. I would tend to think of a process that increases the exergy of a system as non-spontaneous, but I don't know if it is used that way by physicists. The important distinction is that, in order for a non-spontaneous process to occur, there has to be energy input to the system. So, in your example, the system is just the electrolytic cell; in order for
{ "domain": "physics.stackexchange", "id": 81466, "lm_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", "url": null }
everyday-chemistry, water, concentration, alcohols, hydrolysis Along the lines of trying to figure out what could be the cause of the experience of your staff, I doubt it has anything to do with the acetone itself because you say that they can use the same chemical on two different days and have two different experiences. So it's either they're imagining it (let's assume they are not), or it is the dirt that has to be cleaned that is the issue.
{ "domain": "chemistry.stackexchange", "id": 10741, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "everyday-chemistry, water, concentration, alcohols, hydrolysis", "url": null }
ros-kinetic Title: camera_aravis (Unrecognized image encoding) with colour camera Hello everyone, I try to run the camera_aravis package with aravis version 0.6 to see the raw image of a manta G-235c camera. Wen i run the rqt image view i get the following error: ImageView.callback_image() while trying to convert image from 'BayerRG8' to 'rgb8' an exception was thrown (Unrecognized image encoding [BayerRG8]). I can change the pixel format with the aravis viewer, but this only change the 'BayerRG8' to a other type of file in the error messages. The only format that works with the rqt viewer is the Mono8 format, but this turns the image black and white. Does anyone have a idea how to solve this, so i can use the colour images? On my system i run Ubuntu 16.04 and ROS kinetic. The camera_aravis package i cloned from this: git https://github.com/takiaine/camera_aravis
{ "domain": "robotics.stackexchange", "id": 32284, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-kinetic", "url": null }
### Goal Maximize n This is to be understood as : pack as many lists as possible inside a time frame as long as they define a correct set (def 3) of compatible (def 2) lists (def 1). ### Questions My questions are the following :
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676448764484, "lm_q1q2_score": 0.8307265730172152, "lm_q2_score": 0.8479677545357568, "openwebmath_perplexity": 561.6045318012607, "openwebmath_score": 0.7659193277359009, "tags": null, "url": "https://cs.stackexchange.com/questions/106215/a-scheduling-problem-on-an-oriented-graph-with-multiple-constraints" }
homework-and-exercises, statistical-mechanics, fourier-transform, integration Title: How to deduce the energy of a pair of vortices the classical XY model? Consider a pair of oppositely charged vortices with unit strength, we estimate the energy of a pair of vortices as: $$ E_{\text {pair }}-E_{0} \cong \frac{J}{2} \int d^{2} r(\nabla \theta)^{2}=\frac{J}{2} \int d^{2} r\left(\frac{\boldsymbol{r}-\boldsymbol{r}_{1}}{\left|\boldsymbol{r}-\boldsymbol{r}_{1}\right|^{2}}-\frac{\boldsymbol{r}-\boldsymbol{r}_{2}}{\left|\boldsymbol{r}-\boldsymbol{r}_{2}\right|^{2}}\right)^{2}\\=\frac{J}{2} \int \frac{d^{2} k}{(2 \pi)^{2}} \frac{\left|e^{i k \cdot r_{1}}-e^{i k \cdot r_{2}}\right|^{2}}{k^{2}}=2 \pi J \ln \left(\frac{\left|\boldsymbol{r}_{1}-\boldsymbol{r}_{2}\right|}{a}\right) $$ where $L$ is the size of the system, and $a$ is a short distance cutoff that can be thought of as the size of the vortex core, typically the lattice length, and $R$ is the radius between the vortex and the anti-vortex.
{ "domain": "physics.stackexchange", "id": 87240, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, statistical-mechanics, fourier-transform, integration", "url": null }
javascript, sorting, functional-programming, ecmascript-6 The recursive transformation working horse. const transformRecursivelyWithPredicate = predicate => transform => objectToTransform => predicate(objectToTransform) ? transform(objectToTransform) : Object.entries(objectToTransform) .sort(([_, value1], [__, value2]) => value1 - value2) .reduce( (subresult, [key, value]) => ( predicate(value) ? ((subresult[key] = transform(value)), subresult) : ((subresult[key] = transformRecursivelyWithPredicate(predicate)(transform)(value)), subresult) ), {} ); And the original composed beast. :) const group = (...groupingFields) => compose(...groupingFields.map(compose(groupBy, transformRecursivelyWithPredicate(isGroup))), flatten); Little Warning The very last thing to say is that there's a concerning piece of code. Not a bug per se. I'd try to treat it as a warning. Original code:
{ "domain": "codereview.stackexchange", "id": 28710, "lm_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, sorting, functional-programming, ecmascript-6", "url": null }
group, Members of the R community: be part of the response to COVID-19 (and future epidemic outbreaks), Digging into BVB Dortmund Football Club’s Tweets with R, (Half) Lies, (half) truths and (half) statistics, A quiz about a 95% CI interpretation in the FDA Covid vaccine meeting, Missing data imputation in machine learning pipelines, Advent of 2020, Day 11 – Using Azure Databricks Notebooks with R Language for data analytics, From ”for()” loops to the ”split-apply-combine” paradigm for column-wise tasks: the transition for a dinosaur, Junior Data Scientist / Quantitative economist, Data Scientist – CGIAR Excellence in Agronomy (Ref No: DDG-R4D/DS/1/CG/EA/06/20), Data Analytics Auditor, Future of Audit Lead @ London or Newcastle, python-bloggers.com (python/data-science news), How to Make Stunning Interactive Maps with Python and Folium in Minutes, ROC and AUC – How to Evaluate Machine Learning Models in No Time, How to Perform a Student’s T-test in Python, How to Effortlessly Handle
{ "domain": "otvedaem.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924793940118, "lm_q1q2_score": 0.8545240355307095, "lm_q2_score": 0.8791467564270272, "openwebmath_perplexity": 756.6352661589661, "openwebmath_score": 0.5182982087135315, "tags": null, "url": "http://otvedaem.com/rw8q0t2p/compute-combinations-r-cb7d5c" }
classical-mechanics, hamiltonian-formalism, history, hamiltonian 26. Helmholtz did not consider an explicit dependence of the equations of motion on time. Subsequent studies indicated that his findings were insensitive to such a dependence.27. The equations of variations of Lagrange's equations or, equivalently, of Euler's equations of a variational problem, are called *Jacobi's equations* in the current literature of the calculus of variations. We shall use the same terminology for our Newtonian analysis.
{ "domain": "physics.stackexchange", "id": 34681, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, hamiltonian-formalism, history, hamiltonian", "url": null }
python, formatting, floating-point return str(price[0]) + str(decimals) price_format_gateway(10) # Expected -> 1000 price_format_gateway(10.1) # Expected -> 1010 price_format_gateway(10.15765) # Expected -> 1016 Is there another way more elegant, or cleaner? I just want to improve. When you want to round a number to a specific number of digits, instead use round. Here you can use round(price, 2). The string format performs this too, so, if you perform the string format to force two decimal places, you can get the number rounded to two decimals separated by a period. I.e 10.16. You then just want to remove the period, and so you can just use '10.00'.replace('.', ''), and so you can drastically simplify this to: def price_format_gateway(price): return '{:.2f}'.format(price).replace('.', '')
{ "domain": "codereview.stackexchange", "id": 25503, "lm_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, formatting, floating-point", "url": null }
machine-learning, r, programming user system elapsed 14.041 0.100 14.001 while the second uses only apply (but going over the indices, which are paired using expand.grid): system.time( D_2 <- matrix(apply(expand.grid(i = 1:nrow(myMatrix), j = 1:nrow(myMatrix)), 1, function(I) d_fun(myMatrix[I[["i"]], ], myMatrix[I[["j"]], ]) ) ) ) user system elapsed 39.313 0.498 39.561 However, as expected both are much slower than dist: system.time( distancematrix <- as.matrix( dist(myMatrix, method = "euclidean", diag = T, upper = T) ) ) user system elapsed 0.337 0.054 0.388
{ "domain": "datascience.stackexchange", "id": 475, "lm_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, r, programming", "url": null }