text
stringlengths
1
1.11k
source
dict
bond are of higher energy and can lose electrons more easily, but those electrons still must have somewhere to go except possibly when in flight in a cathode ray tube. That is why when you walk along a rug in winter and touch a metal post all those electrons stored in your molecules antibonding orbitals readily transfer to empty conduction bands in the metal. Physical forces as well as magnetic and electrical forces can transfer electrons among orbitals. It may be hard to analyze but that is what is happening. Some of that glass and wool is most likely chemically changed. Some of the molecules in the lightning bolt most certainly do get rearranged.
{ "domain": "chemistry.stackexchange", "id": 17123, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bond", "url": null }
python, interview-questions # Check that at least one letter has been used if len(tiles) < 1: return 3 # Check that letters are not on top of other letters for tile in tiles: if squares[(tile.x, tile.y)].letter != "": return 3 # Check that tiles are in a line if len(tiles) == 1: direction = "horiz" else: # If x coordinates are the same if tiles[0].x - tiles[1].x == 0: direction = "vert" # If y coordinates are the same elif tiles[0].y - tiles[1].y == 0: direction = "horiz" else: return 3 if direction == "horiz": # Make sure y coordinates are the same for tile in tiles: if tile.y != tiles[0].y: return 3 elif direction == "vert": # Make sure x coordinates are the same for tile in tiles: if tile.x != tiles[0].x: return 3 else: raise NameError('Wrong direction')
{ "domain": "codereview.stackexchange", "id": 2237, "lm_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, interview-questions", "url": null }
shortest-path, linear-programming, check-my-answer $(i)$ Besides the non-negativity constraint, all constraints are actually equalities. $(ii)$ The algorithm should be easily adaptable to also allow for negative cycles (by putting some linear restriction on the solution, e.g. that the path mustn't be too long, etc.) There is a major flaw in your question: You presented a shortest path formulation and not a special case of a network flow problem. Your objective function minimizes the cost of the path. The next 5 constraints are the classic flow constraints, which ensure a path between $s$ and $t$. The last constraint is just the bound of variable $x$. Now, we can start answering your questions:
{ "domain": "cs.stackexchange", "id": 13631, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "shortest-path, linear-programming, check-my-answer", "url": null }
electrons, quantum-spin So is there a remote possibility of pair formation among spin opposed electrons inside the collimated beam? And if not, why not? The electrons in a Cooper pair form a bound state because there is an attractive force between them. Since they form a bound state they pair up with opposite spins in the lowest energy level of the bound state. This bound state then has a zero net spin. In an electron beam there is no attractive force between the electrons so there is no way for pairs of electrons to form any bound states analogous to a Cooper pair.
{ "domain": "physics.stackexchange", "id": 58055, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrons, quantum-spin", "url": null }
Suppose that $$a$$ satisfies the inequality. If $$a\leq 0$$, then $$0<\frac{1}{(k+1)^3}<\frac{1}{k^a}-\frac{1}{(k+1)^a}\leq 0$$ for every $$k>0$$. This is a contraiction. Therefore, $$a>0$$. For $$a\geq 1$$, we have from Bernoulli's Inequality that $$\left(1-\frac{1}{k+1}\right)^a\geq 1-\frac{a}{k+1}$$ for all $$k\geq 0$$. Therefore, $$\frac{1}{(k+1)^a}\geq \frac{1}{k^a}-\frac{a}{(k+1)k^a}$$ for each $$k>0$$. This means $$\frac{a}{(k+1)k^a}\geq \frac{1}{k^a}-\frac{1}{(k+1)^a}>\frac{1}{(k+1)^3}\,.$$ Hence, $$k^a for every $$k>0$$. This immediately implies that $$a\leq 2$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109525293959, "lm_q1q2_score": 0.8206671823606393, "lm_q2_score": 0.8333245891029456, "openwebmath_perplexity": 149.40634638042923, "openwebmath_score": 0.8595632910728455, "tags": null, "url": "https://math.stackexchange.com/questions/3395384/inequality-frac1ka-frac1k1a-frac1k13-finding-a-s" }
xgboost, machine-learning-model, optimization, objective-function optimising for default binary:logistic and auc as an evaluation metric model2 = XGBClassifier(learning_rate=0.02, n_estimators=2000, max_depth=5, min_child_weight=1, gamma=0.3, reg_lambda=20, subsample=1, colsample_bytree=0.6, scale_pos_weight=1, seed=0, disable_default_eval_metric=1) model2.fit(X_train, y_train, eval_metric='auc', eval_set=[(X_train, y_train), (X_test, y_train)], early_stopping_rounds=100) y_proba2 = model2.predict_proba(X_test)[:, 1] brier_score_loss(y_test, y_proba2) # 0.004914 roc_auc_score(y_test, y_proba2) # 0.8721
{ "domain": "datascience.stackexchange", "id": 7288, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "xgboost, machine-learning-model, optimization, objective-function", "url": null }
python, python-3.x, object-oriented, matrix, mathematics def matrix_multiplication(self): """ uses the matrix class to multiply two matrices together Ex: 1. Add matrices 2. Multiply matrix by a constant 3. Multiply matrices 0. Exit Your choice: 3 Enter size of first matrix: 3 3 Enter first matrix: 2 2 2 2 2 2 2 2 2 Enter size of second matrix: 3 3 Enter second matrix: 2 2 2 2 2 2 2 2 2 The result is: 12 12 12 12 12 12 12 12 12 """ self.input_matrix_n_times(2) if self.matrices[0].dimension[1] != self.matrices[1].dimension[0]: print('The operation cannot be performed.', "", sep='\n') return print('The result is: ') print(self.matrices[0] * self.matrices[1], "", sep='\n') self.clear_matrices_and_count()
{ "domain": "codereview.stackexchange", "id": 38613, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, object-oriented, matrix, mathematics", "url": null }
imu, navigation, ekf, robot-localization, ekf-localization-node pose0: "odometry/visual" pose0_differential: true pose0_relative: false pose0_queue_size: 10 pose0_config: [ false, false, false, true, true, true, false, false, false, false, false, false, false, false, false] pose1: "odometry/visual" pose1_differential: false pose1_relative: false pose1_queue_size: 10 pose1_config: [ true, true, true, false, false, false, false, false, false, false, false, false, false, false, false]
{ "domain": "robotics.stackexchange", "id": 38212, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "imu, navigation, ekf, robot-localization, ekf-localization-node", "url": null }
algorithms, reference-request, sorting Consider the special case in which the array $B$ is taken from the list $$ \{1,2\} \times \{3,4\} \times \cdots \times \{2n-1,2n\}. $$ In words, the $i$th element is either $2i-1$ or $2i$. I claim that if the algorithm concludes that $A$ and $B$ contain the same elements, that the algorithm has compared each element in $B$ to its counterpart in $A$. Indeed, suppose that the algorithm concludes that $A$ and $B$ contain the same elements, but never compares the first element of $B$ to its counterpart in $A$. If we switch the first element then the algorithm would proceed in exactly the same way, even though the answer is different. This shows that the algorithm must compare the first element (and any other element) to its counterpart in $A$. This means that if $A$ and $B$ contain the same elements, then after verifying this the algorithm knows the sorted order of $A$. Hence it must have at least $n!$ different leaves, and so it takes time $\Omega(n\log n)$.
{ "domain": "cs.stackexchange", "id": 5804, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, reference-request, sorting", "url": null }
special-relativity, classical-mechanics - see the link below) that directly leads to the invention of the special theory of relativity. Moreover, the invariance of speed of light is one of the two basic principles of special theory of relativity.
{ "domain": "physics.stackexchange", "id": 19114, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, classical-mechanics", "url": null }
organic-chemistry, nomenclature, ions, terminology Title: Difference Between Betaine & Zwitterion? what is difference btw Betaine & Zwitterion, Both having positive and negative charge in a molecule. How to categorize Zwitterion and Betaine? or both are same. From Wikipedia: A betaine (BEET-ah-een, /ˈbiːtɑːˌiːn/) in chemistry is any neutral chemical compound with a positively charged cationic functional group [...] which bears no hydrogen atom [...]. A betaine thus may be a specific type of zwitterion.
{ "domain": "chemistry.stackexchange", "id": 6325, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, nomenclature, ions, terminology", "url": null }
neuroscience, neurophysiology, synapses Hence, to my understanding the axodendritic and axosomatic connections yield the same result: they influence the graded potential of the neuron (e.g. whether the neuron "fires"), where the axoaxonic connection only influences whether the axon fires. Is this correct? If so, then what is the purpose of dendrites? If axons can connect to the cell body directly, then why would they need dendrites (apart from yielding a larger connection surface to the neuron)?
{ "domain": "biology.stackexchange", "id": 4694, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience, neurophysiology, synapses", "url": null }
one of the chain rule h at x=0 is 312–331 the! Listed above 13• ( 12X 2 + 10X -7 ) is an acceptable answer definite integrals equations without hassle... When the value of f ( x ) = 5x and function is the same one we before... 24X5 + 120 x2, ignore whatever is inside the chain rule parentheses we need to re-express y\displaystyle y! Sideways eyebrow thingies, better known as parentheses, ignore whatever is inside another function is! As we come in from the summation and divide both equations by -2 featured on Creating. 2X+1 )$ is calculated by first calculating the expressions in parentheses and then multiplying number before evaluating the rule! Inverse trigonometric, hyperbolic and inverse hyperbolic functions we come in from the outside—it ’ s should be when! You might be thinking that the derivative a moment to just breathe different ways to differentiate this function the... Problems Please take a look at the same example listed above of algebraic and trigonometric expressions
{ "domain": "hpihouston.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9597620550745211, "lm_q1q2_score": 0.8250726513132075, "lm_q2_score": 0.8596637541053281, "openwebmath_perplexity": 629.7009622842282, "openwebmath_score": 0.8074383735656738, "tags": null, "url": "https://hpihouston.com/lfvlzol/2ef68a-chain-rule-parentheses" }
harmonic-oscillator and once again the solution is complicated. So we consider a separate problem, given by the equation of motion $$\frac{\textrm{d}^2 y}{\textrm{d}t^2} + \omega^2 y = \frac{F_0}{m} \sin(\Omega t),$$ and then solve them both together by doing $$\frac{\textrm{d}^2}{\textrm{d}t^2}(x + iy) + \omega^2 (x + iy) = \frac{F_0}{m} e^{i\Omega t}.$$ In this situation, $x$ and $y$ respond to different forces, not only different initial conditions, but it is mathematically easier to solve them both at once. In summary:
{ "domain": "physics.stackexchange", "id": 83797, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "harmonic-oscillator", "url": null }
1. Have the program output a proof for each member of the set. We can then check these proofs without having to trust the program at all. We could even send them all through an automated proof checker, which of course would also need to be proven correct! This may be worth doing, since proof checkers are generally simpler (easier to prove correct) and more general than proof finders; you might output proofs in a format understood by an existing proof checker. 2. Prove that the program is correct for each member of the set. This might defeat the point of using a program in the first place!
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877675527112, "lm_q1q2_score": 0.8250566192942055, "lm_q2_score": 0.8499711718571775, "openwebmath_perplexity": 537.3519567634502, "openwebmath_score": 0.7045856714248657, "tags": null, "url": "http://math.stackexchange.com/questions/717467/is-a-brute-force-method-considered-a-proof" }
c++, c++11, graphics for(float i=0.f; i<1.f; i+=1.f/accuracy) I'd write this a bit differently. As it stands, i can accumulate rounding errors from one iteration of the loop to the next. I'd prefer to do something like: for (int j=0; j<accuracy; j++) { float i = 1.0f/j; // ... This way, each value of i is computed independently, and rounding from one iteration doesn't affect its value in the next. std::vector<Vector2f> temp; for(unsigned int j=1; j<anchors.size(); ++j) temp.push_back(Vector2f(interpolate(anchors[j-1].x, anchors[j].x, i), interpolate(anchors[j-1].y, anchors[j].y, i)));
{ "domain": "codereview.stackexchange", "id": 6372, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, graphics", "url": null }
general-relativity, black-holes, time-dilation, binary-stars However, this feels like the wrong conclusion because she's still stuck in the gravitational well of this binary system and requires a non-zero escape velocity to exit the system and meet with Bob. In literature, lot of discussion about time dilation talks about escape velocity which is straightforward when talking about single spherically symmetric masses - but I am not sure how it applies to this system. Of course, the resolution here might just be they both don't experience any relative time dilation, but any signals they try to send each other will always be gravitationally redshifted. And there is no way for them to meet up and compare clocks that show the same passage of time. Lets suppose that the orbit is very large, so we could apply the linearized theory at the center. The spacetime metric is then $$\tag{1} ds^2 \approx (1 + 2 \phi) \, dt^2 - (1 - 2 \phi) (dx^2 + dy^2 + dz^2), $$ where $\phi$ is the newtonian potential. For two black holes on the circular orbit: $$\tag{2}
{ "domain": "physics.stackexchange", "id": 85726, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, black-holes, time-dilation, binary-stars", "url": null }
javascript, node.js, file-system, bluemix var fs = require('fs'); var path = require('path'); var cfgfiles = fs.readdirSync(__dirname); for (var i = 0; i < cfgfiles.length; i++) { var file = cfgfiles[i]; if (!file.match(/\.env$/)) { continue; } var name = file; //console.log("processing file " + file); name = name.replace(/\.env$/, ""); file = path.join(__dirname , file); if (process.env[name]) { //console.log("Environment variable " + name + " already set: ignoring"); } else { var val = fs.readFileSync(file, 'utf8'); process.env[name] = val; console.log("Loaded unset environment variable " + name + " from file " + file); //console.log("setting environment " + name + " to config file " + file + ":\n " + val); } } One simple thing I see as a (small performance) improvement would be to store the length of your set of files. You have this tiny for: for (var i = 0; i < cfgfiles.length; i++) {
{ "domain": "codereview.stackexchange", "id": 14837, "lm_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, node.js, file-system, bluemix", "url": null }
human-biology, biochemistry, food Title: Can drinking caffeine, alcohol and other diuretics be part of a good drinking regime? Tea, Coffee, Beer, Coke etc… I wonder if the benefit from amount of fluid we get from them is bigger or smaller then the handicap of dehydration. In other words it is worth to drink them if we want to have a good drinking regime? Opening on the recommendation from this question. A PlOS One study notes drinking moderate amounts of coffee (aka moderate caffeine intake) doesn't necessarily lead to dehydration. They note coffee has hydrating qualities akin to water. Further empirical studies found no substantial fluid loss in caffeinated beverages. EDIT: Make note we're talking normal doses and moderate intake, though source 2 goes into diminishing effect of caffeine-mediated fluid loss in heavy/prolonged uptake. The issue therein is with alcohol, which tends to inhibit vasopressin and the kidneys are constantly permeable to fluids.
{ "domain": "biology.stackexchange", "id": 3402, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, biochemistry, food", "url": null }
ros, plugin, gui, rqt void MyPlugin::restoreSettings(const qt_gui_cpp::Settings& plugin_settings, const qt_gui_cpp::Settings& instance_settings) { } } // namespace PLUGINLIB_DECLARE_CLASS(rqt_mypkg, MyPlugin, rqt_mypkg::MyPlugin, rqt_gui_cpp::Plugin)
{ "domain": "robotics.stackexchange", "id": 25168, "lm_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, plugin, gui, rqt", "url": null }
java, parsing, file, serialization //skip the first byte inStream.read(); int bytesToRead = 0; while((bytesToRead = inStream.read())!= -1) { byte[] payBytes = new byte[bytesToRead]; // inStream.read(payBytes); // May not read all bytes requested - prefer the loop below int offset = 0; while(bytesToRead > 0) { int bytesRead = inStream.read(payBytes, offset, bytesToRead); offset += bytesRead; bytesToRead -= bytesRead; } Message m = parsers.messageIn(payBytes, stock); if (!m.isEmpty()) { //process the message } } } }
{ "domain": "codereview.stackexchange", "id": 43135, "lm_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, parsing, file, serialization", "url": null }
javascript, game, node.js, electron I'm leaving out index.js (the script that starts electron) and the CSS, since it doesn't seem relevant. index.html <!DOCTYPE html> <html lang="en-US"> <head> <title>ProceduralTA</title> <link rel="stylesheet" href="css/styles.css"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="log"></div> <div id="input-prefix">&gt</div> <div id="input-wrapper"> <form onsubmit="newInput(); return false"> <label> <input id="input-box" type="text" placeholder="You can type here!" autocomplete="off"> </label> </form> </div> <script src="js/game.js"></script> <script src="js/input-handler.js"></script> <script src="js/map.js"></script> <script src="js/player.js"></script> <script src="js/room.js"></script> </body> </html> game.js 'use strict'; const {ipcRenderer} = window.require('electron'); window.$ = window.require('jquery'); const inputBox = $('#input-box'); const log = $('#log');
{ "domain": "codereview.stackexchange", "id": 40351, "lm_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, game, node.js, electron", "url": null }
javascript, object-oriented, playing-cards From here, you can tell from looking at the data what cards are in the deck, how many players there are, who are the players, what cards they have. You can easily serialize this data structure, use it for logging, debugging, reporting. Now let's take a state transition. For instance, shuffling the deck would be like: const previousState = { phase: 'start', // start, in-game, end, etc. winner: null, deck: [ ...values... ], players: [ { name: 'player1', hand: [/* empty hand */] }, { name: 'player2', hand: [/* empty hand */] }, ] } function shuffleDeck(state){ return { // Copy everything over ...state, // But override deck deck: state.deck.reduce((shuffled, card) => { // For each card in the previous state's deck, insert them in random // positions in the array and return that array. shuffled.splice(Math.floor(Math.random() * shuffled.length), 0, card); return shuffled; }, []); } } const newState = shuffleDeck(state);
{ "domain": "codereview.stackexchange", "id": 24433, "lm_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, playing-cards", "url": null }
convolution, frequency-domain, dct Title: Convolution Theorem using DCT I am trying to digest this paper. [2002] Anna Usakova. Using Of Discrete Orthogonal Transforms For Convolution So far, I've been successful with DFT and DHT. Could someone give a hand with DCT? I am trying to reproduce the convolution theorem for DCT-I and DCT-II. But my results never match the same as the result I get with DFT and DHT. I am reading reference 9 of the paper RAO, K. R.—YIP, P.: Discrete Cosine Transform — Algo- rithms, Advantages, Applications, Academic Press, Inc., Lon- don, 1990. But it puts the conv. theorem of DCT-II in other terms. I have also read other works, such as [1994] Martucci. Symmetric Convolution and the Discrete Sine and Cosine Transforms [2011] Roma. A tutorial overview on the properties of the discrete cosine transform for encoded image and video processing
{ "domain": "dsp.stackexchange", "id": 9875, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "convolution, frequency-domain, dct", "url": null }
electromagnetism, charge Consider a positive charge of magnitude $q$. It has got an electrostatic field (more precisely, an electromagnetic field) of its own. Don't ask why. It's their property and we cannot question that. This electrostatic field originates from the positive charge $q$ and diverges out in space. If you consider a negative charge, but of same magnitude, you can see that the number of field lines passing through a given area placed at the same distance from the charges are the same, except the point that the electric field due to a negative charge do not diverge, but they converge into the charge. So, what I actually want you to focus upon is that the electric field has got a particular magnitude and direction. Hence it's a vector quantity. Charges on the other hand are scalar quantities.
{ "domain": "physics.stackexchange", "id": 37682, "lm_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, charge", "url": null }
ros2 And then use: ros2 run pkg_name exe_name --ros-args param:=1. So it was important to specify the parameter type. Nevertheless, I had a problem with string parameters, so I surrounded the 2 functions with a try-catch: try { this->declare_parameter<std::string>("calib", "no"); this->get_parameter_or("calib", calib, std::string("no")); } catch (std::exception e) { std::cout << e.what() << "\n"; } And I found out a strange behaviour: if I use ros2 run pkg_name exe_name --ros-args -p "calib:=yes" I get an exception that says: parameter 'calib' has invalid type: expected [string] got [bool]. While using something else ros2 run pkg_name exe_name --ros-args -p "calib:=ok" The param is read correctly. So it seems that true, false, yes and no are recognised as bool. In fact, using: try { this->declare_parameter<bool>("calib", false); this->get_parameter_or("calib", calib, false); } catch (std::exception e) { std::cout << e.what() << "\n"; }
{ "domain": "robotics.stackexchange", "id": 37908, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2", "url": null }
fft, sparse-fourier-transform This idea of a known sparsity pattern of the coefficients / signal leading to more efficient computation is also exploited in RFFT, DCT and DST. My question is the following: Suppose I know a periodic sparsity pattern for the coefficients, how can I use this kind of trick to avoid redondant computation. Related question: I've heard of "sparse" fast Fourier transforms. Is this what I'm describing or is this something else? Are "sparse" fast Fourier transform algorithms the answer to my question? Where can I read/learn more about them? The simplest way is to just do an FFT over $M$ samples and than expand to the desired FFT length by inserting zeros between samples and dividing by the ratio of the FFT length to the period $R = N/M$ $$C_{k,N} = \frac{M}{N}\begin{cases} C_{k/R,M} & k = r \cdot R, r \in \mathbb{Z} \\ 0 & \text{otherwise} \end{cases} $$
{ "domain": "dsp.stackexchange", "id": 12194, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, sparse-fourier-transform", "url": null }
c++, makefile Object files depend on headers This is the biggest thing that I think could be improved; I think it's probably a whole question in itself. Your object files naturally depend on the corresponding C++ source files, but they also need rebuilding when their headers change. Consider including generated makefiles that tell make how the object files depend on the headers; for a suitable recipe, see the Stack Overflow question "Makefile, header dependencies", and for a longer exposition, read "Auto-Dependency Generation" by Paul D. Smith. I normally use something like -include $(OBJS:.o=.d)
{ "domain": "codereview.stackexchange", "id": 24707, "lm_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++, makefile", "url": null }
ros, ros-kinetic, navsat-transform The transforms are shown here C:\fakepath\frames.jpg And the topics shown here. C:\fakepath\rosgraph.png I was somewhat concerned that the IMU was not being used by the NAVSAT Transform node but this topic was discussed in this thread so I do not think it is related. https://answers.ros.org/question/287090/navsat_transform_node-does-not-subscribe-to-imu-topic/ Originally posted by billy on ROS Answers with karma: 1850 on 2018-07-29 Post score: 0 NaN values indicate a problem with the sensor data. Offhand, your IMU driver is not filling out the orientation field of your IMU message (you have an invalid, all-zero quaternion). navsat_transform_node needs an earth-referenced heading, so it won't work if your IMU doesn't have a magnetometer. Originally posted by Tom Moore with karma: 13689 on 2018-07-30 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 31400, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, navsat-transform", "url": null }
context-free, formal-grammars, compilers, parsers, lr-k Title: Reduce-reduce conflict in SLR vs LALR I was wondering if I could say any of the following is true. Given a grammar $G$, If the LALR parser has reduce-reduce conflict for $G$, then the SLR parser also has reduce-reduce conflict for $G$. If the SLR parser has reduce-reduce conflict for $G$, then the LALR parser also has reduce-reduce conflict. The LALR parser has reduce-reduce conflict for $G$ if and only if SLR also has reduce-reduce conflict for $G$.
{ "domain": "cs.stackexchange", "id": 19435, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "context-free, formal-grammars, compilers, parsers, lr-k", "url": null }
haskell I feel like I must be missing some obvious abstractions, because all these operations seem trivial and necessary, but the wrapping adds a lot of boilerplate. The full code is here: http://hpaste.org/73124 I think the is* functions are a bad idea - Haskell has pattern matching for this. Also you can 'unwrap' your World when necessary and get unwrapped data from it. data Cell = Wall | Crate | Storage | Worker | Empty cellContents coords world = bar where f x = S.member coords (x ^$ world) bar | f wCrates = Crate | f wWalls = Wall | f wStorage = Storage | coords == (wWorker ^$ world) = Worker | otherwise = Empty With this approach toChar can be just toChar :: World -> Coord -> Char toChar2 coords world = case cellContents coords world of Wall -> '#' Worker -> '@' Crate -> 'o' Storage -> '.' _ -> ' ' If you have already unpacked current world, you can use let char = toChar2 coords world
{ "domain": "codereview.stackexchange", "id": 2325, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "haskell", "url": null }
Then, a strategy is to write out one part or the other for the $n=k+1$ case, and manipulate it so that you pull out the $n=k$ expression. Let's do the sum: $$\sum_{j=1}^{k+1} j^3 = \sum_{j=1}^{k} j^3 + (k+1)^3.$$ This is just algebra; I pulled out the last term and wrote it explicitly. But now I can substitute in the assumption for the sum on the right hand side. The rest is to manipulate the expression on the right hand side to come up with the expression $$\frac{(k+1)^2(k+2)^2}{4},$$ and then you're done. Can you take it from here? Show that: $$1^3 + 2^3 + 3^3 + ... + n^3= \frac{n^2(n+1)^2}{4}$$ $(1)$ First step is to evaluate the expression for $n=1$, $$1^3=\frac{1\times(1+1)^2}{4}$$ Which is $1=1$, which means we can proceed. $(2)$ Now assume it is true for $n$, $$1^3 + 2^3 + 3^3 + ... + n^3= \frac{n^2(n+1)^2}{4}$$ $(3)$ Lastly prove for $n+1$ and you have proved it for all $n\in\mathbb N$, $$1^3 + 2^3 + 3^3 + ... +n^3+ (n+1)^3= \frac{(n+1)^2(n+2)^2}{4}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850832642353, "lm_q1q2_score": 0.8105162236601872, "lm_q2_score": 0.8244619285331332, "openwebmath_perplexity": 226.9562218363893, "openwebmath_score": 0.888282835483551, "tags": null, "url": "https://math.stackexchange.com/questions/2055695/use-mathematical-induction-to-prove-equation" }
console, assembly Title: BIOS Video Service INT 10H (functions 9 and 13H) functionality On the way to protected or long modes, real mode code needs to provide a lot of visual feedback. Video services INT 10H provide this functionality, but lack fluidity. This algorithm provides write character and attribute AH = 9 and write string AH = 13H functionality, reading NULL terminated strings. ENTER ; BH = Video page ; BL = Attribute ; CX = Repeat count or NULL to read string to EOS ; DH = Row (0 - 24) ; DL = Column (0 - 79) ; DS:SI = Pointer to ASCIIZ string or character to be repeated CX times LEAVE ; CX = Number of characters displayed ; ES:SI = Points to the next position after null. Might be next string To achieve a result like this: The string would be defined as: Title: db 'Proto_Sys 1.00.0', 0, 0xc4
{ "domain": "codereview.stackexchange", "id": 26297, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "console, assembly", "url": null }
java, array Title: Simple Java ArrayList stores and shows not repeated elements entered by user Is this good code? I do believe I improved quite a lot since last year, still I would really appriciate some feedback :) import javax.swing.JOptionPane; import java.util.ArrayList ; public class IfNotRepeated { /* * 7.12 (Duplicate Elimination) Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it’s not a duplicate of a number already read. Provide for the “worst case,” in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user enters each new value. */ final static int ELEMENTS = 5 ; final static int UPPER_BOUND = 100 ; final static int LOWER_BOUND= 10 ; public static void main(String[] args) {
{ "domain": "codereview.stackexchange", "id": 24817, "lm_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, array", "url": null }
performance, algorithm, c, error-handling, tic-tac-toe void pressToContinue(void){ puts("\nPress ENTER to continue"); getchar(); getchar(); } void resetGrid(char grid[][3]){ size_t column = 0; size_t row = 0; char first = '1'; for (row = 0 ; row < 3; row++){ for(column = 0; column < 3 ; column++){ grid[row][column] = first; first++; } } } void resetVars(int *nX_ptr, int *nO_ptr, int *result_ptr){ *nX_ptr = 0; *nO_ptr = 0; *result_ptr = 0; }
{ "domain": "codereview.stackexchange", "id": 45391, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, algorithm, c, error-handling, tic-tac-toe", "url": null }
matrix, swift, ios, pathfinding currentPosition = currentPosition.walk(increment: walkingIncrement) } return true } Do you have any advice for me to solve this more practical ? As asked in the comments I provided a sample playground with a self contained example to better understand the problem and to get a compilable example:Playground Gist At several places in your code the explicit type annotation is not needed, for example var from: Int = start.column var to: Int = move.end.column + 1 can be simplified because the compiler infers the type automatically: var from = start.column var to = move.end.column + 1
{ "domain": "codereview.stackexchange", "id": 32475, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matrix, swift, ios, pathfinding", "url": null }
# Homework Help: Sequence Convergence Proof 1. Mar 22, 2010 1. The problem statement, all variables and given/known data Let $$X=(x_n)$$ be a sequence of strictly positive numbers such that $$\lim(x_{n+1}/x_n)<1$$. Show for some $$0<r<1$$, and for some $$C>0$$, $$0<x_n<Cr^n$$ 2. Relevant equations 3. The attempt at a solution Let $$\lim(x_{n+1}/x_n)=x<1$$ By definition of the limit, $$\lim(x_{n+1}/x_n)=x \Rightarrow \forall \epsilon>0$$ there exists $$\: K(\epsilon)$$ such that $$. \: \forall n>K(\epsilon)$$ $$|\frac{x_{n+1}}{x_n}-x|<\epsilon$$ Since i can pick any epsilon, let epsilon be such that $$\epsilon + x = r <1$$. Also, I know that since this is a positive sequence, $$\frac{x_{n+1}}{x_n}>0$$. Therefore, for large enough $$n$$, $$0<\frac{x_{n+1}}{x_n}<r<1.$$ From here I am not sure where to go, any hints would be much appreciated! I cannot find out what this tells me about $x_n$ 2. Mar 22, 2010 ### jbunniii For large enough $n$ you also have the following:
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759677214397, "lm_q1q2_score": 0.8375824960778737, "lm_q2_score": 0.8539127510928476, "openwebmath_perplexity": 230.616213655558, "openwebmath_score": 0.9545565843582153, "tags": null, "url": "https://www.physicsforums.com/threads/sequence-convergence-proof.388851/" }
parallelogram with 4 right angles and that its angles. Equal and parallel, its opposite angles a two-dimensional object is known its! Of both a rhombus with sides AB = DC ) no right.... In sexuality studies the interior angles of a parallelogram may be equiangular ( four identical angles ) equilateral. Photos, illustrations and vectors in the figure below, side BC is equal to AD in.! Angle, then create an inscribed quadrilateral its sides, angles, and angles B '' are the solutions. 2020 at the fundamental properties of parallelograms are quadrilaterals that have two sets of parallel sides the diagonal of circle! ) Interactive Video Lesson with notes on how to determine the area the. Making it a regular quadrilateral is also a Type of rectangle and parallelogram are of following types according to special... Address will not be published and multi-sided shapes and their properties with this BBC Bitesize GCSE Maths Edexcel guide. Particular crossword clue Type of parallelogram and also
{ "domain": "com.br", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9585377261041521, "lm_q1q2_score": 0.8108677328268771, "lm_q2_score": 0.8459424295406088, "openwebmath_perplexity": 1170.6445476133808, "openwebmath_score": 0.4068468511104584, "tags": null, "url": "https://d3system.com.br/5dd73/k510st.php?page=4e7070-types-of-parallelogram" }
python, performance, cython self.assertAlmostEqual(team_result3.points, Points(7.45)) if __name__ == '__main__': unittest.main() Though it's really outside of the scope of your question, given your priorities you shouldn't be using generators or classes at all. This is an example that should get you started down the path to vectorization; it's not exactly the same as what you do because you have piecewise operations and floor division in some places. The less of that you do the better. positions = np.array( ( # Goalkeep defender midfield forward (-1.0, -1.0, -1.0, -1.0), # yellow-card booked (-0.5, -0.5, 0.0, 0.0), # goals-against ( 0.0, 0.0, 1.0, 1.0), # finished game ( 0.0, 6-0.6, 5-0.4, 4-0.4), # goals, subtracting shot coefficient ( 0.5, 0.0, 0.0, 0.0), # saves ( 0.0, 3.0, 3.0, 3.0), # assists ( 0.0, 0.6, 0.4, 0.4), # shots ) )
{ "domain": "codereview.stackexchange", "id": 41809, "lm_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, cython", "url": null }
quantum-mechanics, angular-momentum, quantum-spin Title: Is $\boldsymbol{\nabla}\cdot\mathbf{S}$ zero? There exists a classical definition of the orbital angular momentum, $$\mathbf{L}=\mathbf{r}\times\mathbf{p}$$ Due to this definition, the following quantity is identically zero, $$\boldsymbol{\nabla}\cdot\mathbf{L}=0$$ because the divergence of a curl is zero. I presume this result carries over to quantum mechanics as well, that is, $$\langle\phi|\boldsymbol{\nabla}\cdot\mathbf{\hat{L}}|\psi\rangle=0$$ and is true for any two arbitrary states $|\phi\rangle$ and $|\psi\rangle$. Now I am not sure whether there exists any relationship analogous to $\mathbf{L}=\mathbf{r}\times\mathbf{p}$ for spin angular momentum. So my questions are these, What is $\boldsymbol{\nabla}\cdot\mathbf{S}$? Does it identically vanish? What is the quantum version of it, i.e., what is $\langle\phi|\boldsymbol{\nabla}\cdot\mathbf{\hat{S}}|\psi\rangle$?
{ "domain": "physics.stackexchange", "id": 66071, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, angular-momentum, quantum-spin", "url": null }
Once we add the rescaling and the frame ticks, the Image approach de-facto converges to the built-in function ArrayPlot. This is another easy-to-use way of getting a fast plot of a large matrix. You would use it like this: ArrayPlot[m, ColorFunction -> "LakeColors", DataReversed -> True]. I just tried this with the last example matrix, and it works nicely. One more observation According to this linked answer, when using ColorFunction, ArrayPlot isn't as fast as the direct creation of a Raster image. The solution proposed there is not Image as I used here, but instead something like this: Graphics[Raster[Rescale[...], ColorFunction -> "LakeColors"]] To try this with my frame construction, you would have to write it like this (where s is the same as defined in Edit 3):
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9124361700013356, "lm_q1q2_score": 0.8164382766080901, "lm_q2_score": 0.8947894696095783, "openwebmath_perplexity": 2742.378608255836, "openwebmath_score": 0.3761099874973297, "tags": null, "url": "http://mathematica.stackexchange.com/questions/7552/plotting-large-datasets/7555" }
newtonian-mechanics, forces, equilibrium Having established that, calculating the tension on an ideal string needs us to find the strain on the spring. Strain is $$\epsilon = \frac{\Delta{L}}{L_0}$$ where $L_0$ is the length of the unstrained spring (i.e. without force). This makes the calculations trivial: You first calculate $L_0$ from the first configuration with tension $T$, then use this length to find the final strain and tension $T'$.
{ "domain": "physics.stackexchange", "id": 58084, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, forces, equilibrium", "url": null }
April 7th, 2014, 09:36 PM #7 Senior Member     Joined: Apr 2014 From: Greater London, England, UK Posts: 320 Thanks: 156 Math Focus: Abstract algebra In general … Lemma: Take a number and swap any two of its digits. Then the difference between the old and new numbers is divisible by 9. Proof: Similar to the one by MarkFL. Corollary: Take a number and permute its digits in any way. Then the difference between the old and new numbers is divisible by 9. Proof: Follows from the fact that any permutation is a product of transpositions. For example: $$321-123\,=\,198\,=\,9\times22$$ $$321-132\,=\,189\,=\,9\times21$$ $$321-213\,=\,108\,=\,9\times12$$ $$321-231\,=\,90\,=\,9\times10$$ $$321-312\,=\,9\,=\,9\times1$$ $$321-321\,=\,0\,=\,9\times0$$ Thanks from MarkFL, agentredlum and nicksona
{ "domain": "mymathforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.982287697666963, "lm_q1q2_score": 0.8227837872933923, "lm_q2_score": 0.8376199653600372, "openwebmath_perplexity": 1083.779786212904, "openwebmath_score": 0.6599670052528381, "tags": null, "url": "http://mymathforum.com/algebra/42675-divisibility-3-a.html" }
php, mysql, database * * @return string */ protected function queryBuilder() { $query = null; if(!empty($this->insert)) { $query = $this->insert; } if(!empty($this->select)) { $query = $this->select; } if(!empty($this->update)) { $query = $this->update; } if(!empty($this->delete)) { $query = $this->delete; } if(!empty($this->where) OR !empty($this->orWhere)) { $query .= " WHERE "; } if(!empty($this->where)) { $query .= implode(" AND ", $this->where); } if(!empty($this->orWhere)) { if(!empty($this->where)) { $query .= " OR "; } $query .= implode(" OR ", $this->orWhere); } if(!empty($this->groupBy)) {
{ "domain": "codereview.stackexchange", "id": 19167, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, mysql, database", "url": null }
java, performance, concurrency /* If the string builder was too large, it might have been discarded */ if (null == poolEntry.stringBuilder) { poolEntry.stringBuilder = new StringBuilder(INITIAL_STRING_BUILDER_CAPACITY); } else { poolEntry.stringBuilder.setLength(0); } recycle(poolEntry.charBuffer); recycle(poolEntry.byteBuffer); return poolEntry; } private CharsetEncoder createCharsetEncoder(Charset charset) { final CharsetEncoder charsetEncoder = charset.newEncoder(); /* * Preserve the behaviour of the old URLEncoder */ charsetEncoder.onMalformedInput(CodingErrorAction.REPLACE); charsetEncoder.onUnmappableCharacter(CodingErrorAction.REPLACE); return charsetEncoder; }
{ "domain": "codereview.stackexchange", "id": 26935, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, concurrency", "url": null }
gas-laws, concentration I found out the molar mass of the gas $68.75 \times 2$. But don't know how to proceed from here? I would express equivalent weight $M_\mathrm{eq}(\ce{E})$ of unknown element $\ce{E}$ using the number of equivalents $x$ and corresponding molecular weights $M$: \begin{align} M(\ce{ECl_x}) &= x \cdot M_\mathrm{eq}(\ce{E}) + x \cdot M(\ce{Cl}) \tag{1} \\ \to \quad M_\mathrm{eq}(\ce{E}) &= \frac{M(\ce{ECl_x}) - x \cdot M(\ce{Cl})}{x} \tag{1a} \end{align} To find $x$, let's apply to the balanced reaction, assuming it is complete and there is no chlorine left: $$\ce{E (s) + x/2 Cl2 (g) -> ECl_x (g)}$$ The amounts $n$ of gaseous products are bound by stoichiometry: $$n(\ce{Cl2}) = \frac{x}{2}n(\ce{ECl_x}) \tag{2}$$ At constant temperature and pressure $n_i V_i = \mathrm{const}$. The problem says the volume of the system reduces by $1/3$, which means: \begin{align} V(\ce{Cl2}) &= \frac{3}{2}V(\ce{ECl_x}) \tag{3} \\ \to \quad n(\ce{Cl2}) &= \frac{3}{2}n(\ce{ECl_x}) \tag{3a} \end{align}
{ "domain": "chemistry.stackexchange", "id": 9375, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gas-laws, concentration", "url": null }
javascript, object-oriented, ecmascript-6, hangman Function blocks do not need to be terminated with }; There is no need to split the string into an array. String have array like properties in JavaScript. The keyword this is both a danger (can be replaced by code outside the Object) and noisy as it turns up all over the place. In Good OO JavaScript you seldom need to use this. The example does not use this window is the default this. Avoid using it randomly. Learn to use the ternary operator ? as it can remove a lot of noise from the code. Unique to JavaScript is the fact that expressions and statements are evaluated in a known order. This introduces the ability to use the shortcircuit style to replace the messy and rather old fashioned if () { } else if () { } See example there is only one if statement in the whole thing. The prototype can be assigned with an object literal eg eg Hangman.prototype = { getPuzzle() { }, makeGuess() { }, ... etc ... } OO coding
{ "domain": "codereview.stackexchange", "id": 40291, "lm_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, ecmascript-6, hangman", "url": null }
organic-chemistry, bond, covalent-compounds $\ce{C^{4-}}$ ions: In gas form this does not happen. Carbon's first electron affinity is positive, so we would expect to see it form $\ce{C-}$ ions in the gas phase if given free electrons to attract. Adding a second electron to this substance would require it to attract an electron against its already negative overall charge, and that is not energetically favorable. In order to make the $\ce{C^{4-}}$ion in a compound, a species would have to donate 4 electrons to carbon. The attraction of carbon's nucleus to other atoms' electrons is just too low for that to happen. The best candidates for a cation in an ionic compound of this type would be either lithium or cesium, however, when we try to actually make this compound we get another class of ions, the carbides, which feature $\ce{C2^{2-}}$ ions. In short, it doesn't happen.
{ "domain": "chemistry.stackexchange", "id": 2040, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, bond, covalent-compounds", "url": null }
filters, noise, estimation, linear-systems, adaptive-filters We have a system $ G \left( f \right) $ which is unknown yet can be defined by $ {N}_{p} $ poles and $ {N}_{z} $ zeros. The signal $ x \left( t \right) $ is an IID White Noise. This signal samples can not be accessed. The signal $ y \left( t \right) $ is the colored noise (Filtered). This signal samples are available. The filter $ H \left( f \right) $ is adaptive (Time changing). Its model, which is to be determined, is given by $ {N}_{z} $ poles and $ {N}_{p} $ zeros. The signal $ z \left( t \right) $ is the result of the $ H \left( f \right) $ Filter. This signal samples are available. How can one set the parameters (Poles and Zeros) of $ H \left( f \right) $ such that $ z \left( t \right) $ is White Noise? This means how to adaptively set the parameters of $ H \left( f \right) $ to be the inverse filter of $ G \left( f \right) $.
{ "domain": "dsp.stackexchange", "id": 3507, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, noise, estimation, linear-systems, adaptive-filters", "url": null }
the points (1, 3) and (2, 5) is Now that you have worked through the lesson and practice, you are able to apply the Distance Formula to the endpoints of any diagonal line segment appearing in a coordinate, or Cartesian, grid. The only true failure is not trying at all. Midpoint formula. Find the distance between the two points (5,5) and (1,2) by using the distance formula. These points can be in any dimension. (2, 5) = [ (x + (-5)) / 2 , (y + 6) / 2 ] Equate the coordinates. Comparing the distances of the (alleged) midpoint from each of the given points to the distance of those two points from each other, I can see that the distances I just found are exactly half of the whole distance. How can we use this? How can I apply the Distance Formula to this? Midpoint formula review. Distance between two points. The formula , which is used to find the distance between two points (x 1, y 1) and (x 2, y 2), is called the Distance Formula.. Those are your two points. Donate or volunteer today!
{ "domain": "maconneriemariopasquale.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9591542840900507, "lm_q1q2_score": 0.8333389261898744, "lm_q2_score": 0.8688267779364222, "openwebmath_perplexity": 731.5304579916493, "openwebmath_score": 0.6780861020088196, "tags": null, "url": "http://maconneriemariopasquale.com/you-dropped-waun/distance-formula-examples-8b41bd" }
javascript, jquery, optimization "K5a_v0MP_Fk", "dX_1B0w7Hzc", "xDj7gvc_dsA", "17CLlZuiBkQ", "0kRAKXFrYQ4", "gJ1Mz7kGVf0", "-6G6CZT7h4", "liLU2tEz7KY", "eHCyaJS4Cbs", "uEIPCOwY4DE", "V2XGp5ix8HE", "DrQRS40OKNE", "BBcYG_J3O2Q", "upxzaVMhw8k", "0XcN12uVHeQ", "itvJybdcYbI", "l7iVsdRbhnc", "51V1VMkuyx0", "aQQeg3jYgOA", "XGK84Poeynk", "MaCZN2N6Q_I", "9q5pZ49r9aU", "DFM140rju4k", "qHBVnMf2t7w", "YtO-6Xg3g2M"]; var updateTimer = setInterval(getList, timer); // Update the streams list every minute
{ "domain": "codereview.stackexchange", "id": 6618, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, optimization", "url": null }
newtonian-mechanics, forces, spring CASE 1 ( when net force on $m_{2}$ is upwards) In this case, block $m_{2}$ will decelerate and block $m_{1}$ accelerate, the spring will first stretch ( when $ \vec{V_{2}} > \vec{V_{1}}$) then elongation of spring stop ( when $ \vec{V_{2}} = \vec{V_{1}}$) and then the spring will shrink ( when $ \vec{V_{2}} < \vec{V_{1}}$ as the block $m_{1}$ accelerates and the block $m_{2}$ decelerates ) and so on ... the motion will continue. I hope you will be able to figure out the rest of the motion in this case. Here I have created a simulation for your help. Heavier block is on the right side.
{ "domain": "physics.stackexchange", "id": 82425, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, forces, spring", "url": null }
c++, performance, c++17, queue constexpr bool full() const noexcept {return theSize == N;} //Check if queue is full constexpr bool empty() const noexcept {return !theSize;} //Check if queue is empty constexpr Idxtype size() const noexcept {return theSize;} //Returns the queue's current size //Returns the max number of elements the queue may hold constexpr std::size_t capacity() const noexcept {return N;} //Returns the element next to be popped. Undefined behavior if queue is empty constexpr const T& front() const {return theArray[head].value;} constexpr T& front() {return theArray[head].value;} //Returns the element last to be popped. Undefined behavior if queue is empty constexpr const T& back() const {return theArray[tail - 1].value;} constexpr T& back() {return theArray[tail - 1].value;} protected: Idxtype head{0}, tail{0}, theSize{0}; Cell<T, std::is_trivially_destructible<T>::value> theArray[N];
{ "domain": "codereview.stackexchange", "id": 38715, "lm_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, c++17, queue", "url": null }
php <?php // A mockup of the original ExceptionModel inheriting from Enum class ExceptionModel { const NO_EXCEPTIONS = 'no_exception'; const ALLER = 'aller'; const AVOIR_IRR = 'avoir_irr'; const ETRE_IRR = 'etre_irr';
{ "domain": "codereview.stackexchange", "id": 16980, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php", "url": null }
c#, overloading static string PrintArray(string[] inputArray) { string s = String.Join(", ", inputArray); return s; } static string PrintArray(double[] inputArray) { string s = String.Join(", ", inputArray); return s; } I end up copying and pasting the same code and change the argument type This is precisely why generic types have been invented. At their very core, generic type parameters are "type variables" where the caller (i.e. not the generic class/method itself) can decide what the specific type is. That String.Join method you are using already does this, as per the MSDN documentation. This is why you're able to pass in any kind of arrays. You can rework your methods to be a single generic method as well: static string PrintArray<T>(IEnumerable<T> inputArray) { string s = String.Join(", ", inputArray); return s; }
{ "domain": "codereview.stackexchange", "id": 43059, "lm_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#, overloading", "url": null }
type-theory In case one can spare $\mathbb N$ and the specification is just not minimal, are there other items one could, in principle, drop? E.g. I could imagine $\bf 2$ and then $+$ coming from some combination of $\Pi, \Sigma, {\bf 0}, {\bf 1}$, but I was not able to do it. The purpose of the system described in the appendix of the HoTT book is to present something that corresponds to what is used by the book. The book is aiming to be educational. Therefore it would be a bad idea to do everything in a minimalist way. For example, we introduce $\mathbb{N}$ separately because it is instructional to see how inductive constructions work in a familiar case. You are perfectly correct, to jump-start inductive types from general $W$-types you just need $0$ and $2$. You immediately get $1$ as $0 \to 0$, and you get $+$ from $2$ and $\Sigma$. Once you have that, you get all finite sums $1 + 1 + \cdots + 1$. At this point it is easy to do the usual algebraic datatypes.
{ "domain": "cstheory.stackexchange", "id": 2925, "lm_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 }
features of the distribution. The term "skewness" as applied to a probability distribution seems from an initial look to originate with Karl Pearson, 1895$^{\text{[1]}}$.He begins by talking about asymmetry.. $$\skw(X)$$ can be expressed in terms of the first three moments of $$X$$. Suppose that $$Z$$ has the standard normal distribution. Second (s=2) The 2nd moment around the mean = Σ(xi – μx) 2 The second is the Variance. Skewness is a measure of the symmetry, or lack thereof, of a distribution. We will compute and interpret the skewness and the kurtosis on time data for each of the three schools. For selected values of the parameter, run the experiment 1000 times and compare the empirical density function to the true probability density function. For $$n \in \N_+$$, note that $$I^n = I$$ and $$(1 - I)^n = 1 - I$$ and note also that the random variable $$I (1 - I)$$ just takes the value 0. Open the gamma experiment and set $$n = 1$$ to get the exponential distribution. Suppose that
{ "domain": "oldfartsbikegang.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808724687407, "lm_q1q2_score": 0.8211028244800265, "lm_q2_score": 0.8376199592797929, "openwebmath_perplexity": 647.6766546311429, "openwebmath_score": 0.8420978784561157, "tags": null, "url": "http://oldfartsbikegang.com/fqr2ca/eac088-skewness-and-kurtosis-formula" }
species-identification Title: What insect is this? (England) Found this in my room and haven't seen anything like it before. It was about 4-5cm long and has wings. Flew away before I could get a better picture. Photo taken from the Midlands, UK I think i have an answer it is this nice guy. Latin name is Leptoglossus occidentalis. Short description of Leptoglossus occidentalis: Western Conifer Seed Bug The Western Conifer Seed Bug Leptoglossus occidentalis is a large and conspicuous squashbug, reaching a length of 20mm when adult. It is easily distinguished from all other GB coreids by its reddish-brown body, transverse white zigzag line across the centre of its wings and characteristic leaf-like expansions on the hind tibiae.
{ "domain": "biology.stackexchange", "id": 9175, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "species-identification", "url": null }
general-relativity, spacetime, variational-principle, geodesics Title: What is the parameter $\lambda$ that parameterizes a spacetime trajectory $x^\mu(\lambda)$? In Newtonian mechanics, the trajectory of a particle in three-dimensional space is parameterized as $x^i(t)$ where the parameter $t$ represents time. In relativity, one uses the proper time $\tau$ to parameterize a path in the spacetime i.e., in the form $x^\mu(\tau)$. But sometimes, the path is spacetime is also parameterized as $x^\mu(\lambda)$ where $\lambda$ is a continuous parameter. For example, see here. In this case, the proper time taken by a particle, to go from a spacetime point $A$ to point $B$ is given by $$\tau=\int\limits_{A}^B\Big(g_{\mu\nu}(x)\frac{dx^\mu}{d\lambda}\frac{d x^\nu}{d\lambda}\Big)^{1/2}d\lambda.$$
{ "domain": "physics.stackexchange", "id": 46433, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, spacetime, variational-principle, geodesics", "url": null }
the! For creating Demonstrations and anything technical a purely real number without regard to its sign 're getting hang. Number = > z is expressed as a complex number we have equate! > OM/MP == > PM/OP == > PM/OP == > PM/OP == > PM/OP == >.... == > PM/OP == > OM/MP == > PM/OP == > x/r Mathematical! The principal argument using a diagram and some trigonometry + bi is the imaginary part + b where... Alerts and government job alerts in India, join our Telegram channel to identify the rectangular coordinates and line! Xi Classes Maths All Topics Notes help you try the next example on to... Task is to find modulus // of a complex numbers a phasor,! // function to find the modulus and argument of the given complex number is of. Π/2, –π/2 = > z = a + bi is the length of the complex corresponding! Addition to, we would calculate its modulus the traditional way θ = side/hypotenuse! Getting the hang of this complex number. by z from the positive x-axis Maths All Topics Notes to them. − 3i ), b
{ "domain": "christwire.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9603611654370415, "lm_q1q2_score": 0.816279310667278, "lm_q2_score": 0.8499711775577736, "openwebmath_perplexity": 691.5255625589425, "openwebmath_score": 0.7691668272018433, "tags": null, "url": "http://christwire.org/180vgm76/modulus-of-a-complex-number" }
c#, beginner File.Delete("utilities.txt"); File.Move("temp.txt", "utilities.txt"); SetStartUp(); } shouldChange = true; } private void HelpToolStripMenuItem_Click(object sender, EventArgs e) { MessageBox.Show ("Common applications and their .exe's :\n\n" + "Microsoft Edge: microsoftedge.exe\n" + "Gyazo: gystation.exe\n" + "Hearthstone: hearthstone beta launcher.exe", "Help with Startup Manager"); } #endregion Miscellaneous utilities /// <summary> /// Region ends /// </summary> #endregion GUI utilities /// <summary> /// Region ends /// </summary> } } This is quite a lot of code to review, I can't go in-depth on everything here. I'll review it as I scroll through. Long and clear method names are good.
{ "domain": "codereview.stackexchange", "id": 30288, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner", "url": null }
electric-fields, charge, classical-electrodynamics $$\mathbf{E\cdot}dA\hat{z} - \mathbf{E}\cdot{dA\hat{z}} = \frac{\sigma dA}{\epsilon_0}. $$ It immediately follows that $$ E_1^\perp - E_2^\perp = \frac{\sigma}{\epsilon_0}.$$ Griffiths refers to these as $E^{\perp}_{abv.} $ and $E^{\perp}_{bel.}$respectively.
{ "domain": "physics.stackexchange", "id": 54312, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-fields, charge, classical-electrodynamics", "url": null }
python, programming-challenge, circular-list You can see that for each doubling of n, the runtime increases by roughly four times, which is what we expect for an \$ O(n^2) \$ algorithm. 4. Making it linear How can we speed this up? Well, we could avoid the expensive del operation by making a list of the survivors, instead of deleting the deceased. Consider a single trip around the circular firing squad. If there are an even number of people remaining, then the people with indexes 0, 2, 4, and so on, survive. But if there are an odd number of people remaining, then the last survivor shoots the person with index 0, so the survivors are the people with indexes 2, 4, and so on. Putting this into code form: def survivor2(n): """Return the survivor of a circular firing squad of n people.""" persons = list(range(1, n + 1)) while len(persons) > 1: if len(persons) % 2 == 0: persons = persons[::2] else: persons = persons[2::2] return persons[0]
{ "domain": "codereview.stackexchange", "id": 12907, "lm_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, programming-challenge, circular-list", "url": null }
ruby, tic-tac-toe, ai def draw? @board.all &:taken? end def display_board @board.each.with_index(1) |field, idx| print "#{field.owner || idx} | " print "\n-----------\n" if idx % 3 == 0 end end It's more verbose and still not ideal, as @owner is still a Symbol, but #draw? and #display_board now telegraph how they work much better (although #each_slice definitely looks better than a modulo, reader now doesn't need to scroll through code to find what #display_board actually prints. This would apply to other parts of code, i.e. if @board.include?(position) vs. if @board[position].empty?
{ "domain": "codereview.stackexchange", "id": 15918, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ruby, tic-tac-toe, ai", "url": null }
classical-mechanics, hamiltonian-formalism, differentiation, phase-space, time-evolution as known. However, one will have one problem: Notice that: $$ \frac{d}{dt}\int f(x,t)\,dx =\int \frac{\partial f(x,t)}{\partial t}\, dx $$ not $$\frac{d}{dt}\int f(x,t)\,dx =\int \frac{d f(x,t)}{dt}\, dx $$ One will obtain: $$\frac{d\langle q\rangle}{dt}=\frac{d}{dt}\int dq \int dp\,\rho(p,q,t)q=\int dq \int dp\,\frac{\partial}{\partial t}(\rho(p,q,t)q)\neq \int dq \int dp\,\frac{d}{d t}(\rho(p,q,t)q) $$ However, the latter is what expected. What is wrong here? Liouville's theorem says that $\frac{d\rho}{dt} = 0$ along the motion. Expanding, the theorem is that $$0 = \frac{\partial \rho}{\partial q} \frac{dq}{dt} + \frac{\partial \rho}{\partial p}\frac{dp}{dt} + \frac{\partial \rho}{ \partial t}.$$ Substitute from this for $\partial \rho / \partial t$, and integrate by parts to find your desired result.
{ "domain": "physics.stackexchange", "id": 37210, "lm_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, differentiation, phase-space, time-evolution", "url": null }
inorganic-chemistry, redox, aqueous-solution Title: Why is water instead of hydroxide ions used to balance oxygen atoms in redox half equations? When balancing half equations of redox reactions, $\ce{H2O}$ is used to balance any oxygen atoms? For example, this half equation $$\ce{NO3- → NH4+}$$ is balanced into: $$\ce{NO3- + 8 e- + 10 H+ → NH4+ + 3 H2O}$$ Why is $\ce{OH-}$ not used instead of $\ce{H2O}$? E.g. the balanced equation becomes $$\ce{NO3- + 8 e- + 7 H+ → NH4+ + 3 OH-}$$ It's not that we really have a choice in this case between water or hydroxide or pick one or another arbitrarily to fit the stoichiometry of the whole redox reaction. The redox reaction is obviously taking place in quite a strong acidic medium (makes sense, e.g. if $\ce{Zn}$ is used as reducing agent) as you supply protons $\ce{H+}$ to the nitrate according to your reaction.
{ "domain": "chemistry.stackexchange", "id": 11225, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, redox, aqueous-solution", "url": null }
math object class) ceil(x) Returns the smallest integer greater than or equal to x. Find largest integer d that evenly divides into p and q. Random; import sun. Solve advanced problems in Physics, Mathematics and Engineering. If it isn't divisible, return -1. If n is even then 2 is the smallest divisor. As it turns out (for me), there exists Extended Euclidean algorithm. you will write a simple C program that will create permutations of numbers. out to output the results. 2520 is the smallest number that can be divided by each of the numbers from 2 to 10 without any remainder. Java program to find HCF of two numbers – The below given Java programs explains the process of evaluating the Highest Common Factor(HCF) between two given numbers. Proper divisors are the divisors less than the integer you started with: the proper divisors of 6 are {1, 2, 3}. • Every integer > 1 is either prime or composite, but. one is the smallest divisor. Select the range of numbers for the input digits.
{ "domain": "costruzionipallotta.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138157595305, "lm_q1q2_score": 0.8147529779430526, "lm_q2_score": 0.8333246035907932, "openwebmath_perplexity": 507.1189965819911, "openwebmath_score": 0.37257230281829834, "tags": null, "url": "http://costruzionipallotta.it/skuu/java-smallest-divisor.html" }
ros, vslam /opt/ros/topological_navigation_rosinstall/vslam/sba/src/csparse.cpp:746: instantiated from here /opt/ros/topological_navigation_rosinstall/vslam/bpcg/include/bpcg/bpcg.h:160: error: invalid conversion from ‘const double*’ to ‘double*’ /opt/ros/topological_navigation_rosinstall/vslam/bpcg/include/bpcg/bpcg.h:160: error: initializing argument 1 of ‘Eigen::Map<MatrixType, MapOptions, StrideType>::Map(typename Eigen::MapBase<Eigen::Map<PlainObjectType, MapOptions, StrideType>, (Eigen::internal::accessors_level::has_write_access ? (Eigen::AccessorLevels)1u : (Eigen::AccessorLevels)0u)>::PointerType, const StrideType&) [with PlainObjectType = Eigen::Matrix<double, 3, 1, 0, 3, 1>, int MapOptions = 1, StrideType = Eigen::Stride<0, 0>]’ make[3]: *** [CMakeFiles/sba.dir/src/csparse.o] Error 1 make[3]: Leaving directory `/opt/ros/topological_navigation_rosinstall/vslam/sba/build' make[2]: *** [CMakeFiles/sba.dir/all] Error 2
{ "domain": "robotics.stackexchange", "id": 8749, "lm_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, vslam", "url": null }
neuroscience, dendrites Is it possible for one dendrite to pass through another? Perhaps I shouldn't have 'connected' the top part with the bottom part? I can't think of any reason that would explicitly prohibit a dendrite from travelling through a space created by another dendrite's branching pattern. In non-EM images of dendritic branching patterns I don't think I have ever observed dendritic loops, but of course, that has nothing to do with whether or not they occur. Nonetheless, I think there are more likely explanations for what you are seeing in these particular images. As shown, the upper and lower parts of the "dendrite" in the first image do not look like a continuous structure. I would guess that you are looking at a synapse or some other contact between two different processes in the first image. The 3-4'o'clock connection in the loop suggests this interpretation. Can you see vesicles in the images around those connections?
{ "domain": "biology.stackexchange", "id": 321, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience, dendrites", "url": null }
machine-learning, regression Once you've trained your linear regression take a look at the coefficients of each variable on the trained model. The absolute value of these coefficients represent how "important" that characteristic is to the target player value. If it's a large negative coefficient - having a lot of that characteristic negatively impacts player value, while if it's large positive having a lot positively effects player value. Low absolute values represents characteristics that have very little impact. The reason you want to scale your input values between 0 and 1 is to make sure you can effectively compare the raw value of your coefficients knowing the inputs are all on the same scale.
{ "domain": "datascience.stackexchange", "id": 8461, "lm_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, regression", "url": null }
java, object-oriented, statistics, data-mining } return mode.getMode(); } /** * Work like {@link #mode(Object...)}. */ public static ModePair<Double> mode(double... numbers) { Objects.requireNonNull(numbers, "numbers must not be null"); if (numbers.length == 0) { return new ModePair<>(new HashSet<>(), 0); } Arrays.sort(numbers); Mode<Double> mode = new Mode<Double>(numbers[0]); for (double t : numbers) { mode.checkMaxAppears(t); } return mode.getMode(); } /** * Work like {@link #mode(Object...)}. */ public static ModePair<Float> mode(float... numbers) { Objects.requireNonNull(numbers, "numbers must not be null"); if (numbers.length == 0) { return new ModePair<>(new HashSet<>(), 0); }
{ "domain": "codereview.stackexchange", "id": 26833, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, statistics, data-mining", "url": null }
organic-chemistry, inorganic-chemistry, nmr-spectroscopy Title: 1H NMR of Acetylferrocene (source: sigmaaldrich.com) I'm trying to analyse the proton NMR of this, and there's one singlet for the H on the non-substituted Cp ring and a singlet for the methyl group, as expected.
{ "domain": "chemistry.stackexchange", "id": 5473, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, inorganic-chemistry, nmr-spectroscopy", "url": null }
digital-communications, bandwidth Title: Bandwidth transmission for uniform PCM using m-ary PPM I have a uniform PCM whose bandwidth is W = 1Hz and n = 12 bits, i.e. the transmission bandwidth B_T = n*W = 12Hz. Given this features of the signal, I need to calculate the minimum transmission badnwidth B_T if the same PCM signal is transmitted using m-ary PPM with M=4 and M=8. I don't yet understand how the choice of transmitting with Pulse Position Modulation will change the bandwidth. I intuitively guess that it will increase with respect to the initial B_T = 12Hz but I can't tell how to calculate that. I don't understand the notions of bandwidth and will look only at the time domain, where, if I understand the question correctly, $12$ bits need to be transmitted in one second using $4$-ary PPM (alternatively $8$-ary PPM).
{ "domain": "dsp.stackexchange", "id": 12098, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "digital-communications, bandwidth", "url": null }
rqt Title: remove rqt left corner 'x - []' icons I plan to use rqt on a raspberry touch panel which is apparently smaller than a pc. I'd like to realize two modifications, Let the rqt automatically fit to the size of the raspberry screen once launched from terminal. Given that a launch file is used to start the rqt and fill it to the size of the screen, I want to remove the icons 'close, minimize and maximize' on the left corner of rqt because they look redundent to these simliar icons on the raspberry display. Originally posted by Helen HOU on ROS Answers with karma: 1 on 2017-09-13 Post score: 0 The icons in the top left corner of the window are coming from the window manager. Those are not specific to rqt / ros / qt but the window manager you use on your system. Depending on what platform you are that might be Unity, Gnome, etc. Maybe that helps you direct your search.
{ "domain": "robotics.stackexchange", "id": 28844, "lm_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", "url": null }
transfer-function, laplace-transform Title: Time invariance in transfer functions I read this in a book: here ${\cal L}[x(t-a)u(t-a)]$ is the laplace transform of a time shifted function $x(t)$ shifted by $a$ seconds and we know that transfer functions have the formula $H(s)=Y(s)/X(s)$. Also, $y(t)$ = Laplace inverse of $Y(s)$, so shouldn't $y(t) = {\cal L}^{-1}[H(s)X(s)e^{-as}]$ instead of the given result in equation 14.62 The notation in the book is confusing. They use $y(t)$ to denote the output signal corresponding to the original input signal $x(t)$. However, they use $Y(s)$ as the Laplace transform of the response to the delayed input, i.e., $Y(s)$ is not the Laplace transform of $y(t)$ (but of $y(t-a)$).
{ "domain": "dsp.stackexchange", "id": 11234, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "transfer-function, laplace-transform", "url": null }
c#, mvc, entity-framework, asp.net-mvc, asp.net-mvc-5 Title: Keeping data processing out of controllers I would like to start by mentioning that I am LAMP stack guy who happens to be making my first ever .NET C# web app and I'm seeking general advises for best practices and to see how more experienced people would have done it. I am using code first development pattern with latest Entity Framework . I have a AppUser model. The user could be on of few types, one of them is employee. public class AppUser{ public int Id { get; set; } public UserType Type { get; set; } public Title Title { get; set; } public string FirstName { get; set; } public string MiddleName { get; set; } public string LastName { get; set; } public virtual AddressDetails AddressDetails { get; set; } public virtual Company Company { get; set; } .................................................. }
{ "domain": "codereview.stackexchange", "id": 17269, "lm_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#, mvc, entity-framework, asp.net-mvc, asp.net-mvc-5", "url": null }
regular-languages, pumping-lemma, chomsky-hierarchy Otherwise, there is no subtree of the parse tree which reuses the same nonterminal, and in that case the length of the word is bounded because the depth of the parse tree is bounded by the number of nonterminals in the grammar.
{ "domain": "cs.stackexchange", "id": 11629, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "regular-languages, pumping-lemma, chomsky-hierarchy", "url": null }
java, beginner, calculator, math-expression-eval Misc don't import *, but the concrete classes that you need. use private or public for fields. use a lot more spaces to increase readability (you can use an IDE to format this for you). don't ignore exceptions. If you don't want to deal with them, throw them upwards. Just swallowing them will make it very hard to find bugs. declare fields in as small a scope as possible. contents and item are both only used in recognize and put. It would be a lot better to declare them inside recognize and pass them as arguments to put.
{ "domain": "codereview.stackexchange", "id": 12440, "lm_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, beginner, calculator, math-expression-eval", "url": null }
# Solving the following equation for x: $(x-5)^{-2} = 9$ 1. Jun 24, 2016 ### malknar 1. The problem statement, all variables and given/known data An exercise in Lang's Basic Mathematics which asked to solve for x in the equation $(x - 5)^{-2} = 9$ I tried to solve it and got $x = \frac {16} 3$ which is correct according to the book, but I've found that the book states that x also equals \frac {14}3, and I can't figure out how. 2. Relevant equations 3. The attempt at a solution $(x-5)^{-2} = 9$ This yields: $x-5 = 9^{-1/2} =\frac 1 {9^{1/2}} = \frac13$ Which yields: $x=\frac 13 +5 = \frac {1+15} 3 =\frac {16}3$ But I can't figure out how can x equals $\frac {14}3$ too. 2. Jun 24, 2016 ### Staff: Mentor It's better to write this as $(x - 5)^2 = \frac 1 9$, which leads to $x - 5 = \pm \sqrt{\frac 1 9}$ Quadratic equations can have two solutions. 3. Jun 24, 2016 ### mfig What is $(-\frac{1}{3})^2$? 4. Jun 24, 2016 ### late347
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9736446463891303, "lm_q1q2_score": 0.8653352440839929, "lm_q2_score": 0.8887587964389113, "openwebmath_perplexity": 1349.4600987906697, "openwebmath_score": 0.6323896050453186, "tags": null, "url": "https://www.physicsforums.com/threads/solving-the-following-equation-for-x-x-5-2-9.876632/" }
c#, .net, multithreading, thread-safety foreach (TKey expiredItemKey in expiredItemKeys) { ICacheItem<TValue> expiredItem; if (_cachedItems.TryRemove(expiredItemKey, out expiredItem)) { if (expiredItem.IsExpired) { expiredItem.Expire(); } else { _cachedItems.TryAdd(expiredItemKey, expiredItem); } } } _timer.Start(); }
{ "domain": "codereview.stackexchange", "id": 16351, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, multithreading, thread-safety", "url": null }
optics, waves, complex-numbers, linear-systems Title: Using complex numbers to represent waves When talking about a plane wave of the form $$\vec E=\vec E_0\cos(\vec k \cdot \vec r-\omega t)$$ We can replace it by $$\vec E=\vec E_0\exp[i(\vec k \cdot \vec r-\omega t)]$$ so that it is easier for calculation and then only taking the real part as the physical quantity. How can we be sure that the complex part of the wave equation will never become real and contribute to our calculations and let us arrive at an incorrect answer? We have \begin{align} E(r,t) &= E_0 \cos(kr - \omega t - \phi)\\ &=E_0\left(e^{i(kr-\omega t -\phi)} + e^{-i(kr - \omega t + \phi)} \right)\\ &= \tilde{E}_0 e^{i(kr-\omega t)} + \tilde{E}^* e^{-i(kr-\omega t)}\\ &= E^{(+)} + E^{(-)} \end{align} Note I've set $\tilde{E}_0 = E_0 e^{-i\phi}$. By (a particular choice of) convention, the first term is called the positive frequency term and the second term is called the negative frequency term.
{ "domain": "physics.stackexchange", "id": 47848, "lm_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, waves, complex-numbers, linear-systems", "url": null }
magnetic-fields, magnetic-monopoles Title: What happens to a magnetic needle inside a bar magnet? Imagine if we have a hollow bar magnet and we are trying to draw directions of magnetic field lines using a magnetic needle. The north of magnetic needle always points in the direction of the net magnetic field. Now, when we are inside the magnet, the north of the magnetic needle would point towards north and south towards the south - this is what is confusing me; this would mean the south of the magnetic needle remained attracted to the south and the north towards the north. Well, that predicts the direction of the magnetic field very well but it is quite opposite of the fundamental law of attraction. it is not against the law of attraction. If you divide the bar magnet there will be a south pol opposite the N of your needle
{ "domain": "physics.stackexchange", "id": 70187, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "magnetic-fields, magnetic-monopoles", "url": null }
beginner, mergesort, lisp, common-lisp (t (let ((a (first upper))) (setf merged-list (append merged-list (list a))) (setf upper (rest upper)) (incf num-inversions (length lower)))))) (list merged-list (+ (second lower-pair) (second upper-pair) num-inversions))) Use nconc instead of append for speed in (setf merged-list (append merged-list (list a))) Note that you need setf with nconc only if merged-list is nil. Use pop: instead of (let ((a (first lower))) (setf merged-list (append merged-list (list a))) (setf lower (rest lower)))) you can write (setf merged-list (nconc merged-list (list (pop lower)))) The combination of let and loop creates extra indentation for no good reason. You can use with clause in loop to create bindings instead, or use the do macro. Usually predicates are named with a -p suffix, so I suggest that you rename your small-list to small-list-p. Please fix line breaks and indentation in the third cond clause.
{ "domain": "codereview.stackexchange", "id": 22712, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, mergesort, lisp, common-lisp", "url": null }
fourier-transform From spectral analysis, the original spectrum (frequency components) $X(f)$ and the sampled signal spectrum $X_s(f)$ in terms of Hz are related as $X_{s}(f)=\frac{1}{T}\sum_{n=-\infty}^{\infty} X(f-nf_{s})$ where $X(f)$ is assumed to be the original baseband spectrum, while $X_s(f)$ is its sampled signal spectrum, consisting of the original baseband spectrum $X(f)$ and its replicas $X(f-nf_s)$. Since Equation (2.2) is a well-known formula, the derivation is omitted here and can be found in well-known texts (Ahmed and Natarajan, 1983; Alkin, 1993; Ambardar, 1999; Oppenheim and Schafer, 1975; Proakis and Manolakis, 1996). It's not a theorem, but a result that is part of the sampling theorem, and that shows the sampling operation in the frequency domain: The sampling operation with frequency $f_s = \dfrac{1}{T}$ can be defined as:
{ "domain": "dsp.stackexchange", "id": 11688, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fourier-transform", "url": null }
python, python-3.x As suggested in the comments, we may have a valid use-case for an environment variable that doesn't currently have a value. In that case, we would remove the exception, and instead do this: @variable.setter def variable(self, name): self._base_value = os.environ.get(name, None) self._variable = name def __exit__(self, *): if self.original_value is None: os.environ.pop(self.variable) else: os.environ[self.variable] = self.original_value Once we have that, then we just inherit. class MaxOmpThreads(EnvironmentVariableContextManager): def __init__(self, max_threads=None): max_threads = max_threads or mp.cpu_count() super().__init__("OMP_NUM_THREADS", max_threads)
{ "domain": "codereview.stackexchange", "id": 35744, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x", "url": null }
ros, gazebo, laser, sdf, xacro <gazebo reference="base_link"> <material>Gazebo/Blue</material> </gazebo> <gazebo reference="wheel_1"> <material>Gazebo/Black</material> </gazebo> <gazebo reference="wheel_2"> <material>Gazebo/Black</material> </gazebo> <gazebo reference="wheel_3"> <material>Gazebo/Black</material> </gazebo> <gazebo reference="wheel_4"> <material>Gazebo/Black</material> </gazebo> </robot> Originally posted by littlestar on ROS Answers with karma: 9 on 2016-03-30 Post score: 0 Check out hokuyo.xacro It may already be on your system in /opt/ros/jade/share/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo.xacro if you have gazebo_ros_pkgs installed, and a launch file with example lasers worked on my jade system: roslaunch gazebo_plugins multi_robot_scenario.launch (I did get a few warnings about deprecated use of xacro)
{ "domain": "robotics.stackexchange", "id": 24280, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, laser, sdf, xacro", "url": null }
r, simulation, matlab, julia, wolfram-mathematica function doStep(tv, fitnessfunc, mutrate, stdev) n = length(tv) # current population size numberoffspring = R.rpois(n,fitnessfunc(tv, n)) newtv = R.rep(tv,numberoffspring) # offspring are copies of their parents # but some of them mutate, so we also apply mutation n = length(newtv) nrmutants = rand(Binomial(n, mutrate)) rnoise = scale!(randn(nrmutants), stdev) rndelem = sample(1:n, nrmutants[1], replace=false) newtv[rndelem] += rnoise return(max(newtv,0.0)) end function evolve(init_traitv, fitnessfunc, mutrate, stdev, ngens) Results = Vector{Vector{Float64}}(ngens) Results[1] = init_traitv for idx = 2:ngens Results[idx] = doStep(Results[idx - 1], fitnessfunc, mutrate, stdev) end return(Results) end
{ "domain": "codereview.stackexchange", "id": 21621, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "r, simulation, matlab, julia, wolfram-mathematica", "url": null }
c#, linq, json var dataUri = new Uri(WebApiUri + "api/etest/" + group.ObjectID); using (var client = new Windows.Web.Http.HttpClient()) { var response = await client.GetAsync(dataUri).AsTask(); if (response.StatusCode == Windows.Web.Http.HttpStatusCode.Ok) { var jsonText = await response.Content.ReadAsStringAsync().GetResults(); var test = JsonConvert.DeserializeObject<List<TestSession>>(jsonText); group.Test = test; } } if (group.Test.Count > 0) { groups.Add(group); } } return groups.OrderByDescending(x => x.Test.Count); }
{ "domain": "codereview.stackexchange", "id": 10888, "lm_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#, linq, json", "url": null }
computability, computation-models, turing-completeness Title: Is there a problem solution which, if implementable in a given language, implies that that language is Turing complete? I have been researching a bit lately and found myself thinking about the title question for some time now, but have found nothing conclusive. For example, some problems require loops practically - making 10^100^1000^10000 repeated calculations (even no-ops) is not possible practically as the space necessary to store the code would likely be greater than the number of atoms in the universe, but would be possible theoretically given infinite memory (similar to how current implementations of programming languages only approximate Turing-completeness). Alternatively: is there a problem which requires Turing-completeness to solve theoretically? The answer is no (although from a rather syntactic reason, which might not be what you were looking for).
{ "domain": "cs.stackexchange", "id": 8960, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computability, computation-models, turing-completeness", "url": null }
#### Rino Raj solved this puzzle: It seems two sets should suffice. The following construction shows this. Let the sets be $$A$$ and $$B$$. Let $$1$$ be in set $$A$$. For every successive positive integer, we check if half of it is an integer. If not, put it in set $$A$$. If half the number is an integer, put it in the set which does not have that integer. This way, every integer gets placed in a set, and its double is never in the same set. Alternately, every positive integer can be represented uniquely as $$2^m (2n + 1)$$, for non-negative integers $$m$$ and $$n$$. Let set $$A$$ contain all the positive integers where $$m$$ is even, and set B contain all integers where $$m$$ is odd. It may be noted that doubling changes the parity of $$m$$, hence each integer and it's double will be in different sets. #### Wonderwice Margera solved this puzzle:
{ "domain": "cotpi.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9863631635159684, "lm_q1q2_score": 0.821960682026163, "lm_q2_score": 0.8333245932423308, "openwebmath_perplexity": 232.9263453692985, "openwebmath_score": 0.8204192519187927, "tags": null, "url": "http://cotpi.com/p/61/" }
php I just want to know is there any pro and con of doing something like this. Separate your logic and site specific functionality like this: function Router{ $url = array_values(array_filter(explode('/', strtolower($_SERVER["REQUEST_URI"])))); switch($url[0]){ case "admin": $this->Admin($url); break; case "article": $this->Article($url); break; default: displayIndex(); } } function Admin($uri){ if( !$this->us->isAdmin ) { $this->GoToLoginPage(); } array_shift( $uri ); $department = new Admin( $uri ); } function Article($uri){ if( count( $uri ) == 2 ) { displayArticle( $uri[1] ); } else { displayError(); } } It's much cleaner, and easier to update.
{ "domain": "codereview.stackexchange", "id": 6447, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php", "url": null }
java, android checkpointComplete = false; runOnce = true; }, 3000); } }); } else { if (bombed == 0) //GAME OVER { final int duration = Toast.LENGTH_SHORT; ((Activity) this.getContext()).runOnUiThread(new Runnable() { @Override public void run() { final Toast toast = Toast.makeText(context, "GAME OVER!\nScore: " + score, duration); toast.show(); Handler handler = new Handler(); handler.postDelayed(() -> { toast.cancel(); bombed = 5; score = 0; MoonBackground.checkpoint = 'A';
{ "domain": "codereview.stackexchange", "id": 31261, "lm_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 }
array, vba, excel For now I'm the only one using it, so I can manually constrain my selections and inputs to either not crash the code or just click "End" if it throws an error. It seems to work fine for "normal" columns but I suspect something hidden in the flawed logic will collapse if this encounters a more intricate spreadsheet. After I figure everything out here eventually I want to expand to horizontal sums, and also reading the selection for "sum", "sumif", "+" etc., and checking the corresponding cells... but that's for later. I would appreciate any feedback, for both code and comments! Thanks :] General Notes
{ "domain": "codereview.stackexchange", "id": 39350, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "array, vba, excel", "url": null }
javascript, to-do-list, vue.js li { margin: 10px; } <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js"></script> <div id="app"> <div id="hobby-counter"> <p>Hobbies: {{ hobbies.length }}</p> </div> <div id="add-control"> <input type="text" id="newHobby" v-model="newHobby" /> <button v-on:click="addHobby" id="addNewHobby">Add New Hobby</button> </div> <div id="deleted-message"> <p v-if="deleted">Hobby deleted!</p> </div> <li v-for="hobby in hobbies" v-on:click="removeHobby" v-bind:style="{ backgroundColor: setStyle() }"> {{ hobby.name }} </li> </div> Is everything done in a good way and manner? Where could my implementation been improved? Any ideas how to solve point 8? There I get finally stucked. Looking forward to read your comments and answers. At the moment all your current hobbies only consists of a name. I think you could use a simple string instead of wrapping it in an object (for point 8 this is not possible though, of course).
{ "domain": "codereview.stackexchange", "id": 30040, "lm_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, to-do-list, vue.js", "url": null }
electromagnetism, mathematical-physics, vector-fields, calculus major issues that seems to be going on here is the notion of point and surface structures in our 3D world. When we define electrostatic fields by a distribution of point charges, we are being somewhat non-physical. If we keep zooming in on an electron, it's going to start not looking like a point charge anymore. Consider the Darwin Term in the Fine Structure Hamiltonian. The "rapid quantum oscillation smearing out the charge" removes the idea of a stationary point charge (albeit for the proton). What's more important in electrostatics is to say: in what region does our field need to be valid? The answer is only the region in which we're doing physics. To a good approximation, the electron behaves like a point charge as long as you're not on top of. Our point like charge distribution gives a field which is valid and a good approximation pretty much all the way down to the point itself. This doesn't need to be a problem though. Let us compare with an example from GR: In the normal
{ "domain": "physics.stackexchange", "id": 15999, "lm_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, mathematical-physics, vector-fields, calculus", "url": null }
c#, rubberduck, com if (_selectedDeclaration != null) { Debug.WriteLine("Current selection ({0}) is '{1}' ({2})", selection, _selectedDeclaration.IdentifierName, _selectedDeclaration.DeclarationType); } return _selectedDeclaration; } but if I read var matches or var match I always think about regular expressions, so I would prefer to rename these variables to foundDeclarations and foundDeclaration.
{ "domain": "codereview.stackexchange", "id": 19553, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, rubberduck, com", "url": null }
• You are confusing the meaning of the function $\sin(2x)$. You can let $f(x) = \sin(2x)$ to resolve your confusion. Then, you would see that the last statement you made is actually $f(x)=f(x+\pi)$. – Kenny Lau May 3 '17 at 18:05 • The period of a function $f:\mathbb{R}\to \mathbb{R}$ is the smallest positive $t$ such that $f(x+t) = f(x)$. In your example, $f(x) = \sin(2x)$ and $f(x + \pi) = f(x)$. – Darth Geek May 3 '17 at 18:06 • $T$ is a period of $f$ if $f(x)=f(x+T)$ for all $x$. Let $f(x)=\sin 2x$ and $T=\pi$. $f(x+T)=\sin2(x+\pi)=\sin(2x+2\pi)=\sin2x$. So $\pi$ is a period. $2\pi$ is also a period as $f(x+2\pi)=\sin(2x+4\pi)=\sin 2x$. However, we usaually take the smallest possible period. – CY Aries May 3 '17 at 18:07 • This boils down to: If an object spins twice as fast, it takes half as long to make one turn. – Semiclassical May 3 '17 at 18:08 • @Semiclassical, I can understand this intuitively but it is the reasoning which is puzzling me. – MrAP May 3 '17 at 18:10
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676502191266, "lm_q1q2_score": 0.8032229864474891, "lm_q2_score": 0.8198933447152498, "openwebmath_perplexity": 185.7429081572871, "openwebmath_score": 0.9460229277610779, "tags": null, "url": "https://math.stackexchange.com/questions/2264288/why-is-the-period-of-sin2x-%CF%80/2264377" }
homework-and-exercises, special-relativity, kinematics, collision Title: Relativistic collisions (elastic) - stationary target, equal mass A moving electron with energy $E$ hits a stationary electron. Question is to find the scattering angle (the angle between the paths of the two electrons after collision) in terms of the energy $E$ and the electron mass $m$. What can we say about the angle between the electrons after collision? Are both making the same angle to the horizontal axis? Is the angle between them $\pi/2$ ? EDIT 3: *By squaring and adding equations (2) and (3) written below, we can show that $$\cos\phi = \frac{\gamma_1\gamma_2 - \gamma}{\sqrt{\gamma_1^2-1}\sqrt{\gamma_2^2-1}} $$ EDIT 2: In Newtonian mechanics, this information is sufficient to show that the angle between them after collision is $\pi/2$. I can show the proof also. I just can't be sure if this information is not enough in relativistic mechanics. What extra information, if necessary, can be added to find the angle between them after collision?
{ "domain": "physics.stackexchange", "id": 56370, "lm_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, special-relativity, kinematics, collision", "url": null }
ros-melodic Original comments Comment by gvdhoorn on 2021-03-28: Note: nothing here is ROS-specific. This is all CMake. If you want to learn more about selecting and configuring compilers which will be used by Catkin/Colcon: look up the relevant CMake documentation. Comment by seif_seghiri on 2021-03-30: The problem I'm facing is that Cmake is giving an error which is the compiler can't find some of the boost libraries (boost_signals), but i am pretty sure that the boost library is well installed. Comment by miura on 2021-03-31: This may have already been discussed in https://answers.ros.org/question/333142/boost_signals-library-not-found/. If not, please create a new question. I think we are starting to stray from the title of this question. Comment by seif_seghiri on 2021-04-01: please can you tell me where can i find the tf ros package C/C++ codes because I'm only finding the include codes not source codes Comment by miura on 2021-04-02:
{ "domain": "robotics.stackexchange", "id": 36241, "lm_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 }
javascript, calculator, finance Title: My Basic Tax Calculator The goal is: I can add many services as I need. I can add many taxes as I need (the idea is that services has all of this taxes) Calculate per services each tax value Sum all the taxes of each service and throw me the total value per service. This is the first attempt at making a JavaScript program and I would love to hear any advice, what did I do wrong, what is right, what could be better or improved. CodePen // Services var servicios = [ // { nombre_servicio: 'Fotografia', valor: 40000 }, { nombre_servicio: 'Tarjetas', valor: 60000 } ]; var tablaServicios = 0; var nS = document.getElementById('nombre-servicio'); var vS = document.getElementById('valor-servicio'); var botonAgregarServicio = document.getElementById('agrega-valor');
{ "domain": "codereview.stackexchange", "id": 23266, "lm_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, calculator, finance", "url": null }