text
stringlengths
1
1.11k
source
dict
python, c# { Console.WriteLine($"Disk fault @ {addr:X}"); Environment.Exit(1); } byte[] buffer = File.ReadAllBytes("r:\\disk" + disk.ToString("X").PadLeft(2, '0')); CachedDisks[disk] = buffer; registers[5] += 2; break; } case 0x43: // MEMRANGE { int disknum = bytes[addr + 1]; int segment0 = Unsafe.As<byte, int>(ref bytes[addr + 2]); int segment1 = Unsafe.As<byte, int>(ref bytes[addr + 6]);
{ "domain": "codereview.stackexchange", "id": 41441, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, c#", "url": null }
water, phase, isotope Extra Credit: Trying to Interpret the Data:
{ "domain": "chemistry.stackexchange", "id": 8685, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "water, phase, isotope", "url": null }
For N=3, P(S) = 1/2 * 5/6 ( X1 + X2 + X3 > 1. This holds when X1 + X2 > 1 - X3 and integrating over all values of X3 gave the probability to be 5/6 which is multiplied with 1/2 because X1 + X2 < 1) This seems to be a rather lengthy way to approach this problem. Is there a shorter more intuitive method? - Uniformly random. Made an edit to the question mentioning that. –  web_ninja Sep 12 '13 at 10:43 This question was Problem A3 of the 1958 Putnam Competition (and as such is not research-level mathematics). –  Greg Marks Sep 13 '13 at 1:05 @Greg Marks: The problem itself isn't research level. However, web_ninja asked, "Is there a shorter, more intuitive method?" Finding a short, intuitive approach to a problem you can solve in another way seems to fit. In addition, this is not an isolated puzzle as shown by the question I linked. –  Douglas Zare Sep 13 '13 at 2:54
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9916842196792611, "lm_q1q2_score": 0.8084532039637159, "lm_q2_score": 0.8152324983301567, "openwebmath_perplexity": 120.21672176369869, "openwebmath_score": 0.8104360699653625, "tags": null, "url": "http://mathoverflow.net/questions/141942/what-is-the-expected-number-of-random-numbers-generated-uniformly-such-that-th" }
observational-astronomy, photography, space-telescope Title: Why does Nancy Grace Roman = 100 × Hubble? Why is the new space telescopes wide field camera so much wider than the old one's? The title of the WFIRST project description (before it was named the Nancy Grace Roman Space Telescope) is The Wide Field Infrared Survey Telescope: 100 Hubbles for the 2020s. Question: Why does Nancy Grace Roman = 100 × Hubble? Why does the new space telescopes wide field camera so much wider than the old one's?
{ "domain": "astronomy.stackexchange", "id": 5216, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "observational-astronomy, photography, space-telescope", "url": null }
matlab, discrete-signals, filter-design, convolution, interpolation $$I(\mathbf{x}) = (\dots((I_s(\mathbf{p})*h(x_1))*h(x_2))*\dots)*h(x_N),$$ What are the several x in there? In case of images, they are the positions of the original image (before it is reconstructed from $I_s(p)$), but how do I apply this concept to one-dimensional discrete-time signals? I would be thankful for any help! Starting from the equation with the convolutions and assuming unit distance between sampling grid points, for a one-dimensional signal you'll have just: $$I(\mathbf{x}) = I((x_1))= I_s((p_1))*h(x_1),$$ where $\mathbf{x}$ is the vector of continuous coordinates of which there is only one: $x_1 \in \mathbb{R}.$ Likewise there is just a single discrete coordinate $p_1 \in \mathbb{Z}.$ For simplicity, you could drop the vector notation and subscripts altogether and have just: $$I(x) = I_s(p)*h(x).$$
{ "domain": "dsp.stackexchange", "id": 7056, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, discrete-signals, filter-design, convolution, interpolation", "url": null }
ros2 Title: ROS2 action client callbacks not triggered Hello, I am trying to call an action from an action server. However, the action client callbacks do not seem to trigger. Here is a minimal example I wrote based on the Fibonacci action tutorial. This action server calls the action_tutorials_cpp Fibonacci action. #include <functional> #include <memory> #include <thread> #include "rclcpp/rclcpp.hpp" #include "rclcpp_action/rclcpp_action.hpp" #include "action_tutorials_interfaces/action/fibonacci.hpp" class FibonacciActionServer : public rclcpp::Node { public: using Fibonacci = action_tutorials_interfaces::action::Fibonacci; using ServerGoalHandleFibonacci = rclcpp_action::ServerGoalHandle<Fibonacci>; using ClientGoalHandleFibonacci = rclcpp_action::ClientGoalHandle<Fibonacci>; explicit FibonacciActionServer(const rclcpp::NodeOptions &options = rclcpp::NodeOptions()) : Node("fibonacci_action_server", options) { using namespace std::placeholders;
{ "domain": "robotics.stackexchange", "id": 37771, "lm_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 }
special-relativity, time-dilation I don't see how to solve this issue: is it related that we give definition of "length" to some objects, which we assume to be at rest in the reference frame where we define the proper length? I'm not sure if in this case $ \Delta x$ can be associated to a length. I'm just very confused and (as you already know by now) new to relativity. Thank you for any help! The answer by Vincent Thacker is correct, but I hope I can clarify further. The term "length contraction" or "Lorentz contraction" does not refer to a distance between any given pair of events. Rather it refers to a separation between two worldlines. The worldlines are typically the ones at the two ends of a given solid object. But how do you measure the distance between lines? If they were lines in space then we might for example employ the perpendicular distance, and there is just one answer. But for lines in spacetime there can be more than one suitable way to state the distance.
{ "domain": "physics.stackexchange", "id": 79490, "lm_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, time-dilation", "url": null }
quantum-mechanics, homework-and-exercises, hamiltonian I should point out that the $i$'s that you use should be the basis set that you're in. If you have a state $\psi$, then if $$|\psi \rangle = \sum_{i} c_i|i\rangle $$ only than can you express the matrix elements of your operator in this way. If you sandwich the operator between the state itself, you'll end up with the expectation of the state. $$\langle H \rangle = \langle\psi |H| \psi\rangle $$
{ "domain": "physics.stackexchange", "id": 95820, "lm_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, homework-and-exercises, hamiltonian", "url": null }
python, python-3.x You also had some minor spacing issues between your functions which is why I suspect you could use a better editor =) user interface I really like your user interface, it is mostly clear what you want your users to do. I would recommend some clearer naming '\nWhat do you want to do? ' Is at best vague ^^ Suggestion Implemented all the suggestions above. Use a class to keep track of which functions we want to be callable (allowing every function is bad from a security standpoint). We store the allowed actions as a namedtuple. When adding functions we make sure they are callable. Added options for more than one argument. This is done by *args The printing is left to the __str__ part of the class. Rewrote parts of the code to suit the new walrus operator :=
{ "domain": "codereview.stackexchange", "id": 41579, "lm_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 }
genomics, gwas Do you still see those 205 cases if you use a genome build matching the PGS file? (I.e., GRCh37.) Do you still see those 205 cases if you use the LiftOver PGS scoring file with hg38 coordinates? (Download it here.)
{ "domain": "bioinformatics.stackexchange", "id": 2509, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genomics, gwas", "url": null }
quantum-field-theory, standard-model, electroweak, beyond-the-standard-model $$SU(3) \times SU(2) \times U(1) \rightarrow SU(3) \times U(1) $$ Most books and papers talk about a unified electroweak interaction. Shouldn't this mean that the electromagnetic and weak coupling strength get unified? And bonus: Shouldn't all fermions and bosons get a mass comparable to the Electroweak scale? Even without the neutrino the mass difference between the lightest (electron) $\approx 0,5 \cdot 10^{-3}$ GeV and heaviest (top) $\approx 170$ GeV is six orders of magnitude. Answer to the main question: It is a well regarded fact that the terminology unified electroweak interaction is a bit of an abuse of terminology. What the term means is that both Quantum Field Theories, the Hypercharge ($U(1)_Y$) and Weak ($SU(2)_L$), are unified in a common framework, which predicts the low energy electromagnetism ($U(1)_{em}$) through the Higgs mechanism $$ U(1)_Y \times SU(2)_L \to U(1)_{em}$$
{ "domain": "physics.stackexchange", "id": 21977, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, standard-model, electroweak, beyond-the-standard-model", "url": null }
control Title: Model Predictive Control (MPC) horizon and constraints I am new to the MPC idea and I am trying to understand the key concepts but there are two things which I found confusing and I didn't find answers regarding to them. The first one is about the optimized control signal sequence which can be computed from the cost function. If we want to predict, say five steps further, then we will have 5 control signals. After the calculation is done, we will apply only the first signal from the sequence to our system, and them remaining four will be "wasted" (I read that it can be used as an initial guess for the next optimization but thats not my point here). My first question is why don't we just predict one step further, and instead of optimizing five signals, we restrict our optimization to just one, which makes the computation faster?
{ "domain": "robotics.stackexchange", "id": 1283, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "control", "url": null }
quantum-mechanics, waves, wavefunction, boundary-conditions, semiclassical whilst the solution in region 3 is as follows: $$\psi_3(x) = \frac{A_2}{\sqrt{q(x)}}e^{\int_b^x -q(x')dx'/\hbar}.\tag{3}$$ Note that $$q(x) = \sqrt{(2m(V(x)- E))}.$$ My question is why that the term for $\psi_1$ contains the negative exponential; surely that will be the one to blow up as negative * negative is positive. Surely if we go to negative infinity then we would want to discard the term with the negative exponential and keep the one with the positive exponential. Notice first of all that $q>0$ is positive in the forbidden regions, so the integrand is positive.
{ "domain": "physics.stackexchange", "id": 71942, "lm_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, waves, wavefunction, boundary-conditions, semiclassical", "url": null }
astrophysics, stellar-evolution, stellar-physics The process continues and appears to speed up - that is the mass loss increases as the star reaches the end of the AGB phase. This is termed the "AGB superwind". The exact mix of mechanisms responsible for this final phase be it pulsational instability or radiation pressure on copious dust, is still debated. What seems agreed is that it almost entirely removes the H-rich outer envelope.
{ "domain": "physics.stackexchange", "id": 18476, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics, stellar-evolution, stellar-physics", "url": null }
newtonian-gravity, speed-of-light, causality, history is not very correct. Considering Laplace didn't think this was the best hypothesis, and the model wasn't correct for the consequences of a speed of gravity, and the observation it was trying to explain was also wrong.
{ "domain": "physics.stackexchange", "id": 94351, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-gravity, speed-of-light, causality, history", "url": null }
# Semicircle Coverage ### Solution 1 Each semicircle is bounded by two, diametrically opposite, points. The $n$ pairs of points divide the circle into $2n$ regions (which can be proved by induction.) A point on the circle may belong to a given semicircle, or to its complement. Hence, the probability that a given point on the circle is in one of the semicircles is $2^{-1}.$ The probability that it is covered by none of the $n$ semicircles is $2^{-n}.$ Further, a point belongs to exactly one of the $2n$ regions. If the point is not covered by the semicircles, so is the region it belongs to. Thus, the probability that at least one of those regions is not covered by the semicircles is $2^{-n}(2n)=2^{-n+1}n.$ The probability that the entire circle is covered is then $1-2^{-n+1}n.$
{ "domain": "cut-the-knot.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9893474894743616, "lm_q1q2_score": 0.8088652576792781, "lm_q2_score": 0.8175744784160989, "openwebmath_perplexity": 250.08098951563437, "openwebmath_score": 0.993390679359436, "tags": null, "url": "https://www.cut-the-knot.org/m/Probability/SemicircleCoverage.shtml" }
newtonian-mechanics, forces, rotational-dynamics, acceleration, rotation This is your mistake. There is no reason to assume that the static friction force magnitude is equal to the applied force magnitude in general. You are correct to think in terms of Newton's second law though. Applying a force $F_\text{app}$ from a distance $r$ above the center of the object of radius $R$ and in a direction perpendicular to the radius give us Net force: $$F_\text{app}-f_s=ma$$ Net torque: $$rF_\text{app}+Rf_s=I\alpha$$ And then additionally imposing the rolling without slipping condition $a=R\alpha$ results in the correct relation between $f_s$ and $F_\text{app}$ $$f_s=\frac{I-mrR}{I+mR^2}F_\text{app}$$ and also gives us the acceleration of the object $$a=\frac{rR+R^2}{I+mR^2}F_\text{app}$$ So let's see what this tells us
{ "domain": "physics.stackexchange", "id": 66752, "lm_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, rotational-dynamics, acceleration, rotation", "url": null }
fft, dft Could there be a general way of coming up with such things? Update To explain number 4 above, let me demonstrate what I mean with an example. I don't want a situation in that was produced by repeating something that has a known integer DFT several times.DFT of [1 5 -1 0] is [5 2-5i -5 2+5i]. If you simply repeat [1 5 -1 0] four times to get [1 5 -1 0 1 5 -1 0 1 5 -1 0 1 5 -1 0], its DFT would be [20 0 0 0 8-20i 0 0 0 -20 0 0 0 8+20i 0 0 0].
{ "domain": "dsp.stackexchange", "id": 4951, "lm_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, dft", "url": null }
javascript, html, animation Title: Click on an image to zoom in I'm still a newbie when it comes to javascript, so I don't know yet how to optimize this code. customize.js // Get the modal var modal = document.getElementById('myModal'); var modal2 = document.getElementById('myModal2'); var modal3 = document.getElementById('myModal3'); // Get the image and insert it inside the modal - use its "alt" text as a caption var img = document.getElementById('myImg'); var modalImg = document.getElementById("img1"); var captionText = document.getElementById("caption"); var img2 = document.getElementById('myImg2'); var modalImg2 = document.getElementById("img2"); var captionText2 = document.getElementById("caption2"); var img3 = document.getElementById('myImg3'); var modalImg3 = document.getElementById("img3"); var captionText3 = document.getElementById("caption3"); img.onclick = function(){ modal.style.display = "block"; modalImg.src = this.src; captionText.innerHTML = this.alt; }
{ "domain": "codereview.stackexchange", "id": 27086, "lm_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, html, animation", "url": null }
c++, object-oriented, console, tic-tac-toe Player.h #pragma once #include <vector> class Board; class Player { private: const int winningScore = 1; //Score that player must reach to win game public: int GetWinningScore(); bool DecideFirstTurn(Board& board); //Decides who gets the first turn char PlayerGamePiece(Board&board); //Player gets their game piece char OpponentGamePiece(Board& board, char player1); //Opponent gets their gamne piece int PlayerMove(Board& board, const std::vector<char>& playingBoard, int move); //Gets the players movement on board int PositionOfMove(const std::vector<char>& playingBoard, int high, int low); //Asks player where they would like to move on board bool CheckGameOver(bool gameOver, int player1Score, int player2Score); //Check to see if scores have reached maximum amount }; Player.cpp #include "stdafx.h" #include "Player.h" #include "Board.h" #include <iostream> int Player::GetWinningScore() { return winningScore; }
{ "domain": "codereview.stackexchange", "id": 17583, "lm_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++, object-oriented, console, tic-tac-toe", "url": null }
quantum-mechanics, homework-and-exercises, coherent-states $$D(\alpha)=e^{\alpha a^\dagger-\alpha^\star a}.$$ It is the exponential of an anti-Hermitian operator and so is unitary by construction. What is interesting is it's effect on the vacuum state, namely we can write $$|\alpha\rangle=D(\alpha)|0\rangle.$$ To show this, let's compute the operator $$D^\dagger(\alpha)aD(\alpha).$$ We can use BCH expansion and it reduces to $$a+\alpha.$$ As such, when we act with this operator on the vacuum state, $$D^\dagger(\alpha)aD(\alpha)|0\rangle=(a+\alpha)|0\rangle=\alpha|0\rangle.$$ Since $D(\alpha)$ is unitary, acting with it on the left on both sides, we get $$aD(\alpha)|0\rangle=\alpha D(\alpha)|0\rangle,$$ i.e. $D(\alpha)|0\rangle=|\alpha\rangle$ for any complex number $\alpha$.
{ "domain": "physics.stackexchange", "id": 51056, "lm_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, homework-and-exercises, coherent-states", "url": null }
c++, programming-challenge, c++11, datetime I was a bit dismayed to find that my previous answer, in Python, did not generalize very well to handle months of non-uniform lengths. I also considered @maxb's brute-force approach to be too inefficient. (This challenge involves permutations of 8 digits chosen out of 12, or 19958400 tries. Choosing 6 digits out of 9 for hh:mm:ss would only take 60480 tries.) For an additional challenge, I decided to try using C++ instead of Python. I used C++11, but advice based on any recent version would also be welcome. Concerns: Is the solution readable enough? Is the design of the iterator idiomatic for C++? Any memory-management faux pas? (The this->pool.substr() in desc2iter::unused() seems a bit wasteful. I feel like doing this->pool.c_str() + 2.) #include <algorithm> #include <cassert> #include <cctype> #include <iostream> #include <string>
{ "domain": "codereview.stackexchange", "id": 31642, "lm_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++, programming-challenge, c++11, datetime", "url": null }
java, programming-challenge StringBuilder result = new StringBuilder(); for (int i = 1; i < tieredFreq.size(); i++) { // iterate through tiers ArrayList<Character> tier = tieredFreq.get(i); // get tier for (Character c : tier) { // for each char in tier, append to string a number of times equal to the tier for (int j = 0; j < i; j++) result.append(c); } } result.reverse(); // reverse, since result is currently in ascending order return result.toString(); } You have conceived a theoretical model that works. And avoids sorting. Tiers by frequency Every tier contains letters of that frequency It will come at no surprise, that moving a char from on frequency's bin to the next frequency's bin will cost at least as much as sorting. But it is a nice mechanism one sees too rare, and might have its application in vector operations, GPUs or whatever.
{ "domain": "codereview.stackexchange", "id": 38340, "lm_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, programming-challenge", "url": null }
navigation, transform, robot-localization, amcl Original comments Comment by Julio Aguilar on 2017-03-08: Hi there, were you able to start a robot_localization's ekf node with amcl and odometry? I haven't been able to. My ekf instance doesn't publish the right transform. It filters the odom frame even though I specified world_frame as map_frame. Did you do something else besides blocking the amcl tf? Comment by Nicholash Bedi on 2017-03-08: Hi, You also need to make sure map_frame, odom_frame, and base_link_frame are set appropriately. Additionally, publish_tf should be set to true. What do you mean by "filters odom"? Do you have a direct map to base_link transform? or no Map or odom frame at all? Comment by Julio Aguilar on 2017-03-08: Hi, could you look at http://answers.ros.org/question/256504/yet-another-problem-with-robot_localization-and-amcl/ ? Hi Nicholash,
{ "domain": "robotics.stackexchange", "id": 27147, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, transform, robot-localization, amcl", "url": null }
np-hard, satisfiability There some variants of half-SAT in this community, but I couldn't find the way of reduction to this version of HALF-SAT problem. Is there any suggestion to solve this problem? If all clauses must be non-empty, then your problem isn't NP-hard, since every CNF can be half-satisfied: a random assignment satisfies at least half of the clauses in expectation, and so some assignment satisfies at least half of the clauses. If clauses are allowed to be empty (unsatisfiable), then there is an easy reduction from SAT: given an instance of SAT with $m$ clauses, add $m$ unsatisfiable clauses. The new instance is half-satisfiable iff the original one is satisfiable.
{ "domain": "cs.stackexchange", "id": 18511, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np-hard, satisfiability", "url": null }
game, functional-programming, f#, battleship type Point(x : int, y : int) = struct member this.X = x member this.Y = y end type Ship(position : Point, shipType : ShipType, direction : Direction, hits : Point list) = member this.Position = position member this.Type = shipType member this.Direction = direction member this.Hits = hits member this.Length = match this.Type with | AircraftCarrier -> 5 | BattleShip -> 4 | Frigate | Submarine -> 3 | Minesweeper -> 2 member this.IsFinished = this.Hits.Length >= this.Length member this.HitTest(pos : Point) = let offset, dirValid = if this.Direction = Horz then pos.X - this.Position.X, pos.Y = this.Position.Y else pos.Y - this.Position.Y, pos.X = this.Position.X if not dirValid then false else offset >= 0 && offset < this.Length static member Copy(ship: Ship, hit : Point) = Ship(ship.Position, ship.Type, ship.Direction, hit :: ship.Hits)
{ "domain": "codereview.stackexchange", "id": 22024, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "game, functional-programming, f#, battleship", "url": null }
java, optimization, hibernate Now insert reads like this: public void insert(final E t) { execute(new Consumer<Session>() { public void accept(Session session) { session.save(t); } }); } If you have Java 8, you already have Consumer interface. And above can be written even more concisely as follows: public void insert(final E t) { execute(session -> {session.save(t);}); }
{ "domain": "codereview.stackexchange", "id": 9368, "lm_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, optimization, hibernate", "url": null }
Given the provided set inclusion, take $$y \in Y \setminus \{0\}$$. Then $$\frac{y}{\|y\|} \in \overline{B_Y} \subseteq r \cdot\overline{T(B_X)}$$. Therefore, there exists some $$z \in \overline{T(B_X)}$$ such that $$\frac{y}{\|y\|} = rz$$. Given $$z \in \overline{T(B_X)}$$, there must be some $$v \in B_X$$ such that $$\|T(v) - z\| < \frac{\varepsilon}{r\|y\|}$$. Putting this together, $$\|T(v) - z\| < \frac{\varepsilon}{r\|y\|} \implies \Big\|\|y\|rT(v) - \|y\|rz\Big\| < \varepsilon \implies \|T(r\|y\|v) - y\| < \varepsilon.$$ Take $$x = r\|y\|v \in X$$ such that $$\|x\| = \Big\|r\|y\|v\Big\| = r\|y\| \cdot \|v\| \le r\|y\|$$ as required. If $$y = 0$$, then take $$x = 0$$. • Why does $r\|y\| \cdot \|x\| \leq r\|y\|$ imply the inequality? It looks like this just means $x$ is in $B_X$ (by canceling) – yoshi Jul 28 '19 at 15:31 • @yoshi The $x$ I have and the $x$ in the question are not the same. I've edited my answer to make it more clear, hopefully. – Theo Bendit Jul 28 '19 at 15:33
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575142422758, "lm_q1q2_score": 0.8122918832793565, "lm_q2_score": 0.8267117919359419, "openwebmath_perplexity": 210.10841373455867, "openwebmath_score": 0.9207475781440735, "tags": null, "url": "https://math.stackexchange.com/questions/3306509/inclusion-of-open-balls-gives-an-inequality" }
php, object-oriented, mvc create the render() method to extract() my $data array into the local scope and include the view. After that I work on getting my model fleshed out. Once the model is completely done I go back to the controller and remove all those hard coded variables, one at a time, and replace them with the proper sequences necessary to retrieve them from the Model. This way, at the conclusion of each step, I have a fully functional test I can touch and tweak as the code progresses.
{ "domain": "codereview.stackexchange", "id": 2208, "lm_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, object-oriented, mvc", "url": null }
homework-and-exercises, electromagnetism, magnetic-fields, electromagnetic-induction Magnetic flux is calculated through a surface bound by a closed loop. In your case the closed loop is the wires and the imaginary surface is the area enclosed by the circuit. The emf in Faraday's law refers to the net electromotive force generated in the closed loop, which is in this case the ENTIRE circuit. What I'm trying to say is that your integral should be calculated along the entire closed loop, and not just through the part where the rod is located(put a circle on your integral sign). But again, since the rest of the circuit is not moving, what you did is not incorrect. The entire flux change is only due to the moving rod.
{ "domain": "physics.stackexchange", "id": 36397, "lm_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, electromagnetism, magnetic-fields, electromagnetic-induction", "url": null }
electromagnetism, magnetic-fields Title: Why is the perpendicular velocity of a charge in a homogeneous magnetic field constant? I know that when a charge is moving through a magnetic field with all or some of its velocity being perpendicular to the field direction, it is influenced by the field. The Lorentz force - which is perpendicular to the field direction and the velocity of the charge - can be calculated with the following equation: $$F=qBv \text{ (perpendicular force)}$$ with $v$ (perpendicular) being perpendicular to the field direction. If the Lorentz force is a centripetal force, then it is caused by a homogeneous field. The force is constant because $q B$ and $v$ (perpendicular) are constant. How can you prove that the Lorentz force is changing the direction of the velocity of the charge so that $v$ (perpendicular) stays the same? Because the work done to the particle by the Lorentz force is zero. The work is directly related to the change of kinetic energy and the speed: $$
{ "domain": "physics.stackexchange", "id": 75606, "lm_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, magnetic-fields", "url": null }
python, beginner, mechatronics time.sleep(1) get_cameraimage() get_finalimage() if get_finalimage.c == 1.50: print("Desired diameter of drop obtained: ", get_finalimage.c) break else: i = j print("************** The value of steps from last case ******************************:",i) while get_finalimage.c < 1.50: i = i + 2 # print("After decrementation of 10 i become: ", i) print("Increasing step size..", "i= ", 2, "New steps: ", i) j = i # print("2000-i: ", j) epMotion.DosingMotor.GotoPos(currentPos + j) time.sleep(1) get_cameraimage()
{ "domain": "codereview.stackexchange", "id": 26869, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, mechatronics", "url": null }
ros, driver, ros-kinetic, ros-hydro Title: Migration from hydro to kinetic I need to find a kinetic kame driver for a motor controller (Roboteq AX2550) but the closest thing I found was a driver from hydro ( https://github.com/wjwwood/ax2550 ). After copying it from github, I can't figure out how to convert it over to kinetic kame. In CMakeLists.txt, I changed find_package(catkin REQUIRED COMPONENTS geometry_msgs nav_msgs roscpp serial serial_utils tf ) to find_package(catkin REQUIRED NO_MODULE) as per instructions on http://wiki.ros.org/kinetic/Migration but then it says "If you were using the exported dependency list to pass a CMake module name that will not work anymore. You will need to find the CMake module manually in your CMake extra file. " I have no idea what this means. How do I find those CMake modules manually? What/where is that CMake extra file?
{ "domain": "robotics.stackexchange", "id": 26792, "lm_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, driver, ros-kinetic, ros-hydro", "url": null }
homework-and-exercises, electromagnetism, capacitance Title: When calculating the pressure increment when a capacitor is submerged underwater why do we take force as +dU/dx?
{ "domain": "physics.stackexchange", "id": 80763, "lm_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, electromagnetism, capacitance", "url": null }
c#, genetic-algorithm, framework chromosome.Genes.ShuffleFast(); population.Solutions.Add(chromosome); } var elite = new Elite(5); //criação do operador elite var crossover = new Crossover(0.8); var mutacao = new SwapMutate(0.02); var gA = new GeneticAlgorithm(population, CalculateFitness); //operators of Genetic Algorithm gA.Operators.Add(elite); gA.Operators.Add(crossover); gA.Operators.Add(mutacao); //run Genetic Algorithm gA.Run(Terminate); } } static bool Terminate(Population pop, int currentGeneration, long currentEvaluation) { return currentGeneration >= 400; } static double CalculateFitness(GAF.Chromosome chromossome) { int[] corArray = new int[chromossome.Genes.Count]; int cor;
{ "domain": "codereview.stackexchange", "id": 20499, "lm_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#, genetic-algorithm, framework", "url": null }
fluid-dynamics, navier-stokes, porous-media, soft-matter, rheology Lagrangian: every material point is labelled with a coordinate $\mathbf{x}_0$ Eulerian: the problem is described using a stationary set of coordinates $\mathbf{x}$ arbitrary Lagrangian Eulerian: the problem is described following points labelled with coordinates $\mathbf{x}_b$ in an arbitrary motion.
{ "domain": "physics.stackexchange", "id": 97393, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, navier-stokes, porous-media, soft-matter, rheology", "url": null }
Note that this requires neither intelligence nor good luck, and doesn't really have anything to do with factorials! • The only problem I have with this answer is "(and possibly should)." Your second paragraph can be turned into a fast algorithm (it's essentially binary search) and is possibly the best way to do it on a computer but then, at least in my opinion, it no longer qualifies as "less clever." Good answer otherwise though. – Matt Samuel Sep 18 '15 at 23:21 • I said "and possibly should" because, as Einstein is alleged to have said, "chalk is cheaper than grey matter" and if there's a stupid way to do something effectively it's often a good choice. Only "possibly", of course, because Andreas's solution is pretty parsimonious with the grey matter too. I agree that once you go from sequential to binary search it's no longer "less clever" -- but it's still less mathematically clever. – Gareth McCaughan Sep 21 '15 at 11:11
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9688561667674653, "lm_q1q2_score": 0.8009648198247669, "lm_q2_score": 0.8267117940706734, "openwebmath_perplexity": 515.0475399813623, "openwebmath_score": 0.9949217438697815, "tags": null, "url": "https://math.stackexchange.com/questions/1440482/find-n-where-its-factorial-is-a-product-of-factorials/1441041" }
energy-conservation, potential-energy, spring, elasticity Although it is legitimate (and maybe cool) to consider the mass equivalence of the elastic energy (as well as the energy of the chemical bounds), but this way of thinking usually does not gain us any deeper understanding only to cause confusions. Most mass of the matter are stored in the nucleus as the energy of the strong interaction between quarks, which is of the order GeV. While the energy of the chemical bound originated from a weaker type of interaction, the electromagnetic interaction, which is typically of the order eV. The elastic energy is just the deformation energy of the chemical bounds which is even weaker. So these mechanical and chemical energies will never contribute prominently to the mass of the matter. Therefore talking about their mass equivalences does not make a point to me.
{ "domain": "physics.stackexchange", "id": 16282, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy-conservation, potential-energy, spring, elasticity", "url": null }
computability, turing-machines, lambda-calculus, computation-models, halting-problem Coq only allows a subset of all recursive functions: $\mathsf{Coq} \subsetneq \mathsf{R} \subsetneq \mathsf{RE}$. Both bounds of this inequality chain have decidable models but the middle item doesn't. Intuitively speaking, Coq only contains recursive functions whose termination can be proved by sufficiently simple arguments. While “sufficiently simple” covers just about anything mathematicians do, it is still very limited in a theoretical sense. (More precisely, Coq's theory is equivalent to I think the Peano axioms with a schema for recursion that goes up to a certain ordinal, but at that point it gets beyond my comprehension.)
{ "domain": "cs.stackexchange", "id": 1393, "lm_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, turing-machines, lambda-calculus, computation-models, halting-problem", "url": null }
c# Title: Determining which vehicle Rob wants to buy Rob is looking to buy a used pickup truck. He will spend a maximum of $10,000 but would like to spend as little as possible. He will spend up to $3000 for a 2000 or older model, $5000 for a 2001-05 model, $7000 for a 2006-09 model, $9000 for a 2010 or newer model. Rob will not buy a red truck but he will pay 20% more for a white truck. Given the information above and using C# or VB.net, write a function using nested if/else statements that receives the following variables: d_Price decimal s_Color string i_Year integer ...and returns a Boolean value to determine whether a truck is one Rob wants to buy. I don't think is a good approach. How can this be improved? //Function to decide if the car is what Rob wants static bool Rob_Wants(decimal d_Price, string s_Color, int i_Year) { decimal [] max_array = {3000, 5000, 7000, 9000}; //max prices
{ "domain": "codereview.stackexchange", "id": 19497, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#", "url": null }
ruby, project-euler Title: Lowest Common Multiple of 1 to n in Ruby Project Euler problem 5 asks: What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? I'm learning Ruby by going through Project Euler problems, and though I got the following code right (as in the answer given by it), I'm not sure if I'm doing things quite the "Ruby way". Hence, I wanted the community's opinion of my code to better understand alternatives to my code (using the same algorithm please!), so that I don't become used to writing "C++ using Ruby!" def prime? x (2..x-1).each { |y| return false if x % y == 0 } true end def primes_upto n p = Array.new (2..n-1).each {|x| p.push(x) if prime? x} return p end
{ "domain": "codereview.stackexchange", "id": 5527, "lm_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, project-euler", "url": null }
fft, python, amplitude As MackTuesday ask in comment, I plotted the signal and related FFT for signal length = 1000 and 1400. Your code is bit unclear, especially generation of your signal. Python allows for vectorized operations so it is good to use it. What's more, it is good to clearly specify the sampling frequency of your signal and use it then. Also please remember to normalize your FFT by length of your signal (in this particular case) and multiply by 2 (half of spectrum is removed so energy must be preserved). Phenomena you are facing is connected with fact that your frequency is not matching exactly frequency bin for it. Because of that energy is leaking into other frequency bins. This is due to fact that you don't have integer amount of cycles of your sinusoid. Please search for spectral leakage. Easy way to check that is to use the equation for frequency spacing in frequency domain, that is: $$\Delta f=\dfrac{f_s}{N} $$ Where $f_s $ is your sampling frequency. Then your frequency vector is:
{ "domain": "dsp.stackexchange", "id": 1815, "lm_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, python, amplitude", "url": null }
deep-learning, nlp My model architecture is as follows (if not relevant please ignore): I pass the explanation (encoded) and question each through the same lstm to get a vector representation of the explanation/question and add these representations together to get a combined representation for the explanation and question. I then pass the answers through an LSTM to get a representation (50 units) of the same length for answers. In one example, I use 2 answers, one correct answer and one wrong answer. From this I calculate 2 cosine similarities, one for the correct answer and one for the wrong answer, and define my loss to be a hinge loss, i.e. I try to maximize the difference between the cosine similarities for the correct and wrong answers, correct answer representation should have a high similarity with the question/explanation representation while wrong answer should have a low similarity, and minimize this loss.
{ "domain": "datascience.stackexchange", "id": 9587, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "deep-learning, nlp", "url": null }
bioinformatics, genomics I would categorize my self as a beginner in java and python in terms of skills. I was also told anecdotally that the best way to learn coding is by having a project. But I feel incompetent in my coding skills to even attempt anything. I tried to learn Python via "Codecademy" and their 13 hour course for python. Having completed it I felt lost enough to make this post, looking for further guidance. I tried to read a bioinformatics book based in Python, but I missed the handholding and directed exercises that Codecademy gave me. Should one interested in genomics learn the coding language, R or Perl? Also what would be the best ways to learn these for one who does "not excel" in coding?
{ "domain": "biology.stackexchange", "id": 4213, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bioinformatics, genomics", "url": null }
c++, template, c++20 Title: function template for string_view-to-integer conversion I want to make the following function a function template that supports all the integral types: #include <iostream> #include <utility> #include <charconv> #include <string_view> #include <concepts> #include <limits> #include <optional> // header file std::optional<int> to_integer( std::string_view token, const std::pair<int, int> acceptableRange = { std::numeric_limits<int>::min( ), std::numeric_limits<int>::max( ) } ) noexcept; std::optional<int> to_integer( const char* const token, const std::pair<int, int> acceptableRange = { std::numeric_limits<int>::min( ), std::numeric_limits<int>::max( ) } ) noexcept = delete; // source file std::optional<int> to_integer( std::string_view token, const std::pair<int, int> acceptableRange ) noexcept { if ( token.empty( ) ) { return { }; }
{ "domain": "codereview.stackexchange", "id": 42887, "lm_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++, template, c++20", "url": null }
game, vba, excel, winapi If GuessArray.ColorFour = TempMasterGuessArray.ColorFour Then GuessArray.ColorFour = rgbNone TempMasterGuessArray.ColorFour = rgbNone DetermineMatches.MatchesComplete = DetermineMatches.MatchesComplete + 1 End If
{ "domain": "codereview.stackexchange", "id": 34957, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "game, vba, excel, winapi", "url": null }
algorithms, comparison algorithm ArrayMax Input: array $A$ of size $n$; $A[i] \in [1,2^m-1]$ Output: $max(A)$ left <- 1 right <- 1 max <- A[0] while right <= A[0]: right <- 2*right left <- right // 2 for i = 1...n-1: if A[i] <= left: continue if A[i] >= right: max <- A[i] while right <= A[i]: right <- 2*right left <- right//2 continue while left-right > 1: mid <- (left+right)//2 if max < mid: right <- mid else: left <- mid if A[i] < left: break else if A[i] >= right: max <- A[i] delta <- right-left left <- right right <- left+delta break return max
{ "domain": "cs.stackexchange", "id": 17022, "lm_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, comparison", "url": null }
experimental-physics, diffraction, error-analysis Title: Error analysis in measuring wavelength using diffraction grating If $\alpha_m$ are the diffraction angles where the diffracted wave has maxima, then the wavelength is given by the following $$d\sin{\alpha_m} = m\lambda.$$ In order to find $\lambda$, I've run a series of experiments, measuring different values of $\alpha_m$. Now that I have my data I realized that I don't know how to proceed further. I think I could calculate $\lambda$ from the equation above using linear regression (finding $m$ in $y=mx+b$ with $m=\lambda$ and $y=d\sin{\alpha_m}$). But I'm not sure how to go about doing the error analysis here. Excel's LINEST is going to give some approximation error, but I have to take the inaccuracy of measuring $\alpha_m$ and $d$ into account as well. Here's the data I collected along with the plot ($d=7.35$ For the data driven approach I deliberately reserve a second answer: it's a different approach, and it's lengthy, too.
{ "domain": "physics.stackexchange", "id": 94011, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-physics, diffraction, error-analysis", "url": null }
complexity, boolean-matrix This argument extends to all finite fields. The bound can be improved to $(n-r)^2/\log{n}$. Moreover, for many settings of the parameters, the factor of $\log{n}$ can be shaved off, too. Finally, a slight modification of this argument gives a tight bound of $(n-r)^2$ for the case when $\mathbb{F}$ is infinite. All of these extensions can be found, for example, in Theorem 1.10 here.
{ "domain": "cstheory.stackexchange", "id": 5633, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity, boolean-matrix", "url": null }
scikit-learn, naive-bayes-classifier Is my understanding of Naive Bayes correct or is my implementation just wrong? Your assumption seems to be correct that both approaches are actually equivalent. I can not see any difference here in the propabilities and conditional propabilities for either one way or the other. That's why the predictions should also be the same for both ways. It is more likely that there is something wrong with your implementation.
{ "domain": "datascience.stackexchange", "id": 2491, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "scikit-learn, naive-bayes-classifier", "url": null }
# $f_n(x)=\sum_{k=0}^n \frac{x^{2k}}{(2k)!}$ converges uniformly on any compact subset of $\Bbb R$ Consider a sequence of functions on $\Bbb R$ defined by $$f_n(x)=\sum_{k=0}^n \frac{x^{2k}}{(2k)!}, n \ge 0.$$ I'd like to show that $\{f_n(x)\}$ converges uniformly on any compact subset of $\Bbb R$. We have $\{f_n(x)\}$ is a monotonically increasing sequence which converges pointwise to a continuous function $f(x)=\frac{e^x+e^{-x}}2$ since $$\lim_{n \to \infty}f_n(x)=\sum_{k=0}^\infty \frac{x^{2k}}{(2k)!}=\frac{e^x+e^{-x}}2,$$ by Dini's theorem $\{f_n(x)\}$ converges uniformly. How does the proof look? Is there any better proof?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9865717484165855, "lm_q1q2_score": 0.8199822457834487, "lm_q2_score": 0.8311430436757313, "openwebmath_perplexity": 152.4621034072773, "openwebmath_score": 0.9917270541191101, "tags": null, "url": "https://math.stackexchange.com/questions/1952143/f-nx-sum-k-0n-fracx2k2k-converges-uniformly-on-any-compact-su" }
paragraph 1 paragraph 2 [example link](https://brilliant.org)example link > This is a quote This is a quote # I indented these lines # 4 spaces, and now they show # up as a code block. print "hello world" # I indented these lines # 4 spaces, and now they show # up as a code block. print "hello world" MathAppears as Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting. 2 \times 3 $2 \times 3$ 2^{34} $2^{34}$ a_{i-1} $a_{i-1}$ \frac{2}{3} $\frac{2}{3}$ \sqrt{2} $\sqrt{2}$ \sum_{i=1}^3 $\sum_{i=1}^3$ \sin \theta $\sin \theta$ \boxed{123} $\boxed{123}$ Sort by: Good advice. But you must consider that answering questions in exam is much different from doing it this way because of the shortage of time. So can you provide any strategies for that. - 4 years, 9 months ago
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9136765281148513, "lm_q1q2_score": 0.8453608878396986, "lm_q2_score": 0.9252299493606284, "openwebmath_perplexity": 1336.187277103536, "openwebmath_score": 0.9080659747123718, "tags": null, "url": "https://brilliant.org/discussions/thread/problem-solving-2/" }
python, beginner, python-2.x, number-guessing-game So the game for me works as expected. You can win, lose, guess invalid numbers (I haven't tried letters but I won't get into that yet). Just not sure if this is the most efficient I can get. But if it's good enough for a beginner, I'll take it. This is a good first stab at a guess the number game. Here's a few things: You should be learning/using Python 3 instead of Python 2. So far the only difference for you will be raw_input becomes input and print "foo" becomes print("foo"). The line tries = tries doesn't do anything meaningful. You don't need it You should put all of this inside a function called main and then at the bottom you run it with this (tests if this script is being run standalone): if __name__ == '__main__': main() You do int(guess) a lot. This is something that can fail (if someone types abc for example). You should do it once and check for failure.
{ "domain": "codereview.stackexchange", "id": 33310, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-2.x, number-guessing-game", "url": null }
java, performance, recursion, image, gui try { // split the current topping choices into an array so that the program // can see how many toppings there are and will be able to determine how // many images it will update. String[] curTop = topChoiceString.split(" "); // gain the number of toppings int i = curTop.length; // pass the string to know which toppings and the integer to know // how many toppings imgLoop(i, curTop); }catch (PatternSyntaxException ex){ } } /** * this is a recursive method that takes in how many images will be changed * and which toppings were chosen so it knows which images to display. * it uses the ImageView array in order to keep the toppings stacked close * to the pizza instead of just randomly placed on the GUI. * @param i * @param curTop */ public void imgLoop(int i, String[] curTop){ int img;
{ "domain": "codereview.stackexchange", "id": 24206, "lm_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, recursion, image, gui", "url": null }
and so indeed each of the bullets holds true. With each of the D j D j falling by the wayside you may also expect that the respective geometric and algebraic multiplicities coincide. ## The Spectral Representation We have amassed anecdotal evidence in support of the claim that each D j D j in the spectral representation B= j =1h λ j P j + j =1h D j B j 1 h λ j P j j 1 h D j (1) is the zero matrix when B B is symmetric, i.e., when B=BT B B , or, more generally, when B=BH B B where BHB¯T B B Matrices for which B=BH B B are called Hermitian. Of course real symmetric matrices are Hermitian. Taking the conjugate transpose throughout Equation 1 we find
{ "domain": "cnx.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969645988575, "lm_q1q2_score": 0.8018601975535536, "lm_q2_score": 0.8152324848629215, "openwebmath_perplexity": 1667.1443206653234, "openwebmath_score": 0.8702697157859802, "tags": null, "url": "http://cnx.org/content/m10382/latest/?collection=col10048/latest" }
## 1 Answer Let the probability distribution of the other person's roll be $$P(i)$$. Hint: If you roll a $$n$$, what will make you indifferent to pay $$0.25$$ to increase your roll? You are indifferent if $$P(n) + P(n+1) = 0.25$$. Is there a probability distribution when you are always indifferent? The probability distribution is $$P(i) = \frac{1}{8}$$. (Each outcome is equally likely) If yes, can that be achieved via the rules? It can be achieved. Specifically, what is the strategy? If yes, is that a symmetric Nash equilibrium? Yes, see comment. If yes, what is the payout? The payout under case 1 is $$\frac{5}{16}$$, under case 2 is $$\frac{1}{2}$$. Why? Is this the max possible payout? Why, or why not? Case 1: (I had an error so now I'm not certain)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137874059599, "lm_q1q2_score": 0.8074010620278737, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 656.1027159621976, "openwebmath_score": 0.7044549584388733, "tags": null, "url": "https://math.stackexchange.com/questions/3433751/optimal-strategy-for-this-d6-game" }
lidar, laser, ros-kinetic, scan, translation Title: transformation the laser scan data with robot pose? hello guys, I want to simulate the bag data that I got from ROS in MATLAB. I separated the pose and range data from the bag file. and I wrote a script to plot the laser data and build a map (I assumed that my poses are correct). when I run my code, It works well, till the robot turns!. at that point, the scan data turns in the opposite direction! till the robot gets straight again. and again when the robot turns again I experience the same problem till the robot gets straight. I don't know whats wrong!!...the transformation I used works well except when the robot turn!!
{ "domain": "robotics.stackexchange", "id": 30087, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lidar, laser, ros-kinetic, scan, translation", "url": null }
quantum-mechanics, electromagnetism, forces, gravity you find that all the aberrations you might expect because of a finite speed of light end up canceling out, so gravity acts like it's instantaneous is highly misleading; the correct statement is that the aberrations cancel out to first order in $v/c$, but there are nonzero speed-of-light corrections starting at second order in $v/c$. The key phrase in Albert's statement is "in a sense". His statement isn't "really" true in general. The field's apparent instantaneous motion only holds for objects moving with uniform velocity. The instant they start to accelerate at all, the results of that acceleration only propagate outward with a speed-of-light delay. You can find more details in my answer here.
{ "domain": "physics.stackexchange", "id": 96572, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, electromagnetism, forces, gravity", "url": null }
physical-chemistry, aqueous-solution, solubility So there is a difference. 0.1 molar $\ce{MgSO4}$ has a freezing point depression of 0.22 degrees Celsius whereas the other 0.1 molar salts are about 0.35 degrees. As far as the "answer" goes the problem is very poorly worded. First the problem states to "assume an ideal solution," then poses the problem in such a manor that some sort of non-ideal behavior must be assumed to obtain an answer. "Ideal behavior" for electrolytes only occurs in very dilute solutions. A 0.1 molar solution is much too concentrated for ideal electrolyte behavior. Without any "lookup" of data the only solution seems to be some hand-waving about $\ce{MgSO4}$ being the only salt with divalent ions so the effective dissociation is smaller because of forming ion-pairs in solution.
{ "domain": "chemistry.stackexchange", "id": 5463, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, aqueous-solution, solubility", "url": null }
toss a coin and the result of the pair of coin tosses will indicate the pair of alleles contributed by an egg and a sperm to the baby that results from that mating. But the relative frequency of each outcome over a long run (many tosses) is predictable. Mechanics of a tossed coin. If you toss a coin, what is the probability that it will come up heads? _____ 2. If there is a chance that an event will happen, then its probability is between zero and 1. 2 What is the Karl Pearson (1857-1936) tossed a coin 24000 times. it is empty, is 1. Describe a procedure that takes as input two integers a and b such that 0 < a < b and, using fair coin flips, produces as output heads with probability a/b and tails with probability (b - a)/b. # of PP tosses/50) and record under Actual Probability on Table 1. 30/129; D. As mentioned above, each flip of the coin has a 50 / 50 chance of landing heads or tails but flipping a coin 100 times doesn't mean that it will end up with results of 50 tails and 50
{ "domain": "simplemarket.pl", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9808759654852756, "lm_q1q2_score": 0.8130861497953521, "lm_q2_score": 0.8289388040954683, "openwebmath_perplexity": 405.5127665087262, "openwebmath_score": 0.8215392827987671, "tags": null, "url": "http://simplemarket.pl/a-pair-of-coins-is-tossed.-what-is-the-probability-of-no-tails_.html" }
python, game def player(self): """ Returns whose turn it is. """ if len(self.pieces)%2 == 0: return 1 else: return 2 def other_player(self): """ Returns the other person's turn. """ if len(self.pieces)%2 == 0: return 2 else: return 1 def print_board(self): """ Prints the board. """ for row in self.board: pr = [] for piece in row: if piece: pr.append(piece.get_piece_abbr()) else: pr.append(None) print(pr)
{ "domain": "codereview.stackexchange", "id": 22899, "lm_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, game", "url": null }
array, assembly Bypassing when the counter is zero is fine, but perhaps a negative counter value should rather be considered an error and handled accordingly? Don't loose yourself in jumping around cmp edx, 8 jl SetupLessThan8Bytes ; Check if counter is less than 8 mov r8d, edx ; Storing the original count ... ... SetupLessThan8Bytes: mov r8d, edx jmp SetFinalBytesLoop When the counter in EDX is smaller than 8, you jump to SetupLessThan8Bytes where you just make a convenient copy of the counter and then jump again to SetFinalBytesLoop. If you move the instruction that makes a copy of the original counter to right before where you compare the counter to 8, you can save yourself from writing 3 lines of code (a label, a mov, and a jmp). Moreover the program becomes clearer. mov r8d, edx ; Storing the original count cmp edx, 8 jl SetFinalBytesLoop ; Check if counter is less than 8
{ "domain": "codereview.stackexchange", "id": 27732, "lm_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, assembly", "url": null }
@Scott, I think that when you start with the first 11 primes that greedy algorithm does not work. –  Mariano Suárez-Alvarez Aug 5 '10 at 5:48 Thank you, Scoot,Mariano. @Mariano,Yes! According to the greedy algorithm: (31+19+17+7+5) -(29+23+13+11+3)=79-79=0, then how to put 2? While (31+29+17+3)=80, 23+13+19+11+7+5+2=80, to be more beautiful, 31+29-23-19+17-13-11-7-5+3-2=0 –  user8140 Aug 5 '10 at 6:57 Sorry, by "small case analysis at the end" I meant that the smallest primes needed to be arranged by hand, not that the greedy algorithm could be proved to work by case analysis. –  S. Carnahan Aug 10 '10 at 17:18
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9935117317481194, "lm_q1q2_score": 0.805220304098378, "lm_q2_score": 0.8104789086703225, "openwebmath_perplexity": 384.8502692522481, "openwebmath_score": 0.9848455786705017, "tags": null, "url": "http://mathoverflow.net/questions/34581/a-prime-sequence-can-be-partitioned-into-two-sets-of-equal-or-consecutive-sum/35458" }
(La,x) \\ \downarrow & & \downarrow \\ \hom(A_i,Rx) & \leftarrow & \hom(LA_i,x ) \end{array}$$ and follow $$\phi$$ around the square, we see that $$\phi ^{*}\circ\lambda _{i} =(\phi\circ L\lambda _{i} )^{*}$$. But LHS of this is just $$\mu ^{*}_{i}$$, so that $$\phi\circ L\lambda _{i} =\mu_{i}$$ and $$\phi$$ is unique because $$\phi ^{*}$$ is.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9852713835553861, "lm_q1q2_score": 0.8123187471393811, "lm_q2_score": 0.8244619306896955, "openwebmath_perplexity": 133.70918232818872, "openwebmath_score": 0.9810760617256165, "tags": null, "url": "https://math.stackexchange.com/questions/3257918/functor-l-mathcala-to-mathcalb-is-left-adjoint-to-r-functor-then-l-p/3258153" }
homework-and-exercises, newtonian-mechanics, string, approximations If the pulley is not considered "light", but has mass/moment of inertia, then it will also affect the acceleration of the system, much like any other mass would. If a pulley is not fixed but can move, then it can change the relative acceleration rates of each end of the rope.
{ "domain": "physics.stackexchange", "id": 56513, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, string, approximations", "url": null }
haskell The problem I see is that there is no easy way to execute multiple instructions. There's a small hotfix for that; swap the order of arguments for exec so you can do exec firstInstruction $ exec secondInstruction $ exec thirdInstruction cpu, but that's not that great either. What happens in a CPU stays in a CPU You can't modify values inplace, there's always a copy that's returned back - that's the way Haskell works. But this is one of the cases where it certainly would be nice to manipulate values, your CPU that is. Introducing: State! State (found in Control.Monad.State) is a handy monad to do exactly that - carry around a modifiable state on which you can perform many actions. Let's think about what type of actions there actually are... honestly, there's just incrementing by some value. Easy enough then, let's write some code! increaseRegisterBy :: Register -> Int -> State CPU () increaseRegisterBy reg incr = do cpu <- get cpu' = if reg `member` cpu
{ "domain": "codereview.stackexchange", "id": 28631, "lm_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 }
ros, target-link-libraries //Path to a library. CGAL_LIBRARY:FILEPATH=/usr/local/lib/libCGAL.so //Path to a library. GMP_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libgmp.so The command sudo dpkg -L libgmp-dev shows: /. /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libgmp.a /usr/lib/x86_64-linux-gnu/libgmpxx.a /usr/include /usr/include/gmp.h /usr/include/gmpxx.h /usr/include/gmp-x86_64.h /usr/share /usr/share/doc /usr/share/doc/libgmp-dev /usr/share/doc/libgmp-dev/NEWS.gz /usr/share/doc/libgmp-dev/AUTHORS /usr/share/doc/libgmp-dev/README /usr/share/doc/libgmp-dev/copyright /usr/lib/x86_64-linux-gnu/libgmp.so /usr/lib/x86_64-linux-gnu/libgmpxx.so /usr/share/doc/libgmp-dev/changelog.Debian.gz
{ "domain": "robotics.stackexchange", "id": 11437, "lm_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, target-link-libraries", "url": null }
beginner, c, csv Tokenizer t; printf("average = %lf\n", average(tokenizer_init(&t, f))); fclose(f); return 0; } I would consider that a SRP-compliant solution that does not have any memory management headaches. (Of course, there is sophisticated buffer management going on behind the scenes within fscanf(), but it's nicely hidden from you.) The tokenizer concept is actually just window dressing around fscanf(). You could simplify things with typedef FILE tokenizer, but I prefer to keep the abstraction there. Miscellaneous While Ruby uses two spaces per level of indentation, C code generally has 4 or 8 spaces per level.
{ "domain": "codereview.stackexchange", "id": 6832, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, c, csv", "url": null }
datasets, overfitting, transfer-learning, data-labelling, faster-r-cnn Title: Is there an argument against using the (reviewed) predictions of a model as ground truth to further train exactly this model? I plan to use my predictions as ground truth to continue training my model. These predictions are of course reviewed during this process. Is there an argument against that (reinforcement of slight mistakes/overfitting etc.)?
{ "domain": "ai.stackexchange", "id": 3333, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "datasets, overfitting, transfer-learning, data-labelling, faster-r-cnn", "url": null }
Accused of cheating due to the time accounted by Blackboard, Motivate students to work on exercises if solutions are provided. How to alleviate the tedium of PC death at higher levels? TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Identifying Binomial Coefficients. How to write it in Latex ? The binomial coefficient also arises in combinatorics, where it gives the number of different combinations of $b$ elements that can be chosen from a … Pasting the above "text" into MathType 5.0 will enter the above equation and make it possible to edit, save, and use in applications such as MS Word. (adsbygoogle = window.adsbygoogle || []).push({}); begin{tabular}...end{tabular}, How to write matrices in Latex ? (n - k)!} {k! This website was useful to you? Le coefficient binomial (n k) ( n k) est le nombre de possibilités de choisir k élément dans un ensemble de n éléments. Isn’t this exactly the same as the first line
{ "domain": "homesante.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9572778048911612, "lm_q1q2_score": 0.8136585430732609, "lm_q2_score": 0.8499711775577736, "openwebmath_perplexity": 2364.2004548331647, "openwebmath_score": 0.910993754863739, "tags": null, "url": "https://homesante.org/7rd4hu2/69a8d7-engie-et-roland-garros" }
homework-and-exercises, fluid-dynamics, pressure, water, bernoulli-equation Title: Determine Pressure before and after Pump I've been trying to solve this (exam) question but keep getting wrong answers. I need to calculate P1 (pressure before pump) and P2 (pressure after pump), the pump drives a fountain.
{ "domain": "physics.stackexchange", "id": 42354, "lm_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, fluid-dynamics, pressure, water, bernoulli-equation", "url": null }
quantum-mechanics, wavefunction, potential, schroedinger-equation, scattering Title: Potential barrier scattering when particle energy equals to the barrier height What happens if we have $E=V$, where $E$ is the energy of a incoming particle and $V$ is the height of a square potential barrier? This wiki page actually gives a finite transmission probability for this case. But what does the wave function look like in the barrier region? Edit: I just realized that the potential barrier case can be easily solved and the transmission can be calculated to be the one given in wiki. However, things are slightly different if we have a step potential at the origin instead of a square barrier. Even though a step potential is just a square barrier with infinite width, we look at the situation separately. If we look at the schroedinger equation for the barrier region, which goes from 0 to $\infty$, then we have $$\psi''(x)=0$$
{ "domain": "physics.stackexchange", "id": 85397, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, potential, schroedinger-equation, scattering", "url": null }
304 North Cardinal St. Dorchester Center, MA 02124 # The Mango Truck CodeChef Solution ## Problem – The Mango Truck CodeChef Solution You are given that a mango weighs X kilograms and a truck weighs Y kilograms. You want to cross a bridge that can withstand a weight of Z kilograms. Find the maximum number of mangoes you can load in the truck so that you can cross the bridge safely. ### Input Format • First line will contain T, the number of test cases. Then the test cases follow. • Each test case consists of a single line of input, three integers X,Y,Z – the weight of mango, the weight of truck and the weight the bridge can withstand respectively. ### Output Format For each test case, output in a single line the maximum number of mangoes that you can load in the truck. • 1≤T≤1000 • 1≤XYZ≤100 ### Sample 1: Input: 4 2 5 11 4 10 20 1 1 1 6 40 90 Output: 3 2 0 8 ### Explanation:
{ "domain": "queslers.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812309063186, "lm_q1q2_score": 0.8172121762666285, "lm_q2_score": 0.8438951005915208, "openwebmath_perplexity": 4062.496730168898, "openwebmath_score": 0.1717681884765625, "tags": null, "url": "https://queslers.com/the-mango-truck-codechef-solution/" }
compilers, recursion, program-optimization, tail-recursion What applyPow(k, acc) does is take a list, i.e. free monoid, like k=Cons(x, Cons(x, Cons(x, Nil))) and make it into x*(x*(x*acc)). But since * is associative and generally forms a monoid with unit 1, we can reassociate this into ((x*x)*x)*acc, and, for simplicity, tack a 1 on to start, producing (((1*x)*x)*x)*acc. The key thing is that we can actually partially compute the result even before we have acc. That means instead of passing k around as a list which is essentially some incomplete "syntax" that we'll "interpret" at the end, we can "interpret" it as we go. The upshot is that we can replace Nil with the unit of the monoid, 1 in this case, and Cons with the operation of the monoid, *, and now k represents the "running product". applyPow(k, acc) then becomes just k*acc which we can inline back into pow2 and simplify producing: pow(x, n): return pow2(x, n, 1) pow2(x, n, k): if n == 0: return k else if n == 1: return k*x else: return pow2(x, n-1, k*x)
{ "domain": "cs.stackexchange", "id": 10443, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "compilers, recursion, program-optimization, tail-recursion", "url": null }
combinatorics, notation, selection-problem Title: Selection type generated by nested loops where initial value is current value of parent loop Consider the generator of the selections: for (i1 = 0; i1 < 10; i1++) for (i2 = i1; i2 < 10; i2++) for (i3 = i2; i3 < 10; i3++) for (i4 = i3; i4 < 10; i4++) printf("%d%d%d%d", i1, i2, i3, i4); Result: 0000 0001 0002 ... 0009 0011 <-- 0010 is skipped 0012 ... 0019 0022 <-- 0020 and 0021 are skipped 0023 ... 8999 9999 Generated selections have the following property: the order in the selection does not mater, i.e. 0011 0101 1001 1010 1100 are the same. Basically it is 4-combination of the set { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, ..., 9, 9, 9, 9} What do you say to name this type of the selection? I always get stuck when I say: 4-xxxxxxxx of the set {0, 1, 2, ..., 9} where xxxxxxxx is the name of this selection. The sequences your program generates are non-decreasing sequences.
{ "domain": "cs.stackexchange", "id": 3614, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "combinatorics, notation, selection-problem", "url": null }
tf2-ros, tf2, pointcloud-to-laserscan, geometry-msgs, linking <build_depend>message_generation</build_depend> <run_depend>message_generation</run_depend> Below is the CMakeList.txt file: cmake_minimum_required(VERSION 2.8.3) project(pointcloud_to_laserscan) find_package(catkin REQUIRED COMPONENTS message_filters nodelet roscpp sensor_msgs tf2 tf2_ros tf2_msgs tf2_sensor_msgs tf2_geometry_msgs geometry_msgs sensor_msgs message_generation ) catkin_package( INCLUDE_DIRS include LIBRARIES pointcloud_to_laserscan CATKIN_DEPENDS roscpp message_filters nodelet sensor_msgs tf2 tf2_ros tf2_msgs tf2_sensor_msgs tf2_geometry_msgs geometry_msgs sensor_msgs message_generation ) include_directories( include ${catkin_INCLUDE_DIRS} ) add_library(pointcloud_to_laserscan src/pointcloud_to_laserscan_nodelet.cpp) target_link_libraries(pointcloud_to_laserscan ${catkin_LIBRARIES})
{ "domain": "robotics.stackexchange", "id": 32720, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "tf2-ros, tf2, pointcloud-to-laserscan, geometry-msgs, linking", "url": null }
c#, beginner, object-oriented, winforms, inheritance Count = model.Workers.Count(); IEnumerable<WorkerTableRow> rows = model.Workers .OrderByDescending(r => r.Id) .Skip(Page * Size) .Take(Size) .Select(w => new WorkerTableRow { IdWorker = w.Id, FullName = w.FullName, PassportNumber = w.PassportNumber, PassportSeries = w.PassportSeries, Address = w.Address, BankAccount = w.BankAccount, DateIssued = w.DateIssued.ToLongDateString(),
{ "domain": "codereview.stackexchange", "id": 35380, "lm_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, object-oriented, winforms, inheritance", "url": null }
We just need to show that we've also added two more $n$-hyperoctants. These are the ones where the first $n-1$ coordinates all have the same sign or all have the opposite sign as the first $n-1$ coordinates of ${\bf n}$, just like when we went from $n=2$ to $n=3$ above. Examples of solutions to the equation of $P$ that are in those 2 $n$-hyperoctants are $(a_1,a_2,...,a_{n-1},-\dfrac{1}{a_n}\sum_{i=1}^{n-1}{a_i^2})$ and $(-a_1,-a_2,...,-a_{n-1},\dfrac{1}{a_n}\sum_{i=1}^{n-1}{a_i^2})$. So now we are up to $2^{n}-4+2 = 2^{n}-2$, so $P$ intersects at least that many $n$-hyperoctants. There are only 2 more $n$-hyperoctants, and those are the ones that contain $\pm {\bf n}$, but we already know that points in those $n$-hyperoctants cannot satisfy the equation of ${\bf n} \cdot {\bf x} = 0$, so $P$ intersects exactly $2^{n}-2$ of the $2^n$ $n$-hyperoctants, and the theorem is proved. $\square$
{ "domain": "gtmath.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9923043532767741, "lm_q1q2_score": 0.804241758397556, "lm_q2_score": 0.8104789178257654, "openwebmath_perplexity": 107.46082824433414, "openwebmath_score": 0.9477369785308838, "tags": null, "url": "http://www.gtmath.com/2015/04/" }
This means,that there are $3$ outcomes for this event with the sample space of $6$.So, probability is $\frac{1}{2}$. But I don't know how to generalize this.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226314280634, "lm_q1q2_score": 0.8224827071427835, "lm_q2_score": 0.8418256452674009, "openwebmath_perplexity": 225.62801981396782, "openwebmath_score": 0.8428834676742554, "tags": null, "url": "https://math.stackexchange.com/questions/512105/probability-of-drawing-all-red-balls-before-any-green-ball" }
homework-and-exercises, doppler-effect Title: Doppler effect when two bodies are not moving in straight line What is a Doppler line? Why are the velocity components taken along Doppler line as shown here? And what is the derivation of formula $$f_0=f \frac{v+v_1 \cos\theta_1}{v-v_2 \cos\theta_2}$$ where $f_0$ is frequency observed by car 2 when car 1 blows horn. $f$ is the original frequency of source (horn) from car 1. $v_1$ is velocity of car 1 and $v_2$ is velocity of car 2. $\theta_1$ and $\theta_2$ are shown in diagram. In diagram Car 1 shown position is position when it horned and Car 2 shown position when he receives the sound. What is a Doppler line? It is slightly unusual terminology, but it refers to the line along which the signal propagates. I.e. the line from the emitter at the time of emission to the receiver at the time of reception. For the usual acoustic Doppler formulas the reference frame used is the frame in which the medium is at rest.
{ "domain": "physics.stackexchange", "id": 55455, "lm_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, doppler-effect", "url": null }
security, bash, linux, unix, macos echo "[-] Changing file permissions ..." chmod +x /usr/bin/mac-camo echo "[-] File permissions changed !" installComplete } # MacOS install, Pt. 2 function macInstallPt2() { $green; $bold; $standoutStart; echo echo " OS: $os " echo " Homebrew installed: $brewInstalled " echo " macchanger installed: $macchangerInstalled " $standoutFinish; $white; $bold; echo echo "[*] ^--- $($stopAllFX; $bgBlack; $white)Install with these settings?:" $yellow; $bold; echo " [$($white)0$($yellow)] $($stopAllFX; $bgBlack; $white)Yes" $yellow; $bold; echo " [$($white)1$($yellow)] $($stopAllFX; $bgBlack; $white)No" read -p ">>> " installWithTheseSettings if [[ "$installWithTheseSettings" == "0" ]]; then macInstallPt3 elif [[ "$installWithTheseSettings" == "1" ]]; then installCancelled else macInstallPt2 fi } # MacOS Install, Pt. 1 function macInstallPt1() {
{ "domain": "codereview.stackexchange", "id": 25693, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "security, bash, linux, unix, macos", "url": null }
to keep the $$i$$-th column or not. After you pick, you won't touch the previous columns again. So doing this will give you square determinants with certain columns missing. If you pick some columns (equivalently, some diagonal elements) to remove, say "NO" to every decision where you remove one of the desired columns and "YES" otherwise. This defines a path down the binary tree which terminantes when no more $$\lambda$$'s are left. Since every selection of $$k$$ diagonal elements corresponds to exactly one path down the binary tree with $$n-k$$ "YES"'s, you will get $$(-1)^{n-k}\lambda^{n-k}$$ in front of each such determinant and so when you sum it all up, you get precisely the sum of of all diagonal-centered $$k\times k$$ determinants.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534349454033, "lm_q1q2_score": 0.8241597850440342, "lm_q2_score": 0.8397339656668286, "openwebmath_perplexity": 226.98294061818646, "openwebmath_score": 0.9696048498153687, "tags": null, "url": "https://math.stackexchange.com/questions/3272063/coefficients-of-the-characteristic-polynomial" }
general-relativity, cosmology, dark-matter, dark-energy Title: The scale factor of $\Lambda$CDM as a function of time From Friedmann equation for flat universe: $$ \left(\frac{\dot{a}}{a}\right)^2= \frac{8\pi G}{3} ~~ \left( \rho_m + \rho_r + \rho_\Lambda \right), $$ can we simply get the scale factor $a$ as a function of time? I’m following this thread numerically solving for cosmological scale factor.. But there’s the Hubble constant $H_0$, whose value is given in units of GeV by $\sim 10^{-42}$. I think this is the value we should substitute by in the Friedmann equation to have units balance, since in natural units GeV equivalent for $s^{-1}$, and $[\frac{\dot{a}}{a}]= s^{-1}$. But this value is so small!! Will we get the right scale factor so, even in eV it’s $H_0\sim 10^{-33}$ , this means we will get $a(t)$ multipled by this small factor! Also in the first answer of the thread they say: You should use $H_0$ in terms of its normal units, $[H] = kms^{-1}Mpc^{-1}$. Or simply $H_0 \approx 70 km/s/Mpc$.
{ "domain": "physics.stackexchange", "id": 88415, "lm_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, cosmology, dark-matter, dark-energy", "url": null }
beginner, programming-challenge, rust Title: ARC 067 - read ints and find the best choices I just started learning Rust, and this is my solution to a problem from Atcoder's Regular Contest #067, D - Walk and Teleport. The problem can be summarized as follows: There are N towns in a line, and you are about to visit all of them. Town i is located at the point with coordinate xi. You can travel either by walking or by teleporting. (You can combine them) Walking costs you a * |Δx|, where a is a constant given and Δx is the distance you are about to travel. Teleporing to any location costs you b, regardless of the distance you travel. Given a, b and a sorted list of coordinates (xi), find the minimum cost to travel all towns. Input is given in the form of N a b x1 x2 ... xN where N is the number of cities and a, b, xi is what described above. Again, xi is sorted. All a, b, xi are integers in the range of [1, 109].
{ "domain": "codereview.stackexchange", "id": 24762, "lm_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, programming-challenge, rust", "url": null }
python, strings, reinventing-the-wheel Title: Join List with Separator I was implementing something similar to Python's join function, where join([a1, a2, ..., aN], separator :: String) returns str(a1) + separator + str(a2) + separator + ... + str(aN) e.g., join([1, 2, 3], '+') == '1+2+3' I was implementing something similar and was wondering, what is a good pattern to do this? Because there is the issue of only adding the separator if it is not the last element def join(l, sep): out_str = '' for i, el in enumerate(l): out_str += '{}{}'.format(el, sep) return out_str[:-len(sep)]
{ "domain": "codereview.stackexchange", "id": 38777, "lm_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, strings, reinventing-the-wheel", "url": null }
$$7\sin^2 x\csc^2 x-7\sin^2 x=7\sin^2 x\frac{1}{\sin^2x}-7\sin^2 x=$$ $$=7-7\sin^2 x=7(1-\sin^2 x)=7\cos^2x$$ • This is what should come to mind first. Why does anyone need to factor out the $7\sin^2x$ first? – G-man Jan 17 '16 at 10:19 Notice, your mistake $\csc^2-1\ne 1+\cot^2 x$, one can easily simplify as follows $$7\sin^2 x\csc^2 x-7\sin^2 x$$ $$=7\sin^2 x(\csc^2 x-1)$$ $$=7\sin^2 x(\cot^2 x)$$ $$=7\sin^2 x\left(\frac{\cos^2 x}{\sin^2 x}\right)$$ $$=\color{red}{7\cos^2x}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471656514752, "lm_q1q2_score": 0.8155491012232224, "lm_q2_score": 0.8289388125473628, "openwebmath_perplexity": 699.7447043265048, "openwebmath_score": 0.8523096442222595, "tags": null, "url": "https://math.stackexchange.com/questions/1385941/factor-the-expression-and-use-the-fundamental-identities-to-simplify-7-sin2-x" }
homework-and-exercises, electromagnetism, energy Where is the energy stored? Equations 2.43 and 2.45 offer two different ways of calculating the same thing. The first is an integral over the charge distribution; the second is an integral over the field. These can involve completely different regions. For instance, in the case of the spherical shell (Ex. 2.9) the charge is confined to the surface, whereas the electric field is everywhere outside this surface. Where is the energy, then? Is it stored in the field, as Eq. 2.45 seems to suggest, or is it stored in the charge, as Eq. 2.43 implies? At the present stage this is simply an unanswerable question: I can tell you what the total energy is, and I can provide you with several different ways to compute it, but it is impertinent to worry about where the energy is located. In the context of radiation theory (Chapter 11) it is useful (and in general relativity it is essential) to regard the energy as stored in the field, with a density
{ "domain": "physics.stackexchange", "id": 98307, "lm_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, electromagnetism, energy", "url": null }
image-processing, stitching, photo Title: Blending Artifacts in Photo Stitching I am working on a photo stitching application that uses multi-band blending. I need to get rid of unpleasant edges appearing at some places: Here is the area of overlap (left - new image added to the mosaic, right - current mosaic contaning pixels of new image on background pixels to improve blending, middle - blending mask): If I just compute weighted average between left and right image according to mask, the result is of course OK. However, this would leave a visible seam as two images have usually slightly different exposure. So all three images need to be successively blurred to build a Gaussian pyramid - here is how one level of the pyramid looks like: You can see that the top part of blending mask "touches" the border. The Gaussian blurring filter reflects on image borders and this causes inaccuracy in lower band. I colored the images to make the problem more visible:
{ "domain": "dsp.stackexchange", "id": 399, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, stitching, photo", "url": null }
r, time-series Title: Decompose annual time series in R I have a time series. Data points are available for each year from 1966 to 2000. Using R, I want to decompose this time series into trend, seasonal and random components. When I run the decompose command, I get the error "time series has no or less than 2 periods". Since my data is annual I have specified a frequency of 1. What am I doing wrong? Here is the R code that I am using: dat=c(37.2,37,37.4,37.5,37.7,37.7,37.4,37.2,37.3,37.2,36.9,36.7,36.7,36.5, 36.3,35.9, 35.8,35.9,36,35.7,35.6, 35.2, 34.8, 35.3,35.6,35.6, 35.6, 35.9,36,35.7, 35.7, 35.5, 35.6, 36.3, 36.5)
{ "domain": "datascience.stackexchange", "id": 636, "lm_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, time-series", "url": null }
python, nlp, language-model Title: Are there any good out-of-the-box language models for python? I'm prototyping an application and I need a language model to compute perplexity on some generated sentences. Is there any trained language model in python I can readily use? Something simple like model = LanguageModel('en') p1 = model.perplexity('This is a well constructed sentence') p2 = model.perplexity('Bunny lamp robert junior pancake') assert p1 < p2 I've looked at some frameworks but couldn't find what I want. I know I can use something like: from nltk.model.ngram import NgramModel lm = NgramModel(3, brown.words(categories='news'))
{ "domain": "datascience.stackexchange", "id": 11650, "lm_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, nlp, language-model", "url": null }
react.js, jsx nextSquare.visited = true; nextSquare.color = newColor; } this.setState({ squares }); this.clearVisisted(squares); } getUniqueRandomColor(color) { const numberBetweenZeroAndFour = Math.floor((Math.random() * this.props.numberOfColors)); if (color === this.props.colors[numberBetweenZeroAndFour]) { return this.getUniqueRandomColor(color); } else { return this.props.colors[numberBetweenZeroAndFour]; } } clearVisisted(squares) { for (let i = 0; i < squares.length; i++) { for (let j = 0; j < squares[i].length; j++) { squares[i][j].visited = false; } } } renderSquare(i, j) { return <Square color={this.props.squares[i][j].color} onClick={() => this.floodFillIterative(i, j)} widthOfSquare={this.props.widthOfSquare} key={i + "," + j} />; } createTable() { let table = []
{ "domain": "codereview.stackexchange", "id": 32422, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "react.js, jsx", "url": null }
machine-learning, classification Enhancing your feature space in this way is often a necessary step in classification of images or other data objects because the raw feature space is typically filled with an overwhelming amount of unstructured and irrelevant data that comprises what's often referred to as "noise" in the paradigm of a "signal" and "noise" (which is to say that some data has predictive value and other data does not). By enhancing the feature space you can better identify the important data which has predictive or other value in your analysis (i.e. the "signal") while removing confounding information (i.e. "noise").
{ "domain": "datascience.stackexchange", "id": 197, "lm_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, classification", "url": null }
ros, navigation, cpu, move-base, load #recovery_behaviors: #- name: 'super_conservative_reset1' #type: 'clear_costmap_recovery/ClearCostmapRecovery' #- name: 'conservative_reset1' #type: 'clear_costmap_recovery/ClearCostmapRecovery' #- name: 'aggressive_reset1' #type: 'clear_costmap_recovery/ClearCostmapRecovery' #- name: 'clearing_rotation1' #type: 'rotate_recovery/RotateRecovery' #- name: 'super_conservative_reset2' #type: 'clear_costmap_recovery/ClearCostmapRecovery' #- name: 'conservative_reset2' #type: 'clear_costmap_recovery/ClearCostmapRecovery' #- name: 'aggressive_reset2' #type: 'clear_costmap_recovery/ClearCostmapRecovery' #- name: 'clearing_rotation2' #type: 'rotate_recovery/RotateRecovery' #super_conservative_reset1: #reset_distance: 3.0 #conservative_reset1: #reset_distance: 1.5 #aggressive_reset1: #reset_distance: 0.0 #super_conservative_reset2: #reset_distance: 3.0 #conservative_reset2: #reset_distance: 1.5 #aggressive_reset2: #reset_distance: 0.0
{ "domain": "robotics.stackexchange", "id": 28973, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, cpu, move-base, load", "url": null }
star, temperature Title: Hottest Possible Hydrogen-Fusing Stars I guess this is more a question about stellar models than anything else. I was wondering what is predicted to be the hottest possible stars that would still be hydrogen-burning. What complicates this more is that the most massive stars will probably only sit close to the main sequence (as very early O-type) for several thousand years before gaining a WNh spectrum despite still being relatively early in the lifetime. So I'll be somewhat more precise and ask what is the hottest possible star predicted at ZAMS that won't just blow itself apart by radiation pressure. Also tangential to the topic but have there been any stars found with an O1 spectrum, and is this even a spectral type that has models made for it? An answer to your question is contained within What is the largest hydrogen-burning star? The hottest observed main sequence stars are of type O3V, with photospheric temperatures of about 50,000 K.
{ "domain": "astronomy.stackexchange", "id": 3765, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "star, temperature", "url": null }
java, multithreading, networking, socket, location-services if(previousByte == 21 && currentByte == 22) { inputDataArray.clear(); System.out.println("Na4alo..."); } else if(previousByte == 23 && currentByte == 24) { //Do something here...
{ "domain": "codereview.stackexchange", "id": 6463, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, multithreading, networking, socket, location-services", "url": null }
type-theory, functional-programming, fixed-point, church-numerals The type C is a fixpoint of the type isomorphism F C ≅ C. In other words, we need to prove that there exist two functions, fix :: F C -> C and unfix :: C -> F C such that fix . unfix = id and unfix . fix = id. The type C is the initial algebra of the functor F; that is, the initial object in the category of F-algebras. In other words, for any type A such that a function p :: F A -> A is given (that is, A is an F-algebra), we can find a unique function q :: C -> A which is an F-algebra morphism. This means, q must be such that the law q . fix = p . fmap q holds. We need to prove that, given A and p, such q exists and is unique. These two statements are not equivalent; but proving (2) implies (1). (Lambek's theorem says that an initial algebra is an isomorphism.) The code of the functions fix and unfix can be written relatively easily: fix :: F C -> C fix fc = Cfix (forall r. \g -> g . fmap (\h -> h g) fc ) unfix :: C -> F C unfix c = (run c) (fmap fix)
{ "domain": "cs.stackexchange", "id": 17168, "lm_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, functional-programming, fixed-point, church-numerals", "url": null }
Now use binary search to find the largest value of $m$ for which a feasible solution exists. Of course, your problem is a NP-hard problem, so you shouldn't expect an efficient solution that works for all parameters -- but you might find that the ILP-based solution works well enough for your problem. Incidentally, you mention that a typical problem instance would have "1000 widgets, [with] weights ranging from 2-4 oz in .05 oz increments". This means that there are only 40 possible weights, so while you have 1000 widgets, there are effectively only 40 different types of widgets. This kind of situation allows a more efficient solution. It is possible to adjust the above algorithm to handle this situation. Let $w_1,\dots,w_n$ be the weights of the $n$ types of widgets, and let $q_1,\dots,q_n$ be the quantities of each type of widgets (i.e., you have $q_i$ widgets of weight $w_i$).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806546550656, "lm_q1q2_score": 0.8106575901476083, "lm_q2_score": 0.8267117919359419, "openwebmath_perplexity": 443.0305581765356, "openwebmath_score": 0.3960328996181488, "tags": null, "url": "https://cs.stackexchange.com/questions/48510/help-wrapping-my-head-around-a-combinatorial-optimization-problem/50179" }
an average of 5% annually, that is called your "minimal acceptable return," or MAR. In Markowitz's famous paper he writes that the return on the portfolio is a weighted average of the returns on the individual assets. Here's the rate of return (ROR) formula: Rate of return = [ (Current value − Initial value) ÷ Initial Value ] × 100. Investment Income Calculator. 48, you can expect your return to be 10 points higher or lower than the average … › Verified 1 days ago. For most funds, future monthly returns will fall within one standard deviation of its average return 68%. If there are N assets in the portfolio, the covariance matrix is a symmetric NxN matrix. It is calculated as the square root of variance by examining the variation between each data point (in this case the price of an asset) against the average. 4*10*16) = 0. Sauros perform better or worse than the market? b. This measure is similar to the Sharpe ratio, but uses DD in the denominator. 2021 No Comments Novinky. The
{ "domain": "leplec.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357542883923, "lm_q1q2_score": 0.8049525470371031, "lm_q2_score": 0.822189121808099, "openwebmath_perplexity": 882.7628329495639, "openwebmath_score": 0.7142139673233032, "tags": null, "url": "http://leplec.de/standard-deviation-of-portfolio-return-formula.html" }
ros, gazebo, joint, urdf, ros-kinetic I'm getting the following error message with Ignition Gazebo Fortress: [ign gazebo-6] [Err] [SDFFeatures.cc:1024] Asked to create a joint between links [left_inner_knuckle] as parent and [left_inner_finger] as child, but the child link already has a parent joint of type [RevoluteJoint]. [ign gazebo-6] [Err] [SDFFeatures.cc:1024] Asked to create a joint between links [right_inner_knuckle] as parent and [right_inner_finger] as child, but the child link already has a parent joint of type [RevoluteJoint].
{ "domain": "robotics.stackexchange", "id": 30135, "lm_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, joint, urdf, ros-kinetic", "url": null }
c++, array, iterator, collections public: using iterator = typename MDynIterator<T, dims-1, 0, Allocator>; using const_iterator = typename MDynIterator<T, dims-1, 1, Allocator>; // access to member MSubArray<T, dims-1, Allocator> operator[] (size_type i) { MSubArray<T, dims-1, Allocator> child(arr + rowsize * i, sizes + 1, rowsize / sizes[1]); return child; } const MSubArray<T, dims-1, Allocator> operator[] (size_type i) const { MSubArray<T, dims-1, Allocator> child(arr + rowsize * i, sizes + 1, rowsize / sizes[1]); return child; }
{ "domain": "codereview.stackexchange", "id": 30987, "lm_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++, array, iterator, collections", "url": null }