text
stringlengths
1
1.11k
source
dict
ExampleLet R be the rectangle [0,  /2]  [0,  /2]. Find (sin x)(cos y) dA. R (sin x)(cos y) dA = R (sin x)(cos y) dy dx = 0  /2 0 (sin x)(sin y) dx =  /2 0 y = 0  /2 (sin x) dx = 0  /2 – cos x = x = 0  /2 1 Alternatively, one could find that (sin x)(cos y) dx dy = 0  /2 0 1 Download ppt "If f(x)  0 for a  x  b, then b f(x) dx a is defined to be the area of the region under the graph of f(x) on the interval [a,b]. The precise definition." Similar presentations
{ "domain": "slideplayer.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9458012701768144, "lm_q1q2_score": 0.849041338446574, "lm_q2_score": 0.8976952825278492, "openwebmath_perplexity": 761.4241295965478, "openwebmath_score": 0.8639759421348572, "tags": null, "url": "http://slideplayer.com/slide/4261794/" }
ros2, image-view, ubuntu sudo apt instal rqt* ... install ok but no image view in gui under visualization. (re-install rqt) even tried Rviz2 --- gui opens up but camera add and link to camera topic What am I doing wrong here? How do you one view a camera in Foxy or Galactic? I do source in terminal, and use a different terminal to run commands than the one I colcon build. 28-6-2021 (28-June) I think I am onto something here. So I installed Galactic and Foxy from here;docs.ros.org It says to source it by . ~/ros2_galactic/ros2-linux/setup.bash .....when you do all works well enough minor glitches. BUT then tuts(tutorials) says to source /opt/ros/galactic/setup.bash like this and then nothing works although when you check the files it is there. So unintended X2 ros directorys? When I apt install or ros dep install image_view ends up in tk@tk-Aspire-5820T:/opt/ros/galactic/include$ the source directory that does not work.
{ "domain": "robotics.stackexchange", "id": 36589, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, image-view, ubuntu", "url": null }
thermodynamics, differentiation \end{align} the notation $\left(\frac{\partial U}{\partial T}\right)_p$ means consider "$U$ as a function of $p,T$, and then differentiate with respect to $T$ while keeping $p$ fixed". But now you may be wondering that initially, $U$ was a function of $T,V$ so how is this possible? Well the answer is that if you interpret this statement literally like a robot (which is unfortunately how I interpreted it for most of my introductory thermodynamics course) then it's a completely nonsensical statement. How can $U$ be a function of $T,V$ initially and then suddenly become a function of $p,T$ later? The resolution to this "paradox" is to realize that we're talking about completely different mathematical functions $U$ vs $\zeta$.
{ "domain": "physics.stackexchange", "id": 70939, "lm_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, differentiation", "url": null }
c++, median, constrained-templates struct nocopy_int { int value; nocopy_int(int i) : value{i} {} nocopy_int(const nocopy_int&) = delete; void operator=(const nocopy_int&) = delete; bool operator<(const nocopy_int& other) const { return value < other.value; } }; // specific midpoint for this type, to be found by ADL double midpoint(const nocopy_int& a, const nocopy_int& b) { return a.value + b.value; // the name is a lie } template<typename T> struct expect_midpoint { const T expected_a; const T expected_b; void operator()(T const& actual_a, T const& actual_b) const { EXPECT_EQ(expected_a, actual_a); EXPECT_EQ(expected_b, actual_b); } }; struct dummy_midpoint { auto operator()(auto&&, auto&&) const {} };
{ "domain": "codereview.stackexchange", "id": 42930, "lm_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++, median, constrained-templates", "url": null }
statistical-mechanics, computational-physics, molecular-dynamics Secondly, in equation (5.1.52) of the book, the authors attempted to regenerate the results of Borgis et al., equation (6). However, in my opinion, the book's result is not evidently the equivalent to the result of Borgis et al. The book wrote in angled bracket $F^{(r)}_j-F^{(r)}_i$, where $F^{(r)}_j$ represents $\hat{\mathbf{r}}\cdot \mathbf{F}_j$, the projection of the force acting on particle $j$ over unit vector $\hat{\mathbf{r}}$. In contrast, the paper of Borgis et al. wrote $(\mathbf{F}_j - \mathbf{F}_i) \cdot \hat{\mathbf{r}_{ij}}$, which is not equal to $F^{(r)}_j-F^{(r)}_i$ as given by the authors (at least not straightforward). A brief scan of the aforementioned pages are attached. Any suggestion will be highly appreciated! Reproduction of the relevant derivation from pp141 to 143 in the book (as the original text, be careful as any possible mistake in the original text is not corrected):
{ "domain": "physics.stackexchange", "id": 98213, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, computational-physics, molecular-dynamics", "url": null }
where one $R_n$, say $R_{17}$, never holds, but all the other $R_n$'s always hold. In this case, $R_\omega$ will never hold, and so it's validities will agree with the validities of $R_{17}$, but not with any other $R_n$. </p> http://mathoverflow.net/questions/130019/forcing-mildly-over-a-worldly-cardinal/130028#130028 Answer by Joel David Hamkins for Forcing mildly over a worldly cardinal. Joel David Hamkins 2013-05-07T22:18:16Z 2013-05-08T19:12:41Z <p>I've got it! We can kill the worldliness of a singular worldly cardinals as softly as we like.</p> <p><strong>Theorem.</strong> If $\theta$ is any singular worldly cardinal, then for any natural number $n$ there is a forcing extension $V[G]$ in which $\theta$ remains $\Sigma_n$ worldly, but not worldly, meaning that $V_\theta^{V[G]}$ satisfies the $\Sigma_n$ fragment of ZFC, but not ZFC itself.</p> <p>Thus, such worldly cardinals can be killed as softly as desired.</p> <p>Proof. First, we may assume without loss that the GCH holds, by
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9621075739136381, "lm_q1q2_score": 0.8324386563542616, "lm_q2_score": 0.8652240964782011, "openwebmath_perplexity": 380.9785412055225, "openwebmath_score": 0.8968687653541565, "tags": null, "url": "http://mathoverflow.net/feeds/user/1946" }
Calculus AB & BC. Polar To Rectangular Coordinates Calculator. The blue curve shows this year’s melt extent while the dark grey curve traces the mean value over the period 1981-2010. Use the Plot Full Circumference and Plot Radials section in my code your referred to, to plot the polar coordinate grid. Author: Area Between 2 Curves; Area Between 2 Polar Graphs;. The functions are. 2 0 (a) Find the coordinates of the points where the curves intersect. Castillo, and K. Be able to Calculate the area enclosed by a polar curve or curves. We will also discuss finding the area between two polar curves. Let Dbe a region in xy-plane which can be represented and r 1( ) r r 2( ) in polar coordinates. In the following applet, you can input Greater Polar Function Lesser Polar Function Tmin Tmax Number of sectors (n) into which you'd into which you'd like to split the interval [Tmin, Tmax]. A2 = area between the cardioid and the origin = ⌡⌠ θ=0 π/2. Area Between Polar Curves. 10 - At what points
{ "domain": "radiofakenews.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9861513905984457, "lm_q1q2_score": 0.8130442815718196, "lm_q2_score": 0.8244619328462579, "openwebmath_perplexity": 490.98177478940477, "openwebmath_score": 0.8563680648803711, "tags": null, "url": "http://cnew.radiofakenews.it/area-between-polar-curves-calculator.html" }
java, beginner, object-oriented, hangman // Building a string to represent the chosen word with it's revealed letters @Override public String toString(){ StringBuilder formattedWord = new StringBuilder(); // Iterating through the characters of the word. if the character was guessed, adding it, otherwise add '_' for(int index = 0; index < word.length(); index++){ if (charsGuessed[index]){ formattedWord.append(word.charAt(index)); } else { formattedWord.append('_'); } formattedWord.append(' '); } return formattedWord.toString(); } } Game: import javax.swing.*; public class Game { private int numberOfGuesses; private String unguessedCharacters; private ChosenWord chosenWord; private WordsBank wordsBank = new WordsBank(); private JFrame frame = new JFrame("Input"); public void startNewGame(){
{ "domain": "codereview.stackexchange", "id": 33811, "lm_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, object-oriented, hangman", "url": null }
Choice (a) is incorrect As ${2}^{3}\ne {2}^{2}$ the function is not continuous if $a=2$. Choice (b) is incorrect As ${\left(\sqrt{2}\right)}^{3}\ne {\left(\sqrt{2}\right)}^{2}$ the function is not continuous if $a=\sqrt{2}$. Choice (c) is incorrect As ${\left(-1\right)}^{3}\ne {\left(-1\right)}^{2}$ the function is not continuous if $a=-1$. Choice (d) is correct! For the function to be continuous at $x=a$, we must have or ${a}^{3}={a}^{2}$. Hence $a=0$ or 1. Choice (e) is incorrect As ${\left(-1\right)}^{3}\ne {\left(-1\right)}^{2}$ the function is not continuous if $a=-1$. Which of the following are correct proofs, using the Intermediate Value Theorem, that the polynomial $f\left(x\right)={x}^{3}+2{x}^{2}-1$ has at least one root? (More than one answer may be correct.) (Zero or more options can be correct)
{ "domain": "edu.au", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668728630677, "lm_q1q2_score": 0.8021769943201775, "lm_q2_score": 0.817574478416099, "openwebmath_perplexity": 1284.0827828502586, "openwebmath_score": 0.949281632900238, "tags": null, "url": "http://www.maths.usyd.edu.au/u/UG/JM/MATH1901/Quizzes/quiz6.html" }
electromagnetism, electromagnetic-radiation, maxwell-equations $$\vec{E}(t,x,y,z) = tE \: \bf e_z$$ for some constant $E>0$. Let us also assume that the magnetic field $\vec{B}$ is instead stationary like this $$\vec{B}(t,x,y,z) = \frac{Ex}{c^2} \: \bf e_y\:.$$ We have $$\nabla\cdot \vec{E} = \frac{\partial }{\partial z}tE = 0$$ $$\nabla\cdot \vec{B}= \frac{\partial }{\partial y}Ex = 0$$ $$\nabla\times \vec{E}=0 =-\frac{\partial \vec{B}}{\partial t}$$ $$\nabla \times \vec{B}= \frac{1}{c^2} E {\bf e_z}=\frac{1}{c^2}\frac{\partial \vec{E}}{\partial t}$$ You see that Maxwell's equations are therefore satisfied. It is interesting to notice that redefining $\vec{B}$ by replacing ${\bf e_y}$ for every other unit vector normal to ${\bf e_z}$, we would obtain another solution, since the problem is invariant under rotations around $z$. This means that $\vec B$ can only be fixed by giving boundary conditions breaking this symmetry.
{ "domain": "physics.stackexchange", "id": 35981, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, electromagnetic-radiation, maxwell-equations", "url": null }
ros2 The main idea is to create a lifecycle node with different states. The main_gui.py script controls the states. And the talker lifecycle node will publish when it is in the activate state. And stop publishing in the deactivate state. main_gui.py - Adapted from : https://github.com/ros2/demos/blob/humble/lifecycle_py/lifecycle_py/talker.py import rclpy from rclpy.lifecycle import Node from rclpy.lifecycle import State from rclpy.lifecycle import TransitionCallbackReturn from std_msgs.msg import String class LifecycleTalker(Node): def __init__(self): super().__init__('play_button') self.pub = None self.timer = None self._count = 0 def publish(self): """Publish a new message when enabled.""" msg = String() msg.data = "Lifecycle HelloWorld #" + str(self._count) self._count += 1
{ "domain": "robotics.stackexchange", "id": 38254, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2", "url": null }
ros, add-message-files Title: catkin_make error after creating custom message after creating a custom messages files .msg under /mypackage/msg/ when i run the catkin_make i git this error Messages depends on unknown pkg: geometry_msgs (Missing find_package(geometry_msgs?)) even after uncommented this in the Cmake file ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES geometry_msgs std_msgs ) note when i run the command rospack find geometry_msgs i got this /opt/ros/indigo/share/geometry_msgs Originally posted by g-emad on ROS Answers with karma: 15 on 2016-03-26 Post score: 1 You're probably missing some things in your CMakeLists.txt and / or package.xml. See catkin 0.6.18 documentation » How to do common tasks » Package format 2 (recommended) » Building messages, services or actions. Originally posted by gvdhoorn with karma: 86574 on 2016-03-27 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 24250, "lm_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, add-message-files", "url": null }
bioinformatics, gene-annotation, chip-seq strand - Defines the strand - either '+' or '-'. thickStart - The starting position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part, thickStart and thickEnd are usually set to the chromStart position. thickEnd - The ending position at which the feature is drawn thickly (for example, the stop codon in gene displays). itemRgb - An RGB value of the form R,G,B (e.g. 255,0,0). If the track line itemRgb attribute is set to "On", this RBG value will determine the display color of the data contained in this BED line. NOTE: It is recommended that a simple color scheme (eight colors or less) be used with this attribute to avoid overwhelming the color resources of the Genome Browser and your Internet browser. blockCount - The number of blocks (exons) in the BED line. blockSizes - A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount.
{ "domain": "biology.stackexchange", "id": 4773, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bioinformatics, gene-annotation, chip-seq", "url": null }
ros2, rosdep Originally posted by Dirk Thomas with karma: 16276 on 2018-12-14 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 32167, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, rosdep", "url": null }
reinforcement-learning, soft-actor-critic A quintessential ML model using partition function is the restricted Boltzmann machine (RBM) which is a special case of Markov random field whose graphical model is undirected, inducing unnormalized joint density of the input in the form of a product of factors aka factor analysis in statistics. In all references you could see the partition function involves summation or integral of many or infinite inputs, thus it's usually intractable. And here for SAC policy improvement with continuous action space defined earlier, the inputs are just all actions in the action space $\mathcal{A}$, therefore the partition function is $Z^{\pi_{old}}(s_t)=\int_\mathcal{A} \exp Q^{\pi_{old}}(s_t,a)da$.
{ "domain": "ai.stackexchange", "id": 4205, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reinforcement-learning, soft-actor-critic", "url": null }
objective-c, modules, lua As long as the scripts are loaded at the start, they can be used in two ways. Values can be typed into the UITextView, and when the user hits evaluate, it will return the result. So if the user types return repair(10) and hits the evaluate button, lua will look for the return method, input the value of 10, and output the value of 100. If they punch in return mymodule.foo() it will output Hello World! The second way to access lua is to use the format shown in the testFunction method. You pass in as a string the same thing that you would otherwise type into the live interpreter. This will still load a value into the UI, but could easily be altered to be called from anywhere, accept whatever required values, and return the result of the lua string converted to the proper format. It is just a proof of concept at this time. -(void) testFunction { [self loadTextIntoLua:@"return repair(10)"]; //repair is the name of a lua function from a loaded script [self evaluateLuaStack]; }
{ "domain": "codereview.stackexchange", "id": 8998, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "objective-c, modules, lua", "url": null }
series has harmonic solutions of the form sawtooth wave. A Fourier series can only converge to a 2π periodic function. The following code calculates the Fourier series of the following signal with Matlab symbolic calculation, with T 0 5,W 1. 9 Fourier transformation of measures 104 Preface These notes are based on handwritten lecture notes in Danish from a graduate course in 1999. This document describes the Discrete Fourier Transform (DFT), that is, a Fourier Transform as applied to a discrete complex valued series. Cu (Lecture 7) ELE 301: Signals and Systems Fall 2011-12 4 / 22. Note that this problem reduces to a Fourier Cosine Series, with the Fourier coefficient given by 1/3 o a and a ( 1)n 4/( n2) n S. The Linked Data Service provides access to commonly found standards and vocabularies promulgated by the Library of Congress. Fourier Series Basics Basic. In the Taylor Series case we also had to correct by a factor of n!, and we get a correction factor in the Fourier Series case as
{ "domain": "psicologicamenteonlus.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9793540704659681, "lm_q1q2_score": 0.8006948933458974, "lm_q2_score": 0.817574478416099, "openwebmath_perplexity": 771.7534024236097, "openwebmath_score": 0.8521015048027039, "tags": null, "url": "http://psicologicamenteonlus.it/fourier-series-notes.html" }
java } /** * Returns a randomly generated 4 character string that will combined with a number entered by the user to make the student id. * * @return The four character random string */ private String randomString() { String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; Random random = new Random(); int great = AB.length(); int temp; String codeword = ""; for (int i = 0; i < 4; i++) { temp = (int) (random.nextFloat() * great); codeword = codeword.concat(Character.toString(AB.charAt(temp))); } return codeword; } /** * A payment system that allows the user to make multiple payments on their tuition */ private void payForCourses() { String answer; BigDecimal payment; BigDecimal moneyLeftOver;
{ "domain": "codereview.stackexchange", "id": 31438, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java", "url": null }
python, python-3.x, dice This means that: You don't need the add method; You would need to add num and possibly min and max as parameters; You can compute the sample_space in __init__. Given how simple dice_outcomes is now and how tied the class and sample_space_report are, you could combine everything in this class: from fractions import Fraction from collections import Counter from itertools import product class AbilityScoreStats: def __init__(self, roll_handler, num_die, min_roll=1, max_roll=6): max_roll += 1 # Account for excluded upper bound and off-by-one substraction self.sample_space = (max_roll - min_roll) ** num_die self.outcomes = Counter( roll_handler(roll) for roll in product(range(min_roll, max_roll), repeat=num_die) ) def print_report(self, title): print(f' {title}:')
{ "domain": "codereview.stackexchange", "id": 31436, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, dice", "url": null }
gazebo Title: DRCSIM: hand bits with too big moments of inertia drcsim-2.0: There seem to be lots of parts of the Sandia hand which are quite light yet have the default moments of inertia: inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01" right_f0_base mass value="0.35" right_f0_fixed_accel mass value="0.001" right_f0_0 mass value="0.05" right_f0_1 mass value="0.05" right_f0_1_accel mass value="0.001" right_f0_2 mass value="0.05" right_f0_2_accel mass value="0.001" right_f1_base mass value="0.35 ...
{ "domain": "robotics.stackexchange", "id": 3002, "lm_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 }
organic-chemistry, biochemistry, chemical-biology, carbohydrates The crystal structure of $\beta$-D-glucose published in 1960 (Ref.5) clearly showed the exsistence of pyranose ring system. As in the inserted box in Figure 1 state that, in aqueous solutions, 99% of D‐glucose exists as a mixture of the $\alpha$- and $\beta$-forms (approximately 62%  $\beta$ and 38% $\alpha$ when equilibrated at $\pu{31 ^{\circ}C}$ (Ref.1). Recent NMR study using fully $\ce{^13C}$ labelled glucose (Ref.6) clearly showed $\alpha/\beta$ ratio of $37/63$, which is almost identical to this literature value (Figure 2):
{ "domain": "chemistry.stackexchange", "id": 11495, "lm_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, biochemistry, chemical-biology, carbohydrates", "url": null }
java, android Title: Developing a method of programming a multi-level menu I am attempting to create my own speech to text assistant. This involves the user speaking and the assistant responding to the user's input. I do this by looking for keywords that indicate the user wants to initiate a certain command. However, some commands can only be accessed if prior commands have been called already (e.g. Open Contacts > Search for Jim > Edit Number). I don't want Edit Number to be called unless Open Contacts and "Search for XXX" is called first. Because of this, I have resorted to using an Enum class to label where the user is in the sequence of commands. Then, I use a switch to determine which lines of code to execute once I identify where the user is in the program. This seems unnecessarily complex and not easily maintainable. I was not able to find anything online about this since I don't know any keywords for this technique/process.
{ "domain": "codereview.stackexchange", "id": 31630, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, android", "url": null }
objective-c, opengl, cocoa @implementation IRGameEditView - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self != nil) { //snip [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(surfaceNeedsUpdate:) name:NSViewGlobalFrameDidChangeNotification object:self]; } return self; } - (void)initDisplayLink { GLint swapInt = 1; [[[IRGL gl] glContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; CVDisplayLinkCreateWithActiveCGDisplays(&displayLink); CVDisplayLinkSetOutputCallback(displayLink, &MyDisplayLinkCallback, self); CGLContextObj cglContext = [[[IRGL gl] glContext] CGLContextObj]; CGLPixelFormatObj cglPixelFormat = [[NSOpenGLView defaultPixelFormat] CGLPixelFormatObj]; CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(displayLink, cglContext, cglPixelFormat); CVDisplayLinkStart(displayLink); } - (void)initGL { glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE);
{ "domain": "codereview.stackexchange", "id": 941, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "objective-c, opengl, cocoa", "url": null }
Since $A^TA = 8I$, clearly the canonical vectors $\{e_1, \ldots, e_8\}$ are eigenvectors for $A^TA$. Your previous question then implies that $\{Ae_1, \ldots, Ae_8\}$ are orthogonal vectors and these are precisely the columns of $A$. Since $\{Ae_1, \ldots, Ae_8\}$ is orthogonal, in particular it is linearly independent so the rank of $A$ is $$r(A) = \dim \operatorname{span} \{Ae_1, \ldots, Ae_8\} = 8$$ Direct calculation gives $\|Ae_i\| = \sqrt{8}$ for all $i = 1, \ldots, 8$. Hence the matrix $\frac{1}{\sqrt{8}}A$ has orthonormal columns, so we conclude that $\frac{1}{\sqrt{8}}A$ is an orthogonal matrix, so its eigenvalues are on the unit circle. It is also symmetric so its eigenvalues are real. Therefore $$\sigma(A) = \sqrt{8}\sigma\left(\frac{1}{\sqrt{8}}A\right) \subseteq \sqrt{8} \cdot \{-1,1\} = \{-\sqrt8,\sqrt8\}$$ Let $a(\pm\sqrt{8})$ be the algebraic multiplicities of $\pm\sqrt8$ respectively. We have
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9653811581728098, "lm_q1q2_score": 0.8280731648840074, "lm_q2_score": 0.8577681031721325, "openwebmath_perplexity": 160.83736777653704, "openwebmath_score": 0.9672564268112183, "tags": null, "url": "https://math.stackexchange.com/questions/2904825/try-to-find-eigenvalues-orthogonal-vectors-when-you-have-big-matrix?noredirect=1" }
cc.complexity-theory, complexity-classes, turing-machines, space-bounded, time-hierarchy However, $L_k$ could be decided in $n^3$ steps by using $(k+1)n \in O(n)$ space. Without limiting $M$ to four tape symbols and thus allowing to compress $O(n)$ cells into $n$ cells, we get space issues when simulating an $M$ with too many tape symbols. In this case, the language is not in $\text{DSPACE}(O(n))$ anymore. The same happens when setting $k = h(|w|)$ for some $h$ that can be computed fast enough. This question is basically a rephrase of my question here. Edit Summary: Changed $\textrm{DSPACE}(s(n)) \cap \textrm{DTIME}(f(n))$ to $\textrm{DTISP}(f(n), s(n))$, however, I think the intersection is also worth to think about. This is an open problem: It is open whether $\mathrm{DTISP}(O(n \log n),O(n)) = \mathrm{DSPACE}(O(n))$ (or even $\mathrm{NSPACE}(O(n))$). We only know that $\mathrm{DTIME}(O(n))⊆\mathrm{DSPACE}(O(n/\log n))$.
{ "domain": "cstheory.stackexchange", "id": 4114, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, complexity-classes, turing-machines, space-bounded, time-hierarchy", "url": null }
algorithms, algorithm-analysis Title: Why does this recurrence give O(n) time? Given this following recurrence: $$T(n) = T(n/2) + O(n)$$Find the final time complexity. My first thought is $O(n\log n)$, since there is at most $\log n$ times the $O(n)$ will appear. However, if we adopt the following analysis and let $n=2^m$, then we have: $$T(2^m) = T(2^{m-1}) + k(2^m) = T(2^{m-2}) + k(2^m + 2^{m-1})...$$ Which we can then condense to have the cost become: $$2^m + 2^{m-1} .... + 1 = 2^{m+1} - 1$$ And so since the cost is $O(2^m)$, we have our $O(n)$ time as required. Is the analysis valid? Because I have so very often seen proofs using recurrences of the form $T(n) = T(n/2) + ...$, and they all similarly concluded that there will be $\log n$ times of the relationship. Which is correct? Your second analysis is correct, and $T(n) \in \Theta(n)$. You can also use the Master Theorem to verify this.
{ "domain": "cs.stackexchange", "id": 11161, "lm_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, algorithm-analysis", "url": null }
ros, urg-node, hokuyo, hokuyo-laser, cmake cd src/ catkin_create_pkg hokuyo_test_pkg std_msgs roscpp rospy cd ~/new_hokuyo_test/ catkin_make # Uncommented some stuff (like add executable etc) in CMakeLists.txt (see github) catkin_make (just to test) added `hokuyo_test_pkg_node.cpp` in `src` of `hokuyo_test_pkg` catkin_make in ws directory source devel/setup.bash rosrun hokuyo_test_pkg hokuyo_test_pkg_node And at this point you have the urg_node already running in another terminal? And a roscore? Originally posted by gvdhoorn with karma: 86574 on 2015-02-26 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 20990, "lm_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, urg-node, hokuyo, hokuyo-laser, cmake", "url": null }
finite-element-method, ansys that has investigated the hyperelastic material properties of the brain you may find that there is less displacement and therefore much less vibrational analytics. Then again It could be dead on. What are you using for boundary conditions? Crack propagation ?
{ "domain": "engineering.stackexchange", "id": 1224, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "finite-element-method, ansys", "url": null }
ruby, weekend-challenge, playing-cards # Return if the card is an ace high def ace? value == ACE_HIGH end def ace_low? value == ACE_LOW end # Return if the card has suit spades def spades? suit == :spades end # Return if the card has suit diamonds def diamonds? suit == :diamonds end # Return if the card is suit hearts def hearts? suit == :hearts end # Return if the card has suit clubs def clubs? suit == :clubs end # Compare cards based on values and suits # Ordered by suits and values - the suits_index will be introduced below def <=> other if other.is_a? Card (suit_index(suit) <=> suit_index(other.suit)).nonzero? || value <=> other.value else value <=> other end end
{ "domain": "codereview.stackexchange", "id": 5371, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ruby, weekend-challenge, playing-cards", "url": null }
c++, performance, reinventing-the-wheel, c++20 Future I do plan on expanding the functionality to include lines of code versus lines of comments. I may also add cyclic complexity to the analysis. Code: The code on GitHub as posted in the review.. The updated code on GitHub based on the reviews here. This is a work in progress. Note, I am no longer the only contributor to this project, 2 of the people that posted reviews are now contributing to the project, Toby Speight and Edward, thank you for your contributions. Obviously I won't be posting a followup review because I am no longer the sole author of the code. If you want to limit your review to C++20 or the most complex code, focus on CommandLineParser.cpp and CommandLineParser.h. CommandLineParser.cpp #include <algorithm> #include <cstring> #include <iostream> #include <string> #include <unordered_map> #include <vector> #include "CommandLineParser.h" #include "CmdLineFileExtractor.h" #include "Executionctrlvalues.h" #include "UtilityTimer.h"
{ "domain": "codereview.stackexchange", "id": 44065, "lm_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, reinventing-the-wheel, c++20", "url": null }
c, assembly, virtual-machine uint8_t register_index = ReadByte(vm, GetProgramCounter(vm) + 1); if (!IsValidRegisterIndex(register_index)) { vm->cpu.status.INVALID_REGISTER_INDEX = 1; return true; } uint32_t address = ReadWord(vm, GetProgramCounter(vm) + 2); vm->cpu.registers[register_index] = ReadWord(vm, address); vm->cpu.program_counter += GetInstructionLength(vm, LOAD); return false; } static bool ExecuteStore(TOYVM* vm) { if (!InstructionFitsInMemory(vm, STORE)) { vm->cpu.status.BAD_ACCESS = 1; return true; } uint8_t register_index = ReadByte(vm, GetProgramCounter(vm) + 1); if (!IsValidRegisterIndex(register_index)) { vm->cpu.status.INVALID_REGISTER_INDEX = 1; return true; } uint32_t address = ReadWord(vm, GetProgramCounter(vm) + 2); WriteWord(vm, address, vm->cpu.registers[register_index]); vm->cpu.program_counter += GetInstructionLength(vm, STORE); return false; }
{ "domain": "codereview.stackexchange", "id": 18947, "lm_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, assembly, virtual-machine", "url": null }
ds.algorithms, graph-colouring But has this problem been studied in graphs where chromatic number is easy such as interval graphs or perfect graphs? It is not clear to me that this problem is easy on graph classes where finding the chromatic number is polynomial time. This WALCOM 2022 paper by Bandopadhyay et al. introduces the variant of Coloring (that they refer to as "Budgeted Graph Coloring") that you are looking for! Here is a summary of their results:
{ "domain": "cstheory.stackexchange", "id": 5491, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.algorithms, graph-colouring", "url": null }
newtonian-mechanics, newtonian-gravity, momentum, conservation-laws Title: Will the momentum be conserved in this scenario? I faced a problem: A truck filled with sand has a mass of $6*10^3$ kg. It's moving at a constant speed of 20 $kms^-1$. If at one moment, sand starts to fall through a hole normal to the motion of the truck from the truck with rate 5 kg/s(due to a downward gravitational force); what would be the force needed to keep the truck at same constant initial speed? Neglect air drag, friction etc.
{ "domain": "physics.stackexchange", "id": 41204, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, newtonian-gravity, momentum, conservation-laws", "url": null }
b]$ by the Intermediate Value Theorem), then this method is guaranteed to zone into our root with better and better approximations. Given these facts. Blog Archive. 6 in the text. It’s take a first approximation by apply two times the Bisection method and complete a correct approximation by use the Newton-Raphson method. Freund February, 2004 1 2004 Massachusetts Institute of Technology. Noanyother restrictionsapplied. Additional optional inputs and outputs for more control and capabilities that don't exist in other implementations of the bisection method or other root finding functions like fzero. In this video tutorial, the algorithm and MATLAB programming steps of finding the roots of a nonlinear equation by using bisection method are explained. It is obvious that the secant method does not always converge, but when it does, it does so faster than the bisection method. What are the applications of the bisection. Note that just as in the bisection algorithm, the initial two guesses
{ "domain": "ac-immacolata.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363499098283, "lm_q1q2_score": 0.8516715152979666, "lm_q2_score": 0.8652240825770432, "openwebmath_perplexity": 622.7896160604779, "openwebmath_score": 0.4754257798194885, "tags": null, "url": "http://ac-immacolata.it/csxr/bisection-method-algorithm-matlab.html" }
python, pandas, powerbi Test Code: import pandas as pd from bs4 import BeautifulSoup with open('test.html', 'r') as f: print(get_tables(f)) Results: Col1 Col2 Col3 Caption Group 1 ValA ValB ValC Group 2 ValP ValQ ValR
{ "domain": "datascience.stackexchange", "id": 3539, "lm_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, pandas, powerbi", "url": null }
organic-chemistry, hydrogen, mole, isomers No, 1,3-butadiene is not the most stable of these compounds, either for the whole molecule or on a per double bond basis (see below). The actual numbers (see table below) are too close, we need to look at some data in order to answer the question correctly. The question asks us to select the compound with the smallest heat of hydrogenation per mole out of the following: So would we consider each heat of hydrogenation "per mole of hydrogen" or "per mole of the given compound"? Here is some data that will help answer the question.
{ "domain": "chemistry.stackexchange", "id": 3925, "lm_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, hydrogen, mole, isomers", "url": null }
construct the Taylor series of a function, by virtue of Taylor series being power series. then the power series is a polynomial function, but if infinitely many of the an are nonzero, then we need to consider the convergence of the power series. By the end of this section students will be fa-miliar with: • convergence and divergence of power and Taylor series; • their importance;. E11 Taylor series | Essence of calculus,. a) Use the definition to find the Taylor series centered at c = 1 for f xx ln. It converges at both endpoints x= 1 and x= −1, since the series P 1/n2 converges (by the integral test or else view this as a p-series). Infinite Series Introduction Tests for Convergence Power Series Introduction Creating New Power Series from Known Ones Differentiating and Integrating Power Series 10. Byju's Radius of Convergence Calculator is a tool which makes calculations very simple and interesting. lim x!1xsin 1 x Example 4 (x9. TELESCOPING SERIES Dosubsequent termscancel out
{ "domain": "emporiumgalorium.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.991152642826358, "lm_q1q2_score": 0.8080198407885075, "lm_q2_score": 0.8152324938410784, "openwebmath_perplexity": 304.45206388120926, "openwebmath_score": 0.9233711957931519, "tags": null, "url": "http://lxlj.emporiumgalorium.de/interval-of-convergence-taylor-series-calculator.html" }
• What would be the proper tags? – AJY Jun 21 '15 at 6:30 • There are several examples at the wolfram demonstration center such as demonstrations.wolfram.com/TheCantorSequenceWithBits and demonstrations.wolfram.com/FernFractals Search for "fractal". – bill s Jun 21 '15 at 8:22 • Two suggestions: 1) Google on "Barnsley IFS Mathematica"; 2) Read this question – m_goldberg Jun 21 '15 at 10:16
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9643214511730024, "lm_q1q2_score": 0.8097734725033753, "lm_q2_score": 0.8397339616560072, "openwebmath_perplexity": 3195.741003644101, "openwebmath_score": 0.2060854434967041, "tags": null, "url": "https://mathematica.stackexchange.com/questions/86473/plotting-iterated-function-system-images" }
11 12 2 13 14 1 8 3 7 6 0 10 4 12 9 5 Denote N - the number of inversions in the permutation (i.e. the number of such elements a[i] and a[j] that i < j but a[i] > a[j]). Next, let K- line number in which there is an empty element (i.e. in our notation K = 3). Then, a solution exists if and only if N + K is even. • I tried to edit your post to make the math formatting work, but I failed (partly because I could not understand some of it). Have a look at the introduction to posting mathematical expressions. May 31, 2017 at 2:08 • Thanks @hardmath. Fixed the formatting. Aug 2, 2017 at 12:23
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464471055738, "lm_q1q2_score": 0.8408151528051123, "lm_q2_score": 0.8615382076534743, "openwebmath_perplexity": 449.4043882564316, "openwebmath_score": 0.625257670879364, "tags": null, "url": "https://math.stackexchange.com/questions/754827/does-a-15-puzzle-always-have-a-solution" }
visible-light, waves, electromagnetic-radiation, spacetime Title: Is light amplitude spatial? In diagrams I often see light waves depicted as little sine waves that travel through space. And often when describing polarizers, the explainer will angle their hand to show the angle of polarization and bob it up and down in a sine wave action, apparently emulating the amplitude of the wave. My questions is, is the amplitude of light really like this? Where it moves up and down or side to side in space? Or, is the sine wave relationship just an analogy? If the person drawing the graph bothers to label the axes you'll see that the thing that "goes up and down" is not displacement as it is in a wave on a string but electric field strength. So, no, nothing is moving off the line of the ray, but the because electric field is a vector the oscillation does have a direction associated with it (and therefore polarization makes sense).
{ "domain": "physics.stackexchange", "id": 19103, "lm_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, waves, electromagnetic-radiation, spacetime", "url": null }
dna-sequencing, chromosome Title: Whole Genome Sequencing and B Chromosomes Do whole genome sequencing techniques detect B chromosomes if such chromosomes are present? My understanding is as follows: How the DNA material in a B Chromosome is mapped depends on the reference map and not on how the material is packaged into chromosomes for the sample being sequenced. Is this correct? You can use differences in coverage (number of reads mapping to certain regions in reference) to infer if there is a B chromosome.
{ "domain": "biology.stackexchange", "id": 5067, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dna-sequencing, chromosome", "url": null }
ros [ 11%] Building CXX object lsd_slam/lsd_slam_core/CMakeFiles/lsdslam.dir/src/IOWrapper/ROS/ROSOutput3DWrapper.cpp.o /home/isnl/catkin_ws/src/lsd_slam/lsd_slam_core/src/IOWrapper/ROS/ROSOutput3DWrapper.cpp:28:46: fatal error: lsd_slam_viewer/keyframeGraphMsg.h: No such file or directory #include "lsd_slam_viewer/keyframeGraphMsg.h" ^ compilation terminated. [ 12%] Building CXX object lsd_slam/lsd_slam_core/CMakeFiles/lsdslam.dir/src/IOWrapper/OpenCV/ImageDisplay_OpenCV.cpp.o lsd_slam/lsd_slam_core/CMakeFiles/lsdslam.dir/build.make:560: recipe for target 'lsd_slam/lsd_slam_core/CMakeFiles/lsdslam.dir/src/IOWrapper/ROS/ROSOutput3DWrapper.cpp.o' failed make[2]: *** [lsd_slam/lsd_slam_core/CMakeFiles/lsdslam.dir/src/IOWrapper/ROS/ROSOutput3DWrapper.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:4160: recipe for target 'lsd_slam/lsd_slam_core/CMakeFiles/lsdslam.dir/all' failed
{ "domain": "robotics.stackexchange", "id": 23512, "lm_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 }
ros, boost const boost::shared_ptr<const message_filters::NullType>&, const boost::shared_ptr<const message_filters::NullType>&, const boost::shared_ptr<const message_filters::NullType>&, const boost::shared_ptr<const message_filters::NullType>&>; A1 = boost::arg<1>; A2 = boost::arg<2>; A3 = boost::arg<3>; A4 = boost::arg<4>; A5 = boost::arg<5>; A6 = boost::arg<6>; A7 = boost::arg<7>; A8 = boost::arg<8>; A9 = boost::arg<9>]’
{ "domain": "robotics.stackexchange", "id": 36402, "lm_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, boost", "url": null }
javascript, jquery, html Title: How can I write this jQuery code different and more simple? My HTML: <div class="text-left pb-5"> <h6>Aantal</h6> <input type="text" class="calc" id="aantal" name="aantal" value="100" style="padding-left: 5px"> </div> <div class="text-left pb-5"> <h6>Kleur</h6> <input type="text" class="calc" id="kleur" name="kleur" value="5" style="padding-left: 5px"> </div> <div class="text-left pb-5"> <h6>Grootte</h6> <input type="text" class="calc" id="grootte" name="grootte" value="50" style="padding-left: 5px"> </div> <div class="text-left pt-5"> <h6>Prijs</h6> <input type="text" id="prijs" name="prijs" readonly style="padding-left: 5px"> </div>
{ "domain": "codereview.stackexchange", "id": 32382, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, html", "url": null }
quantum-mechanics, hilbert-space, vectors, notation, quantum-states vectors are objects that satisfy the vector-space axioms. This includes things like arrows-with-a-magnitude-and-a-direction in two or three dimensions, but - as it turns out - pretty much everything useful that you can say about arrows-with-a-magnitude-and-a-direction follows directly from the vector-space axioms (possibly augmented with the notion of an (abstract) inner product). And, because the way to make mathematics truly thrive is to make things as general as possible without sacrificing the results, the way we develop the mathematics for vectors is to work directly for vector spaces (i.e. any objects that satisfy the axioms), so that our results will be useful for arrows-with-a-magnitude-and-a-direction but also for a broad swathe of other objects. What sort of other objects, you ask? Well, as a small selection:
{ "domain": "physics.stackexchange", "id": 99969, "lm_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, hilbert-space, vectors, notation, quantum-states", "url": null }
nuclear-physics, mass, photons, mass-energy Title: Non-conversion of mass & energy? This article is certainly an interesting alternative perspective, but is it factual or does it contain fallacies? http://www.circlon-theory.com/HTML/EmcFallacies.html Are mass and energy not convertible after all? Do photons really have kinetic mass? Is it really fair to classify the energy stored in the nuclear strong force as "rotational kinetic energy"? If you collide two protons in the LHC you get lots of particles coming out of the collision, and the total mass of these particles is far greater than the mass of the two protons. So the LHC demonstrates the conversion of energy to matter every day.
{ "domain": "physics.stackexchange", "id": 4707, "lm_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, mass, photons, mass-energy", "url": null }
the-sun, mathematics, artificial-satellite, satellite, eclipse # Validate the results for index, row in validation_data.iterrows(): total_checks += 1 # extract args for function earth_sun_position_vector_teme = np.array( [row["Sun_Position_TEME_X_km"], row["Sun_Position_TEME_Y_km"], row["Sun_Position_TEME_Z_km"]] ) earth_object_position_vector_teme = np.array( [row["Cartesian_TEME_X_km"], row["Cartesian_TEME_Y_km"], row["Cartesian_TEME_Z_km"]] ) # get actual value in_penumbra, in_umbra = check_eclipse(-earth_sun_position_vector_teme, earth_object_position_vector_teme) # using negative earth-sun vector because equation expects sun-earth vectpr is_in_eclipse_actual = in_penumbra or in_umbra # get expected value is_in_eclipse_expected = bool(row["Sat_InShadow_bool"]) # represented as 0 or 1 in csv
{ "domain": "astronomy.stackexchange", "id": 7156, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "the-sun, mathematics, artificial-satellite, satellite, eclipse", "url": null }
ros-kinetic, actionlib Title: Python tutorials for Actionlib? Are there python versions of the instructions for the various tutorials for ActionLib? I think I found the .py source code (that looks like the counterpart to the C++ version) but no instructions. Is that true? For example: http://wiki.ros.org/actionlib_tutorials/Tutorials/SimpleActionClient Originally posted by pitosalas on ROS Answers with karma: 628 on 2018-01-28 Post score: 0 The listing on wiki/actionlib_tutorials (section Beginner Tutorials) links to 2 Python versions of the C++ tutorials for me: "Writing a Simple Action Server using the Execute Callback (Python)" "Writing a Simple Action Client (Python)" The advanced tutorials do not seem to have Python variants available. Originally posted by gvdhoorn with karma: 86574 on 2018-01-28 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 29889, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-kinetic, actionlib", "url": null }
electrons, conservation-laws, mass-energy This means that if you want to propose a mechanism for an electron to decay all by its lonely self into something else, that "something else" must exhibit lepton number = 1, charge number = -1, and spin number = 1/2. Now, are there any other particles with the same values of those numbers that an electron can spontaneously decay into? Since a decay process that runs all by itself must turn some mass into energy, the decay product (some other particle) must be lighter than an electron. Since there are no leptons lighter than an electron that have spin 1/2 and charge -1, spontaneous decay of an isolated electron is forbidden by these conservation laws.
{ "domain": "physics.stackexchange", "id": 85712, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrons, conservation-laws, mass-energy", "url": null }
ros, catkin, git The user manually calls git clone / hg clone / svn checkout / / whatever else you want to imagine. The user uses the tool rosinstall_generator to collect a list of repositories and uses a tools like wstool or vcstool to fetch a set of repositories. This can e.g. be used to build a full ROS distribution (see from-source instructions). Build the workspace with any of the build tools (catkin_make, catkin_make_isolated, catkin_tools). If you don't want users to build your packages from source all the time you can also release your packages to provide binary packages of it. That way users can just install the Debian packages using apt install ros-kinetic-your-pkgnames. Originally posted by Dirk Thomas with karma: 16276 on 2017-03-25 This answer was ACCEPTED on the original site Post score: 12
{ "domain": "robotics.stackexchange", "id": 27422, "lm_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, catkin, git", "url": null }
LINEARIZATION OF NONLINEAR SYSTEMS 2 Near a critical point the nonlinear system, is approximately linear. When you are faced with data sets that need a nonlinear model, you have at least two choices:. a function with any number of derivatives everywhere, but no more than that number anywhere. If this happens, there are actually two different variables with the same name: one local and one global. 3 Vector function of a vector of variables. The input storage class defines the external variable. If so, linear control design techniques can be used. Just change. Second example of a cumulative distribution function. 8416 \end{align}. The variables held fixed are viewed as parameters. So we would like to find the closest linear system when (x,y) is close to. Consider a general nonlinear function of a single variable ; is a continuous function, and is within the interval []. However, in multivariable calculus we want to integrate over regions other than boxes, and ensuring that we can do so
{ "domain": "giacomagiacalone.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9888419671077918, "lm_q1q2_score": 0.8152625488186886, "lm_q2_score": 0.8244619220634457, "openwebmath_perplexity": 504.17456154686255, "openwebmath_score": 0.6199976801872253, "tags": null, "url": "http://giacomagiacalone.it/zwha/linearization-of-a-function-of-two-variables.html" }
energy-conservation, conservation-laws, scattering, radiation, photon-emission Title: Does Bremsstrahlung happen when any of scattering take place (Compton, Rayleigh, Thomson etc.)? The Bremsstrahlung effect happens when an electron is decelerated by changing its direction typically around a nucleus and then a photon beam is released. We know that when a scattering happens, let's say Compton scattering, the particle nature of the photon presents itself and the photon hit a free (or valance) electron like a billiard ball then they change courses of motion with different energies and angles. Now the change in the direction of motion is a change in the direction of the velocity of the electron, which results in the acceleration (or let's say deceleration of a moving electron) of that electron. So this looks like a very quick, sudden and short Bremsstrahlung as in a quick change in motion of an electron when the scattering happens.
{ "domain": "physics.stackexchange", "id": 95487, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy-conservation, conservation-laws, scattering, radiation, photon-emission", "url": null }
algorithm, c, sorting Possible unknown behavior in this case can be a memory page error (in Unix this would be call Segmentation Violation), corrupted data in the program and in very old computers it could even cause the computer to reboot (corruption of the stack pointer). To prevent this undefined behavior a best practice is to always follow the memory allocation statement with a test that the pointer that was returned is not NULL. int* n_arr = malloc(sizeof(int) * size); if (n_arr == NULL) { fprintf(stderr, "ERROR: selection_sort malloc() failed\n"); return n_arr; }
{ "domain": "codereview.stackexchange", "id": 43695, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm, c, sorting", "url": null }
c, linux, device-driver /* Offset in buffer*/ u16 offset; /* Frame length as kept by this module */ u16 len; }; u16 stmfrm_create_header(u8 *buf); static inline void qcafrm_fsm_init_uart(struct stmfrm_handle *handle) { handle->init = STMFRM_WAIT_AA1; handle->state = handle->init; } /* Gather received bytes and try to extract a full Ethernet frame * by following a simple state machine. * * Return: QCAFRM_GATHER No Ethernet frame fully received yet. * QCAFRM_NOHEAD Header expected but not found. */ s32 stmfrm_fsm_decode(struct stmfrm_handle *handle, u8 *buf, u16 buf_len, u8 recv_byte); struct stmuart { struct net_device *net_dev; struct gpio_desc *rts_gpio; spinlock_t lock; /* transmit lock */ struct work_struct tx_work; /* Flushes transmit buffer */ struct serdev_device *serdev; struct stmfrm_handle frm_handle; struct sk_buff *rx_skb;
{ "domain": "codereview.stackexchange", "id": 41657, "lm_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, linux, device-driver", "url": null }
newtonian-mechanics, momentum, conservation-laws, collision Proof that the above obeys the conservation of linear momentum Momentum before the impact is $\boldsymbol{p} = m_1 \boldsymbol{v}_1 + m_2 \boldsymbol{v}_2$. Momentum after the impact is $$ \require{cancel} \begin{aligned}\boldsymbol{p} & =m_{1}\left(\boldsymbol{v}_{1}+\Delta\boldsymbol{v}_{1}\right)+m_{2}\left(\boldsymbol{v}_{2}+\Delta\boldsymbol{v}_{2}\right)\\ & =m_{1}\left(\boldsymbol{v}_{1}-\tfrac{J}{m_{1}}\boldsymbol{n}\right)+m_{2}\left(\boldsymbol{v}_{2}+\tfrac{J}{m_{2}}\boldsymbol{n}\right)\\ & =m_{1}\boldsymbol{v}_{1}-\cancel{J\boldsymbol{n}}+m_{2}\boldsymbol{v}_{2}+\cancel{J\boldsymbol{n}}\;\;\;\checkmark \end{aligned} \tag{6} $$ Proof that the above obeys and the law of collisions
{ "domain": "physics.stackexchange", "id": 62450, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, momentum, conservation-laws, collision", "url": null }
quantum-mechanics, schroedinger-equation Given a space $M$, what are the physically allowable wavefunctions for a particle moving on $M$? Aside from issues of smoothness wavefunctions (which can be tricky; consider the Dirac delta potential well on the real line for example), as far as I can tell there are precisely two other conditions that one needs to consider: Does the wavefunction in question satisfy the desired boundary conditions? Is the wavefunction in question square integrable? If a wavefunction satisfies these properties, then I would be inclined to assert that it is physically allowable. In your case where $M$ is the circle $S^1$, the constant solution is smooth, satisfies the appropriate conditions to be a function on the circle (periodicity), and is square integrable, so it is a physically allowed state. It also happens to be an eigenvector of the Hamiltonian operator with zero eigenvalue; there's nothing wrong with a state having zero energy.
{ "domain": "physics.stackexchange", "id": 7546, "lm_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, schroedinger-equation", "url": null }
## How do we know if element is not present in the array? We need to have some condition to stop searching further which will indicate that the element is not present in the array. We will iteratively search for the element in the array as long as the left index is less than or equal to the right index. Once this condition turns false and we haven’t found the element yet, this means that the element is not present in the array. ### Example Let us take the following sorted array and we need to search element 6. 2 5 6 8 10 11 13 15 16 L=0 H=8 Mid=4 2 5 6 8 10 11 13 15 16 6<10, therefore take the first half. H=Mid-1 L=0 H=3 Mid=1 2 5 6 8 10 11 13 15 16 6>5, therefore choose the second half. L=Mid+1 L=2 H=3 Mid=2 2 5 6 8 10 11 13 15 16 6==6, an element found Hence the element 6 is found at index 2. ## Implementation
{ "domain": "tutorialspoint.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105314577313, "lm_q1q2_score": 0.8516819225076558, "lm_q2_score": 0.872347368040789, "openwebmath_perplexity": 352.90324975178623, "openwebmath_score": 0.27458852529525757, "tags": null, "url": "https://www.tutorialspoint.com/explain-binary-search-in-python" }
python, python-2.x, image, django if 'cover' in request.FILES: cover_path = handle_uploaded_image(IMAGE_DIR, 'cover', request.FILES['cover'], width=None, height=None) cover_path = handle_uploaded_image(IMAGE_DIR, 'cover', request.FILES['cover'], width=800, height=600) cover_path = handle_uploaded_image(IMAGE_DIR, 'cover', request.FILES['cover'], width=600, height=480) cover_path = handle_uploaded_image(IMAGE_DIR, 'cover', request.FILES['cover'], width=480, height=360) cover_path = handle_uploaded_image(IMAGE_DIR, 'cover', request.FILES['cover'], width=200, height=150) if 'cover' in cleaned_data: cleaned_data.pop('cover')
{ "domain": "codereview.stackexchange", "id": 8928, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-2.x, image, django", "url": null }
image-processing, dft, convolution, frequency-domain, matrix Basically it is a multiplication in Fourier Domain (DFT) by the conjugate of the DFT of the vector $ h $. By the DFT properties it means it is the flipped version of $ h $. By the way: $$ {H}^{H} H = {F}^{H} {D}^{H} F {F}^{H} D F = {F}^{H} {D}^{H} D F $$ Now, pay attention to $ {D}^{H} D $. It is a diagonal matrix multiplied by its conjugate. Namely it is, in the Fourier Domain, the Squared Magnitude. In time domain it means it can be done by circular convolution with the correlation function of $ h $ (Or just do circular convolution in one direction and then in the other which is basically convolution with the flipped version).
{ "domain": "dsp.stackexchange", "id": 7420, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, dft, convolution, frequency-domain, matrix", "url": null }
It is sometimes better to find an answer by a different route and then consider what went wrong or right using the initial problem solving equations. Let $N$ be the force exerted by the rod, length $l$, radially inwards and the speed of the mass $m$ be $v$ when the angle between the rod and the horizontal is $\theta$. N2L gives $mg \sin \theta+N = \frac {mv^2}{l}$. Now consider energy conservation with the speed of the mass equal to $v_o$ when $\theta =90^\circ$. $\frac 12 m v^2_o + mgl(1-\sin \theta) =\frac 12 m v^2$ Combining the two equations and eliminating $v$ gives $N= \frac {mv^2_o}{l}+mg(2-3\sin \theta)$. This equation shows that the force exerted on the mass by the rod $N$ depends on the angle $\theta$ and the speed at the top $v_o$ and can be positive or negative.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9658995733060719, "lm_q1q2_score": 0.8028007112426987, "lm_q2_score": 0.8311430436757312, "openwebmath_perplexity": 224.03300833091134, "openwebmath_score": 0.7658323645591736, "tags": null, "url": "https://physics.stackexchange.com/questions/300748/a-sign-problem" }
operating-systems Title: How does an Operating System without kernel mode work? Andrew S. Tanenbaum, in his book Modern Operating Systems (3rd Edition), states that the distinction between operating system software and normal (user mode) software can sometimes be blurred in embedded systems (which may not have a kernel mode). Can someone please describe more what an OS without a kernel mode looks like and how it works?
{ "domain": "cs.stackexchange", "id": 2623, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "operating-systems", "url": null }
c++, performance, pathfinding, a-star The known cost of the path so far The estimated cost of getting to the goal from the end of the path If you've already gone 100 squares (known) and you think you have 50 more to go (estimated), the total estimated cost is 150. You MUST include the known cost in with the estimated cost of the remainder; if you did not then you would, say, take a path known to be at least 100 long and put it in the queue as though it had a cost of 50! So you must compute the estimated cost in two parts: the known cost of the path, and the estimated cost of the remainder. It is the second part that is usually called the "heuristic", because it's a guess. The known cost can be computed exactly. I think that I need to optimise my heuristic function. For now, I calculate candidly : the distance between the current tile and the goal if no tile were blocked, plus the current cost.
{ "domain": "codereview.stackexchange", "id": 22086, "lm_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, pathfinding, a-star", "url": null }
fizzbuzz, vyxal I'm a bit dissatisfied with the need for three nested conditionals, and I feel like the code would be nicer if I didn't have to use the currentvalue variable. I'm looking for tips on making this more readable and idiomatic, not shorter, unless it helps with the other two points. Thanks for helping! Firstly, it doesn't really make sense to push 100, run a ( block, and then do n 1 + when you could instead just use ɾ to get the range 1, 2, ..., 100: 100 ɾ (. Now, you are looping from 1 to 100, which makes a lot more sense. In fact, in the comments, I mentioned how by duplicating the computed currentvalue thrice, you could just pop off the stack instead of using ←currentvalue, but this way, n will be the correct value (or you could save it in the for loop using (x|...). Also, as pointed out by exedraj/lyxal (the creator of this language), it is better to use a map lambda as this creates the list and lets you manipulate it later, rather than just outputting within the for loop.
{ "domain": "codereview.stackexchange", "id": 41853, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fizzbuzz, vyxal", "url": null }
labels = [labels; (z, -0.2, LaTeXString("\$x_$i\$"))] end plot!(x_vals, y_vals, color=:black, linestyle=:dash, label="", annotation=labels) p2 = plot(x, y, color=:black, label=[L"$f$" ""], grid=false) plot!(x, ya*ones(Nx, 1), fill_between=yb*ones(Nx, 1), fillalpha=0.1, color=:blue, label="", lw=0) plot!(zeros(2, 2), [ya ya; yb yb], lw=3, color=:blue, label=[L"range of$f$" ""]) annotate!(0.04, -0.3, L"$0$", ylims=(-0.6, 3.2)) vline!([0], color=:black, label="") hline!([0], color=:black, label="") plot!(foreground_color_axis=:white, foreground_color_text=:white, foreground_color_border=:white) ybar = 2.6 plot!(x, x .* 0 .+ ybar, color=:black, linestyle=:dash, legend=:none) annotate!(0.04, 0.91 * ybar, L"$y$") plot(p1, p2, layout=(2, 1), size=(600, 700)) In the first plot there are multiple solutions, as the function is not one-to-one, while in the second there are no solutions, since $$y$$ lies outside the range of $$f$$ Can we impose conditions on $$A$$ in (3) that rule out these
{ "domain": "quantecon.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9937100989807552, "lm_q1q2_score": 0.8876905691374989, "lm_q2_score": 0.8933093968230773, "openwebmath_perplexity": 430.0254335697078, "openwebmath_score": 0.9785626530647278, "tags": null, "url": "https://lectures.quantecon.org/jl/linear_algebra.html" }
keras, image-classification, preprocessing, transfer-learning Unfortunately this is not possible in my case since the original image set is so large it will not fit into memory and also converted to a bottleneck feature set it is still to large. So I am looking for a solution where the bottleneck features of a single image are stored in a single file and where those bottleneck feature vectors can be loaded in a way that is similar to how image_dataset_from_directory loads images. You can first write the bottleneck features into a tfrecords file, and then load them as a dataset for the training phase. In the tensorflow documentation you can find complete examples of how to do both.
{ "domain": "datascience.stackexchange", "id": 9449, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "keras, image-classification, preprocessing, transfer-learning", "url": null }
r, predictive-modeling, scoring Delivering Shiny applications dealing with data that is not/ not yet institutionalized. I will generally load already-processed data frames and use Shiny to display different graphs and charts. Computation is minimal. Decision making analysis that requires heavy use of advanced libraries (mcclust, machine learning) but done on a daily or longer time-scale. In this case there is no reason to use any other language. I've already done the prototyping in R, so my fastest and best option is to keep things there. I did not use R for production when integrating with a real-time C++ decision engine. Issues: An additional layer of complication to spawn R processes and integrate the results A suitable machine-learning library (Waffles) was available in C++ The caveat in the latter case: I still use R to generate the training files.
{ "domain": "datascience.stackexchange", "id": 10655, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "r, predictive-modeling, scoring", "url": null }
turtlebot, ros-fuerte, rosmake [rosmake-0] Finished <<< nodelet ROS_NOBUILD in package nodelet [rosmake-0] Starting >>> rosbag [ make ] [rosmake-0] Finished <<< rosbag No Makefile in package rosbag [rosmake-0] Starting >>> nodelet_topic_tools [ make ] [rosmake-0] Finished <<< nodelet_topic_tools ROS_NOBUILD in package nodelet_topic_tools [rosmake-0] Starting >>> pcl_ros [ make ] [rosmake-0] Finished <<< pcl_ros ROS_NOBUILD in package pcl_ros [rosmake-0] Starting >>> pointcloud_to_laserscan [ make ] [rosmake-0] Finished <<< pointcloud_to_laserscan ROS_NOBUILD in package pointcloud_to_laserscan [rosmake-0] Starting >>> hector_turtlebot_apps [ make ] [ rosmake ] All 21 linesector_turtlebot_descripti... [ 4 Active 49/55 Complete ] {------------------------------------------------------------------------------- mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=rospack find rosbuild/rostoolchain.cmake .. [rosbuild] Building package hector_turtlebot_description
{ "domain": "robotics.stackexchange", "id": 15463, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "turtlebot, ros-fuerte, rosmake", "url": null }
c, interpreter, brainfuck could just as well be puts("Error: Could not open source file"); While printf is great for formatted output, the look for formatting specifiers carries a computational overhead that puts doesn't have. Some compilers (like GCC) will perform that optimization automatically for you, if you use a format string literal without format specifiers. Checking whether a characters is in a set of characters In isInstruction(char), instead of using a series of disjoint (joint with the || operator) equality comparisons, you could much better express your intent and the source character set with strchr: return strchr("+-><[].,", c) != NULL; A possible improvements might be: const static char brainfuck_alphabet[] = {'+', '-', '>', '<', '[', ']', '.', ','}; return memchr(brainfuck_alphabet, c, sizeof(brainfuck_alphabet));
{ "domain": "codereview.stackexchange", "id": 45455, "lm_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, interpreter, brainfuck", "url": null }
physical-chemistry, free-energy The thermodynamic quantities only give us information about initial and final states at equilibrium. The activation energy is obtained from kinetic, that is rate constant measurements usually vs, temperature and not from thermodynamic quantities. In the vast majority of reactions the activation energy is greater than thermal energy (approx kBT, where kB is Boltzmann's constant). These reactions are generally slow because, by the decreasing exponential nature of the Boltzmann distribution with energy, not many reactants have enough energy to react in any given time period, say 1 sec. (This is lucky otherwise we would all have reacted eons ago!) In some special types of unimolecular reactions, e.g. electron transfer, bond dissociation & isomerization, with zero or very small activation energy then clearly these will be very fast possibly with rate constants $ >10^{12}\ /sec $.
{ "domain": "chemistry.stackexchange", "id": 5844, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, free-energy", "url": null }
java, algorithm, strings, combinatorics Possible implementation (not using preincrement for kand j as I think it makes the code more difficult to read): public static String[] combinations(String[] array) { String[] res = new String[-1 >>> -array.length]; for (int i = array.length, k = 0; --i >= 0;) { String s = res[k] = array[i].toString(); for (int j = 0, x = k++; j < x;) res[k++] = s + res[j++]; } return res; }
{ "domain": "codereview.stackexchange", "id": 27057, "lm_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, algorithm, strings, combinatorics", "url": null }
vibrations, string, normal-modes Title: Parabolic polarization of a hanging chain When a chain hangs between two short posts, I can use my hand to oscillate it up and down in a standing wave. It's easy to demonstrate three of the possible normal modes, at the fundamental frequency and the first two harmonics. For mechanical reasons it's hard to get the chain to oscillate in a higher mode, but I think there's no problem in principle, and I could do it if the chain were lighter. I can also vibrate the chain horizontally obtaining a sort of horizontal polarization of the wave. I can vibrate the chain circularly, obtaining a circular polarization of the wave; it's as if the chain was oscillating horizontally and vertically at the same time, with the vibrations out of phase. Each link of the chain travels around in a circle in a plane perpendicular to the line between the chain's endpoints.
{ "domain": "physics.stackexchange", "id": 23225, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vibrations, string, normal-modes", "url": null }
fluid-dynamics, navier-stokes This is used for the boundary condition on $\omega$. ADDENDUM First of all, the stream function is known (and constant) at the solid boundaries (because the solid boundaries are stream lines). So it doesn't have to be solved for. It is determined up to an arbitrary constant, and can thus be taken to be zero at one of the boundaries. At the other boundary, the stream function is equal to the volumetric throughput rate per unit width of channel (which is typically known). So you don't need to solve for the stream function at the solid boundaries. If the tangential derivative $\partial \psi/\partial x=0$ at all locations along the boundary, it's second partial with respect to x must also be equal to zero. This, of course, all follows from the fact that $\psi$ is constant at the boundary.
{ "domain": "physics.stackexchange", "id": 42631, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, navier-stokes", "url": null }
c++, multithreading } //pthread_mutex_unlock(&lock); if (end_index == X_SIZE - 1) { local.push_back(zeros); } else { local.push_back(phi[end_index + 1]); }*/ //print_matrix(local); //std::cout << local.size() << std::endl; for (int i = start_index; i <= end_index; i ++) { if (i == start_index && start_index == 0) next.push_back(solve(zeros, phi[i], phi[i + 1], i - start_index)); else if (i == end_index && end_index == X_SIZE - 1) next.push_back(solve(phi[i - 1], phi[i], zeros, i - start_index)); else next.push_back(solve(phi[i - 1], phi[i], phi[i + 1], i - start_index)); } cur_time += dt; // pthread_barrier_wait(&bar); for (int i = start_index; i <=end_index; i++) { phi[i] = next[i - start_index]; } next.clear(); pthread_barrier_wait(&syn); }
{ "domain": "codereview.stackexchange", "id": 10621, "lm_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++, multithreading", "url": null }
java, json, role-playing-game // Set the ready statistics for the native public void setReadyStats(String[] readyStats){ this.readyStats = readyStats; } // Set the un-ready statistics for the native public void setUnreadyStats(String[] unReadyStats) { this.unReadyStats = unReadyStats; } // Set the group native is in public void setGroup(String group) { this.group = group; } // Used for testing purposes public String toString() { String strToReturn = "Native Details\n"; return strToReturn; } public static void main(String[] args){ Native n = new Native("Knight"); } }
{ "domain": "codereview.stackexchange", "id": 14048, "lm_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, json, role-playing-game", "url": null }
python, units, astropy J2 = u.m * u.kg * u.m * (1/u.s) J1.to(J2) ---> UnitConversionError or angular_momentum(1*u.Msun, 3*u.Mearth, 0.1*u.au).decompose() #why?
{ "domain": "astronomy.stackexchange", "id": 5915, "lm_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, units, astropy", "url": null }
differential-geometry, hamiltonian-formalism, hamiltonian, flow Background Consider a separable Hamiltonian $H(x, v) = V(x) + K(v)$ where the kinetic energy is even $K(v) = K(-v)$. Let $\phi_t$ be the flow of the autonomous ODE system given by Hamilton's equations (here we set $z = (x, v)$) $$ \dot{z} = J\nabla_z H(z) \qquad \text{where} \qquad J =\begin{pmatrix} 0 & I\\-I & 0 \end{pmatrix} \qquad \text{and} \qquad \nabla_z H(z) = (\nabla_x V(x), \nabla_v K(v)) $$ Define the momentum reversal/negation/flip as $\phi_N(x, v) = (x, -v)$. I want to show that $$ \varphi_t^{-1} = \phi_N \circ \varphi_t \circ \phi_N $$ The idea is to show that the "momentum-flipped" $\phi_N\varphi_t\phi_N$ obeys the correct differential equation to be $\varphi_t^{-1}$: The chain rule says $$ \partial_t( \phi_N\varphi_t\phi_N) = \partial_t(\phi_N\varphi_t)\phi_N = (D\phi_N) \partial_t(\varphi_t)\phi_N$$ Now, $$ D\phi_N = \begin{pmatrix} 1_x & 0 \\ 0 & -1_v \end{pmatrix}$$
{ "domain": "physics.stackexchange", "id": 88957, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "differential-geometry, hamiltonian-formalism, hamiltonian, flow", "url": null }
classical-mechanics, inertia If you could flip or spin the racquet so that it turned exclusively about one of its three principal axes, it would continue to spin about that axis indefinitely. That's why they're called principal axes. But in a real flip there is always some mixture of motions about all three axes. Here is where the intermediate axis theorem enters the picture: while a racquet spinning mostly about either the low-rotational-inertia axis or high-rotational-inertia axis will be relatively unaffected by extraneous motion about the other two axes, a racquet that is spinning mostly about the intermediate-rotational-inertia axis is exquisitely sensitive to any accidental motion about those other two axes. Even a tiny amount of unintended motion about those axes will cause the racquet to wobble significantly.
{ "domain": "physics.stackexchange", "id": 3950, "lm_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, inertia", "url": null }
reaction-mechanism, redox, hydrogen Title: Reaction mechanism of combustion of hydrogen After a discussion about the usefulness of hydrogen fuel for cars with a friend of mine, I wondered what the reaction mechanism for combustion of $\ce{H2}$ was. I only study (well almost) organic chemistry, so I have no idea if the mechanisms from organic chemistry can be applied at all to non-organic molecules. So we have the following reaction: $$2\ce{H2 + O2 -> 2 H2O}$$ In most textbooks this would be described as a redox-reaction with the two half reactions: $$2\ce{H+ + 2 e- -> H2}$$ $$\ce{O2 + 4 H+ + 4 e- -> 2 H2O}$$ But I wonder what the real mechanism is. Based on my organic thinking I thought the following (it's probably completely wrong, but I think it is important to state because someone can correct me much better if I express my thinking than if he has no idea where the misconception started):
{ "domain": "chemistry.stackexchange", "id": 12063, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reaction-mechanism, redox, hydrogen", "url": null }
13 Since nobody pointed this out I think there is still room for another reply. Note that this works fine Unevaluated[(x + Log[y*z])/(y*z)] /. (y*z) :> w (x + Log[w])/w In more complex cases you may also need to use HoldPattern Unevaluated[(x + Log[(y*z)/2])/((y*z)/2)] /. HoldPattern[((y*z)/2)] :> w (x + Log[w])/w This is not a panacea. ... 13 Use the following representation of the Legendre polynomials: $$P_n(x) = 2^n \sum_{k=0}^n x^k \binom{n}{k} \binom{\frac{n+k-1}{n}}{n}$$ Note that the sum effectively is over $k \equiv n \bmod 2$. Expand each Legendre polynomial into a sum. Integration with respect to $\theta$ is easy: \int_0^{\pi} \sin^{k_1+k_2+k_3+1} \theta \mathrm{d}\theta ... 13
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9343951643678381, "lm_q1q2_score": 0.8230125392231699, "lm_q2_score": 0.8807970873650403, "openwebmath_perplexity": 1305.4646071212592, "openwebmath_score": 0.5352917909622192, "tags": null, "url": "http://mathematica.stackexchange.com/tags/symbolic/hot?filter=all" }
algorithms, np-complete If you wanted to automate this process of creating new NP-complete problems, then it would likely be more efficient to construct the mappings from some base set of polytime mappings, using methods known to preserve polynomial time, rather than picking an arbitrary mapping and proving that it is a polytime reduction. Note that this is not quite what you suggest in your question. You can take a logical formula and build a Turing machine corresponding to it, but that in itself doesn't lead to an NP-complete problem. For instance, 2SAT instances can be decided in polynomial time. And a particular formula will only correspond to a particular machine, whereas you need a set of formulas (or machines) to define a complexity class; so to make new problems in NPC, you really need to show how one set can be converted into another (i.e. a polytime reduction), even if your sets are sets of logical formulas.
{ "domain": "cs.stackexchange", "id": 800, "lm_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, np-complete", "url": null }
orbital-motion, rocket-science, popular-science Title: Why is the Pegasus launched from a subsonic airplane? Considering that the reason typically given for launching spacecraft from sea-level as opposed to mountains is that the limiting factor is velocity, not altitude, then why isn't the Pegasus rocket launched from a supersonic airplane?
{ "domain": "physics.stackexchange", "id": 8385, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "orbital-motion, rocket-science, popular-science", "url": null }
Sequence of rationals that converge to irrational 1. Mar 14, 2005 tonebone10 Find a sequence of rational numbers that converges to the square root of 2 2. Mar 14, 2005 mathwonk use newton's binomial theorem? i.e. (1+1)^(1/2) = 1 + (1/2) + (1/2)(-1/2)(1/2) + + (1/2)(-1/2)(-3/2)(1/2)(1/3)+...... this might work. 3. Mar 14, 2005 Data Or another of Newton's tricks: How do I approximate the positive root of $$x^2-2$$? $$x_1 = 1$$ $$x_2 = x_1 - \frac{x_1^2 - 2}{2x_1}$$ $$. \ . \ .$$ $$x_n = x_{n-1} - \frac{x_{n-1}^2 - 2}{2x_{n-1}}$$ $$. \ . \ .$$ Obviously each term is rational and $$\{x_n\}$$ converges to $$\sqrt{2}$$. Last edited: Mar 14, 2005 4. Mar 14, 2005 Data And converges quite quickly, I might add. 5. Mar 15, 2005 HallsofIvy Do you mean giving a general formula? If not, take the square root of 2 on a calculator: 1.4142135623730950488016887242097
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464478051828, "lm_q1q2_score": 0.8215767462335845, "lm_q2_score": 0.8418256432832333, "openwebmath_perplexity": 729.8486178691958, "openwebmath_score": 0.9679652452468872, "tags": null, "url": "https://www.physicsforums.com/threads/sequence-of-rationals-that-converge-to-irrational.67309/" }
1st year - 6 units 2nd year - 4 units 3rd year - 5 units 4th year - 3 units
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.805632181981183, "lm_q2_score": 0.805632181981183, "openwebmath_perplexity": 6591.673671552857, "openwebmath_score": 0.7729761600494385, "tags": null, "url": "https://gmatclub.com/forum/the-cost-per-unit-of-electricity-during-a-4-year-period-is-a-169947.html" }
image-processing, fourier-transform What I don't understand is, if we can get the frequencies for each row and accurately reconstruct what a row of the image looks like via frequency encoding, and if we already know where each row is in relation to the other rows (position of the blue line), why do we need to do the same basic thing along a different dimension (the y-axis using phase encoding)? Isn't it sufficient to simply stack the rows to get the full image? The reality (as in physical reality, the phenomenon) is that a pixel's "value" is determined both by what is happening along the X dimension and the Y dimension (in k-space). If you want to reconstruct an image you have to do it from **two spatial sinusoidal waves. This is represented in the $f[m,n] \cdot e^{-j 2 \pi (u m + v n)}$ part of the DFT. This is the product that we sum along the $u$ and $v$ directions.
{ "domain": "dsp.stackexchange", "id": 9044, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, fourier-transform", "url": null }
c++, file-system, c++20, dynamic-loading if (it != mapAndMutexObject.fileMap.end()) { #ifdef _WIN32 printf("\n%ls found in map\n", pathStr.c_str()); #else printf("\n%s found in map\n", pathStr.c_str()); #endif mapAndMutexObject.delayFile(it->second); } else { #ifdef _WIN32 printf("\n%ls not found in map\n", pathStr.c_str()); #else printf("\n%s not found in map\n", pathStr.c_str()); #endif } } void unixHookFunction(MapAndMutex& mapAndMutexObject, strType& pathStr) { if (!pathStr.empty() && pathStr.back() == '\r') { pathStr.pop_back(); } const wcharOrChar* path = pathStr.c_str(); int filenameIndex = -1; int pathEndIndex = 0; for (; path[pathEndIndex] != '\0'; pathEndIndex++) { if (path[pathEndIndex] == '/') { filenameIndex = pathEndIndex; } }
{ "domain": "codereview.stackexchange", "id": 43231, "lm_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++, file-system, c++20, dynamic-loading", "url": null }
performance, r, vectors You might also know that apply is a disguised for loop: while syntactically shorter, it is just as slow when it comes to computation times. Instead of apply(bool_mat, FUN = any, MARGIN = 1), you could just do: rowSums(bool_mat) > 0L where rowSums is a super fast (internal C-compiled) function. Question 2 Is the argument handling OK? I wanted users of the function to be able supply either ppm or mz_tol, but not both. Am I using missing() correctly? There are two schools for this kind of situation:
{ "domain": "codereview.stackexchange", "id": 19145, "lm_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, r, vectors", "url": null }
python, time-series, numpy plt.plot(data_FT['GS'], label='Real') plt.xlabel('Days') plt.ylabel('USD') plt.title('Figure 3: Goldman Sachs (close) stock prices & Fourier transforms') plt.legend() plt.show() This happens because the FFT assumes your signal is periodic. This is why you see the reconstruction increase on the left and decrease on the right. You can avoid this by artificially making your function periodic before taking the fft. Mirroring your signal is one way to do this, eg: # make a signal N = 64 x = np.linspace(0, 1.5 * np.pi, N) signal = 0.5*x + np.sin( 2*x ) + 0.25*np.random.randn( N )
{ "domain": "datascience.stackexchange", "id": 10771, "lm_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, time-series, numpy", "url": null }
python, datetime, regex match_code = sorted(match_code, key=lambda x: x[1]) #Remove duplicate matches, the first match gets priority over the rest match_code = [next(group) for i, group in itertools.groupby(match_code, key=lambda x: x[1])] match_code = [i[0] for i in match_code] return match_code self.feature_extractor = feature_extractor
{ "domain": "codereview.stackexchange", "id": 26638, "lm_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, datetime, regex", "url": null }
turing-machines, computability, logic, undecidability, oracle-machines Now to your other question. Let $O_0 := \emptyset$, and $O_{i+1} = \mathrm{Halt}_{O_i}$ (so $O_i = 0^{(i)}$ using the usual terminology). Let us show that given oracle access to $O_{i+1}$ you can simulate oracle access to $O_i$. Consider the following program:
{ "domain": "cs.stackexchange", "id": 11173, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "turing-machines, computability, logic, undecidability, oracle-machines", "url": null }
newtonian-mechanics, energy, momentum, energy-conservation, conservation-laws Title: How can conservation of momentum coexist with conservation of energy? COM posits that Mass*Velocity is constant, and COE posits that 0.5*mass*velocity^2 is constant. If i have a 10kg box moving left at 10m/s, it has Momentum of 100 and Kinetic energy of 500. If i then place a 10kg box on it while it's moving (assume both are covered in velcro so they stick together), how fast will the two move now. If we assume that COM holds, then the boxes would both travel at 5m/s together, 5*20=100. However, this makes the kinetic energy be 250, because 0.5*20*5^2 = 250. Momentum is definitely conserved here, as given Newton's first and second laws it is logically equivalent to the third. However, conservation of energy is not strictly a law of Newtonian mechanics, but of thermodynamics. The boxes absorb the missing energy into internal degrees of freedom when they stick together. They might vibrate, or heat up. Adding in that excess energy will give you proper conservation.
{ "domain": "physics.stackexchange", "id": 96399, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, energy, momentum, energy-conservation, conservation-laws", "url": null }
organic-chemistry, reaction-mechanism, halides, erratum, nucleophilic-substitution Title: How can a methyl halide react by intramolecular SN2? Out of the following, $\ce{CH3Br}$ doesn't react by which mechanism? SN2 SN1 E2 Intramolecular SN2 E1 My textbook gives 2, 3 and 5 as the correct answers, which means it does react by 1 and 4. But how can a methyl halide react by intramolecular SN2, without a nucleophile present in the molecule? There's just a leaving group ($\ce{-Br}$). I agree. There is no way that a one-carbon and one-heteroatom compound could react by intramolecular substitution. All intramolecular nucleophilic substitutions will require some ring-like transition state. The smallest ring you can build is a three-membered ring — but bromomethane does not have three atoms that could build up that ring (hydrogen does not participate).
{ "domain": "chemistry.stackexchange", "id": 9321, "lm_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, reaction-mechanism, halides, erratum, nucleophilic-substitution", "url": null }
• Is it also possible to just do these two cases? 1) Draw a '1' and '2' before the 5th draw, or 2) Draw a '1' before the 5th draw AND draw a '2' before the 8th draw? I'm not sure how to express 2) but would it be more cumbersome than the complementary events? – user152294 Sep 3 '17 at 17:34 • @user152294 Yes you can consider two cases, but I think that with 3 cases is simpler. – Robert Z Sep 3 '17 at 17:36 • How come in this solution, we don't have to use binomial coefficients? – user152294 Sep 3 '17 at 17:43 • @user152294 Let me know if the official solution is the one that I have found. – Robert Z Sep 3 '17 at 17:44
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9877587261496031, "lm_q1q2_score": 0.8528225950999307, "lm_q2_score": 0.8633916082162403, "openwebmath_perplexity": 236.12312727635154, "openwebmath_score": 0.76022869348526, "tags": null, "url": "https://math.stackexchange.com/questions/2415076/probability-of-drawing-cards-on-specific-draw-counts" }
python, performance, web-scraping, beautifulsoup g_url = 'https://www.google.fr/search' params = {"q": search_term, "num": number_results, "hl": language_code} response = requests.get(g_url, params=params, headers=USER_AGENT) response.raise_for_status() return response.text, search_term Note that I also followed Python's official style-guide, PEP8, and did not use spaces around the = for keyword arguments. But the obvious improvement is not to parse the Google search results at all, but directly query the website you are interested in. If I understand it correctly, what you actually want to parse is: url = "https://www.infogreffe.fr/recherche-entreprise-dirigeants/resultats-entreprise-dirigeants.html" params = {"ga_cat": "globale", "ga_q"=search_term} response = requests.get(url, params=params, header=USER_AGENT)
{ "domain": "codereview.stackexchange", "id": 36590, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, web-scraping, beautifulsoup", "url": null }
electrostatics, electric-fields, gauss-law, integration, calculus Title: Question regarding eliminating volume term from Gauss Law Gauss law is given by $$\oint_{\partial S}\vec E\cdot d\vec {A}=\dfrac{q_\text{enclosed}}{ε_0}.$$ $$q_\text{enclosed}=\iiint \rho\ dV.$$ For a closed surface $$\oint_{\partial S}\vec E\cdot d\vec{A}=\iiint (\nabla\cdot \vec{E})\ dV$$. $$\implies \iiint (\nabla\cdot \vec{E})\ dV =\dfrac{\iiint \rho\ dV}{ε_0}.$$ What's the correct and intuitive way to remove the integral and $dV$ (volume element ) and give us the result (I don't know to establish a proper reasoning for eliminating the integral and $dV$). $$\nabla\cdot E=\dfrac{ρ}{ε_0}$$ The key realization is that the equality $$ \int_\mathcal{V} \vec{\nabla} \cdot \vec{E} \, dV = \int_\mathcal{V} \frac{\rho}{\epsilon_0} \, dV $$
{ "domain": "physics.stackexchange", "id": 90145, "lm_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, electric-fields, gauss-law, integration, calculus", "url": null }
beginner, haskell, data-visualization visible :: [[(Float, Float)]] visible = filter (all (\(_,y) -> b <= y && t >= y)) $ pairs Main.hs import Graphics.Gloss import Graph main :: IO () main = display FullScreen white . scale 20 20 . pictures $ [ color blue $ graph f (-10, 10, -10, 10) 0.001, color black $ Line [(0, -10), (0, 10)], color black $ Line [(-10, 0), (10, 0)] ] where f :: Float -> Float f x = 1 / (x - 1)
{ "domain": "codereview.stackexchange", "id": 36319, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, haskell, data-visualization", "url": null }
c#, entity-framework // hands an Action() to TryDataBase, as indicated by lambda expression in 3rd arguement. bSuccessful = TryDataBaseAction(dbEntities, out ErrorMessage, () => { List<Man> men = myQuery.OfType<Man>().ToList(); TheseRecords = new string[men.Count, 2]; for (int i = 0; i < men.Count; i++) { TheseRecords[i, 0] = men[i].ManID.ToString(); TheseRecords[i, 1] = men[i].Name; } }); Records = TheseRecords; StatusMessage = AssignDBStatusMessage("Records read successfully", ErrorMessage, bSuccessful); return bSuccessful; }
{ "domain": "codereview.stackexchange", "id": 2675, "lm_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#, entity-framework", "url": null }
c++, performance, c++14, number-systems Title: Base 10 to Base N conversion Before I begin using this code in vital systems, I wanted to quadruple-check that it was soundproof. I plan to implement this as part of a larger program, obviously not by itself. Are there any clear flaws (output is incorrect) or optimization issues in this code? #include <iostream> using namespace std; int main() { int convertFromCopy, digit, convertTo; unsigned int convertFrom; string stringDigit, answer; cout << "Num (base 10): "; cin >> convertFrom; cout << "Base: "; cin >> convertTo; convertFromCopy = convertFrom; while (convertFrom != 0){ digit = convertFrom % convertTo; if (digit < 10) stringDigit = '0' + digit; else stringDigit = digit - 10 + 'A'; answer = stringDigit + answer; convertFrom /= convertTo; } cout << convertFromCopy << " written in base " << convertTo << " is: " << answer; return 0; }
{ "domain": "codereview.stackexchange", "id": 21763, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, c++14, number-systems", "url": null }
java, performance, programming-challenge class ConsecutivePrimeSum { public static int limit=1000000; int lengthOfTheLongest =0; int sumOfTheLongest =0; void solution(){ ArrayList<Integer> arrayOfPrimes=generatePrimes(); scanSequences(arrayOfPrimes); System.out.println("The longest sum is "+ sumOfTheLongest +" and contains "+lengthOfTheLongest+" terms"); } private ArrayList<Integer> generatePrimes(){ ArrayList<Integer> arrayOfPrimes=new ArrayList<Integer>(); for(int i=limit;i>=2;i--){ if(isPrime(i)){ arrayOfPrimes.add(i); } } return arrayOfPrimes; }
{ "domain": "codereview.stackexchange", "id": 43692, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, programming-challenge", "url": null }
automata-theory, lower-bounds A two-way DFA (2DFA) is a deterministic finite-state automaton that is allowed to move back and forth on its read-only input tape, unlike finite-state automata that may only move the input head in one direction. It is well-known that 2DFAs recognize precisely the same class of languages as DFAs, in other words the regular languages. Less well-understood is the question of how efficient the simulation is. The original constructions from the late 1950s by Rabin/Scott and Shepherdson used a notion of crossing sequences and are quite hard to analyse. Moshe Vardi published another construction that shows an upper bound of $2^{O(n^2)}$ states, but this bound may have some slack. I am asking whether any (families of) 2DFAs are known that require many states in any DFA simulating them, even after Myhill-Nerode minimization of the DFA. Moreover, would there be any interesting consequences of knowing such 2DFAs?
{ "domain": "cstheory.stackexchange", "id": 2379, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "automata-theory, lower-bounds", "url": null }
ornithology, kidney I think that the paragraph you quote is taking the mammal-centric position a bit too far and therefore the ordering of the statements in this paragraph is a bit misleading. I'll rewrite it using most of the same words but a different order. Though the meaning is the same I think it'll be easier to understand:
{ "domain": "biology.stackexchange", "id": 12417, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ornithology, kidney", "url": null }