text
stringlengths
1
1.11k
source
dict
thermodynamics, energy, statistical-mechanics, partition-function Title: How to express internal energy in terms of the canonical function summing over energy levels? as far as I understand, the canonical partition function of a single particle can be expressed as follows: $$ z = \sum_i e^{-\beta\cdot\epsilon_i} $$ Where $i$ are the micro states, $\beta$ is the inverse of the product of the Boltzman constant and the temperature, and $\epsilon_i$ is the energy at that state. Which can be expanded for a system of N particles as: $ Z=z^N$. Where Z can be expressed $$ Z=\sum_i e^{-\beta\cdot E_i} = \sum_j w(E_j)\cdot e^{-\beta\cdot E_j}$$ Where j represents the energy level, and $w$ is the degeneracy of that energy level. So at this point I have my first question: Are $\epsilon$ from the single particle partition function and $E$, from the system's partition function different?
{ "domain": "physics.stackexchange", "id": 92060, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, energy, statistical-mechanics, partition-function", "url": null }
java, object-oriented, mvc, swing, hangman private void buildLabel(){ JPanel labelPanel = new JPanel(); labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.PAGE_AXIS)); guessesRemainingLabel = new JLabel("Guesses remaining: " + String.valueOf(Information.NUM_OF_GUESSES)); lettersGuessedLabel = new JLabel("Already guessed: "); secretWordLabel = new JLabel(); guessesRemainingLabel.setAlignmentX(Component.LEFT_ALIGNMENT); lettersGuessedLabel.setAlignmentX(Component.LEFT_ALIGNMENT); secretWordLabel.setAlignmentX(Component.LEFT_ALIGNMENT); labelPanel.add(guessesRemainingLabel); labelPanel.add(lettersGuessedLabel); labelPanel.add(secretWordLabel); containerPanel.add(BorderLayout.NORTH, labelPanel); } private void displayFrame(){ frame.setSize(FRAME_SIZE); frame.setLocationRelativeTo(null); frame.setVisible(true); }
{ "domain": "codereview.stackexchange", "id": 12674, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, mvc, swing, hangman", "url": null }
rviz, ros-kinetic, realtime, rosbridge, 2d-mapping thank you for your comment! Yes, I just wanna subscribe to the /map and display that on the web! But I cannot find the way to this. Comment by ahendrix on 2019-03-26: I don't know much about javascript or the ROS web tools, but some quick browsing of the documentation brought me to http://robotwebtools.org/jsdoc/ros2djs/current/maps_OccupancyGridClient.js.html , which seems to be able to subscribe to an occupancy grid and display it. I wasn't able to find a working example of that in a quick search, but there have been a lot of talks and documentation about the robot web tools packages, so I suspect that if you look hard enough, you'll be able to find something. Comment by ahendrix on 2019-03-26: Looks like I was a bit slow; @billy's comment includes a working example of the class that I linked to! See the answer to this question: https://answers.ros.org/question/315015/what-is-the-best-way-to-monitor-and-remote-control-the-robot-from-tablet/#315022
{ "domain": "robotics.stackexchange", "id": 32759, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, ros-kinetic, realtime, rosbridge, 2d-mapping", "url": null }
'Halls', of course, is correct in general. A quadratic function does not have a true inverse, unless the domain of the quadratic function is restricted appropriately. InfinityZero was correct about the function, f(x) = 3-x + 9-x, having a unique inverse, that is to say, an inverse which is truly a function. However, the reason 'IZ' gives, could stand to be elaborated upon. The reason that we can eliminate one of the two solutions to the quadratic equation which results when solving for 3-x, is that 3-x is a positive quantity and one of the solutions is positive while the other is strictly negative. Let's look at a slightly different function for an example of what 'Halls' cautioned about. Suppose we want to solve y = 9-x - 3-x for x. Let F(x) = 9-x - 3-x. F is not 1 to 1. It has a minimum of -1/4 at x = log3(2) . Now to solve y = 9-x - 3-x for x: Let t = 3-x. Substituting that into the equation for y gives: t2 - t = y . Add 1/4 to both sides to complete the square giving:
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305381464927, "lm_q1q2_score": 0.829859916528425, "lm_q2_score": 0.8615382129861583, "openwebmath_perplexity": 1487.0242017243866, "openwebmath_score": 0.6760445237159729, "tags": null, "url": "https://www.physicsforums.com/threads/inverse-of-3-x-9-x.615714/" }
c++, c++11, memory-management, template, container Container<Person> world; struct Company { void hire(Container<Person>::Handle employee){employees.insert(employee);} void fire(Container<Person>::Handle employee){employees.erase(employee);} void payEmployees() { std::cout << "paying employees...\n"; std::vector<Container<Person>::Handle> deadEmployees; for(auto &person : employees) { if(world.isExpired(person)) deadEmployees.push_back(person); else world[person].receivePayment(1200); } for(auto &person : deadEmployees) fire(person); std::cout << "...done.\n\n"; } std::set<Container<Person>::Handle> employees; }; int main() { Company corp; auto alice = world.emplace("Alice"); corp.hire(alice); corp.hire(world.emplace("Bob")); corp.payEmployees();
{ "domain": "codereview.stackexchange", "id": 14347, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, memory-management, template, container", "url": null }
Give a multiplication table for the group $U(12)\text{.}$ Hint ##### Exercise8 Give an example of two elements $A$ and $B$ in $GL_2({\mathbb R})$ with $AB \neq BA\text{.}$ Hint ##### Exercise15 Prove or disprove that every group containing six elements is abelian. Hint ##### Exercise16 Give a specific example of some group $G$ and elements $g, h \in G$ where $(gh)^n \neq g^nh^n\text{.}$ Hint ##### Exercise17 Give an example of three different groups with eight elements. Why are the groups different? Hint ##### Exercise18 Show that there are $n!$ permutations of a set containing $n$ items. Hint ##### Exercise25 Let $a$ and $b$ be elements in a group $G\text{.}$ Prove that $ab^na^{-1} = (aba^{-1})^n$ for $n \in \mathbb Z\text{.}$ Hint ##### Exercise31 Show that if $a^2 = e$ for all elements $a$ in a group $G\text{,}$ then $G$ must be abelian. Hint ##### Exercise35 Find all the subgroups of the symmetry group of an equilateral triangle. Hint ##### Exercise41 Prove that
{ "domain": "pugetsound.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126438601956, "lm_q1q2_score": 0.8176982934818676, "lm_q2_score": 0.8354835289107309, "openwebmath_perplexity": 221.69644107580123, "openwebmath_score": 0.9972699880599976, "tags": null, "url": "http://mathbook.pugetsound.edu/examples/sample-book/html/appendix-2.html" }
c++, strings std::string unicode_to_xascii(const std::wstring &wstr) { std::string result; unsigned p = 0, len = wstr.length(); result.resize(len); for( unsigned k = 0; k < len; ++k ){ uint16_t character = to_int(wstr[k]); if( character == static_cast<uint16_t>(XASCII::IGNORE)){ continue; } if( character <= Unicode::ASCII_END ){ result[p++] = static_cast<unsigned char>(character); continue; } if( Unicode::ALPHA <= character && character <= Unicode::OMEGA ){ result[p++] = static_cast<unsigned char>(XASCII::ALPHA + (character - Unicode::ALPHA)); } else if( Unicode::alpha <= character && character <= Unicode::omega ){ result[p++] = static_cast<unsigned char>(XASCII::alpha + character - Unicode::alpha); continue; }
{ "domain": "codereview.stackexchange", "id": 38564, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, strings", "url": null }
electromagnetism, magnetic-fields, conventions, clifford-algebra In the bivector formulation, the B-field is a bivector, and the force it exerts on a moving charged particle is $\vec{F}_{mag} = -q\vec{v} \vee \mathbf{B}$ (where $\vee$ is the inner product). Where does this extra negative sign come from? Why doesn't it show up in the cross product formulation? This is something I'm personally also trying to understand better, but here is something that might help. I was able to derive the minus sign by starting with the bivector and then deriving the usual $\vec{B}$ pseudovector field from that. Since I start by assuming the bivector is positive, I get the result that the pseudovector points in the "opposite sense", leading to a negative sign. If you turn my derivation backwards, assuming that the pseudovector is the positive one instead, you should get the formula you have.
{ "domain": "physics.stackexchange", "id": 72903, "lm_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, conventions, clifford-algebra", "url": null }
11. Jun 13, 2010 ### Gib Z Do you know how to simplify $$ln (a^b)$$? That will help you for this question. 12. Jun 13, 2010 ### Mentallic Gib Z, the question is exponentiating the entire logarithm. For $$y=\left(ln(5x^3-5)\right)^3$$ Let $$u=5x^3-5$$ Now we have $$y=\left(ln(u)\right)^3$$ Let $$t=ln(u)$$ So finally we have $$y=t^3$$ Now the derivative is $$\frac{dy}{dx}=\frac{dy}{dt}.\frac{dt}{du}.\frac{du}{dx}$$ 13. Jun 13, 2010 ### Twin468 Would it be bln(a) ? 14. Jun 13, 2010 ### Mentallic Yes ln(ab)=b.ln(a) but that's not the problem at hand, according to: 15. Jun 13, 2010 ### Twin468 Ok, I will use your previous post to figure it out. Thanks Mentallic! I really appreciate it! 16. Jun 13, 2010 ### Mentallic No problem By the way, I never use this long tedious method of substitution to find the derivative. Finding the pattern in what happens will really save you time and energy. Let's look at your most recent example: $$y=\left(ln(5x^3-5)\right)^3$$
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9736446463891304, "lm_q1q2_score": 0.8155441930081166, "lm_q2_score": 0.8376199633332891, "openwebmath_perplexity": 3111.7581920250486, "openwebmath_score": 0.567322850227356, "tags": null, "url": "https://www.physicsforums.com/threads/finding-f-x.409829/" }
php, design-patterns class MercedesCreator extends CarFactory { public function factoryMethod(): Car { return new Mercedes(); } } <?php require_once('car/AudiCreator.php'); require_once('car/MercedesCreator.php'); function clientCode(CarFactory $carFactory) { // ... echo "Client: " . $carFactory->someOperation(); // ... } echo "The client . <br>"; clientCode(new AudiCreator()); echo "\r\n"; echo "<br>"; echo "<br>"; clientCode(new MercedesCreator()); I think you're thinking of this backwards. The point isn't that you need to define special subclasses to use the factory method. Rather, when you need to define special subclasses containing their own complex functionality, then you use the factory method. From the Gang of Four: Use the Factory Method pattern when a class can't anticipate the class of objects it must create, [or it] wants its subclasses to specify the classes it creates [...].
{ "domain": "codereview.stackexchange", "id": 39568, "lm_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, design-patterns", "url": null }
quantum-mechanics, symmetry, ising-model, time-reversal-symmetry You asked what if one changes the transverse field $g\sum_i \sigma^x_i$ to the $y$ direction. In that case, the two Hamiltonians are unitarily related (i.e. a $\pi/2$ spin rotation $U_z$ around $z$ would bring it back). Let me call the Hamiltonian with $x$ transverse field $H_x(g)$ where $g$ is the transverse field, and with $y$ transverse field $H_y(g)$. Define $U_z=e^{i\pi \sum_i\sigma^z_i/4}$, then it is easy to check that $U_z H_y(g) U_z^{-1}= H_x(g)$. Since we know $H_x^*(g)=H_x(g)$, we can easily find $H_y^*=U_z^2 H_y U_z^{-2}$. Therefore one just has to redefine the time-reversal symmetry to be $T=K U_z^2$. If you really want to break the reality condition, in a way that can not be fixed by additional unitary transformations, then one needs to turn on transverse fields along all three dimensions.
{ "domain": "physics.stackexchange", "id": 27567, "lm_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, symmetry, ising-model, time-reversal-symmetry", "url": null }
visible-light, plasma-physics The mean free path of light in the plasma is $(n\sigma)^{-1}$, where $n$ is the electron number density. This then has to be smaller than the width of the sabre "beam" if it is to block the light and cast a shadow. If we imagine the "beam" width is about 5cm, then $ n> (0.05\sigma)^{-1} = 3\times 10^{29}$ m$^{-3}$. If the plasma is pure ionised hydrogen, then it would have a density of 500 kg/m$^3$, so I guess this is just about conceivable/portable. Of course you could cheat. For example if you take a partially ionised plasma and then only illuminate it with a lamp that emits photons at the discrete resonant frequency corresponding to a particular atomic/ionic transition in the plasma, then it could be much sparser and cast a shadow because resonant cross-sections are much greater than the Thomson scattering cross-section.
{ "domain": "physics.stackexchange", "id": 48748, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light, plasma-physics", "url": null }
algorithms, graphics $DistanceAtMost(s, t, 1)$ is trivial. For $k > 1$, $$DistanceAtMost(s, t, k) = \bigvee\limits_w DistanceAtMost(s, w, \lfloor k \rfloor) \wedge DistanceAtMost(w, t, \lceil k \rceil).$$ To compute the predicate for given $s$, $t$, $k$, we enumerate all intermediate vertices $w$ independently check for paths from $s$ to $w$ and from $w$ to $t$ recursively. Recursion has $O(\log n)$ depth and $O(1)$ memory is required at each level (we need to keep a counter for $w$ and remember if current recursive call is computing the left or the right part of the conjunct). Thus the predicate is computable in $O(\log n)$. Second, we define $$DistanceIsExactly(s, t, k) = DistanceIsAtMost(s, t, k) \wedge \neg DistanceIsAtMost(s, t, k - 1).$$
{ "domain": "cs.stackexchange", "id": 20315, "lm_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, graphics", "url": null }
quantum-state, quantum-algorithms Title: Clarifying basis encoding Background I'm reviewing basis encoding in this paper. In their example, they state: $(-.07, 0.1, 0.2)^T \in \mathbb{R}^3$ is encoded as $|x\rangle = |11011\;01011\;00011\rangle$ Unpacking this, it seems clear that the first bit representing each value is the sign bit and this appears to be corroborated in the text: The sign of the real number is encoded by an additional leading binary number, e.g. '1' for '−' and '0' for '+'.
{ "domain": "quantumcomputing.stackexchange", "id": 4020, "lm_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-state, quantum-algorithms", "url": null }
c++, c++11, json Are you sure you want to use wide strings? From: rfc7159 JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32. The default encoding is UTF-8 ###Interface // Access JsonHelper operator[](wstring wstr); JsonHelper operator[](long index); That's fine as far as it goes. If your JSON is an object or an array. But what happens if it is just a string on integer? There is currently no way to access it. ##Object Accesses JsonHelper JsonHelper::operator [](std::wstring wstr){ // STUFF This finds the key. long pos = json_wstr.find(wstr); if(pos == std::wstring::npos) { throw L"Object not found in json"; }
{ "domain": "codereview.stackexchange", "id": 25860, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, json", "url": null }
Things would get a little more complicated if the requirement were to have US and Russia with two intervening delegates, not least because we would then have to "unwrap" FAB again. • The correct answer is $564\,480$. So you neglected a multiplication by $2$ somewhere. – ok_ Jan 29 '15 at 3:27 • @side thanks, it was the ordering of US & Russia. – Joffan Jan 29 '15 at 15:15 Another approach: first ignore the US/Russia restriction and just count the number of seatings where France and Britain are adjacent. Your trick of "glue them together and consider them as a seat with 2 permutations" works here. Say you get $X$ seatings this way.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668657039606, "lm_q1q2_score": 0.8197487574182291, "lm_q2_score": 0.8354835309589074, "openwebmath_perplexity": 844.4700525956304, "openwebmath_score": 0.6029691696166992, "tags": null, "url": "https://math.stackexchange.com/questions/1124011/multnomial-coefficient-combinatorics-problem" }
strip is simply “y”. Determine the mass moment of inertia of the plate with respect to (a) the centroidal axes AA' and BF, (b) the centroidal axis CC that is perpendicular to the plate. The center of mass of the square is located at the coordinate origin. This expression simply recognizes how the size of the triangle affects moment of inertia. The second bead of mass m2=45g is placed on the left vertex. We find Ten Sephiroth on the Qabalistic Tree. The moment of inertia for both will be: I y’ = hb 1 3 / 12 + hb 2 3 / 12. Show that a rotation for renders the tensor diagonal. Correct answers: 2 question: A piece of thin uniform wire of mass m and length 3b is bent into an equilateral triangle. Hence, from extreme left line = 2b/3 = (2×12)/3. Physics(please help) Four very thin rods, each 8. Polar Area Moment of Inertia and Section Modulus. Calculating Moment of Inertia Integration can be used to calculate the moment of inertia …. The Moment of Inertia of Right Triangle calculator
{ "domain": "thorstenharte.de", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9850429151632047, "lm_q1q2_score": 0.8271739935020114, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 265.07878507484645, "openwebmath_score": 0.5668525099754333, "tags": null, "url": "https://thorstenharte.de/moment-of-inertia-of-an-equilateral-triangle-about-its-center.html" }
inorganic-chemistry, physical-chemistry, symmetry, group-theory 2. The first-order Jahn–Teller effect Recall that $$E_n = \En{0} + \color{red}{q\En{1}} + \cdots \tag{8}$$ Therefore, if $\En{1} > 0$, then stabilisation may be attained with a negative value of $q$; if $\En{1} < 0$, then stabilisation may be attained with a positive value of $q$. These simply represent distortions in opposite directions along a vibrational coordinate. A well-known example is the distortion of octahedral $\ce{Cu^2+}$: there are two possible choices, one involving axial compression, and one involving axial elongation. These two distortions arise from movement along the same vibrational coordinate, except that one has $q > 0$ and the other has $q < 0$. In order for there to be a first-order Jahn–Teller distortion, we therefore require that $$\En{1} = \left<\n{0}|(\md H/\md q)| \n{0}\right> \neq 0 \tag{9}$$
{ "domain": "chemistry.stackexchange", "id": 8080, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, physical-chemistry, symmetry, group-theory", "url": null }
general-relativity, special-relativity, reference-frames, acceleration, inertial-frames Summary In summary, none of the claims your friend presented are flaws in Relativity. They are misunderstandings, but quite natural ones. Before I started diving deep into the math I also thought that SR was not enough to deal with acceleration and propagated the same mistakes, but once you start doing the calculations these things get cleared out and you notice how everything falls in place beautifully.
{ "domain": "physics.stackexchange", "id": 84857, "lm_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, special-relativity, reference-frames, acceleration, inertial-frames", "url": null }
homework-and-exercises, newtonian-gravity, drag, air, free-fall Split the expected deployment time into a number of intervals (5 shown), each with its average $k_i$ value. To each value $k_i$ and time interval can then be applied the derivation in the previous answer. Adding all obtained $y_i$ gives an approximated total displacement during deployment. This is of course a popular method of numerical integration.
{ "domain": "physics.stackexchange", "id": 28828, "lm_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-gravity, drag, air, free-fall", "url": null }
java, multithreading, datetime, swing, timer public static String toStringHMS(Integer i) { String s = i.toString(); if (s.length() == 1) { s = "0" + s; } return s; } public static String toStringM(Double d) { Integer i = (int) Math.round(d); String s = i.toString(); if (s.length() == 1) { s = "00" + s; } else if (s.length() == 2) { s = "0" + s; } return s; } } class Stopwatch extends JFrame { /** * */ private static final long serialVersionUID = 1L; private static StopwatchController controller; final static MultiThreadedStopwatchController stopwatchController = new MultiThreadedStopwatchController(); static Clock clock = new Clock(stopwatchController); static Thread t = new Thread(clock);
{ "domain": "codereview.stackexchange", "id": 8967, "lm_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, datetime, swing, timer", "url": null }
c#, performance, interview-questions, hash-map string[] Value = textToLower.Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries); // Split the string and remove the empty entries
{ "domain": "codereview.stackexchange", "id": 33939, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, interview-questions, hash-map", "url": null }
biochemistry, physiology, cell-biology It's a difficult question because every step in the development of a germ cell is ultimately necessary for the final differentiation, which includes a meiotic division. Meiosis requires a lot of specialized components to pair and segregate homologues, to induce and resolve recombination, etc. What starts it all is still largely unknown. There are plenty of mutants that halt the process, but these are required along the way, so damaging the pathway ultimately stops it from progressing. At least one study has been able to initiate the program of meiosis in yeast: Induction of meiosis in Saccharomyces cerevisiae depends on conversion of the transcriptional represssor Ume6 to a positive regulator by its regulated association with the transcriptional activator Ime1. I Rubin-Bejerano, S Mandel, K Robzyk, and Y Kassir
{ "domain": "biology.stackexchange", "id": 79, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry, physiology, cell-biology", "url": null }
Staff Emeritus Well, the bad news is we did his homework for him. :tongue2: At least the message was consistent, though, so maybe it will still impress upon him. 9. Jan 25, 2005 ### Townsend Thank you everyone for the overwhelming responses. After Learningphysics's reply I did manage to see my error and realized that I would end up using C(n,r) but that is about as far as I had taken it. This is what I had come up with on my own $$\sum^n_{i=0}{\frac{(2n+1)!}{(2n+1-i)!i!}$$ Which I think that would be correct but not very nice to look at. I was going to attempt to simplify that creature and I still will try to. There is obviously more than one way to approach this kind of problem and I am going to look over all of them, thanks again. Townsend
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9755769092358046, "lm_q1q2_score": 0.8065209368882545, "lm_q2_score": 0.8267117940706734, "openwebmath_perplexity": 519.7550333657284, "openwebmath_score": 0.8139206171035767, "tags": null, "url": "https://www.physicsforums.com/threads/another-counting-problem.61213/" }
ros, ros2, launch-file Title: Which ROS2 launch is preferable python or xml? As of ROS2 Eloquent we can use xml or yaml for writing launch files. Previous versions of ROS2 used python with the roslaunch API. So my question is which of these methods is currently recommended or considered best practice? I will be converting an existing ROS1 package to ROS2 Foxy and I need to decide how to update the launch structure. I'm leaning toward XML since that will make the conversion more straightforward, but if python files are now considered best practice I will follow the community standards. Update from Answer: After reviewing the documentation based on the concerns with XML functionality pointed out by @stevemacenski, I have decided to stick with python until XML adds support for components as they are the recommended way to design nodes https://discourse.ros.org/t/ros-2-dashing-diademata-released/9365.
{ "domain": "robotics.stackexchange", "id": 34982, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros2, launch-file", "url": null }
information-theory, error-correcting-codes For the second part I took random variables $\forall\ J\subseteq [n]:\mathbf{1}_J$ which indicates whether the errors occurred are indexed by $J$. It is clear that $\mathbb{E}[\mathbf{1}_J]=\alpha^{|J|}(1-\alpha)^{n-|J|}$ and I tried to use the above bound for all the $J$'s with $|J|\leq n-k$ and a bound of $1$ with the other $J$'s, but it doesn't seem to be sub-exponential at the end. Moreover I ended up with partial binomial theorem sums and I failed to estimate them. To upper bound the first probability, we can assume without loss of generality that the sent codeword is the zero codeword. After deleting $|J|$ rows, we are left with a random $(n-|J|)\times k$ matrix $A$, and we want to bound the probability that its (right) kernel is non-trivial, that is, that there is a non-zero vector $x$ such that $Ax=0$. For any non-zero vector $x$, $Ax$ is a uniformly random vector (why?), and so the probability that $Ax=0$ is $q^{-(n-|J|)}$. Since there are $q^k-1$ many non-zero vectors $x$,
{ "domain": "cs.stackexchange", "id": 10401, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "information-theory, error-correcting-codes", "url": null }
in this course can earn a certificate in the series by signing up for Coursera's verified certificate program and passing the series' final exam. The radius of convergence for the series ¥ å n=0 n2xn 10n is. about the series P an. Learn vocabulary, terms, and more with flashcards, games, and other study tools. Since 0<1 (in this example the limit does not depend on the value of x), the series converges for all x. ASL-STEM Forum. It is very tough to answer such a general question, but I will give it a shot. Convergence of Fourier Series Some Definitions A function $$f\left( x \right)$$ defined on an interval $$\left[ {a,b} \right]$$ is said to be piecewise continuous if it is continuous on the interval except for a finite number of jump discontinuities (Figure $$1$$). The proof is easy: if the series converges, the partial sums s k s_k s k. So, the original series will be convergent/divergent only if the second infinite series on the right is convergent/divergent and the test can be
{ "domain": "auus.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471661250913, "lm_q1q2_score": 0.8362417361977275, "lm_q2_score": 0.8499711794579723, "openwebmath_perplexity": 425.7375870305053, "openwebmath_score": 0.8789405822753906, "tags": null, "url": "http://nxsr.auus.pw/series-convergence-exam.html" }
ios, osx, networking, swift // Don't need this anymore freeaddrinfo(servinfo) (Remark: I am using println() for diagnostic output in this review instead of your log.atLevelDebug(). The reason is that I wanted to test the code before posting an answer.) That seems to be working code (with one exception, see below), but there are some things that can be simplified or improved. nil is a possible value for any UnsafeMutablePointer<T>, so you can simplify your initialization, for example: var hints = addrinfo( ai_flags: AI_PASSIVE, // Assign the address of my local host to the socket structures ai_family: AF_UNSPEC, // Either IPv4 or IPv6 ai_socktype: SOCK_STREAM, // TCP ai_protocol: 0, ai_addrlen: 0, ai_canonname: nil, ai_addr: nil, ai_next: nil) You traverse the address list from getaddrinfo with var info = servinfo while info != UnsafeMutablePointer<addrinfo>.null() { // ... info = info.memory.ai_next }
{ "domain": "codereview.stackexchange", "id": 10944, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ios, osx, networking, swift", "url": null }
aqueous-solution, analytical-chemistry, ph, equipment The glass is amorphous and in this case, the exterior layers are somewhat porous, so there is a large volume of Si-O groups exposed to the solution. Protons will stick to these groups and establish a negative charge on the outside of the glass. The number is related to the pH or hydronium concentration of the solution on the outside of the electrode. edit: I have just started to read this early discussion, where the idea that the glass itself may behave as a sort of buffer:
{ "domain": "chemistry.stackexchange", "id": 10790, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "aqueous-solution, analytical-chemistry, ph, equipment", "url": null }
nuclear-physics, power, nuclear-engineering Title: What practical issues remain for the adoption of Thorium reactors? From what I've read on thorium reactors, there's enormous benefit to them. Their fuel is abundant enough to power human civilization for centuries, their fission products are relatively short-lived, they're far less prone to catastrophic failure, and they don't produce anything you could feasibly use as a source of material for nuclear weapons. So what technical issues need to be resolved so that Thorium reactors become practical and put into wide use? Is it purely engineering issues that need to be overcome? Or are there problems of physics as well? If so, what are the technical problems and what research is occurring to overcome them?
{ "domain": "physics.stackexchange", "id": 72810, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nuclear-physics, power, nuclear-engineering", "url": null }
graphs $k$-outerplanar graphs: A planar embedding (i.e. an embedding without crossings) is $1$-outerplanar if all of the vertices belong to the unbounded face. For $k \gt 1$, a planar embedding is said to be $k$-outerplanar if removing the vertices on the outer face results in a $(k − 1)$-outerplanar embedding. A graph is $k$-outerplanar if it has a $k$-outerplanar embedding. The idea of the proof is to come up with a parameter of graphs $f(G)$ satisfying the following properties:
{ "domain": "cs.stackexchange", "id": 2305, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graphs", "url": null }
python, beginner, python-3.x, chess # Count the black pieces if len([p for p in current_pieces if p.startswith('b')]) > 16: return False return True Let's put the script back together after giving is_valid_p() a clearer name and formatting to match the other function. def isValidPieceSet(current_pieces): #create a dictionary with all the pieces of each color as the key # and the valid starting number of the pieces as value pieces = ['pawn', 'knight', 'bishop', 'rook', 'queen', 'king'] colors = ['w', 'b'] all_pieces = [] for color in colors: for p in pieces: all_pieces.append(color + p) #accepts a list, checking if the pieces of the chessboard are valid if 'bking' not in current_pieces or 'wking' not in current_pieces: return False for c_p in current_pieces: #checking if the pieces' names are valid if c_p not in all_pieces: return False
{ "domain": "codereview.stackexchange", "id": 44642, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, chess", "url": null }
roslaunch Notice how I added the missing quotation mark and closing > and changed $ to n. Originally posted by jayess with karma: 6155 on 2017-09-24 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by jason on 2017-09-24: Thanks. I have no idea how could I make this mistake with "copy" and "paste". Anyway, thank you very much. Comment by jayess on 2017-09-24: No problem. Glad to help. Comment by gvdhoorn on 2017-09-25: @jason: the $ is typically used by text-based/console editors to indicate that the line is longer than the width of the text editor window. If you then copy-paste using mouse selection, you copy incomplete lines.
{ "domain": "robotics.stackexchange", "id": 28909, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "roslaunch", "url": null }
zoology, adaptation, language, communication In terms of human-pet communication then, there seems to be more emphasis on the human interpretation of the natural postures adopted by animals, than the animals themselves. Pets may behave very differently to animals in the wild, but it comes back to what the specific human is used to. If you have had a lot of contact with pet dogs you are in a better position to associate the current behaviour of a pet dog with the correct emotional state. No doubt the animal with subconsciously adjust their behaviour to achieve the 'correct' human interpretation, and thus get fed, or whatever.
{ "domain": "biology.stackexchange", "id": 6770, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "zoology, adaptation, language, communication", "url": null }
java, object-oriented ActivityTable.java (Abstract class): public abstract class ActivityTable { protected List<String> studentsAtTable; protected int totalChairs; protected Activity activity; public ActivityTable(int chairs) { this.totalChairs = chairs; } public Activity getActivity() { return activity; } public int chairsRemaining() { return totalChairs - studentsAtTable.size(); } public boolean isFullyOccupied(){ return chairsRemaining() == 0; } public void addStudent(String name) { if (chairsRemaining() <= 0){ System.out.println("Table is full"); return; } studentsAtTable.add(name); } }
{ "domain": "codereview.stackexchange", "id": 23248, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented", "url": null }
From the Article $240,$ Ex$-5$ of Plane Trigonometry(by Loney), $$\arctan x+\arctan y=\begin{cases} \arctan\frac{x+y}{1-xy} &\mbox{if } xy<1\\ \pi+\arctan\frac{x+y}{1-xy} & \mbox{if } xy>1\\\text{sign}(x)\cdot\dfrac\pi2 & \mbox{if } xy=1\end{cases}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9678992932829917, "lm_q1q2_score": 0.8107317744733921, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 105.84369404594536, "openwebmath_score": 0.9622615575790405, "tags": null, "url": "https://math.stackexchange.com/questions/1837410/inverse-trigonometric-function-identity-doubt-tan-1x-tan-1y-pi-tan?noredirect=1" }
php, object-oriented, mysql, e-commerce Title: Object-oriented shopping cart I have just started to try and learn 'OOP' but it appears I'm doing this wrong, according to the people on Stack Overflow. The code below is far from object-orientated, but I'm finding it hard as I'm self teaching my self and everyone does everything differently. I'm building a shopping cart and I need to be able to have both the admin and user login, so obviously both user types can use the same login and logout functions. I'm guessing I could use inheritance there, but I just need some one to tell me what I have done wrong or if anything is done right to confirm this. Below is my create user page and my database and user class: //Sanitize User Input $username = $database->sanitize_admin_input($_POST['username']); $password = $database->sanitize_admin_input($_POST['password']); //Check if user already exists. $exists = $database->check_user_exists($username);
{ "domain": "codereview.stackexchange", "id": 3590, "lm_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, mysql, e-commerce", "url": null }
homework-and-exercises, energy, momentum, conservation-laws, collision Title: Mathematical question on Collisions A 2.5kg ball travelling with a speed of 7.5m/s makes an elastic collision with another ball of 1.5kg and travelling at the speed of 3.0m/s in the same direction. -- What are the velocities of the balls immediately after collision? In an elastic collision the guiding principles are the conservation of momentum $$p_{1,before} + p_{2,before} = p_{1,after} + p_{2,after}$$ and the similarly the conservation of total kinetic energy. With both you can solve your problem easily. (I did not downvote but your question shows zero own effort which is not appreciated here, as the complete answer is contained in the first google hit to 'elastic collision'.)
{ "domain": "physics.stackexchange", "id": 2909, "lm_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, energy, momentum, conservation-laws, collision", "url": null }
organic-chemistry, amines 2a. $\ce{CH3+ + H2O -> CH3OH +H+}$ 2b. $\ce{CH3+ + NO2- -> CH3NO2}$ and $\ce{CH3+ + NO2- -> CH3ONO}$ 2c. $\ce{CH3+ + Cl- -> CH3Cl}$ 2d. $\ce{CH3+}$ reacts with methylamine to form dimethyl amine Methanol formed above can react with $\ce{CH3+}$ to form dimethyl ether Methanol can also react with nitrous acid to form methyl nitrite The above book is relying upon Austin, A. T., The Action of Nitrous Acid on Aliphatic Amines Nature 188, 1086-1088 (1960) as reference 472 to support the above information. Austin explains that, under the reaction conditions: 0.5 mole methylamine hydrochloride 1.5 moles sodium nitrite 550 ml water slowly acidified with 0.4 to 0.6 equivalents of 2N sulphuric acid room temperature products are as follows: methanol: 6-25% methyl nitrite: 45-35% methyl chloride: 13% nitromethane : 6% methylnitrolic acid: 10-12% Austin then states:
{ "domain": "chemistry.stackexchange", "id": 6525, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, amines", "url": null }
homework-and-exercises, newtonian-mechanics, forces, kinematics, acceleration Title: Acceleration in $x$ and $y$ directions of a pendulum swinging? If there is a pendulum that gets released and only moves in two dimensions, what would it’s acceleration be in the x and y directions, meaning at what rate is the velocity changing in the x and y directions? If it is possible to derive a formula, how would it be derived? If it is possible to derive a formula, how would it be derived? You would use Newton's second law. This is the standard procedure for problems like these 1) Draw a free body diagram that includes all forces acting on the object 2) Choose a coordinate system to work in 3) Use Newton's second law $\sum \mathbf F=m\mathbf a$ 4) Use algebra to determine the acceleration I will leave it up to you to follow these steps for the simple pendulum. It is a good exercise to do.
{ "domain": "physics.stackexchange", "id": 53985, "lm_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, forces, kinematics, acceleration", "url": null }
python, oauth, jwt parts = list(urlparse.urlparse(url)) query = dict(urlparse.parse_qsl(parts[4])) query.update(params) parts[4] = urlencode(query) redirect_url = urlparse.urlunparse(parts) self.redirect(redirect_url) @gen.coroutine def _do_token(self, requesting_user, params): code = params.get("code", None) grant_type = params.get("grant_type", None) redirect_uri = params.get("redirect_uri", None) resource = params.get("resource", None) state = params.get("state", None) client_id = params.get("client_id", None) client_secret = params.get("client_secret", None) refresh_token = params.get("refresh_token", None) tid = params.get("tenant_id", None) token_type = "bearer"
{ "domain": "codereview.stackexchange", "id": 19529, "lm_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, oauth, jwt", "url": null }
classical-mechanics, tensor-calculus, hamiltonian-formalism Interior Product: To calculate interior products, it's easily observed that $\iota_X\alpha$ is $C^{\infty}(M)$-linear in both the $X$ slot and also $\alpha$. This is why I've been using the $\lrcorner$ notation for interior product: it "almost behaves" like a "regular product" $\cdot$ in the sense that \begin{align} X\, \lrcorner \, \alpha &= \left(\sum_aX^a \frac{\partial}{\partial x^a}\right)\, \lrcorner \, \left(\sum_I \alpha_I \, dx^I\right) = \sum_{a,I} X^a \alpha_I \left(\frac{\partial}{\partial x^a} \, \lrcorner \, dx^I\right) \end{align} So, you see, to calculate the interior product, all you need to know is how the interior product of the basic "coordinate vector fields" and "coordinate $1$-forms" works. Now, using repeated application of the product rule, and the fact that $\frac{\partial}{\partial x^a}\, \lrcorner \, dx^i = \frac{\partial x^i}{\partial x^a}=\delta^i_a$ (immediate consequence of the definitions), we see that \begin{align}
{ "domain": "physics.stackexchange", "id": 70692, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, tensor-calculus, hamiltonian-formalism", "url": null }
On the right there is another right-angled triangle and its base is $$1-3a-x$$. Triangle 2: Angle = $$60°$$, opposite = $$2a$$, and adjacent = $$1 - 3a - x$$ From triangle 1: $$\tan60° = \frac{a}{x} \implies x = \frac{a}{\sqrt{3}}$$ From triangle 2: $$\tan60° = \frac{2a}{1-3a-x}$$ Equalising $$\tan60°$$ and substituting for $$x$$: $$\frac{2a}{1-3a-x} = \frac{a}{x} \implies \frac{2a}{1-3a-\frac{a}{\sqrt{3}}} = \frac{a}{\frac{a}{\sqrt{3}}}$$ Simplify: $$\frac{2}{1-3a-\frac{a}{\sqrt{3}}} = \frac{\sqrt{3}}{a}$$ $$\frac{2a}{1-3a-\frac{a}{\sqrt{3}}} = \sqrt{3}$$ $$2a = \sqrt{3}(1-3a-\frac{a}{\sqrt{3}})$$ $$3a +3a\sqrt{3}= \sqrt{3}$$ $$a= \frac{\sqrt{3}}{(3 +3\sqrt{3})}$$ Rationalise the Denominator $$a= \frac{\sqrt{3}(3 -3\sqrt{3})}{(3 +3\sqrt{3})(3 -3\sqrt{3})}$$ $$a= \frac{3 -\sqrt{3}}{6}$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.975946451303227, "lm_q1q2_score": 0.808999882142364, "lm_q2_score": 0.8289388019824946, "openwebmath_perplexity": 503.7812446410305, "openwebmath_score": 0.8194327354431152, "tags": null, "url": "https://math.stackexchange.com/questions/3360970/how-can-i-find-the-side-length-two-squares-inside-an-equilateral-triangle" }
homework-and-exercises, quantum-field-theory, hilbert-space, gauge-theory, brst The right hand side becomes: $$\langle 0| a_0 a_i a^\dagger_i a_i a^\dagger_0 a^\dagger_i | 0\rangle = \langle 0|a_0 a^\dagger_0 a_i a^\dagger_i a_i a^\dagger_i | 0\rangle$$ $$\langle 0|(-1+a^\dagger_0 a_0)(1+a^\dagger_ia_i)(1+a^\dagger_ia_i)|\rangle$$ $$\langle 0|(-1)(1+a^\dagger_ia_i)(1)|\rangle = \langle 0|(-1)(1)(1)|\rangle = -1$$ Such that $rhs \neq lhs$ and the state appears to by unphysical. The question One of the following statements must be true but I can't figure out which one and why. I'm sorry in advance if this is trivial (it should be) but I'm really confused at the moment:
{ "domain": "physics.stackexchange", "id": 39588, "lm_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, quantum-field-theory, hilbert-space, gauge-theory, brst", "url": null }
acid-base, ph A concern here is that your shortcut equations rely on what's often called the "small x approximation," which says the amount of HF that actually dissociates is so small we can neglect the difference between the initial and equilibrium molarity of HF. Is that actually true? We would need to do the full calculation to see, starting from the Ka equation that describes the equilibrium composition of the solution: $$K_a = \frac{[{\rm H}_3{\rm O}^{+}][{\rm F}^{-}]}{[{\rm HF}]}$$ If we let $x$ stand for the equilibrium molarity of ${\rm H}_3{\rm O}^{+}$ and $C$ for the initial molarity of HF, then this equation turns into $$x^2 = K_a (C - x)$$ which can be solved with the quadratic equation. Using $C = 0.04$ we find $x = 4.819\times10^{-3}$ which gives pH = 2.317... You'll notice that's different from your value, and that's because in fact about 12% of the HF dissociates, which isn't that small.
{ "domain": "chemistry.stackexchange", "id": 10348, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acid-base, ph", "url": null }
Consider the following limit:$$\lim_{x \to\infty}\frac{2+2x+\sin(2x)}{(2x+\sin(2x))e^{\sin(x)}}$$ If we apply L'hospital's rule then we get: Since the function $e^{-\sin(x)}$ is bounded and $\frac{4\cos(x)}{2x+4\cos(x)+\sin(2x)}e^{-\sin(x)}$ tends to $0$. However, it is also stated that: Furthermore, (referring to the application of the L'hospital's Rule) it is stated in conclusion that: • Why would the non-existence of the limit imply the non-existence of it's product with something? I mean, for example, $\lim_{x \to \infty} x$ doesn't exist, but $\lim_{x \to \infty} xe^{-x}$ exists and equals zero. The orinigal limit exists and equals zero by L'Hopital's rule, there is nothing wrong with the question. – астон вілла олоф мэллбэрг Sep 23 '16 at 10:26 • @GiuseppeNegro There was a typo. Please see the edited version. – nls Sep 23 '16 at 10:35 Since $$-1 \leq -\sin x \leq 1, \ \ \ 1/e\leq e^{-\sin x}\leq e$$ Thus,
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9518632302488964, "lm_q1q2_score": 0.8013028761219336, "lm_q2_score": 0.8418256432832333, "openwebmath_perplexity": 133.6641779716754, "openwebmath_score": 0.9448237419128418, "tags": null, "url": "https://math.stackexchange.com/questions/1938253/explain-the-contradiction" }
javascript, node.js, web-scraping Title: Text notifications for Facebook Marketplace posting Application Summary I received a call from a client asking for a "simple app" that notified him via text message whenever a "Jeep Wrangler" is posted to Facebook Marketplace. It sounded simple enough, so I took the gig. I figured I would leverage FB's Graph API or possibly simply set up a filter in his account, or something along those lines. It wasn't long until I faced reality. This was going to be harder than I thought. I ended up deciding to write a screen scraper. I chose NodeJS, Express, and Puppeteer to do this. End User UI
{ "domain": "codereview.stackexchange", "id": 38191, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, web-scraping", "url": null }
machine-learning For each task, we evaluate GPT-3 under 3 conditions: (a) “few-shot learning”, or in-context learning where we allow as many demonstrations as will fit into the model’s context window (typically 10 to 100), (b) “one-shot learning”,where we allow only one demonstration, and (c) “zero-shot” learning, where no demonstrations are allowed and only an instruction in natural language is given to the model. Figure 2.1, on page 7, provides a good example. In the zero-shot case, the model is asked to complete the following text: Translate English to French: cheese => In the few-shot case, the model is asked to complete the following text: ("girafe" is spelled this way in the paper) Translate English to French: sea otter => loutre de mer peppermint => menthe poivrée plush girafe => girafe peluche cheese =>
{ "domain": "datascience.stackexchange", "id": 9873, "lm_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", "url": null }
dynamic-programming, strings, subsequences The final answer is the larger of $\max_\lambda D[0][n-1][\lambda]$ and $0$. Suppose the first $\text{'}a\text{'}$ in $S$ at or after $S[i]$ appears at $S[\vec {i_{\text{'}a\text{'}}}]$. Suppose the first $\text{'}a\text{'}$ in $S$ appears at $S[\overleftarrow{j_{\text{'}a\text{'}}}]$ before $S[j]$ searched backwards. $\vec {i_{\text{'}a\text{'}}}$ or $\overleftarrow{j_{\text{'}a\text{'}}}$ is set to $-1$ if $\text{'}a\text{'}$ is not found respectively. We have, for $j\ge i+2$, $$D[i][j][\text{'}a\text{'}] = \begin{cases} \max(2, 2 + \max_{\mu\not=\text{'}a\text{'}}D[\vec {i_{\text{'}a\text{'}}}+1][\overleftarrow{j_{\text{'}a\text{'}}}][\mu])& \text{ if } 0\le \vec{i_{\text{'}a\text{'}}} \lt \overleftarrow{j_{\text{'}a\text{'}}},\\ -1 & \text{ otherwise,}\\ \end{cases} $$ where $\mu$ runs through all lowercase English letters. The base case is $$D[i][i][\text{'}a\text{'}] = 0.$$
{ "domain": "cs.stackexchange", "id": 16051, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dynamic-programming, strings, subsequences", "url": null }
# Question about basis of free modules. Let $M$ be an $R$-module, $R$ a ring, and $Z$ a nonempty subset of $M$. Assume that for every $R$-module $N$ and every map $f: Z \rightarrow N$ there exists a unique $R$- linear map $\tilde{f}$ : $M \rightarrow N$ s.t.the restriction of $\tilde{f}$ to $Z$ is $f$. Show that $Z$ is a basis of $M$. My attempt: Suppose not. Then there is an element of M which cannot be uniquely written as a linear combination of elements of Z. I think I am supposed to consider the inclusion map from Z to M and use the extended map from the hypothesis to arrive at a contradiction, but I can't see how. Lemma 14.1 in the book above, proves this, but I can't see where $g$ comes from, or why the composition on $N$ to $N$ coincides with the identity on $N$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9637799410139921, "lm_q1q2_score": 0.8031415293153307, "lm_q2_score": 0.8333245953120233, "openwebmath_perplexity": 99.64771891464088, "openwebmath_score": 0.9789889454841614, "tags": null, "url": "https://math.stackexchange.com/questions/2686590/question-about-basis-of-free-modules/2686713#2686713" }
php, mysql, csv $total_array = count( $array ); $x = 0; foreach ( $lines as $line ) { if ( $x >= 1 ) { $data = explode( "|", $line );
{ "domain": "codereview.stackexchange", "id": 10444, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, mysql, csv", "url": null }
fft, python I think this is fine because if A[n] = 0 it provides no contribution to the sum in the DFT but this feels very wrong and I don't know anywhere near enough about this stuff to feel confident. I can't access data set A because the way my data is sampled can only give me B. More detail: I have very large time series data for vibrations caused by air flow over an object, I am trying to parse that data to identify what happens to the vibrations at specific wind speeds and wind directions (this is the sampling I am talking about, and why its sporadic) . However the data comes in a strange file format (.gcf) which I can only deal with using obspy, and the only way I can find to sample the data (because there is so much and my computer is rubbish) is using obspy's trim() function, which essentially deletes the rest of the not useful data. (I know this is stupid but I cant find a better way) And so this is what is reducing the dimension of the data .
{ "domain": "dsp.stackexchange", "id": 7275, "lm_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", "url": null }
gravity, newtonian-gravity, orbital-motion, distance Title: Regarding distance laws of gravity from “A Brief History of Time” and why the Earth doesn't fall into the Sun In “A Brief History of Time”, Hawking explains Newtonian gravity in Chapter 2, Space and Time. The further apart the bodies are, the smaller the force. The gravitational attraction of a star is exactly one quarter that of a similar star at half the distance. This is because as we know, gravitational force is inversely proportional to the square of the distance between the bodies. Next comes the part that confuses me. If the law were that the gravitational attraction of a star went down faster with distance, the orbits of the planets would not be elliptical, they would spiral in to the sun. If it went down slower, the gravitational forces from the distant stars would dominate over that from the earth.
{ "domain": "physics.stackexchange", "id": 81164, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity, newtonian-gravity, orbital-motion, distance", "url": null }
Expanding on the comment by @wxffles Sum[(-1)^k*Binomial[n, k]*Binomial[k, j], {k, 0, n}, GenerateConditions -> True] For the case when j == n, Sum[(-1)^k*Binomial[n, k]*Binomial[k, n], {k, 0, n}, GenerateConditions -> True] Combining these results sum[j_, n_] = Piecewise[{{Sum[(-1)^k*Binomial[n, k]*Binomial[k, j], {k, 0, n}], j != n && Element[n, Integers] && n >= 0}, {Sum[(-1)^k*Binomial[n, k]*Binomial[k, n], {k, 0, n}], j == n && Element[n, Integers] && n >= 0}}] Table[sum[j, n], {j, 0, 5}, {n, 0, 5}] // TableForm However, j need not necessarily be an integer Plot[Evaluate[Table[sum[j, n], {n, 0, 5}]], {j, 0, 5}, PlotLegends -> Range[0, 5]]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9496693674025231, "lm_q1q2_score": 0.821676812112933, "lm_q2_score": 0.8652240877899775, "openwebmath_perplexity": 5090.402031147627, "openwebmath_score": 0.26395949721336365, "tags": null, "url": "https://mathematica.stackexchange.com/questions/77083/weird-results-of-calculating-a-sum-of-binomials" }
electrostatics, charge, voltage, conductors Although we do not know how the charge $Q_i$ distributes itself over the ith conductor, we do know that each conductor is an equipotential, and hence $V_3$ is a constant (not necessarily the same constant) over each conducting surface. (It need not be zero, for the potentials $V_1$ and $V_2$ may not be equal - all we know for sure is that both are constant over any given conductor.)
{ "domain": "physics.stackexchange", "id": 79318, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, charge, voltage, conductors", "url": null }
unit-testing, salesforce-apex notes = [SELECT Id, Note__c, CreatedById, CreatedBy.Name, LastModifiedDate FROM MTX_Matrix_Note__c WHERE Id =: noteId]; return notes.isEmpty() == false ? notes[0] : null; } ``` Your unit tests contain no assertions about the behavior of your code, so they prove nothing other than that the code does not crash in this specific situation. These are commonly referred to as smoke tests. There are three critical elements for any unit test, even before you start thinking about the overall coverage of your application's code paths: Control environment and set up test data. Execute functionality. Validate results. You are only doing (1) and (2) so far. I'd recommend reviewing Salesforce Stack Exchange's canonical QA, How do I write an Apex unit test?, for more information and resources. In particular, you should definitely complete Unit Testing on the Lightning Platform on Trailhead.
{ "domain": "codereview.stackexchange", "id": 34595, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "unit-testing, salesforce-apex", "url": null }
ros-melodic Originally posted by sef_roboter with karma: 16 on 2019-10-11 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by gvdhoorn on 2019-10-11: Good to hear that you got it fixed. Comment by BrettHemes on 2019-10-11: Yay. I have issues like this way more than I would like to admit. Let me know how the driver works out for you.
{ "domain": "robotics.stackexchange", "id": 33868, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-melodic", "url": null }
condensed-matter I search for the most unbreakable material in the univirse. Resistant to heating included. I've heard that Pulsar's surface is thousands of times more solid than the diamond for instance but I am not so sure how unbreakable it is. I would say that the hardest material known to exist in the universe must be the neutron matter, the stuff, of which neutron stars are made. It is so dense though that it cannot exist on earth, as it would just drop through the floor and through the ground to the center of earth. So more realistically, here on earth, different materials can be hardest or strongest or most unbreakable depending on the type of impact. Diamond of course is one of the hardest, but can be broken. Spider fiber is one of the strongest to tear. There is a new material that also in some ways is the strongest ever, graphene, check it out! https://en.m.wikipedia.org/wiki/Graphene
{ "domain": "physics.stackexchange", "id": 43148, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "condensed-matter", "url": null }
mass-spectrometry You want to resolve to signals at approx. m/z = 1060.2 and m/z = 1061.2. So $\Delta m = 1$ The required resolution is: $\frac{m}{\Delta m} = \frac{1061}{1} \approx 1060$: The spectrometer in (a) has only 1000 which is too low. The spectrometer in (b) has 5000 which is quite more than needed. Maybe it is easier to think of the reciprocal: $\frac{\Delta m}{m}$ which tells you how far two signal need to be apart so your spectrometer can resolve them. In (a) this is $\frac{\Delta m}{m} = \frac{1}{1000} = \frac{1.06}{1060}$ two signals can be resolved if they are at least 1.06 m/z apart at m = 1060. I.e. if they were slightly further apart than they are. The spectrometer in (b) can resolve signals that are at least $\Delta m/z = 0.21$ apart at $m/z = 1060$. FWHM and resolution The FWHM is basically part of the resolution. The $\Delta m$ is the m/z difference between two signals that are just resolved.
{ "domain": "chemistry.stackexchange", "id": 31, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mass-spectrometry", "url": null }
php, mysql, session function write($sess_id, $data) { $con = mysqli_connect("localhost", "root", "","pro"); $CurrentTime = date('Y-m-d H:i:s'); $stmt = mysqli_prepare($con,"UPDATE sessions SET Data= ?,DateTouched=? WHERE SessionID=?"); mysqli_stmt_bind_param($stmt,"sss",$data,$CurrentTime,$sess_id); mysqli_stmt_execute($stmt); return true; } function destroy($sess_id) { $con = mysqli_connect("localhost", "root", "","pro"); $stmt = mysqli_prepare($con,"DELETE FROM sessions WHERE SessionID = ?"); mysqli_stmt_bind_param($stmt,"s",$sess_id); mysqli_stmt_execute($stmt); return true; } function gc($sess_maxlifetime) { $con = mysqli_connect("localhost", "root", "","pro"); $stmt = mysqli_prepare($con,"Delete from sessions where TIMESTAMPDIFF (Second ,DateTouched,now())>=?"); mysqli_stmt_bind_param($stmt,"s",$sess_maxlifetime); mysqli_stmt_execute($stmt); return true; }
{ "domain": "codereview.stackexchange", "id": 406, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, mysql, session", "url": null }
php, api // Check for the last update $time = time(); $time_stamp = file_get_contents($file_time); $refresh = ($check_int < ($time - $time_stamp)) ? TRUE : FALSE; // if true run functions and save the results and time to file else pull the results from file if ($refresh) { // Initialize our results array $all_results = array(); // How many entries are there? $api_uri = "https://$account.wufoo.com/api/v3/forms/$form/entries/count.json"; $count = wufoo_api($api_key, $account, $form, $offset, $limit, $api_uri); $counted = $count['EntryCount'];
{ "domain": "codereview.stackexchange", "id": 864, "lm_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, api", "url": null }
quantum-field-theory, dirac-equation, spinors Title: What does Peskin's square root of a matrix mean? Peskin (Intro to QFT) is using the next symbols when discussing Dirac fields - $\sqrt{p\sigma}$ with $\sigma = (1,\sigma^1,\sigma^2,\sigma^3)$ (unit & Pauli). For example, he represents the Dirac spinor solution $u = (\sqrt{p\sigma}\xi^s, \sqrt{p\bar\sigma}\xi^s)$ for $\xi^s$ a 2D basis and $\bar\sigma = (1, -\sigma^1, -\sigma^2, -\sigma^3)$ I dont understand the $\sqrt{p\sigma}$ symbol. Peskin says it's the matrix with the square root of the eigenvalues of $p\sigma$. But that doesn't make sence for two reasons,
{ "domain": "physics.stackexchange", "id": 42080, "lm_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, dirac-equation, spinors", "url": null }
memory-management, cpu-cache, memory-hardware, memory-access, caching It might be noted that performance isolation for multi-use systems (where different uses may give different values to different resources and even to the predictability of resource availability) is the primary/original motivation for Intel's Cache Allocation Technology ("ensuring consistent performance and prioritizing important interactive applications"), but such features can help narrow side-channels for security-oriented isolation.
{ "domain": "cs.stackexchange", "id": 11734, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "memory-management, cpu-cache, memory-hardware, memory-access, caching", "url": null }
# Is this a Mengoli series? The series is, $$\sum \limits_{n = 2}^\infty \frac{1}{(n-1)n(n+1)} \space(a)$$ By partial fractions I've got, $$\sum \limits_{n = 2}^\infty \frac{1}{2(n-1)}-\frac{1}{n}+\frac{1}{2(n+1)}$$ The book says that the series in $(a)$ is a Mengoli series, but I can't see how. A Mengoli series have the form of $\sum \limits_{k} u_{k}-u_{k+1}$, but I don't see any similarities. Thanks. - @MarkBennet Made a sign error lol I see what I did wrong –  Ethan Mar 22 '14 at 18:10 Try $$\left(\frac 1{2(n-1)}-\frac 1{2n}\right)-\left(\frac 1{2n}-\frac 1{2(n+1)}\right)=$$$$\frac 1{2n(n-1)}-\frac 1{2(n+1)n}=$$$$\frac 1{(n-1)n(n+1)}$$ which verifies the partial fraction decomposition.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9857180690117799, "lm_q1q2_score": 0.8256571368182121, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 449.0177150333567, "openwebmath_score": 0.9582481980323792, "tags": null, "url": "http://math.stackexchange.com/questions/722385/is-this-a-mengoli-series" }
thermodynamics, energy, statistical-mechanics, renormalization, definition If the Hamiltonian is $H[\phi]$, then the thermodynamic free energy $F$ obeys $$Z = e^{-\beta F} = \int_{\Delta x\, >\, a} \mathcal{D}\phi \, e^{-\beta H[\phi]}$$ which is just a rewording of the standard identity $F = - k_B T \log Z$. In the Wilsonian view, the thermodynamic free energy is acquired by integrating out all microscopic degrees of freedom. The result only depends on macroscopic quantities like temperature, pressure, and the external field. This is useful because the entire point of thermodynamics is to ignore the microscopic details and focus on macroscopic quantities that are easy to measure. For example, using just the function $F$, we can determine the equilibrium magnetization by minimizing it. Now, the Landau free energy $H_L$ satisfies $$Z = \int_{\Delta x \, > \, b} \mathcal{D}\phi \, e^{-\beta H_L[\phi]}$$
{ "domain": "physics.stackexchange", "id": 49101, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, energy, statistical-mechanics, renormalization, definition", "url": null }
biochemistry, neuroscience, cell-biology, pharmacology Astrocyte mediated: CB1R (cannabinoid receptor) in astrocyte gets activated and promotes glutamate release. This glutamate induces Long Term Depression in post synaptic neuron. Synaptic currents can cause both LTP and LTD. The properties of the synaptic current wave dictates the outcome. Please refer to review articles on LTP and LTD for more information. GABAergic interneuron mediated: CB1R activation in GABAergic interneurons (inhibitory neurons) causes activation of mTOR pathway and promotes protein synthesis. CB1R activates mTOR through PI3K/Akt.
{ "domain": "biology.stackexchange", "id": 937, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "biochemistry, neuroscience, cell-biology, pharmacology", "url": null }
ros, laser, scan, ros-indigo /camera/rgb/image_raw/theora/parameter_updates /clock /cmd_vel_mux/active /cmd_vel_mux/input/navi /cmd_vel_mux/input/safety_controller /cmd_vel_mux/input/switch /cmd_vel_mux/input/teleop /cmd_vel_mux/parameter_descriptions /cmd_vel_mux/parameter_updates /depthimage_to_laserscan/parameter_descriptions /depthimage_to_laserscan/parameter_updates /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/set_link_state /gazebo/set_model_state /joint_states /laserscan_nodelet_manager/bond /mobile_base/commands/motor_power /mobile_base/commands/reset_odometry /mobile_base/commands/velocity /mobile_base/events/bumper /mobile_base/events/cliff /mobile_base/sensors/bumper_pointcloud /mobile_base/sensors/core /mobile_base/sensors/imu_data /mobile_base_nodelet_manager/bond /odom /rosout /rosout_agg /scan /tf /tf_static
{ "domain": "robotics.stackexchange", "id": 30346, "lm_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, laser, scan, ros-indigo", "url": null }
structures, waterproofing Title: How did this building's windows get like this? I don't recall seeing the walls like this before, so I don't think it's just accumulated soilage. If it's wetness, what design flaw causes the windows to do that? Today was very hot and muggy so it's likely the AC was running all day. The building is in a place (Halton Hills, Ontario, Canada) where the relative humidity is about 100% in the summertime (see part Climate in this https://www.britannica.com/place/Toronto) The building must be heavily air conditioned due the numerous medical businesses which do not stand uncomfortable indoor conditions. As already said by others, it's well possible that those single layer glasses are wet all the time in the summertime. The continuous water flow condenses dirt just below the windows which have nothing to keep the wall dry.
{ "domain": "engineering.stackexchange", "id": 4794, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "structures, waterproofing", "url": null }
machine-learning, natural-language-processing, word-embedding And then converted to a numeric representation: [15, 12, 3, 56] where each of the numbers is the number used to encode or tokenize that word. The next step would be to convert this to a multi-hot encoded vector: [ 0, 0, 0, 0, ..., 1, 0, 0, 1, 0, 0, ...] where the length of the vector is the length of the number of words in the vocabulary. As a result of this representation, all information about word order is lost. Now consider the case of bag of n-grams. Let's assume we used an $n=3$ for the number of n-grams. This means that, rather than tokenizing each word individually, we are now converting each trio of words into a token. These tokens are then, again, converted to a multi-hot encoded vector. While it is certainly true that there is some word order information retained within the n-grams themselves, the order of the n-grams in the text is still lost when we convert to the multi-hot encoded vector. TLDR:
{ "domain": "ai.stackexchange", "id": 3653, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, natural-language-processing, word-embedding", "url": null }
classical-mechanics, definition So, your statement Then ϕ is called a stationary solution or a stationary state if all t derivatives of ϕ are zero. certainly seems consistent with Schutz's description of stationary.
{ "domain": "physics.stackexchange", "id": 4520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, definition", "url": null }
operators, mathematics &= \sum_{n=0}^\infty \frac{1}{n!}\left( \sum_{k=1}^\infty \frac{2}{2k-1} \left(\frac{\widehat A-1}{\widehat A+1}\right)^{2k-1} \right)^n \\ &\stackrel ?= \widehat A \end{align*} I can't see whether those power series reduce to just $\widehat A$ or not. Any help or clarification is greatly appreciated! In QM most operators are Hermitean, and thus diagonalizable, $\hat A= U^\dagger D U$, for some unitary U and real diagonal D. So all your series expressions $f(\hat A)=0$ are essentially $U^\dagger f(D) U=0$, that is, a tower of the same relations for each diagonal component of D, each eigenvalue. If it so happens that all eigenvalues of $\hat A$ are positive definite, your equation holds (if your respective expansion expression held for each one of them), otherwise you must be very careful with logarithms, a tall order: hardly realistic. (Exponentials, however, are normally fine, since they are single-valued functions. It is the logarithms that are dangerous. See WP article linked.)
{ "domain": "physics.stackexchange", "id": 61564, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "operators, mathematics", "url": null }
GR 8677927796770177 | # Login | Register GR9677 #92 Problem GREPhysics.NET Official Solution Alternate Solutions This problem is still being typed. Mechanics$\Rightarrow$}Potential Given $V(x)=-ax^2+bx^4$, one can find the minimum by taking the first derivative (second derivative test indicates concave up), $V'(x) =\left( -2ax+4bx^3\right)_{x_0}=0 \Rightarrow x_0=\sqrt{\frac{a}{2b}}$. The force is given by $F=-dV/dx=2ax-4bx^3$. The angular frequency of small oscilations about the minimum can be found from, $\begin{eqnarray} F(x-x_0)&=&2a(x-x_0)-4b(x-x_0)^3\\ &\approx& 2ax-4b(3x_0^2x) + O(2)\\ &=&(2a-12bx_0^2)x\\ m\ddot{x}&=&-4ax\\ \ddot{x}&=&-\omega^2 x \Rightarrow \omega^2 = \frac{4a}{m} \end{eqnarray}$ where one might recall the binomial theorem or pascal's triangle to quickly figure out the trinomial coefficients. One finds that $\omega =2\sqrt{\frac{a}{m}}$, as in choice (D).
{ "domain": "grephysics.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668695588648, "lm_q1q2_score": 0.8021769916187453, "lm_q2_score": 0.8175744784160989, "openwebmath_perplexity": 475.56039386855144, "openwebmath_score": 0.8590074181556702, "tags": null, "url": "https://grephysics.net/ans/9677/92" }
javascript, beginner, html, css, regex footer ul { text-align: center; padding: 0; overflow: hidden; } footer ul li { list-style: none; display: inline; width: auto; height: 60px; padding: 40px; line-height: 60px; vertical-align: middle; justify-content:center; } footer ul li a { text-decoration: none; color: LightGray; } /* Other */ #code { background: LightGray; font-family: monospace; } .column { float: left; width: 50%; } .caption { text-decoration: none; } .icons { width: 32px; height: 32px; border-radius: 50%; text-align: right; } .right { float: right; width: 40px; } .rightLink { width: 40px; padding-left: 0; padding-right: 0; text-align: center; } h2 { font-family: "Courier"; font-style: italic; text-transform: uppercase; color: #252628; } .list > li { margin: 5px 0; } .input { width: 80%; border: 2px solid #252628; padding: 20px; background: LightGray; }
{ "domain": "codereview.stackexchange", "id": 38992, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, beginner, html, css, regex", "url": null }
c++, performance, object-oriented, parsing, csv if (stringToBeParsed[i] == '\"' && quotesUsed) { //if they are true, then mark them false, if they are false then mark them true quoteTriggered = quoteTriggered ? false : true; if (quoteTriggered) { temporary.push_back(stringToBeParsed[i]); } else { //place quote in to the temporary string and store it. temporary.push_back(stringToBeParsed[i]); } } //place comma if the string is in a quote. else if (stringToBeParsed[i] == charToSepBy && quoteTriggered) { temporary.push_back(stringToBeParsed[i]); //<-push the comma on to the string because quotes are being used. } else if (stringToBeParsed[i] == charToSepBy && !quoteTriggered) { inboundVector.push_back(temporary); temporary = ""; }
{ "domain": "codereview.stackexchange", "id": 19324, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, object-oriented, parsing, csv", "url": null }
# Representing geometric series as sum of binomial coefficients I was learning generating functions, where faced following: $$(1-x)^{-n}=\sum_{i=0}^\infty\binom{n+i-1}{i}x^i$$ I didn't get how is this arrived. I tried out to prove this to me. But failed. Using binomial theorem, I can get that $$(1-x)^{-n}=\sum_{i=0}^\infty\binom{-n}{i}x^i$$ However I realize that, I am first time facing $-$ve $n$ in $\binom{-n}{i}$ and I dont know how to solve this. I tried but reached to something involving $-$ve factorial. Googling revealed that $(-n)!$ is somewhat undefined. Wolfram says $(-4)!$ is complex infinity. I also came across this thread which solves $$\binom{-4}{3}=\frac{(-4)_3}{3!}$$ I didnt get how this equality is arrived. Overall I am lost. There are several ways to derive the result; I’ll start with the one using the binomial theorem. What you have isn’t quite right: the $x$ term in $1-x$ is negative, so it should be
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9770226267447513, "lm_q1q2_score": 0.8162863260261399, "lm_q2_score": 0.8354835432479661, "openwebmath_perplexity": 347.3772746377796, "openwebmath_score": 0.937191903591156, "tags": null, "url": "https://math.stackexchange.com/questions/1653670/representing-geometric-series-as-sum-of-binomial-coefficients" }
ros, bashrc # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi source /opt/ros/indigo/setup.bash source /home/robot3/test/devel/setup.bash source /home/robot3/car/devel/setup.bash source /home/robot3/Driver/devel/setup.bash source /home/robot3/test2/devel/setup.bash Originally posted by yueweiliang on ROS Answers with karma: 21 on 2016-11-07 Post score: 0
{ "domain": "robotics.stackexchange", "id": 26171, "lm_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, bashrc", "url": null }
special-relativity, acceleration, coordinate-systems Title: Deriving length of the rope in bells spaceship paradox I want to derive the distance between spaceships in Bell's paradox as a function of proper time of the trailing spaceship, in the case of constant proper acceleration of both space ships. My attempt didn't work, as it gave a distance that gets shorter with time. I would like to know why it didn't work, and what the actual solution is. My attempt: First, define the trajectory of the trailing spaceship as a hyperbolic trajectory with a rindler coordinate frame. In the inertial frame: $x_T = \frac1\alpha \cosh(\alpha \bar t)$ In the inertial frame, the leading spaceship has the same hyperbolic trajectory except it is spatially shifted to the right by the length of the rope $l$. Hence, the difference in the spatial coordinates is always $x_L - x_T = l$ as measured in the inertial frame.
{ "domain": "physics.stackexchange", "id": 93608, "lm_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, acceleration, coordinate-systems", "url": null }
qiskit, programming, grovers-algorithm, oracles Is there any reasoning behind this construction? Are they using the solutions to the actual problem while constructing it? For small boolean functions, up to 16 variables, tweedledum (the library used by Qiskit, repo|docs) synthesizes the circuit using the truth table: it uses to truth table to extract a special case of an ESOP (Exclusive-or Sum-Of-Products) representation, known as Pseudo-Kronecker expression. Indeed, if you are using this method to implement an oracle that will be use in Grover's algorithm to solve satisfiability, then you have the solution before using Grover's. When dealing with bigger functions, however, this method will not work. Truth tables are expensive to represent, hence we need to represent bigger boolean functions through other means. In tweedledum, that method is Xor-And graph (XAG).
{ "domain": "quantumcomputing.stackexchange", "id": 3320, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "qiskit, programming, grovers-algorithm, oracles", "url": null }
1. How many linearly independent eigenvectors does $\mathbf{A}$ have? 2. Suppose that $\mathbf{V}$ is not an eigenvector but satisfies $(\mathbf{A}-\lambda_{2}\mathbf{I})^{3}\mathbf{V}=0$. How many linearly independent solution vectors $\mathbf{V}$ are there? 3. Suppose that the Jordan blocks occur down the diagonal of the $\mathbf{J}$ in the order stated above. Which matrix elements of $\lim_{t\to\infty}t^{4}\mathrm{e}^{-\lambda_{2}t}\mathrm{e}^{\mathbf{J}t}$ are non-zero and what are their values? $\rule{0.2cm}{0.2cm}$ Thanks a lot. bkarpuz 2. Hint for 1 $\dim \ker (J_k-\lambda I_k)=k-\textrm{rank}(J_k-\lambda I_k)=k-(k-1)=1$ Originally Posted by bkarpuz I have some ideas about some parts of the problem but I would like to share it completely because I find the problem nice. Can you comment those ideas?
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806489800367, "lm_q1q2_score": 0.8106575959223767, "lm_q2_score": 0.8267118026095991, "openwebmath_perplexity": 228.57911583523656, "openwebmath_score": 0.9287809729576111, "tags": null, "url": "http://mathhelpforum.com/advanced-algebra/180150-jordan-blocks.html" }
algorithms, data-structures, search-algorithms Randomised algorithms are okay as long as they always achieve the correct answer and work fast enough in the average case, though deterministic algorithms are preferred. Thanks for any and all responses. I was wondering if there was any research in the question, maybe? It does not seem like too obscure a topic, but unfortunately my searching has not been competent enough. EDIT: A method that seems useful. Here was my line of thinking after I asked the question; I wonder if this would help somehow. It uses the idea of modulo as well.
{ "domain": "cs.stackexchange", "id": 15315, "lm_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, data-structures, search-algorithms", "url": null }
java, beginner, programming-challenge, interview-questions, complexity } } } I have the following questions with regards to the above code: How can I further improve my approach? Is there a better way to solve this question? Are there any grave code violations that I have committed? Can space and time complexity be further improved? Reference Another note: Your code could be considerably more concise by using the modern .stream(): public static char getFirstUniqueChar(String value) { LinkedHashMap<Character, Integer> data = new LinkedHashMap<>(); for (char c : value.toCharArray()) { data.compute(c, (t, u) -> (u == null) ? 1 : ++u); } var temp = data.entrySet() .stream() .filter(x -> x.getValue() == 1) .findFirst(); if (temp.isPresent()) { return temp.get().getKey(); } return '\0'; }
{ "domain": "codereview.stackexchange", "id": 31160, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, programming-challenge, interview-questions, complexity", "url": null }
algorithms, regular-languages, optimization Example In order to illustrate the above points, consider the first example in the question (of which I also think that it is incorrect in the paper): Let $L = \Sigma^\ast ab \Sigma^\ast$. Now, the left quotients of $L$ are the sets $x^{-1}L$ for $x\in \Sigma^\ast$, that is, those words $u$ in $\Sigma^\ast$ that can be prefixed with $x$, i.e. $xu \in L$. When is $y^{-1}L=x^{-1}L$ for distinct $x,y$? This is the case if and only if $x$ and $y$ can be augmented to words in $L$ with precisely the same suffixes. This means, to put it into more familiar terms, they are Nerode-equivalent, and the suffixes that are needed to append to words in a Nerode class are precisely the respective left quotients. For $L$, we see that our Nerode-equivalence classes are
{ "domain": "cs.stackexchange", "id": 1655, "lm_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, regular-languages, optimization", "url": null }
ros, ros2, yaml Comment by marguedas on 2020-03-19: this is unfortunate Are you using CycloneDDS by any chance ? Did you try looking for a similar issue on the ros1_bridge repository ? This looks pretty similar to your issue https://github.com/ros2/ros1_bridge/issues/244 Comment by Freesun on 2020-03-19: okay... i'll search more issues! thank u ;) Comment by Freesun on 2020-03-20: Hello!! I solved it when i install cyclone dds!! Comment by marguedas on 2020-03-20: glad you can now bridge your messages. As your problem is solved, could you please close the question or, if it answered your original question, accept the proposed answer by clicking the checkmark on the left. This will allow to remove your question from the unanswered list
{ "domain": "robotics.stackexchange", "id": 34611, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros2, yaml", "url": null }
# Find the polynomial equation of the lowest degree with rational coefficients whose one root is…? Find the polynomial equation of the lowest degree with rational coefficients whose one root is $$\sqrt[3]{2}+3\sqrt[3]{4}$$ I tried using the conjugate pairs but I couldn't solve it for any polynomial equation other than one having roots to the power 1/2. I took the roots as $$(x-\sqrt[3]{2}-3\sqrt[3]{4})(x-\sqrt[3]{2}+3\sqrt[3]{4})$$ but after a few multiplications (taking conjugates of the polynomial repeatedly) the roots would become too complicated and the degree would rise to be more than 6. A detailed Explanation would be helpful. The Answer is $$x^3-18x-110$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808695883038, "lm_q1q2_score": 0.8190085262706808, "lm_q2_score": 0.8354835350552604, "openwebmath_perplexity": 311.2473633056037, "openwebmath_score": 0.7757614254951477, "tags": null, "url": "https://math.stackexchange.com/questions/3389734/find-the-polynomial-equation-of-the-lowest-degree-with-rational-coefficients-who/3390043" }
performance, file, windows, assembly, x86 Main proc sub rsp, 1048h ; align with 16 while simultaneously making room on the stack for the "home space", some parameters, and a 4096 byte buffer lea var0, filePath ; put address of file path into parameter slot 0 mov var1, FILE_ACCESS_READ ; put access mode into parameter slot 1 mov var2, FILE_SHARE_READ ; put share mode into parameter slot 2 xor var3, var3 ; put security attributes into parameter slot 3 mov var4, FILE_DISPOSITION_OPEN ; put disposition into parameter slot 4 mov var5, FILE_FLAG_NORMAL ; put flags into parameter slot 5 mov var6, WINDOWS_NULL ; put pointer to template handle into parameter slot 6 call CreateFile ; create file handle cmp rax, WINDOWS_INVALID_HANDLE ; validate file handle je exitMain ; skip to exit point if create validation failed
{ "domain": "codereview.stackexchange", "id": 33777, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, file, windows, assembly, x86", "url": null }
gazebo Title: Joints of a model are not visible in the joint panel I've inserted two models into Gazebo using the GUI. One is the steering cart that is already included with Gazebo, the other is a Velodyne sensor which I created following the tutorials. The Velodyne model has a single revolute joint connecting the base to the top. When I load the Velodyne, I can apply a force to the join to get it to spin however, when I fix it to the cart and save it as a single model, I can no longer see the revolute joint for the Velodyne listed. I can however see the fixed joint I created and also all the joints for the carts wheels. Is there a proper way to create a new model out of several pre-existing models? Originally posted by ozan192 on Gazebo Answers with karma: 16 on 2017-07-10 Post score: 0
{ "domain": "robotics.stackexchange", "id": 4140, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo", "url": null }
for Patient #1 was 238, while the variation for Patient #2 was only 28. According to our general formula, this factors to a binomial that shares its sign with the sum, and has the opposite sign inside the trinomial. Yˆ b 0 b 1 X E Y | X 0 1 X ˆ* * Y b 0 b. In other words, p is a sum of two squares if it leaves a remainder of 1 when divided by 4, and it is not a sum of two squares if it leaves a remainder of 3. Enabling the creation of sum of squares variables and constraints. We first square each data point and add them together: 2 2 + 4 2 + 6 2 + 8 2 = 4 + 16 + 36 + 64 = 120. Residual Sum Of Squares - RSS: A residual sum of squares (RSS) is a statistical technique used to measure the amount of variance in a data set that is not explained by the regression model. Really clear math lessons (pre-algebra, algebra, precalculus), cool math games, online graphing calculators, geometry art, fractals, polyhedra, parents and teachers areas too. Print the result. (x + 2)(x 2 – 2x + 4) It looks a
{ "domain": "nauticalsas.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9822876992225168, "lm_q1q2_score": 0.8098588108753705, "lm_q2_score": 0.8244619285331332, "openwebmath_perplexity": 608.7188237523523, "openwebmath_score": 0.7077962160110474, "tags": null, "url": "http://hgcj.nauticalsas.it/sum-of-squares.html" }
fluid-dynamics, pressure, ideal-gas $$ {p \over \rho^\gamma} = constant, \gamma = {c_p \over c_v} $$ which could be turned into this: $$ {p \over p_0} = ({1 \over 1+{(\gamma-1) \over 2}Ma^2})^{\gamma \over \gamma-1} $$ There's also a more complicated relation for constant area adiabatic flow with friction (Fanno flow) and constant area non-adiabatic frictionless flow (Rayleigh flow) which you could find in Fundamentals of Fluid Mechanics by Munson.
{ "domain": "physics.stackexchange", "id": 21896, "lm_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, pressure, ideal-gas", "url": null }
ros Title: ROSSERIAL and Helloworld issue on arduino 2560 Hi! I am quiet new to ubuntu and arduino. I managed to install arduino IDE, ROS and even ROSSERIAL. Now while compiling (uploading) the hello world example I have a lot of errors and I don't know how to fix them. Here I provided a printscreen of my IDE, terminal and also my home folders...maybe you can advise me something... imageshack.us/photo/my-images/443/screenshotfrom201303141.png/ P.S: my system information Intel® Core™ i7-2630QM CPU @ 2.00GHz × 8 Ubuntu 12.04 LTS 64bit Thank you in advance Originally posted by Sasha on ROS Answers with karma: 16 on 2013-03-14 Post score: 0
{ "domain": "robotics.stackexchange", "id": 13363, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
$T''+\lambda_n T=0 => T_n(t)=k_1 cos(\frac{tn\pi}{L})+k_2 sin(\frac{tn\pi}{L})$ $T_n'(t)=-k_1 \frac{n\pi}{L}sin(\frac{tn\pi}{L}) + k_2 \frac{n\pi}{L} cos(\frac{tn\pi}{L})$ using the initial condition $T'(t)=0$ I get $k_2=0$ so the fundamental solutions are $u_n(x,t)=X_n(x)T_n(t)$ (the two eigenfunctions multiplied together). The solution is: $u(x,t)=\sum_{n=0}^\infty a_n cos(\frac{tn\pi}{L})cos(\frac{xn\pi}{L})$ Now what I am wondering, first of all is what I have done so far fine, I suppose to have more of a complete answer I should have probably explained a bit about lambda <0. Secondly what is the logic in how to find $a_n$ ? How is finding $a_n$ generally done on these type of problems? I understand that I have to use the last initialvalue condition (that I haven't used yet), but how? The solution you got looks okay. In general, to get the coefficient $a_n$, plug in the initial condition $u(x,0) = f(x)$,then multiply by $\cos(x n' \pi/L)$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109485172559, "lm_q1q2_score": 0.8269792071804071, "lm_q2_score": 0.8397339696776499, "openwebmath_perplexity": 171.98663014545258, "openwebmath_score": 0.9512033462524414, "tags": null, "url": "https://math.stackexchange.com/questions/2359250/solving-the-wave-equation-using-separation-of-variables" }
analytical-chemistry, chromatography but the IS peaks remain more or less stationary
{ "domain": "chemistry.stackexchange", "id": 1527, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "analytical-chemistry, chromatography", "url": null }
glaciology, antarctic, ice, sea-ice, ice-shelf update: The rift continues to be tracked. If I understand correctly, it is now over 350 meters wide and growing: above: From A growing rift on Larsen C at the Project MIDAS website. More can be read about NASA's operation Ice Bridge program at its official website. These are a series of areal flights over antarctic regionss to collect images and data. The image above of the crack in the Larsen-C ice shelf was a featured photo and more can be read about it here. In the image gallery the caption states: Rift in Antarctica's Larsen C Ice Shelf On Nov. 10, 2016, scientists on NASA's IceBridge mission photographed an oblique view of a massive rift in the Antarctic Peninsula's Larsen C ice shelf. Icebridge, an airborne survey of polar ice, completed an eighth consecutive Antarctic deployment on Nov. 18.
{ "domain": "earthscience.stackexchange", "id": 981, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "glaciology, antarctic, ice, sea-ice, ice-shelf", "url": null }
c++, c++11, programming-challenge How can I make this code better and faster? Particularly without using an additional vector? And is there a better solution? Perhaps you should mention that your code takes advantage of the Rearrangement inequality which states that the scalar product of any permutation of the vectors \$ (x_1,x_2,...,x_n) \$ and \$ (y_1,y_2,...,y_n) \$ is minimal if the elements of one vector are in increasing order and the elements of the other in decreasing order. I see two possible simplifications: First, instead of reading the second vector into a temporary vector, sorting it and then reversing it "manually", you can sort in decreasing order by supplying a comparator to the sort: for (std::size_t y_index = 0; y_index < n; ++y_index) { std::cin >> y[y_index]; } sort(y.begin(),y.end(), std::greater<int>()); Second, the scalar product can be computed with #include <numeric> int product = std::inner_product(x.begin(), x.end(), y.begin(), 0);
{ "domain": "codereview.stackexchange", "id": 10847, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, programming-challenge", "url": null }
ros, navigation, move-base, roomba-500-series namespace bumper2pc{ bool left_bumper, right_bumper; //this function is defined in "bumper2pc.hpp" void Bumper2PcNodelet::BumperUpdateCB(const roomba_500_series::Bumper::ConstPtr& msg){ left_bumper = msg->left.state; right_bumper = msg->right.state; } void Bumper2PcNodelet::coreSensorCB(const roomba_500_series::Bumper::ConstPtr& msg){ left_bumper = msg->left.state; right_bumper = msg->right.state; ros::NodeHandle n; ros::Publisher vel_pub_ = n.advertise<geometry_msgs::Twist>("/cmd_vel", 1) geometry_msgs::Twist cmd_vel; if (left_bumper == 1){ bool judge_left = true; while(judge_left == true){ if(judge_left == false){ break; } cmd_vel.linear.x = 0.0; cmd_vel.angular.z = 0.0; vel_pub_.publish(cmd_vel); while(left_bumper == 1){ cmd_vel.linear.x = 0.0; cmd_vel.angular.z = -0.78; //turn right while left bumper is true vel_pub_.publish(cmd_vel);
{ "domain": "robotics.stackexchange", "id": 29282, "lm_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, move-base, roomba-500-series", "url": null }
In fact, there is a much stronger result. Proposition. Let $a,b,c,d\in\mathbb{C}$. If $A,B\in M_n(\mathbb{C})$ satisfy $aA^2+bB^2+cAB+dBA=0_n$, then, generically (for example, randomly choose $a,b,c,d$), $A,B$ are simultaneously triangularizable (denoted by ST). Proof. We follow the last part of the stewbasic's good post. We put $X=\alpha A+\beta B,Y=\gamma A+\delta B$; since generically $\alpha\delta\not= \beta\gamma$, it suffices to show that $X,Y$ are ST. We obtain (generically) $XY=kYX$ for some complex number $k$. Generically, $k\not=1$ and $k$ is not a primitive root of unity; then, by a result from Drazin, $X,Y$ are ST. Remark 1. Of course, there are $a,b,c,d$ s.t. $A,B$ are not necessarily ST. For instance, consider $AB+BA=0_2$ with $A=\begin{pmatrix}1&0\\0&-1\end{pmatrix},B=\begin{pmatrix}0&1\\1&0\end{pmatrix}$. Remark 2. That is linked to the concept of quasi-commutative matrices. There are two non-equivalent definitions:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540680555949, "lm_q1q2_score": 0.8118245940987354, "lm_q2_score": 0.8289388083214156, "openwebmath_perplexity": 273.324286600367, "openwebmath_score": 0.9905948042869568, "tags": null, "url": "https://math.stackexchange.com/questions/2240983/detab-ba-0/2241200" }
energy, work, kinematics this idealized swing going up & down and back & forth once it was already moving. (As for how this phenomenon can occur, gravitational potential energy and conservation of mechanical energy would be a good starting search terms.)
{ "domain": "physics.stackexchange", "id": 11094, "lm_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, work, kinematics", "url": null }
c#, object-oriented, beginner, game-of-life for (int i = 0; i < copy.Count; i++) { //Rule 1: Any live cell with fewer than two live neighbours dies, as if caused by under-population. if (cells[i].isAlive && cells.GetNeighbours(cells[i]).Length < 2) { copy[i].Kill(); } //Rule 2: Any live cell with more than three live neighbours dies, as if by overcrowding. if (cells[i].isAlive && cells.GetNeighbours(cells[i]).Length > 3) { copy[i].Kill(); } //Rule 3: Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. if (!cells[i].isAlive && cells.GetNeighbours(cells[i]).Length == 3) { cells[i].Alive(); } } // Now that all cells are changed we can copy those changes simulatenously by copying the copy back to the original cells = copy; }
{ "domain": "codereview.stackexchange", "id": 6564, "lm_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, beginner, game-of-life", "url": null }
reference-request, graph-theory, planar-graphs, graph-minor I have worked out a proof of the result I needed in this note. The result is the following: given as input a degree-3 planar graph $G$, one can compute in polynomial time a wall graph $H$ and a topological embedding of $G$ in $H$. The proof is by constructing in linear time an embedding of the planar graph with points having integer coordinates, using existing results by Schnyder, and Chrobak and Payne. Then it is not surprising that the drawing can be adjusted to a topological embedding, but working out the details proved out a bit tedious (probably I didn't take the most efficient route...).
{ "domain": "cstheory.stackexchange", "id": 5571, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reference-request, graph-theory, planar-graphs, graph-minor", "url": null }
electromagnetism, computer Of course, that's all assuming that, when the magnet turned on, it didn't immediately turn any nearby chairs, tables, computer equipment and miscellaneous office supplies into flying missiles, with potentially lethal consequences to anyone standing between such an object and the door. Or that the intense magnetic field didn't simply mess up the unlucky officer's pacemaker, as it would surely do to any cell phones or other electronic equipment they might be carrying.
{ "domain": "physics.stackexchange", "id": 14257, "lm_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, computer", "url": null }
haskell, recursion, directory main :: IO () main = do walk "/tmp" myVisitor walk "foo bar" myVisitor putStrLn "Done :-/" As you can see, there is a lot of code and i import a lot of things... I'm sure there is a better way to do that, and i'm interested in any {idea,hint,tip} to improve this piece of code. Thanks in advance :-) You might be interested in the concept of iteratees/pipes that can be used to solve this problem. It allows you to separate producing the tree and consuming it somewhere else without direct callback functions: You create a producer that enumerates the directory tree, perhaps some filters that modify the data and a separate consumer that works on the data. And then compose and run the whole pipeline. See also Streaming recursive descent of a directory in Haskell. There are also specialized Haskell packages for that such as directory-tree, which you can use or study.
{ "domain": "codereview.stackexchange", "id": 3285, "lm_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, recursion, directory", "url": null }